alistair23-linux/net
Tony Lindgren bc417e30f8 net: Add back alignment for size for __alloc_skb
Commit 87fb4b7b53 (net: more
accurate skb truesize) changed the alignment of size. This
can cause problems at least on some machines with NFS root:

Unhandled fault: alignment exception (0x801) at 0xc183a43a
Internal error: : 801 [#1] PREEMPT
Modules linked in:
CPU: 0    Not tainted  (3.1.0-08784-g5eeee4a #733)
pc : [<c02fbba0>]    lr : [<c02fbb9c>]    psr: 60000013
sp : c180fef8  ip : 00000000  fp : c181f580
r10: 00000000  r9 : c044b28c  r8 : 00000001
r7 : c183a3a0  r6 : c1835be0  r5 : c183a412  r4 : 000001f2
r3 : 00000000  r2 : 00000000  r1 : ffffffe6  r0 : c183a43a
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 10004000  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc180e270)
Stack: (0xc180fef8 to 0xc1810000)
fee0:                                                       00000024 00000000
ff00: 00000000 c183b9c0 c183b8e0 c044b28c c0507ccc c019dfc4 c180ff2c c0503cf8
ff20: c180ff4c c180ff4c 00000000 c1835420 c182c740 c18349c0 c05233c0 00000000
ff40: 00000000 c00e6bb8 c180e000 00000000 c04dd82c c0507e7c c050cc18 c183b9c0
ff60: c05233c0 00000000 00000000 c01f34f4 c0430d70 c019d364 c04dd898 c04dd898
ff80: c04dd82c c0507e7c c180e000 00000000 c04c584c c01f4918 c04dd898 c04dd82c
ffa0: c04ddd28 c180e000 00000000 c0008758 c181fa60 3231d82c 00000037 00000000
ffc0: 00000000 c04dd898 c04dd82c c04ddd28 00000013 00000000 00000000 00000000
ffe0: 00000000 c04b2224 00000000 c04b21a0 c001056c c001056c 00000000 00000000
Function entered at [<c02fbba0>] from [<c019dfc4>]
Function entered at [<c019dfc4>] from [<c01f34f4>]
Function entered at [<c01f34f4>] from [<c01f4918>]
Function entered at [<c01f4918>] from [<c0008758>]
Function entered at [<c0008758>] from [<c04b2224>]
Function entered at [<c04b2224>] from [<c001056c>]
Code: e1a00005 e3a01028 ebfa7cb0 e35a0000 (e5858028)

Here PC is at __alloc_skb and &shinfo->dataref is unaligned because
skb->end can be unaligned without this patch.

As explained by Eric Dumazet <eric.dumazet@gmail.com>, this happens
only with SLOB, and not with SLAB or SLUB:

* Eric Dumazet <eric.dumazet@gmail.com> [111102 15:56]:
>
> Your patch is absolutely needed, I completely forgot about SLOB :(
>
> since, kmalloc(386) on SLOB gives exactly ksize=386 bytes, not nearest
> power of two.
>
> [   60.305763] malloc(size=385)->ffff880112c11e38 ksize=386 -> nsize=2
> [   60.305921] malloc(size=385)->ffff88007c92ce28 ksize=386 -> nsize=2
> [   60.306898] malloc(size=656)->ffff88007c44ad28 ksize=656 -> nsize=272
> [   60.325385] malloc(size=656)->ffff88007c575868 ksize=656 -> nsize=272
> [   60.325531] malloc(size=656)->ffff88011c777230 ksize=656 -> nsize=272
> [   60.325701] malloc(size=656)->ffff880114011008 ksize=656 -> nsize=272
> [   60.346716] malloc(size=385)->ffff880114142008 ksize=386 -> nsize=2
> [   60.346900] malloc(size=385)->ffff88011c777690 ksize=386 -> nsize=2

Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-03 18:09:16 -04:00
..
9p net/9p: Convert net/9p protocol dumps to tracepoints 2011-10-24 11:13:12 -05:00
802
8021q vlan: Don't propagate flag changes on down interfaces. 2011-11-01 17:51:03 -04:00
appletalk net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
atm Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
ax25
batman-adv Merge branch 'batman-adv/maint' of git://git.open-mesh.org/linux-merge 2011-10-30 03:05:07 -04:00
bluetooth Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
bridge netfilter: Remove unnecessary OOM logging messages 2011-11-01 09:19:49 +01:00
caif caif: Fix BUG() with network namespaces 2011-10-25 19:22:23 -04:00
can can: remove references to berlios mailinglist 2011-10-17 19:22:46 -04:00
ceph libceph: force resend of osd requests if we skip an osdmap 2011-10-25 16:10:17 -07:00
core net: Add back alignment for size for __alloc_skb 2011-11-03 18:09:16 -04:00
dcb dcb: add DCBX mode to event notifier attributes 2011-10-06 15:49:51 -04:00
dccp net: add missing bh_unlock_sock() calls 2011-11-03 18:06:18 -04:00
decnet
dns_resolver
dsa
econet
ethernet
ieee802154
ipv4 net: add missing bh_unlock_sock() calls 2011-11-03 18:06:18 -04:00
ipv6 net: make the tcp and udp file_operations for the /proc stuff const 2011-11-01 17:56:14 -04:00
ipx
irda Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty 2011-10-26 15:11:09 +02:00
iucv net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
key
l2tp l2tp: fix race in l2tp_recv_dequeue() 2011-11-03 18:02:13 -04:00
lapb
llc
mac80211 Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm 2011-10-25 15:18:39 +02:00
netfilter netfilter: do not propagate nf_queue errors in nf_hook_slow 2011-11-01 09:57:21 +01:00
netlabel
netlink af_unix: dont send SCM_CREDENTIALS by default 2011-09-28 13:29:50 -04:00
netrom
nfc treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
packet macvlan: handle fragmented multicast frames 2011-10-18 23:22:07 -04:00
phonet
rds treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
rfkill net:rfkill: add a gpio setup function into GPIO rfkill 2011-10-03 15:19:19 -04:00
rose
rxrpc
sched net_sched: cls_flow: use skb_header_pointer() 2011-10-24 18:40:14 -04:00
sctp ipv6: tcp: fix TCLASS value in ACK messages sent from TIME_WAIT 2011-10-27 00:44:35 -04:00
sunrpc treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
tipc
unix af_unix: dont send SCM_CREDENTIALS by default 2011-09-28 13:29:50 -04:00
wanrouter
wimax
wireless nl80211: Add sta_flags to the station info 2011-10-14 14:48:23 -04:00
x25 x25: Fix NULL dereference in x25_recvmsg 2011-11-02 00:49:49 -04:00
xfrm net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
compat.c
Kconfig
Makefile
nonet.c
socket.c Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
sysctl_net.c