Prev: [57/89] hwmon: (w83781d) Request I/O ports individually for probing
Next: [41/45] tmpfs: handle MPOL_LOCAL mount option properly
From: Greg KH on 30 Mar 2010 19:20 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Stanislav Brabec <sbrabec(a)suse.cz> commit e0188829cb724e7d12a2d4e343b368ff1d6e1471 upstream. About 50% of shutdowns of b44 Ethernet adapter ends by kernel panic with kernels compiled with stack-protector. Checking b44_magic_pattern() return values, one call of b44_magic_pattern() returns 127. It means, that set_bit(128, pmask) was called on line 1509. It means that bit 0 of 17th byte of pmask was overwritten. But pmask has only 16 bytes. Stack corruption happens. It seems that set_bit() on line 1509 always writes one bit off. The fix does not only solve the stack corruption, but also makes Wake On LAN working on my onboard B44 on Asus A7V-333X mainboard. It seems that this problem affects all kernel versions since commit 725ad800 ([PATCH] b44: add wol for old nic) on 2006-06-20. Signed-off-by: Stanislav Brabec <sbrabec(a)suse.cz> Signed-off-by: David S. Miller <davem(a)davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> --- drivers/net/b44.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/b44.c +++ b/drivers/net/b44.c @@ -1502,8 +1502,7 @@ static int b44_magic_pattern(u8 *macaddr for (k = 0; k< ethaddr_bytes; k++) { ppattern[offset + magicsync + (j * ETH_ALEN) + k] = macaddr[k]; - len++; - set_bit(len, (unsigned long *) pmask); + set_bit(len++, (unsigned long *) pmask); } } return len - 1; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |