mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: "Georg C. F. Greve" <greve@fsfeurope.org>,
	Hans Ulrich Niedermann <vserver@n-dimensional.de>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	ACPI Developers <acpi-devel@lists.sourceforge.net>,
	Andrew Morton <akpm@osdl.org>, Dave Jones <davej@redhat.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Herbert Poetzl <herbert@13thfloor.at>,
	Nick Warne <nick@linicks.net>, Len Brown <len.brown@intel.com>
Subject: Re: PROBLEM: Kernel 2.6.10 crashing repeatedly and hard
Date: Sun, 2 Jan 2005 12:11:47 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0501021147260.2280@ppc970.osdl.org> (raw)
In-Reply-To: <m3zmzvl9x1.fsf@reason.gnu-hamburg>



I think I chased this one down. Very nasty indeed, and the only reason I
was able to find it was pure luck: I just happened to be able to reproduce
the problem on a laptop (but not on my main machine, or indeed, any other
machine I had access to).

Even so, it took thousands of reboots to pinpoint it (I'm not kidding, I
had the thing auto-reboot until it would crash or until I decided some
configuration was crash-proof, and thank God for fast reboot times).

If your problem is the same thing, then it's due to ACPI video enumeration
overwriting an adjacent slab entry at bootup, and depending on just what
happened to follow it it might be harmless or it might totally destroy the
slab cache data structures.

I'll hereby ask the ACPI people to verify whether this was the only such
allocation problem in ACPI - it's a stupid lack of allocation for the
final terminating entry, and maybe other instances of this exist (and I
just found one of them).

As far as I can tell, this bug would only trigger if ACPI Video reported
exactly four (possibly eight, but that is getting very unlikely) video
heads, since anything else would have enough padding in the allocation
that it wouldn't matter that it allocated too little. Again, just pure
luck that I happened to have something that fit that criteria.

DaveJ: this may explain the "Mobile Radeon" reports. Not because of
anything Radeon-specific, but simply because they'd have four ports (CRT,
LVDS TFT panel, tv-out, and tv-in, I think - ACPI doesn't tell me enough
to be sure).

Of course, there might be another independent bug, so there's nothing to
say that this will fix what others are seeing...

Patch appended, and also pushed out to the BK trees.

			Linus

----
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/01/02 11:45:13-08:00 torvalds@evo.osdl.org 
#   acpi video device enumeration: fix incorrect device list allocation
#   
#   It didn't allocate space for the final terminating entry,
#   which caused it to overwrite the next slab entry, which in turn
#   sometimes ended up being a slab array cache pointer. End result:
#   total slab cache corruption at a random time afterwards. Very
#   nasty.
# 
# drivers/acpi/video.c
#   2005/01/02 11:45:03-08:00 torvalds@evo.osdl.org +1 -1
#   acpi video device enumeration: fix incorrect device list allocation
#   
#   It didn't allocate space for the final terminating entry,
#   which caused it to overwrite the next slab entry, which in turn
#   sometimes ended up being a slab array cache pointer. End result:
#   total slab cache corruption at a random time afterwards. Very
#   nasty.
# 
diff -Nru a/drivers/acpi/video.c b/drivers/acpi/video.c
--- a/drivers/acpi/video.c	2005-01-02 12:10:23 -08:00
+++ b/drivers/acpi/video.c	2005-01-02 12:10:23 -08:00
@@ -1524,7 +1524,7 @@
 		dod->package.count));
 
 	active_device_list= kmalloc(
- 		dod->package.count*sizeof(struct acpi_video_enumerated_device),
+ 		(1+dod->package.count)*sizeof(struct acpi_video_enumerated_device),
 	       	GFP_KERNEL);
 
 	if (!active_device_list) {

  parent reply	other threads:[~2005-01-02 20:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-30  0:31 Georg C. F. Greve
2004-12-30 16:23 ` Georg C. F. Greve
     [not found]   ` <v3rda2-hjn.ln1@news.it.uc3m.es>
2004-12-30 17:53     ` Sandro Dentella
2004-12-30 19:50     ` Michael Tokarev
2004-12-30 20:54       ` berk walker
2005-01-01 13:39       ` Helge Hafting
2004-12-30 20:40 ` Linus Torvalds
2004-12-30 22:04   ` Georg C. F. Greve
2004-12-30 22:23     ` Linus Torvalds
2004-12-31  4:16       ` Herbert Poetzl
2004-12-31  4:53         ` Linus Torvalds
2004-12-31 10:55           ` Russell King
2004-12-31  9:58       ` Georg C. F. Greve
2005-01-01 20:06       ` Alan Cox
2005-01-02 20:11     ` Linus Torvalds [this message]
2005-01-02 20:32       ` Dave Jones
2004-12-30 10:21 Nick Warne
2004-12-31 11:46 Manfred Spraul

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=Pine.LNX.4.58.0501021147260.2280@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@redhat.com \
    --cc=greve@fsfeurope.org \
    --cc=herbert@13thfloor.at \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@linicks.net \
    --cc=vserver@n-dimensional.de \
    /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

all inboxes | Powered by JetHome®