Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] powermac: Fix some 64b resource damage

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>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Benjamin Herrenschmidt and committed by
Linus Torvalds
d63fb6c5 fc25465f

+3 -3
+2 -2
drivers/macintosh/macio_asic.c
··· 427 427 428 428 /* MacIO itself has a different reg, we use it's PCI base */ 429 429 if (np == chip->of_node) { 430 - sprintf(dev->ofdev.dev.bus_id, "%1d.%016llx:%.*s", 430 + sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", 431 431 chip->lbus.index, 432 432 #ifdef CONFIG_PCI 433 - (unsigned long long)pci_resource_start(chip->lbus.pdev, 0), 433 + (unsigned int)pci_resource_start(chip->lbus.pdev, 0), 434 434 #else 435 435 0, /* NuBus may want to do something better here */ 436 436 #endif
+1 -1
sound/ppc/pmac.c
··· 1170 1170 chip->rsrc[i].start + 1, 1171 1171 rnames[i]) == NULL) { 1172 1172 printk(KERN_ERR "snd: can't request rsrc " 1173 - " %d (%s: 0x%016lx:%016lx)\n", 1173 + " %d (%s: 0x%016llx:%016llx)\n", 1174 1174 i, rnames[i], 1175 1175 (unsigned long long)chip->rsrc[i].start, 1176 1176 (unsigned long long)chip->rsrc[i].end);