summaryrefslogtreecommitdiffstats
path: root/lib/lshrdi3.c
diff options
context:
space:
mode:
authorAndrew Kanner <andrew.kanner@gmail.com>2023-08-03 20:59:48 +0200
committerJakub Kicinski <kuba@kernel.org>2023-08-07 19:14:41 -0700
commit59eeb232940515590de513b997539ef495faca9a (patch)
treeb7b965f7742632b0fab0a65e720e508f2a2bfb7c /lib/lshrdi3.c
parentfa41884c1c6deb6774135390e5813a97184903e0 (diff)
downloadlinux-59eeb232940515590de513b997539ef495faca9a.tar.gz
linux-59eeb232940515590de513b997539ef495faca9a.tar.bz2
linux-59eeb232940515590de513b997539ef495faca9a.zip
drivers: net: prevent tun_build_skb() to exceed the packet size limit
Using the syzkaller repro with reduced packet size it was discovered that XDP_PACKET_HEADROOM is not checked in tun_can_build_skb(), although pad may be incremented in tun_build_skb(). This may end up with exceeding the PAGE_SIZE limit in tun_build_skb(). Jason Wang <jasowang@redhat.com> proposed to count XDP_PACKET_HEADROOM always (e.g. without rcu_access_pointer(tun->xdp_prog)) in tun_can_build_skb() since there's a window during which XDP program might be attached between tun_can_build_skb() and tun_build_skb(). Fixes: 7df13219d757 ("tun: reserve extra headroom only when XDP is set") Link: https://syzkaller.appspot.com/bug?extid=f817490f5bd20541b90a Signed-off-by: Andrew Kanner <andrew.kanner@gmail.com> Link: https://lore.kernel.org/r/20230803185947.2379988-1-andrew.kanner@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'lib/lshrdi3.c')
0 files changed, 0 insertions, 0 deletions