All of lore.kernel.org
 help / color / mirror / Atom feed
* KASAN: use-after-free Write in nr_release
@ 2019-11-29  8:16 syzbot
  2019-12-20  9:37 ` syzbot
  2021-09-18  4:29 ` [syzbot] " syzbot
  0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2019-11-29  8:16 UTC (permalink / raw)
  To: davem, linux-hams, linux-kernel, netdev, ralf, syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    81b6b964 Merge branch 'master' of git://git.kernel.org/pub..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1553197ae00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=6349516b24252b37
dashboard link: https://syzkaller.appspot.com/bug?extid=caa188bdfc1eeafeb418
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+caa188bdfc1eeafeb418@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in atomic_fetch_add  
include/asm-generic/atomic-instrumented.h:111 [inline]
BUG: KASAN: use-after-free in refcount_add include/linux/refcount.h:188  
[inline]
BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:228  
[inline]
BUG: KASAN: use-after-free in sock_hold include/net/sock.h:648 [inline]
BUG: KASAN: use-after-free in nr_release+0x65/0x4c0  
net/netrom/af_netrom.c:498
Write of size 4 at addr ffff88805abb0080 by task syz-executor.1/8686

CPU: 1 PID: 8686 Comm: syz-executor.1 Not tainted 5.4.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+0x197/0x210 lib/dump_stack.c:118
  print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374
  __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506
  kasan_report+0x12/0x20 mm/kasan/common.c:634
  check_memory_region_inline mm/kasan/generic.c:185 [inline]
  check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192
  __kasan_check_write+0x14/0x20 mm/kasan/common.c:98
  atomic_fetch_add include/asm-generic/atomic-instrumented.h:111 [inline]
  refcount_add include/linux/refcount.h:188 [inline]
  refcount_inc include/linux/refcount.h:228 [inline]
  sock_hold include/net/sock.h:648 [inline]
  nr_release+0x65/0x4c0 net/netrom/af_netrom.c:498
  __sock_release+0xce/0x280 net/socket.c:591
  sock_close+0x1e/0x30 net/socket.c:1269
  __fput+0x2ff/0x890 fs/file_table.c:280
  ____fput+0x16/0x20 fs/file_table.c:313
  task_work_run+0x145/0x1c0 kernel/task_work.c:113
  tracehook_notify_resume include/linux/tracehook.h:188 [inline]
  exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164
  prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline]
  syscall_return_slowpath arch/x86/entry/common.c:278 [inline]
  do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x414211
Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48  
83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48  
89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007ffdfe3cb280 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 000000000000000a RCX: 0000000000414211
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000009
RBP: 0000000000000001 R08: 000000008135072a R09: ffffffffffffffff
R10: 00007ffdfe3cb360 R11: 0000000000000293 R12: 000000000075c9a0
R13: 000000000075c9a0 R14: 0000000000761a30 R15: 000000000075bf2c

Allocated by task 8697:
  save_stack+0x23/0x90 mm/kasan/common.c:69
  set_track mm/kasan/common.c:77 [inline]
  __kasan_kmalloc mm/kasan/common.c:510 [inline]
  __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483
  kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524
  __do_kmalloc mm/slab.c:3655 [inline]
  __kmalloc+0x163/0x770 mm/slab.c:3664
  kmalloc include/linux/slab.h:561 [inline]
  sk_prot_alloc+0x23a/0x310 net/core/sock.c:1603
  sk_alloc+0x39/0xfd0 net/core/sock.c:1657
  nr_create+0xb9/0x5e0 net/netrom/af_netrom.c:411
  __sock_create+0x3ce/0x730 net/socket.c:1419
  sock_create net/socket.c:1470 [inline]
  __sys_socket+0x103/0x220 net/socket.c:1512
  __do_sys_socket net/socket.c:1521 [inline]
  __se_sys_socket net/socket.c:1519 [inline]
  __x64_sys_socket+0x73/0xb0 net/socket.c:1519
  do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
  entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8686:
  save_stack+0x23/0x90 mm/kasan/common.c:69
  set_track mm/kasan/common.c:77 [inline]
  kasan_set_free_info mm/kasan/common.c:332 [inline]
  __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471
  kasan_slab_free+0xe/0x10 mm/kasan/common.c:480
  __cache_free mm/slab.c:3425 [inline]
  kfree+0x10a/0x2c0 mm/slab.c:3756
  sk_prot_free net/core/sock.c:1640 [inline]
  __sk_destruct+0x4fc/0x6f0 net/core/sock.c:1724
  sk_destruct+0xd5/0x110 net/core/sock.c:1739
  __sk_free+0xfb/0x360 net/core/sock.c:1750
  sk_free+0x83/0xb0 net/core/sock.c:1761
  sock_put include/net/sock.h:1729 [inline]
  nr_release+0x3f4/0x4c0 net/netrom/af_netrom.c:532
  __sock_release+0xce/0x280 net/socket.c:591
  sock_close+0x1e/0x30 net/socket.c:1269
  __fput+0x2ff/0x890 fs/file_table.c:280
  ____fput+0x16/0x20 fs/file_table.c:313
  task_work_run+0x145/0x1c0 kernel/task_work.c:113
  tracehook_notify_resume include/linux/tracehook.h:188 [inline]
  exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164
  prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline]
  syscall_return_slowpath arch/x86/entry/common.c:278 [inline]
  do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304
  entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff88805abb0000
  which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 128 bytes inside of
  2048-byte region [ffff88805abb0000, ffff88805abb0800)
The buggy address belongs to the page:
page:ffffea00016aec00 refcount:1 mapcount:0 mapping:ffff8880aa400e00  
index:0x0
raw: 01fffc0000000200 ffffea00016eaa48 ffffea000276f1c8 ffff8880aa400e00
raw: 0000000000000000 ffff88805abb0000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
  ffff88805abaff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  ffff88805abb0000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff88805abb0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                    ^
  ffff88805abb0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff88805abb0180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: KASAN: use-after-free Write in nr_release
  2019-11-29  8:16 KASAN: use-after-free Write in nr_release syzbot
@ 2019-12-20  9:37 ` syzbot
  2021-09-18  4:29 ` [syzbot] " syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2019-12-20  9:37 UTC (permalink / raw)
  To: davem, hdanton, linux-hams, linux-kernel, netdev, ralf, syzkaller-bugs

syzbot has found a reproducer for the following crash on:

HEAD commit:    7e0165b2 Merge branch 'akpm' (patches from Andrew)
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13d65fa6e00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=1b59a3066828ac4c
dashboard link: https://syzkaller.appspot.com/bug?extid=caa188bdfc1eeafeb418
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12d9dd51e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+caa188bdfc1eeafeb418@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in atomic_fetch_add  
include/asm-generic/atomic-instrumented.h:111 [inline]
BUG: KASAN: use-after-free in refcount_add include/linux/refcount.h:188  
[inline]
BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:228  
[inline]
BUG: KASAN: use-after-free in sock_hold include/net/sock.h:648 [inline]
BUG: KASAN: use-after-free in nr_release+0x65/0x4c0  
net/netrom/af_netrom.c:498
Write of size 4 at addr ffff8880781a3080 by task syz-executor.0/12044

CPU: 1 PID: 12044 Comm: syz-executor.0 Not tainted 5.5.0-rc2-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+0x197/0x210 lib/dump_stack.c:118
  print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374
  __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506
  kasan_report+0x12/0x20 mm/kasan/common.c:639
  check_memory_region_inline mm/kasan/generic.c:185 [inline]
  check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192
  __kasan_check_write+0x14/0x20 mm/kasan/common.c:101
  atomic_fetch_add include/asm-generic/atomic-instrumented.h:111 [inline]
  refcount_add include/linux/refcount.h:188 [inline]
  refcount_inc include/linux/refcount.h:228 [inline]
  sock_hold include/net/sock.h:648 [inline]
  nr_release+0x65/0x4c0 net/netrom/af_netrom.c:498
  __sock_release+0xce/0x280 net/socket.c:592
  sock_close+0x1e/0x30 net/socket.c:1270
  __fput+0x2ff/0x890 fs/file_table.c:280
  ____fput+0x16/0x20 fs/file_table.c:313
  task_work_run+0x145/0x1c0 kernel/task_work.c:113
  tracehook_notify_resume include/linux/tracehook.h:188 [inline]
  exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164
  prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline]
  syscall_return_slowpath arch/x86/entry/common.c:278 [inline]
  do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4144b1
Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48  
83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48  
89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007ffc1b260070 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000006 RCX: 00000000004144b1
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000000001 R08: ffffffffffffffff R09: ffffffffffffffff
R10: 00007ffc1b260150 R11: 0000000000000293 R12: 000000000075c9a0
R13: 000000000075c9a0 R14: 0000000000761390 R15: 000000000075c124

Allocated by task 12049:
  save_stack+0x23/0x90 mm/kasan/common.c:72
  set_track mm/kasan/common.c:80 [inline]
  __kasan_kmalloc mm/kasan/common.c:513 [inline]
  __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486
  kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527
  __do_kmalloc mm/slab.c:3656 [inline]
  __kmalloc+0x163/0x770 mm/slab.c:3665
  kmalloc include/linux/slab.h:561 [inline]
  sk_prot_alloc+0x23a/0x310 net/core/sock.c:1603
  sk_alloc+0x39/0xfd0 net/core/sock.c:1657
  nr_create+0xb9/0x5e0 net/netrom/af_netrom.c:411
  __sock_create+0x3ce/0x730 net/socket.c:1420
  sock_create net/socket.c:1471 [inline]
  __sys_socket+0x103/0x220 net/socket.c:1513
  __do_sys_socket net/socket.c:1522 [inline]
  __se_sys_socket net/socket.c:1520 [inline]
  __x64_sys_socket+0x73/0xb0 net/socket.c:1520
  do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
  entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 12044:
  save_stack+0x23/0x90 mm/kasan/common.c:72
  set_track mm/kasan/common.c:80 [inline]
  kasan_set_free_info mm/kasan/common.c:335 [inline]
  __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474
  kasan_slab_free+0xe/0x10 mm/kasan/common.c:483
  __cache_free mm/slab.c:3426 [inline]
  kfree+0x10a/0x2c0 mm/slab.c:3757
  sk_prot_free net/core/sock.c:1640 [inline]
  __sk_destruct+0x5d8/0x7f0 net/core/sock.c:1724
  sk_destruct+0xd5/0x110 net/core/sock.c:1739
  __sk_free+0xfb/0x360 net/core/sock.c:1750
  sk_free+0x83/0xb0 net/core/sock.c:1761
  sock_put include/net/sock.h:1729 [inline]
  nr_release+0x3f4/0x4c0 net/netrom/af_netrom.c:532
  __sock_release+0xce/0x280 net/socket.c:592
  sock_close+0x1e/0x30 net/socket.c:1270
  __fput+0x2ff/0x890 fs/file_table.c:280
  ____fput+0x16/0x20 fs/file_table.c:313
  task_work_run+0x145/0x1c0 kernel/task_work.c:113
  tracehook_notify_resume include/linux/tracehook.h:188 [inline]
  exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164
  prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline]
  syscall_return_slowpath arch/x86/entry/common.c:278 [inline]
  do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304
  entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880781a3000
  which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 128 bytes inside of
  2048-byte region [ffff8880781a3000, ffff8880781a3800)
The buggy address belongs to the page:
page:ffffea0001e068c0 refcount:1 mapcount:0 mapping:ffff8880aa400e00  
index:0x0
raw: 00fffe0000000200 ffffea0001e06848 ffffea0001af0088 ffff8880aa400e00
raw: 0000000000000000 ffff8880781a3000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
  ffff8880781a2f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  ffff8880781a3000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8880781a3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                    ^
  ffff8880781a3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8880781a3180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [syzbot] KASAN: use-after-free Write in nr_release
  2019-11-29  8:16 KASAN: use-after-free Write in nr_release syzbot
  2019-12-20  9:37 ` syzbot
@ 2021-09-18  4:29 ` syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2021-09-18  4:29 UTC (permalink / raw)
  To: davem, hdanton, kuba, linux-hams, linux-kernel, netdev, ralf,
	syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    ddf21bd8ab98 Merge tag 'iov_iter.3-5.15-2021-09-17' of git..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b5b7e7300000
kernel config:  https://syzkaller.appspot.com/x/.config?x=ccfb8533b1cbe3b1
dashboard link: https://syzkaller.appspot.com/bug?extid=caa188bdfc1eeafeb418
compiler:       Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13cf5753300000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13a860f7300000

Bisection is inconclusive: the first bad commit could be any of:

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

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1476109ee00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+caa188bdfc1eeafeb418@syzkaller.appspotmail.com

==================================================================
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
==================================================================


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-18  4:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29  8:16 KASAN: use-after-free Write in nr_release syzbot
2019-12-20  9:37 ` syzbot
2021-09-18  4:29 ` [syzbot] " syzbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.