Revision 4dd2b82d5adfbe0b1587ccad7a8f76d826120f37 authored by Eric Dumazet on 02 May 2019, 01:56:28 UTC, committed by David S. Miller on 02 May 2019, 02:29:56 UTC
syzbot was able to crash host by sending UDP packets with a 0 payload. TCP does not have this issue since we do not aggregate packets without payload. Since dev_gro_receive() sets gso_size based on skb_gro_len(skb) it seems not worth trying to cope with padded packets. BUG: KASAN: slab-out-of-bounds in skb_gro_receive+0xf5f/0x10e0 net/core/skbuff.c:3826 Read of size 16 at addr ffff88808893fff0 by task syz-executor612/7889 CPU: 0 PID: 7889 Comm: syz-executor612 Not tainted 5.1.0-rc7+ #96 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load16_noabort+0x14/0x20 mm/kasan/generic_report.c:133 skb_gro_receive+0xf5f/0x10e0 net/core/skbuff.c:3826 udp_gro_receive_segment net/ipv4/udp_offload.c:382 [inline] call_gro_receive include/linux/netdevice.h:2349 [inline] udp_gro_receive+0xb61/0xfd0 net/ipv4/udp_offload.c:414 udp4_gro_receive+0x763/0xeb0 net/ipv4/udp_offload.c:478 inet_gro_receive+0xe72/0x1110 net/ipv4/af_inet.c:1510 dev_gro_receive+0x1cd0/0x23c0 net/core/dev.c:5581 napi_gro_frags+0x36b/0xd10 net/core/dev.c:5843 tun_get_user+0x2f24/0x3fb0 drivers/net/tun.c:1981 tun_chr_write_iter+0xbd/0x156 drivers/net/tun.c:2027 call_write_iter include/linux/fs.h:1866 [inline] do_iter_readv_writev+0x5e1/0x8e0 fs/read_write.c:681 do_iter_write fs/read_write.c:957 [inline] do_iter_write+0x184/0x610 fs/read_write.c:938 vfs_writev+0x1b3/0x2f0 fs/read_write.c:1002 do_writev+0x15e/0x370 fs/read_write.c:1037 __do_sys_writev fs/read_write.c:1110 [inline] __se_sys_writev fs/read_write.c:1107 [inline] __x64_sys_writev+0x75/0xb0 fs/read_write.c:1107 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x441cc0 Code: 05 48 3d 01 f0 ff ff 0f 83 9d 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 83 3d 51 93 29 00 00 75 14 b8 14 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 74 09 fc ff c3 48 83 ec 08 e8 ba 2b 00 00 RSP: 002b:00007ffe8c716118 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007ffe8c716150 RCX: 0000000000441cc0 RDX: 0000000000000001 RSI: 00007ffe8c716170 RDI: 00000000000000f0 RBP: 0000000000000000 R08: 000000000000ffff R09: 0000000000a64668 R10: 0000000020000040 R11: 0000000000000246 R12: 000000000000c2d9 R13: 0000000000402b50 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5143: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3393 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3555 mm_alloc+0x1d/0xd0 kernel/fork.c:1030 bprm_mm_init fs/exec.c:363 [inline] __do_execve_file.isra.0+0xaa3/0x23f0 fs/exec.c:1791 do_execveat_common fs/exec.c:1865 [inline] do_execve fs/exec.c:1882 [inline] __do_sys_execve fs/exec.c:1958 [inline] __se_sys_execve fs/exec.c:1953 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1953 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 5351: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3499 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3765 __mmdrop+0x238/0x320 kernel/fork.c:677 mmdrop include/linux/sched/mm.h:49 [inline] finish_task_switch+0x47b/0x780 kernel/sched/core.c:2746 context_switch kernel/sched/core.c:2880 [inline] __schedule+0x81b/0x1cc0 kernel/sched/core.c:3518 preempt_schedule_irq+0xb5/0x140 kernel/sched/core.c:3745 retint_kernel+0x1b/0x2d arch_local_irq_restore arch/x86/include/asm/paravirt.h:767 [inline] kmem_cache_free+0xab/0x260 mm/slab.c:3766 anon_vma_chain_free mm/rmap.c:134 [inline] unlink_anon_vmas+0x2ba/0x870 mm/rmap.c:401 free_pgtables+0x1af/0x2f0 mm/memory.c:394 exit_mmap+0x2d1/0x530 mm/mmap.c:3144 __mmput kernel/fork.c:1046 [inline] mmput+0x15f/0x4c0 kernel/fork.c:1067 exec_mmap fs/exec.c:1046 [inline] flush_old_exec+0x8d9/0x1c20 fs/exec.c:1279 load_elf_binary+0x9bc/0x53f0 fs/binfmt_elf.c:864 search_binary_handler fs/exec.c:1656 [inline] search_binary_handler+0x17f/0x570 fs/exec.c:1634 exec_binprm fs/exec.c:1698 [inline] __do_execve_file.isra.0+0x1394/0x23f0 fs/exec.c:1818 do_execveat_common fs/exec.c:1865 [inline] do_execve fs/exec.c:1882 [inline] __do_sys_execve fs/exec.c:1958 [inline] __se_sys_execve fs/exec.c:1953 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1953 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808893f7c0 which belongs to the cache mm_struct of size 1496 The buggy address is located 600 bytes to the right of 1496-byte region [ffff88808893f7c0, ffff88808893fd98) The buggy address belongs to the page: page:ffffea0002224f80 count:1 mapcount:0 mapping:ffff88821bc40ac0 index:0xffff88808893f7c0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00025b4f08 ffffea00027b9d08 ffff88821bc40ac0 raw: ffff88808893f7c0 ffff88808893e440 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808893fe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808893ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808893ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888088940000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888088940080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Paolo Abeni <pabeni@redhat.com> Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 886b7a5
File | Mode | Size |
---|---|---|
atomic | ||
basic | ||
coccinelle | ||
dtc | ||
gcc-plugins | ||
gdb | ||
genksyms | ||
kconfig | ||
ksymoops | ||
mod | ||
package | ||
selinux | ||
tracing | ||
.gitignore | -rw-r--r-- | 145 bytes |
Kbuild.include | -rw-r--r-- | 13.0 KB |
Kconfig.include | -rw-r--r-- | 852 bytes |
Lindent | -rwxr-xr-x | 502 bytes |
Makefile | -rw-r--r-- | 1.6 KB |
Makefile.asm-generic | -rw-r--r-- | 1.8 KB |
Makefile.build | -rw-r--r-- | 17.0 KB |
Makefile.clean | -rw-r--r-- | 2.8 KB |
Makefile.dtbinst | -rw-r--r-- | 1.1 KB |
Makefile.extrawarn | -rw-r--r-- | 2.7 KB |
Makefile.gcc-plugins | -rw-r--r-- | 2.4 KB |
Makefile.headersinst | -rw-r--r-- | 3.8 KB |
Makefile.host | -rw-r--r-- | 6.3 KB |
Makefile.kasan | -rw-r--r-- | 1.4 KB |
Makefile.kcov | -rw-r--r-- | 319 bytes |
Makefile.lib | -rw-r--r-- | 15.0 KB |
Makefile.modbuiltin | -rw-r--r-- | 1.7 KB |
Makefile.modinst | -rw-r--r-- | 1.1 KB |
Makefile.modpost | -rw-r--r-- | 5.3 KB |
Makefile.modsign | -rw-r--r-- | 897 bytes |
Makefile.ubsan | -rw-r--r-- | 926 bytes |
adjust_autoksyms.sh | -rwxr-xr-x | 2.8 KB |
asn1_compiler.c | -rw-r--r-- | 35.5 KB |
bin2c.c | -rw-r--r-- | 743 bytes |
bloat-o-meter | -rwxr-xr-x | 3.3 KB |
bootgraph.pl | -rwxr-xr-x | 6.3 KB |
bpf_helpers_doc.py | -rwxr-xr-x | 15.5 KB |
cc-can-link.sh | -rwxr-xr-x | 166 bytes |
check_extable.sh | -rwxr-xr-x | 4.9 KB |
checkincludes.pl | -rwxr-xr-x | 1.9 KB |
checkkconfigsymbols.py | -rwxr-xr-x | 15.5 KB |
checkpatch.pl | -rwxr-xr-x | 196.9 KB |
checkstack.pl | -rwxr-xr-x | 5.3 KB |
checksyscalls.sh | -rwxr-xr-x | 7.3 KB |
checkversion.pl | -rwxr-xr-x | 1.9 KB |
clang-version.sh | -rwxr-xr-x | 527 bytes |
cleanfile | -rwxr-xr-x | 3.5 KB |
cleanpatch | -rwxr-xr-x | 5.1 KB |
coccicheck | -rwxr-xr-x | 7.2 KB |
config | -rwxr-xr-x | 4.5 KB |
conmakehash.c | -rw-r--r-- | 6.0 KB |
const_structs.checkpatch | -rw-r--r-- | 964 bytes |
decode_stacktrace.sh | -rwxr-xr-x | 3.9 KB |
decodecode | -rwxr-xr-x | 2.6 KB |
depmod.sh | -rwxr-xr-x | 1.3 KB |
diffconfig | -rwxr-xr-x | 3.7 KB |
documentation-file-ref-check | -rwxr-xr-x | 3.7 KB |
export_report.pl | -rwxr-xr-x | 4.5 KB |
extract-cert.c | -rw-r--r-- | 3.5 KB |
extract-ikconfig | -rwxr-xr-x | 1.7 KB |
extract-module-sig.pl | -rwxr-xr-x | 3.7 KB |
extract-sys-certs.pl | -rwxr-xr-x | 3.7 KB |
extract-vmlinux | -rwxr-xr-x | 1.7 KB |
extract_xc3028.pl | -rwxr-xr-x | 44.6 KB |
faddr2line | -rwxr-xr-x | 6.2 KB |
file-size.sh | -rwxr-xr-x | 86 bytes |
find-unused-docs.sh | -rwxr-xr-x | 1.3 KB |
gcc-goto.sh | -rwxr-xr-x | 511 bytes |
gcc-ld | -rwxr-xr-x | 711 bytes |
gcc-plugin.sh | -rwxr-xr-x | 1.1 KB |
gcc-version.sh | -rwxr-xr-x | 588 bytes |
gcc-x86_32-has-stack-protector.sh | -rwxr-xr-x | 173 bytes |
gcc-x86_64-has-stack-protector.sh | -rwxr-xr-x | 198 bytes |
gen_compile_commands.py | -rwxr-xr-x | 5.6 KB |
gen_ksymdeps.sh | -rwxr-xr-x | 399 bytes |
get_dvb_firmware | -rwxr-xr-x | 25.2 KB |
get_maintainer.pl | -rwxr-xr-x | 65.8 KB |
gfp-translate | -rwxr-xr-x | 1.7 KB |
headerdep.pl | -rwxr-xr-x | 3.5 KB |
headers.sh | -rwxr-xr-x | 512 bytes |
headers_check.pl | -rwxr-xr-x | 3.7 KB |
headers_install.sh | -rwxr-xr-x | 1.4 KB |
insert-sys-cert.c | -rw-r--r-- | 8.9 KB |
kallsyms.c | -rw-r--r-- | 17.9 KB |
kernel-doc | -rwxr-xr-x | 60.7 KB |
ld-version.sh | -rwxr-xr-x | 269 bytes |
leaking_addresses.pl | -rwxr-xr-x | 12.8 KB |
link-vmlinux.sh | -rwxr-xr-x | 6.1 KB |
makelst | -rwxr-xr-x | 808 bytes |
markup_oops.pl | -rwxr-xr-x | 8.1 KB |
mkcompile_h | -rwxr-xr-x | 2.5 KB |
mkmakefile | -rwxr-xr-x | 866 bytes |
mksysmap | -rwxr-xr-x | 1.3 KB |
mkuboot.sh | -rwxr-xr-x | 414 bytes |
module-common.lds | -rw-r--r-- | 901 bytes |
namespace.pl | -rwxr-xr-x | 13.0 KB |
objdiff | -rwxr-xr-x | 2.8 KB |
parse-maintainers.pl | -rw-r--r-- | 3.7 KB |
patch-kernel | -rwxr-xr-x | 9.9 KB |
pnmtologo.c | -rw-r--r-- | 11.9 KB |
profile2linkerlist.pl | -rwxr-xr-x | 414 bytes |
prune-kernel | -rwxr-xr-x | 708 bytes |
recordmcount.c | -rw-r--r-- | 16.7 KB |
recordmcount.h | -rw-r--r-- | 16.4 KB |
recordmcount.pl | -rwxr-xr-x | 18.7 KB |
setlocalversion | -rwxr-xr-x | 4.3 KB |
show_delta | -rwxr-xr-x | 3.0 KB |
sign-file.c | -rw-r--r-- | 9.8 KB |
sortextable.c | -rw-r--r-- | 8.4 KB |
sortextable.h | -rw-r--r-- | 5.5 KB |
spdxcheck-test.sh | -rw-r--r-- | 323 bytes |
spdxcheck.py | -rwxr-xr-x | 9.8 KB |
spelling.txt | -rw-r--r-- | 28.1 KB |
sphinx-pre-install | -rwxr-xr-x | 14.0 KB |
split-man.pl | -rwxr-xr-x | 600 bytes |
stackdelta | -rwxr-xr-x | 1.8 KB |
stackusage | -rwxr-xr-x | 794 bytes |
subarch.include | -rw-r--r-- | 641 bytes |
tags.sh | -rwxr-xr-x | 10.0 KB |
unifdef.c | -rw-r--r-- | 34.8 KB |
ver_linux | -rwxr-xr-x | 2.7 KB |
xen-hypercalls.sh | -rw-r--r-- | 386 bytes |
xz_wrap.sh | -rwxr-xr-x | 562 bytes |
Computing file changes ...