syzbot


KASAN: use-after-free Write in nr_release
Status: upstream: reported C repro on 2019/11/29 08:16
Reported-by: syzbot+caa188bdfc1eeafeb418@syzkaller.appspotmail.com
First crash: 911d, last: 1d02h

Cause bisection: the cause commit could be any of (bisect log):
  9211bfbff80a netfilter: add missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to header-file.
  47e640af2e49 netfilter: add missing IS_ENABLED(CONFIG_NF_TABLES) check to header-file.
  a1b2f04ea527 netfilter: add missing includes to a number of header-files.
  0abc8bf4f284 netfilter: add missing IS_ENABLED(CONFIG_NF_CONNTRACK) checks to some header-files.
  bd96b4c75675 netfilter: inline four headers files into another one.
  43dd16efc7f2 netfilter: nf_tables: store data in offload context registers
  78458e3e08cd netfilter: add missing IS_ENABLED(CONFIG_NETFILTER) checks to some header-files.
  20a9379d9a03 netfilter: remove "#ifdef __KERNEL__" guards from some headers.
  bd8699e9e292 netfilter: nft_bitwise: add offload support
  2a475c409fe8 kbuild: remove all netfilter headers from header-test blacklist.
  7e59b3fea2a2 netfilter: remove unnecessary spaces
  1b90af292e71 ipvs: Improve robustness to the ipvs sysctl
  5785cf15fd74 netfilter: nf_tables: add missing prototypes.
  0a30ba509fde netfilter: nf_nat_proto: make tables static
  e84fb4b3666d netfilter: conntrack: use shared sysctl constants
  105333435b4f netfilter: connlabels: prefer static lock initialiser
  8c0bb7873815 netfilter: synproxy: rename mss synproxy_options field
  c162610c7db2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next

Fix bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in nr_release C 182 51m 1022d 0/1 upstream: reported C repro on 2019/08/10 01:07
linux-4.14 KASAN: use-after-free Read in nr_release syz 97 1d02h 1019d 0/1 upstream: reported syz repro on 2019/08/13 12:20

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [inline]
BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline]
BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline]
BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline]
BUG: KASAN: use-after-free in sock_hold include/net/sock.h:702 [inline]
BUG: KASAN: use-after-free in nr_release+0x5c/0x430 net/netrom/af_netrom.c:520
Write of size 4 at addr ffff88801b5d4080 by task syz-executor240/6857

CPU: 1 PID: 6857 Comm: syz-executor240 Not tainted 5.15.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106
 print_address_description+0x66/0x3e0 mm/kasan/report.c:256
 __kasan_report mm/kasan/report.c:442 [inline]
 kasan_report+0x19a/0x1f0 mm/kasan/report.c:459
 kasan_check_range+0x2b5/0x2f0 mm/kasan/generic.c:189
 instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
 atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [inline]
 __refcount_add include/linux/refcount.h:193 [inline]
 __refcount_inc include/linux/refcount.h:250 [inline]
 refcount_inc include/linux/refcount.h:267 [inline]
 sock_hold include/net/sock.h:702 [inline]
 nr_release+0x5c/0x430 net/netrom/af_netrom.c:520
 __sock_release net/socket.c:649 [inline]
 sock_close+0xd8/0x260 net/socket.c:1314
 __fput+0x3fe/0x870 fs/file_table.c:280
 task_work_run+0x146/0x1c0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x6fc/0x2580 kernel/exit.c:825
 do_group_exit+0x168/0x2d0 kernel/exit.c:922
 get_signal+0x16e0/0x20c0 kernel/signal.c:2868
 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:865
 handle_signal_work kernel/entry/common.c:148 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
 exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:209
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:302
 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f50e35fb3c9
Code: Unable to access opcode bytes at RIP 0x7f50e35fb39f.
RSP: 002b:00007ffde62917a8 EFLAGS: 00000246 ORIG_RAX: 000000000000002b
RAX: fffffffffffffe00 RBX: 0000000000000003 RCX: 00007f50e35fb3c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000000004 R08: 00007ffde62917d0 R09: 00007ffde62917d0
R10: 00007ffde62917d0 R11: 0000000000000246 R12: 000055555635f2c0
R13: 000000000000000b R14: 00007ffde6291820 R15: 0000000000000000

