public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Petter Selasky <hselasky@c2i.net>
To: freebsd-acpi@freebsd.org
Cc: Jung-uk Kim <jkim@freebsd.org>, linux-acpi@vger.kernel.org
Subject: Re: MacBookPro 5,1
Date: Sun, 17 Oct 2010 15:47:56 +0200	[thread overview]
Message-ID: <201010171547.56445.hselasky@c2i.net> (raw)
In-Reply-To: <201010171056.12606.hselasky@c2i.net>

Hi,

CC'ing the Linux guys, hence I belive you are using the same ACPI code like in 
FreeBSD.

It appears that when a string is present in the extended interrupt descriptor 
(6.4.3.6, ACPIspec30.pdf), then this is not handled correctly, meaning that 
the precomputed buffer space when encoding to AML, is incorrect and that data 
is written beyond the destination buffer!

The error is catched on a MacBookPro 5,1 and is visible if you zero-pad all 
ACPI allocations to 4096 bytes, and verify that the freed buffer is not 
written beyond the allocation. Also the Extended interrupt descriptor must be 
the last element encoded in the AML.

The quick patch is to disable these elements. I tried to figure out why this 
happens, but this particular handling in the code looks very obfuscated to me.

src/sys/contrib/dev/acpica
%svk diff
=== resources/rsmisc.c
==================================================================
--- resources/rsmisc.c  (revision 213698)
+++ resources/rsmisc.c  (local)
@@ -311,6 +311,8 @@
 
 
         case ACPI_RSC_SOURCEX:
+               break;  /* RSC_SOURCEX is broken */
+
             /*
              * Optional ResourceSource (Index and String). This is the more
              * complicated case used by the Interrupt() macro
@@ -537,6 +539,8 @@
 
 
         case ACPI_RSC_SOURCEX:
+               break;  /* RSC_SOURCEX is broken */
+
             /*
              * Optional ResourceSource (Index and String)
              */


Any comments are welcome!

--HPS

Please keep me CC'ed.

           reply	other threads:[~2010-10-17 13:46 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <201010171056.12606.hselasky@c2i.net>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010171547.56445.hselasky@c2i.net \
    --to=hselasky@c2i.net \
    --cc=freebsd-acpi@freebsd.org \
    --cc=jkim@freebsd.org \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox