android_kernel_samsung_msm8976/include
Stefano Brivio aac8a8ed57 neighbour: Avoid writing before skb->head in neigh_hh_output()
[ Upstream commit e6ac64d4c4d095085d7dd71cbd05704ac99829b2 ]

While skb_push() makes the kernel panic if the skb headroom is less than
the unaligned hardware header size, it will proceed normally in case we
copy more than that because of alignment, and we'll silently corrupt
adjacent slabs.

In the case fixed by the previous patch,
"ipv6: Check available headroom in ip6_xmit() even without options", we
end up in neigh_hh_output() with 14 bytes headroom, 14 bytes hardware
header and write 16 bytes, starting 2 bytes before the allocated buffer.

Always check we're not writing before skb->head and, if the headroom is
not enough, warn and drop the packet.

v2:
 - instead of panicking with BUG_ON(), WARN_ON_ONCE() and drop the packet
   (Eric Dumazet)
 - if we avoid the panic, though, we need to explicitly check the headroom
   before the memcpy(), otherwise we'll have corrupted slabs on a running
   kernel, after we warn
 - use __skb_push() instead of skb_push(), as the headroom check is
   already implemented here explicitly (Eric Dumazet)

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-27 21:53:22 +02:00
..
acpi
asm-generic scsi: dma-mapping: always provide dma_get_cache_alignment 2019-07-27 21:46:11 +02:00
clocksource
crypto crypto: vmac - separate tfm and request context 2019-07-27 21:51:07 +02:00
drm Merge remote-tracking branch 'f2fs/linux-3.10.y' into HEAD 2017-04-18 17:02:28 +02:00
dt-bindings
keys
kvm
linux posix-timers: Sanitize overrun handling 2019-07-27 21:53:21 +02:00
math-emu
media media: v4l: event: Prevent freeing event subscriptions while accessed 2019-07-27 21:51:55 +02:00
memory
misc
net neighbour: Avoid writing before skb->head in neigh_hh_output() 2019-07-27 21:53:22 +02:00
pcmcia
ras
rdma RDMA/core: Fix incorrect structure packing for booleans 2019-07-27 21:43:09 +02:00
rxrpc
scsi scsi: libsas: align sata_device's rps_resp on a cacheline 2019-07-27 21:46:11 +02:00
sdp Import latest Samsung release 2017-04-18 03:43:52 +02:00
soc/qcom Merge tag 'LA.BR.1.3.6-03910-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD 2017-05-26 13:28:48 +02:00
sound ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams 2019-07-27 21:52:25 +02:00
target target: Avoid mappedlun symlink creation during lun shutdown 2019-07-27 21:44:16 +02:00
trace trace: cpufreq: fix typo in min/max cpufreq 2019-07-27 21:51:10 +02:00
uapi ppp: remove the PPPIOCDETACH ioctl 2019-07-27 21:52:16 +02:00
video
xen Merge remote-tracking branch 'f2fs/linux-3.10.y' into HEAD 2017-04-18 17:02:28 +02:00
Kbuild