syzbot


KASAN: null-ptr-deref Read in __fl_put

Status: fixed on 2023/06/08 14:41
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+baabf3efa7c1e57d28b2@syzkaller.appspotmail.com
Fix commit: dfd2f0eb2347 net/sched: flower: fix fl_change() error recovery path
First crash: 459d, last: 433d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net] net/sched: flower: fix fl_change() error recovery path 3 (3) 2023/03/01 17:30
[syzbot] [net?] KASAN: null-ptr-deref Read in __fl_put 0 (1) 2023/02/27 18:42

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:72 [inline]
BUG: KASAN: null-ptr-deref in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
BUG: KASAN: null-ptr-deref in refcount_read include/linux/refcount.h:147 [inline]
BUG: KASAN: null-ptr-deref in __refcount_add_not_zero include/linux/refcount.h:152 [inline]
BUG: KASAN: null-ptr-deref in __refcount_inc_not_zero include/linux/refcount.h:227 [inline]
BUG: KASAN: null-ptr-deref in refcount_inc_not_zero include/linux/refcount.h:245 [inline]
BUG: KASAN: null-ptr-deref in maybe_get_net include/net/net_namespace.h:269 [inline]
BUG: KASAN: null-ptr-deref in tcf_exts_get_net include/net/pkt_cls.h:260 [inline]
BUG: KASAN: null-ptr-deref in __fl_put net/sched/cls_flower.c:513 [inline]
BUG: KASAN: null-ptr-deref in __fl_put+0x13e/0x3b0 net/sched/cls_flower.c:508
Read of size 4 at addr 000000000000014c by task syz-executor548/5082

CPU: 0 PID: 5082 Comm: syz-executor548 Not tainted 6.2.0-syzkaller-05251-g5b7c4cabbb65 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 print_report mm/kasan/report.c:420 [inline]
 kasan_report+0xec/0x130 mm/kasan/report.c:517
 check_region_inline mm/kasan/generic.c:183 [inline]
 kasan_check_range+0x141/0x190 mm/kasan/generic.c:189
 instrument_atomic_read include/linux/instrumented.h:72 [inline]
 atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
 refcount_read include/linux/refcount.h:147 [inline]
 __refcount_add_not_zero include/linux/refcount.h:152 [inline]
 __refcount_inc_not_zero include/linux/refcount.h:227 [inline]
 refcount_inc_not_zero include/linux/refcount.h:245 [inline]
 maybe_get_net include/net/net_namespace.h:269 [inline]
 tcf_exts_get_net include/net/pkt_cls.h:260 [inline]
 __fl_put net/sched/cls_flower.c:513 [inline]
 __fl_put+0x13e/0x3b0 net/sched/cls_flower.c:508
 fl_change+0x101b/0x4ab0 net/sched/cls_flower.c:2341
 tc_new_tfilter+0x97c/0x2290 net/sched/cls_api.c:2310
 rtnetlink_rcv_msg+0x996/0xd50 net/core/rtnetlink.c:6165
 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574
 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
 netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365
 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942
 sock_sendmsg_nosec net/socket.c:722 [inline]
 sock_sendmsg+0xde/0x190 net/socket.c:745
 ____sys_sendmsg+0x334/0x900 net/socket.c:2504
 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2558
 __sys_sendmmsg+0x18f/0x460 net/socket.c:2644
 __do_sys_sendmmsg net/socket.c:2673 [inline]
 __se_sys_sendmmsg net/socket.c:2670 [inline]
 __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2670
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f3613969d19
Code: 28 c3 e8 1a 15 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc884e0c88 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007f36139d7ed0 RCX: 00007f3613969d19
RDX: 04924924924926d3 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007ffc884e0c98 R08: 00007f36139d7e40 R09: 00007f36139d7e40
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc884e0ca0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
==================================================================

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/22 16:47 net-old 5b7c4cabbb65 409945bc .config strace log report syz C ci-upstream-net-this-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/02/22 17:24 net-next-old 5b7c4cabbb65 409945bc .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/03/02 19:16 upstream ee3f96b16468 f8902b57 .config console log report info ci-upstream-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/02/26 21:12 upstream 2fcd07b7ccd5 ee50e71c .config console log report info ci-upstream-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/02/22 20:10 upstream 5b7c4cabbb65 9f1e2cb3 .config console log report info ci-qemu-upstream KASAN: null-ptr-deref Read in __fl_put
2023/02/22 15:32 upstream 5b7c4cabbb65 9f1e2cb3 .config console log report info ci-qemu-upstream KASAN: null-ptr-deref Read in __fl_put
2023/02/23 11:18 net-old fd2a55e74a99 9e2ebb3c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/02/22 13:56 net-old 5b7c4cabbb65 409945bc .config console log report info ci-upstream-net-this-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/03/05 14:37 net-next-old 5b7c4cabbb65 f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/02/21 06:15 net-next-old f2b6cfda76d2 4f5f5209 .config console log report info ci-upstream-net-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/02/21 05:27 net-next-old f2b6cfda76d2 4f5f5209 .config console log report info ci-upstream-net-kasan-gce KASAN: null-ptr-deref Read in __fl_put
2023/03/18 22:45 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fe15c26ee26e 7939252e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in __fl_put
2023/03/16 12:51 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fe15c26ee26e 18b58603 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in __fl_put
2023/03/10 15:58 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fe15c26ee26e 5205ef30 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in __fl_put
2023/03/06 14:33 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fe15c26ee26e f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in __fl_put
2023/03/06 12:31 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fe15c26ee26e f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in __fl_put
* Struck through repros no longer work on HEAD.