syzbot


WARNING in compat_do_ebt_get_ctl

Status: fixed on 2020/09/16 22:51
Subsystems: bridge netfilter
[Documentation on labels]
Reported-by: syzbot+5accb5c62faa1d346480@syzkaller.appspotmail.com
Fix commit: 5c04da55c754 netfilter: ebtables: reject bogus getopt len value
First crash: 1383d, last: 1372d
Cause bisection: the cause commit could be any of (bisect log):
  657e4c34a237 netfilter: split nf_sockopt
  c34bc10d2535 netfilter: remove the compat argument to xt_copy_counters_from_user
  49e74c24f310 net/ipv4: factor out MCAST_MSFILTER getsockopt helpers
  77d4df41d53e netfilter: remove the compat_{get,set} methods
  d62c38f6a1a8 net/ipv4: factor out MCAST_MSFILTER setsockopt helpers
  fc66de8e16ec netfilter/ebtables: clean up compat {get, set}sockopt handling
  02caad7cc084 net/ipv4: factor out mcast join/leave setsockopt helpers
  f415e76fd723 netfilter/ip6_tables: clean up compat {get, set}sockopt handling
  89c53c14e4d2 netfilter/ip_tables: clean up compat {get,set}sockopt handling
  b6238c04c0e5 net/ipv4: remove compat_ip_{get,set}sockopt
  983094b4fc2d netfilter/arp_tables: clean up compat {get, set}sockopt handling
  d5541e85cd40 net/ipv6: factor out MCAST_MSFILTER getsockopt helpers
  55db9c0e8534 net: remove compat_sys_{get,set}sockopt
  ca0e65eb2954 net/ipv6: factor out MCAST_MSFILTER setsockopt helpers
  8c918ffbbad4 net: remove compat_sock_common_{get,set}sockopt
  fdf5bdd87c01 net/ipv6: factor out mcast join/leave setsockopt helpers
  3021ad529950 net/ipv6: remove compat_ipv6_{get,set}sockopt
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH 0/8] Netfilter fixes for net 10 (10) 2020/08/16 23:05
[PATCH nf] netfilter/ebtables: reject bogus getopt len value 4 (4) 2020/08/14 09:59
WARNING in compat_do_ebt_get_ctl 0 (2) 2020/08/13 03:45

Sample crash report:
------------[ cut here ]------------
Buffer overflow detected (80 < 137)!
WARNING: CPU: 0 PID: 6853 at include/linux/thread_info.h:134 copy_overflow include/linux/thread_info.h:134 [inline]
WARNING: CPU: 0 PID: 6853 at include/linux/thread_info.h:134 check_copy_size include/linux/thread_info.h:143 [inline]
WARNING: CPU: 0 PID: 6853 at include/linux/thread_info.h:134 copy_to_user include/linux/uaccess.h:151 [inline]
WARNING: CPU: 0 PID: 6853 at include/linux/thread_info.h:134 compat_do_ebt_get_ctl+0x47e/0x500 net/bridge/netfilter/ebtables.c:2270
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 6853 Comm: syz-executor171 Not tainted 5.8.0-syzkaller #0
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+0x18f/0x20d lib/dump_stack.c:118
 panic+0x2e3/0x75c kernel/panic.c:231
 __warn.cold+0x20/0x45 kernel/panic.c:600
 report_bug+0x1bd/0x210 lib/bug.c:198
 handle_bug+0x38/0x90 arch/x86/kernel/traps.c:234
 exc_invalid_op+0x14/0x40 arch/x86/kernel/traps.c:254
 asm_exc_invalid_op+0x12/0x20 arch/x86/include/asm/idtentry.h:536
RIP: 0010:copy_overflow include/linux/thread_info.h:134 [inline]
RIP: 0010:check_copy_size include/linux/thread_info.h:143 [inline]
RIP: 0010:copy_to_user include/linux/uaccess.h:151 [inline]
RIP: 0010:compat_do_ebt_get_ctl+0x47e/0x500 net/bridge/netfilter/ebtables.c:2270
Code: ba fd ff ff 4c 89 f7 e8 60 07 a2 fa e9 ad fd ff ff e8 36 18 62 fa 4c 89 e2 be 50 00 00 00 48 c7 c7 40 b9 0e 89 e8 94 1f 33 fa <0f> 0b e9 dc fd ff ff 41 bc f2 ff ff ff e9 4f fe ff ff e8 3b 07 a2
RSP: 0018:ffffc90005667ae8 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 1ffff92000accf5e RCX: 0000000000000000
RDX: ffff88809458a280 RSI: ffffffff815dbce7 RDI: fffff52000accf4f
RBP: ffffffff8a8faa60 R08: 0000000000000001 R09: ffff8880ae6318e7
R10: 0000000000000000 R11: 0000000035383654 R12: 0000000000000089
R13: 0000000020000000 R14: ffffc90005667d80 R15: ffffc90005667b20
 do_ebt_get_ctl+0x2b4/0x790 net/bridge/netfilter/ebtables.c:2317
 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116
 ip_getsockopt net/ipv4/ip_sockglue.c:1778 [inline]
 ip_getsockopt+0x164/0x1c0 net/ipv4/ip_sockglue.c:1757
 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:3884
 __sys_getsockopt+0x219/0x4c0 net/socket.c:2179
 __do_sys_getsockopt net/socket.c:2194 [inline]
 __se_sys_getsockopt net/socket.c:2191 [inline]
 __ia32_sys_getsockopt+0xb9/0x150 net/socket.c:2191
 do_syscall_32_irqs_on arch/x86/entry/common.c:84 [inline]
 __do_fast_syscall_32+0x57/0x80 arch/x86/entry/common.c:126
 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:149
 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf7f91569
Code: 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 002b:00000000ffdae08c EFLAGS: 00000292 ORIG_RAX: 000000000000016d
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000000000
RDX: 0000000000000082 RSI: 0000000020000000 RDI: 0000000020000100
RBP: 0000000000000012 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/13 03:45 upstream fb893de323e2 bc15f7db .config console log report syz C ci-upstream-kasan-gce-386
2020/08/18 01:45 upstream 9123e3a74ec7 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/18 00:02 upstream 9123e3a74ec7 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/17 21:27 upstream 9123e3a74ec7 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/17 21:27 upstream 9123e3a74ec7 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/17 21:14 upstream 9123e3a74ec7 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/16 18:04 upstream 4b6c093e21d3 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/16 12:48 upstream 4b6c093e21d3 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/15 20:03 upstream c9c9735c46f5 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/14 19:16 upstream a1d21081a60d 424dd8e7 .config console log report ci-upstream-kasan-gce-386
2020/08/14 06:16 upstream 990f227371a4 54ce1ed6 .config console log report ci-upstream-kasan-gce-386
2020/08/13 09:43 upstream fb893de323e2 bc15f7db .config console log report ci-upstream-kasan-gce-386
2020/08/13 03:33 upstream fb893de323e2 bc15f7db .config console log report ci-upstream-kasan-gce-386
2020/08/06 11:33 upstream 47ec5303d73e 1f122f88 .config console log report ci-qemu-upstream-386
2020/08/06 11:20 upstream 47ec5303d73e 1f122f88 .config console log report ci-qemu-upstream-386
* Struck through repros no longer work on HEAD.