public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
To: Andrew Morton <akpm@osdl•org>, Linus Torvalds <torvalds@osdl•org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs•org>,
	Greg Kroah-Hartman <gregkh@suse•de>,
	Paul Mackerras <paulus@samba•org>
Subject: [PATCH] powermac: Fix some 64b resource damage
Date: Sun, 02 Jul 2006 11:55:03 +1000	[thread overview]
Message-ID: <1151805303.19419.15.camel@localhost.localdomain> (raw)

The 64 bits resource patches did a bit of damage on PowerMac causing a
buffer overflow in macio_asic and a warning in a sound driver. The
former is fixed by reverting the sprintf of the bus_id to %08x as it was
before. The bus_id used for macio devices is always a 32 bits value
(macio always sits in 32 bits space) and since it's exposed to userland,
the format of the string shouldn't be changed like that anyway. The
second by using the proper type for printk.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel•crashing.org>
---
Linus, please apply asap since right now, PowerMac overflows kobject
buffers on boot, pretty bad.


Index: linux-irq-work/drivers/macintosh/macio_asic.c
===================================================================
--- linux-irq-work.orig/drivers/macintosh/macio_asic.c	2006-07-02 11:46:53.000000000 +1000
+++ linux-irq-work/drivers/macintosh/macio_asic.c	2006-07-02 11:47:37.000000000 +1000
@@ -427,10 +427,10 @@
 
 	/* MacIO itself has a different reg, we use it's PCI base */
 	if (np == chip->of_node) {
-		sprintf(dev->ofdev.dev.bus_id, "%1d.%016llx:%.*s",
+		sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
 			chip->lbus.index,
 #ifdef CONFIG_PCI
-			(unsigned long long)pci_resource_start(chip->lbus.pdev, 0),
+			(unsigned int)pci_resource_start(chip->lbus.pdev, 0),
 #else
 			0, /* NuBus may want to do something better here */
 #endif
Index: linux-irq-work/sound/ppc/pmac.c
===================================================================
--- linux-irq-work.orig/sound/ppc/pmac.c	2006-07-02 11:46:53.000000000 +1000
+++ linux-irq-work/sound/ppc/pmac.c	2006-07-02 11:48:40.000000000 +1000
@@ -1170,7 +1170,7 @@
 					       chip->rsrc[i].start + 1,
 					       rnames[i]) == NULL) {
 				printk(KERN_ERR "snd: can't request rsrc "
-				       " %d (%s: 0x%016lx:%016lx)\n",
+				       " %d (%s: 0x%016llx:%016llx)\n",
 				       i, rnames[i],
 				       (unsigned long long)chip->rsrc[i].start,
 				       (unsigned long long)chip->rsrc[i].end);

             reply	other threads:[~2006-07-02  1:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-02  1:55 Benjamin Herrenschmidt [this message]
2006-07-02  4:05 ` [PATCH] powermac: Fix some 64b resource damage Greg KH

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=1151805303.19419.15.camel@localhost.localdomain \
    --to=benh@kernel$(echo .)crashing.org \
    --cc=akpm@osdl$(echo .)org \
    --cc=gregkh@suse$(echo .)de \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=paulus@samba$(echo .)org \
    --cc=torvalds@osdl$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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