Allocated by task 6857:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 __kmalloc+0x24d/0x370 mm/slub.c:4391
 kmalloc include/linux/slab.h:596 [inline]
 sk_prot_alloc+0xf4/0x230 net/core/sock.c:1822
 sk_alloc+0x35/0x300 net/core/sock.c:1875
 nr_create+0x9f/0x4e0 net/netrom/af_netrom.c:433
 __sock_create+0x580/0x8d0 net/socket.c:1464
 sock_create net/socket.c:1515 [inline]
 __sys_socket+0x133/0x380 net/socket.c:1557
 __do_sys_socket net/socket.c:1566 [inline]
 __se_sys_socket net/socket.c:1564 [inline]
 __x64_sys_socket+0x76/0x80 net/socket.c:1564
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 6857:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1700 [inline]
 slab_free_freelist_hook+0x129/0x1a0 mm/slub.c:1725
 slab_free mm/slub.c:3483 [inline]
 kfree+0xcf/0x2f0 mm/slub.c:4543
 sk_prot_free net/core/sock.c:1858 [inline]
 __sk_destruct+0x575/0x820 net/core/sock.c:1943
 call_timer_fn+0xf6/0x210 kernel/time/timer.c:1421
 expire_timers kernel/time/timer.c:1466 [inline]
 __run_timers+0x71a/0x910 kernel/time/timer.c:1734
 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1747
 __do_softirq+0x392/0x7a3 kernel/softirq.c:558

The buggy address belongs to the object at ffff88801b5d4000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 128 bytes inside of
 2048-byte region [ffff88801b5d4000, ffff88801b5d4800)
The buggy address belongs to the page:
page:ffffea00006d7400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1b5d0
head:ffffea00006d7400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011042000
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 20, ts 281243236047, free_ts 281237310240
 prep_new_page mm/page_alloc.c:2424 [inline]
 get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4153
 __alloc_pages+0x255/0x580 mm/page_alloc.c:5375
 alloc_slab_page mm/slub.c:1763 [inline]
 allocate_slab+0xcc/0x4d0 mm/slub.c:1900
 new_slab mm/slub.c:1963 [inline]
 ___slab_alloc+0x41e/0xc40 mm/slub.c:2994
 __slab_alloc mm/slub.c:3081 [inline]
 slab_alloc_node mm/slub.c:3172 [inline]
 __kmalloc_node_track_caller+0x2d9/0x3e0 mm/slub.c:4936
 kmalloc_reserve net/core/skbuff.c:355 [inline]
 pskb_expand_head+0x118/0x10f0 net/core/skbuff.c:1700
 netlink_trim+0x17f/0x210 net/netlink/af_netlink.c:1296
 netlink_broadcast_filtered+0x6c/0x1110 net/netlink/af_netlink.c:1501
 netlink_broadcast net/netlink/af_netlink.c:1546 [inline]
 nlmsg_multicast include/net/netlink.h:1033 [inline]
 nlmsg_notify+0x100/0x1c0 net/netlink/af_netlink.c:2547
 netdev_state_change+0x1c5/0x270 net/core/dev.c:1389
 linkwatch_do_dev+0x10a/0x160 net/core/link_watch.c:167
 __linkwatch_run_queue+0x4f5/0x800 net/core/link_watch.c:213
 linkwatch_event+0x48/0x50 net/core/link_watch.c:252
 process_one_work+0x853/0x1140 kernel/workqueue.c:2297
 worker_thread+0xac1/0x1320 kernel/workqueue.c:2444
 kthread+0x453/0x480 kernel/kthread.c:319
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1338 [inline]
 free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1389
 free_unref_page_prepare mm/page_alloc.c:3315 [inline]
 free_unref_page+0x7d/0x580 mm/page_alloc.c:3394
 free_slab mm/slub.c:2003 [inline]
 discard_slab mm/slub.c:2009 [inline]
 __unfreeze_partials+0x1ab/0x200 mm/slub.c:2495
 put_cpu_partial+0x132/0x1a0 mm/slub.c:2575
 do_slab_free mm/slub.c:3471 [inline]
 ___cache_free+0xe6/0x120 mm/slub.c:3490
 qlist_free_all mm/kasan/quarantine.c:165 [inline]
 kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272
 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook mm/slab.h:519 [inline]
 slab_alloc_node mm/slub.c:3206 [inline]
 slab_alloc mm/slub.c:3214 [inline]
 kmem_cache_alloc+0x1c3/0x300 mm/slub.c:3219
 getname_flags+0xba/0x650 fs/namei.c:138
 do_sys_openat2+0xd2/0x500 fs/open.c:1194
 do_sys_open fs/open.c:1216 [inline]
 __do_sys_open fs/open.c:1224 [inline]
 __se_sys_open fs/open.c:1220 [inline]
 __x64_sys_open+0x221/0x270 fs/open.c:1220
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Memory state around the buggy address:
 ffff88801b5d3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88801b5d4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801b5d4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff88801b5d4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801b5d4180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (962):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-smack-root 2021/09/18 04:28 upstream ddf21bd8ab98 70b76c1d .config log report syz C KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2021/08/29 08:50 upstream 3f5ad13cb012 be2c130d .config log report syz KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-smack-root 2020/08/11 20:30 upstream 00e4db51259a bacaf5fa .config log report syz
ci-upstream-kasan-gce-smack-root 2020/04/11 07:52 upstream ab6f762f0f53 a8c6a3f8 .config log report syz
ci-upstream-kasan-gce-selinux-root 2020/04/10 21:16 upstream c0cc271173b2 a8c6a3f8 .config log report syz
ci-upstream-kasan-gce-selinux-root 2019/12/20 09:36 upstream 7e0165b2f1a9 e30cbdae .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/03/17 03:09 linux-next 770fbb32d34e 749688d2 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/03/06 01:03 linux-next c99b17ac0399 c88c7b75 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2019/12/28 20:42 linux-next 7ddd09fc4b74 af6b8ef8 .config log report syz
ci-upstream-kasan-gce-selinux-root 2022/05/27 21:58 upstream 8291eaafed36 a46af346 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2022/05/27 10:17 upstream 7e284070abe5 116e7a7b .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/26 14:41 upstream babf0bb978e3 3037caa9 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/21 20:04 upstream 6c3f5bec9b40 7268fa62 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-smack-root 2022/05/20 15:10 upstream 3d7285a335ed cb1ac2e7 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/18 17:19 upstream ef1302160bfb 50c53f39 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/16 12:34 upstream 42226c989789 744a39e2 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2022/05/16 08:01 upstream 42226c989789 744a39e2 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-smack-root 2022/05/15 23:07 upstream bc403203d65a 744a39e2 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-smack-root 2022/05/14 19:29 upstream 2fe1020d73ca 744a39e2 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/14 02:51 upstream ec7f49619d8e 107f6434 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-smack-root 2022/05/13 21:02 upstream f3f19f939c11 107f6434 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/13 11:34 upstream f3f19f939c11 107f6434 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2022/05/10 20:32 upstream feb9c5e19e91 8b277b8e .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2022/05/09 05:33 upstream c5eb0a61238d e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/07 10:43 upstream 4b97bac0756a e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/07 04:03 upstream 4b97bac0756a e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2022/05/06 07:15 upstream fe27d189e3f4 e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2022/05/05 09:19 upstream a7391ad35724 02ba4ad6 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/05 04:13 upstream a7391ad35724 dc9e5259 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/04 22:24 upstream a7391ad35724 dc9e5259 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2022/05/02 11:36 upstream 672c0c517342 2df221f6 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-selinux-root 2022/05/02 09:31 upstream 672c0c517342 2df221f6 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-net-this-kasan-gce 2022/05/20 01:30 net d904c8cc0302 cb1ac2e7 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-net-kasan-gce 2022/04/10 03:48 net-next 626a5aaa5067 e22c3da3 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/27 20:39 linux-next d3fde8ff50ab a46af346 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/26 09:27 linux-next b1d84fc09a96 3037caa9 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/26 00:27 linux-next 8cb8311e95e3 3037caa9 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/25 12:43 linux-next 8cb8311e95e3 647c0e27 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/24 16:29 linux-next 09ce5091ff97 fcfad4ff .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/24 12:48 linux-next 09ce5091ff97 fcfad4ff .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/21 06:13 linux-next 18ecd30af1a8 7268fa62 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/20 17:09 linux-next 18ecd30af1a8 bd37ad7e .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/12 12:19 linux-next 187b9ac8c348 beb0b407 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/08 23:20 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/08 22:18 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/08 18:41 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/08 11:56 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/08 02:59 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/08 01:08 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/07 23:04 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/07 18:17 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/07 02:55 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/07 00:45 linux-next 38a288f5941e e60b1103 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/06 03:11 linux-next 632a8c88e339 efeff0a5 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/06 00:11 linux-next 632a8c88e339 efeff0a5 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/05 12:02 linux-next 632a8c88e339 06089fcd .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-linux-next-kasan-gce-root 2022/05/02 15:40 linux-next 9f9b9a2972eb 2df221f6 .config log report info KASAN: use-after-free Write in nr_release
ci-upstream-kasan-gce-root 2019/11/29 06:03 upstream 81b6b96475ac 76357d6f .config log report
ci-upstream-net-kasan-gce 2020/12/12 22:20 net-next 00f7763a26cb bca53db9 .config log report info