All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
@ 2024-04-19  9:39 syzbot
  2024-04-19 11:54 ` Hillf Danton
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: syzbot @ 2024-04-19  9:39 UTC (permalink / raw)
  To: davem, edumazet, kuba, linux-kernel, netdev, pabeni, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    7b4f2bc91c15 Add linux-next specific files for 20240418
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=14a54a53180000
kernel config:  https://syzkaller.appspot.com/x/.config?x=ae644165a243bf62
dashboard link: https://syzkaller.appspot.com/bug?extid=f3f3eef1d2100200e593
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=155e53af180000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=128b1d53180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/524a18e6c5be/disk-7b4f2bc9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/029f1b84d653/vmlinux-7b4f2bc9.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c02d1542e886/bzImage-7b4f2bc9.xz

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

==================================================================
BUG: KASAN: slab-use-after-free in unix_edge_successor net/unix/garbage.c:109 [inline]
BUG: KASAN: slab-use-after-free in unix_del_edge net/unix/garbage.c:165 [inline]
BUG: KASAN: slab-use-after-free in unix_del_edges+0x148/0x630 net/unix/garbage.c:237
Read of size 8 at addr ffff888079c6e640 by task kworker/u8:6/1099

CPU: 0 PID: 1099 Comm: kworker/u8:6 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: events_unbound __unix_gc
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:488
 kasan_report+0x143/0x180 mm/kasan/report.c:601
 unix_edge_successor net/unix/garbage.c:109 [inline]
 unix_del_edge net/unix/garbage.c:165 [inline]
 unix_del_edges+0x148/0x630 net/unix/garbage.c:237
 unix_destroy_fpl+0x59/0x210 net/unix/garbage.c:298
 unix_detach_fds net/unix/af_unix.c:1811 [inline]
 unix_destruct_scm+0x13e/0x210 net/unix/af_unix.c:1826
 skb_release_head_state+0x100/0x250 net/core/skbuff.c:1127
 skb_release_all net/core/skbuff.c:1138 [inline]
 __kfree_skb net/core/skbuff.c:1154 [inline]
 kfree_skb_reason+0x16d/0x3b0 net/core/skbuff.c:1190
 __skb_queue_purge_reason include/linux/skbuff.h:3251 [inline]
 __skb_queue_purge include/linux/skbuff.h:3256 [inline]
 __unix_gc+0x1732/0x1830 net/unix/garbage.c:575
 process_one_work kernel/workqueue.c:3218 [inline]
 process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Allocated by task 14427:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 unpoison_slab_object mm/kasan/common.c:312 [inline]
 __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slub.c:3897 [inline]
 slab_alloc_node mm/slub.c:3957 [inline]
 kmem_cache_alloc_noprof+0x135/0x290 mm/slub.c:3964
 sk_prot_alloc+0x58/0x210 net/core/sock.c:2074
 sk_alloc+0x38/0x370 net/core/sock.c:2133
 unix_create1+0xb4/0x770
 unix_create+0x14e/0x200 net/unix/af_unix.c:1034
 __sock_create+0x490/0x920 net/socket.c:1571
 sock_create net/socket.c:1622 [inline]
 __sys_socketpair+0x33e/0x720 net/socket.c:1773
 __do_sys_socketpair net/socket.c:1822 [inline]
 __se_sys_socketpair net/socket.c:1819 [inline]
 __x64_sys_socketpair+0x9b/0xb0 net/socket.c:1819
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 1805:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579
 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240
 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256
 kasan_slab_free include/linux/kasan.h:184 [inline]
 slab_free_hook mm/slub.c:2190 [inline]
 slab_free mm/slub.c:4393 [inline]
 kmem_cache_free+0x145/0x340 mm/slub.c:4468
 sk_prot_free net/core/sock.c:2114 [inline]
 __sk_destruct+0x467/0x5f0 net/core/sock.c:2208
 sock_put include/net/sock.h:1948 [inline]
 unix_release_sock+0xa8b/0xd20 net/unix/af_unix.c:665
 unix_release+0x91/0xc0 net/unix/af_unix.c:1049
 __sock_release net/socket.c:659 [inline]
 sock_close+0xbc/0x240 net/socket.c:1421
 __fput+0x406/0x8b0 fs/file_table.c:422
 delayed_fput+0x59/0x80 fs/file_table.c:445
 process_one_work kernel/workqueue.c:3218 [inline]
 process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

The buggy address belongs to the object at ffff888079c6e000
 which belongs to the cache UNIX of size 1920
The buggy address is located 1600 bytes inside of
 freed 1920-byte region [ffff888079c6e000, ffff888079c6e780)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888079c6c000 pfn:0x79c68
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff80000000240(workingset|head|node=0|zone=1|lastcpupid=0xfff)
page_type: 0xffffefff(slab)
raw: 00fff80000000240 ffff888017395a00 ffff8880173357c8 ffffea0001f97410
raw: ffff888079c6c000 0000000000100005 00000001ffffefff 0000000000000000
head: 00fff80000000240 ffff888017395a00 ffff8880173357c8 ffffea0001f97410
head: ffff888079c6c000 0000000000100005 00000001ffffefff 0000000000000000
head: 00fff80000000003 ffffea0001e71a01 ffffffffffffffff 0000000000000000
head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 7008, tgid -583571348 (syz-executor297), ts 7008, free_ts 67977031729
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1476
 prep_new_page mm/page_alloc.c:1484 [inline]
 get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3446
 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4704
 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline]
 alloc_pages_node_noprof include/linux/gfp.h:271 [inline]
 alloc_slab_page+0x5f/0x120 mm/slub.c:2259
 allocate_slab+0x5a/0x2e0 mm/slub.c:2422
 new_slab mm/slub.c:2475 [inline]
 ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624
 __slab_alloc+0x58/0xa0 mm/slub.c:3714
 __slab_alloc_node mm/slub.c:3767 [inline]
 slab_alloc_node mm/slub.c:3945 [inline]
 kmem_cache_alloc_noprof+0x1c1/0x290 mm/slub.c:3964
 sk_prot_alloc+0x58/0x210 net/core/sock.c:2074
 sk_alloc+0x38/0x370 net/core/sock.c:2133
 unix_create1+0xb4/0x770
 unix_create+0x14e/0x200 net/unix/af_unix.c:1034
 __sock_create+0x490/0x920 net/socket.c:1571
 sock_create net/socket.c:1622 [inline]
 __sys_socketpair+0x33e/0x720 net/socket.c:1773
 __do_sys_socketpair net/socket.c:1822 [inline]
 __se_sys_socketpair net/socket.c:1819 [inline]
 __x64_sys_socketpair+0x9b/0xb0 net/socket.c:1819
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
page last free pid 5089 tgid 5089 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1096 [inline]
 free_unref_page+0xd22/0xea0 mm/page_alloc.c:2609
 __slab_free+0x31b/0x3d0 mm/slub.c:4304
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slub.c:3897 [inline]
 slab_alloc_node mm/slub.c:3957 [inline]
 kmem_cache_alloc_noprof+0x135/0x290 mm/slub.c:3964
 vma_lock_alloc kernel/fork.c:441 [inline]
 vm_area_dup+0x61/0x290 kernel/fork.c:494
 dup_mmap kernel/fork.c:697 [inline]
 dup_mm kernel/fork.c:1688 [inline]
 copy_mm+0xcf5/0x1fb0 kernel/fork.c:1737
 copy_process+0x187a/0x3dc0 kernel/fork.c:2390
 kernel_clone+0x226/0x8f0 kernel/fork.c:2797
 __do_sys_clone kernel/fork.c:2940 [inline]
 __se_sys_clone kernel/fork.c:2924 [inline]
 __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2924
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff888079c6e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888079c6e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888079c6e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff888079c6e680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888079c6e700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

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

* Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
  2024-04-19  9:39 [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges syzbot
@ 2024-04-19 11:54 ` Hillf Danton
  2024-04-19 14:36   ` syzbot
  2024-04-19 19:17 ` Kuniyuki Iwashima
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Hillf Danton @ 2024-04-19 11:54 UTC (permalink / raw)
  To: syzbot; +Cc: linux-kernel, syzkaller-bugs

On Fri, 19 Apr 2024 02:39:21 -0700
> syzbot found the following issue on:
> 
> HEAD commit:    7b4f2bc91c15 Add linux-next specific files for 20240418
> git tree:       linux-next
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=128b1d53180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git  7b4f2bc91c15

--- x/net/unix/garbage.c
+++ y/net/unix/garbage.c
@@ -205,6 +205,7 @@ void unix_add_edges(struct scm_fp_list *
 		edge = fpl->edges + i++;
 		edge->predecessor = inflight;
 		edge->successor = receiver;
+		sock_hold((struct sock *)receiver);
 
 		unix_add_edge(fpl, edge);
 	} while (i < fpl->count_unix);
@@ -225,6 +226,7 @@ void unix_del_edges(struct scm_fp_list *
 {
 	struct unix_sock *receiver;
 	int i = 0;
+	int j;
 
 	spin_lock(&unix_gc_lock);
 
@@ -246,6 +248,12 @@ out:
 	spin_unlock(&unix_gc_lock);
 
 	fpl->inflight = false;
+
+	for (j = 0; j < i; j++) {
+		struct unix_edge *edge = fpl->edges + j;
+
+		sock_put((struct sock *)(edge->successor));
+	}
 }
 
 void unix_update_edges(struct unix_sock *receiver)
--

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

* Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
  2024-04-19 11:54 ` Hillf Danton
@ 2024-04-19 14:36   ` syzbot
  0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-04-19 14:36 UTC (permalink / raw)
  To: hdanton, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+f3f3eef1d2100200e593@syzkaller.appspotmail.com

Tested on:

commit:         7b4f2bc9 Add linux-next specific files for 20240418
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11e892bf180000
kernel config:  https://syzkaller.appspot.com/x/.config?x=ae644165a243bf62
dashboard link: https://syzkaller.appspot.com/bug?extid=f3f3eef1d2100200e593
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=15ad594f180000

Note: testing is done by a robot and is best-effort only.

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

* Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
  2024-04-19  9:39 [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges syzbot
  2024-04-19 11:54 ` Hillf Danton
@ 2024-04-19 19:17 ` Kuniyuki Iwashima
  2024-04-19 20:39 ` Kuniyuki Iwashima
  2024-04-21  4:06 ` syzbot
  3 siblings, 0 replies; 7+ messages in thread
From: Kuniyuki Iwashima @ 2024-04-19 19:17 UTC (permalink / raw)
  To: syzbot+f3f3eef1d2100200e593
  Cc: davem, edumazet, kuba, linux-kernel, netdev, pabeni,
	syzkaller-bugs, kuniyu

From: syzbot <syzbot+f3f3eef1d2100200e593@syzkaller.appspotmail.com>
Date: Fri, 19 Apr 2024 02:39:21 -0700
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    7b4f2bc91c15 Add linux-next specific files for 20240418
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=14a54a53180000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=ae644165a243bf62
> dashboard link: https://syzkaller.appspot.com/bug?extid=f3f3eef1d2100200e593
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=155e53af180000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=128b1d53180000
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/524a18e6c5be/disk-7b4f2bc9.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/029f1b84d653/vmlinux-7b4f2bc9.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/c02d1542e886/bzImage-7b4f2bc9.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+f3f3eef1d2100200e593@syzkaller.appspotmail.com
> 
> ==================================================================
> BUG: KASAN: slab-use-after-free in unix_edge_successor net/unix/garbage.c:109 [inline]
> BUG: KASAN: slab-use-after-free in unix_del_edge net/unix/garbage.c:165 [inline]
> BUG: KASAN: slab-use-after-free in unix_del_edges+0x148/0x630 net/unix/garbage.c:237
> Read of size 8 at addr ffff888079c6e640 by task kworker/u8:6/1099
> 
> CPU: 0 PID: 1099 Comm: kworker/u8:6 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
> Workqueue: events_unbound __unix_gc
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
>  print_address_description mm/kasan/report.c:377 [inline]
>  print_report+0x169/0x550 mm/kasan/report.c:488
>  kasan_report+0x143/0x180 mm/kasan/report.c:601
>  unix_edge_successor net/unix/garbage.c:109 [inline]

It seems successor is freed during the same GC iteration ?

Will cook a patch soon.

Thanks!


>  unix_del_edge net/unix/garbage.c:165 [inline]
>  unix_del_edges+0x148/0x630 net/unix/garbage.c:237
>  unix_destroy_fpl+0x59/0x210 net/unix/garbage.c:298
>  unix_detach_fds net/unix/af_unix.c:1811 [inline]
>  unix_destruct_scm+0x13e/0x210 net/unix/af_unix.c:1826
>  skb_release_head_state+0x100/0x250 net/core/skbuff.c:1127
>  skb_release_all net/core/skbuff.c:1138 [inline]
>  __kfree_skb net/core/skbuff.c:1154 [inline]
>  kfree_skb_reason+0x16d/0x3b0 net/core/skbuff.c:1190
>  __skb_queue_purge_reason include/linux/skbuff.h:3251 [inline]
>  __skb_queue_purge include/linux/skbuff.h:3256 [inline]
>  __unix_gc+0x1732/0x1830 net/unix/garbage.c:575
>  process_one_work kernel/workqueue.c:3218 [inline]
>  process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299
>  worker_thread+0x86d/0xd70 kernel/workqueue.c:3380
>  kthread+0x2f0/0x390 kernel/kthread.c:389
>  ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
>  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
>  </TASK>
> 
> Allocated by task 14427:
>  kasan_save_stack mm/kasan/common.c:47 [inline]
>  kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
>  unpoison_slab_object mm/kasan/common.c:312 [inline]
>  __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338
>  kasan_slab_alloc include/linux/kasan.h:201 [inline]
>  slab_post_alloc_hook mm/slub.c:3897 [inline]
>  slab_alloc_node mm/slub.c:3957 [inline]
>  kmem_cache_alloc_noprof+0x135/0x290 mm/slub.c:3964
>  sk_prot_alloc+0x58/0x210 net/core/sock.c:2074
>  sk_alloc+0x38/0x370 net/core/sock.c:2133
>  unix_create1+0xb4/0x770
>  unix_create+0x14e/0x200 net/unix/af_unix.c:1034
>  __sock_create+0x490/0x920 net/socket.c:1571
>  sock_create net/socket.c:1622 [inline]
>  __sys_socketpair+0x33e/0x720 net/socket.c:1773
>  __do_sys_socketpair net/socket.c:1822 [inline]
>  __se_sys_socketpair net/socket.c:1819 [inline]
>  __x64_sys_socketpair+0x9b/0xb0 net/socket.c:1819
>  do_syscall_x64 arch/x86/entry/common.c:52 [inline]
>  do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> 
> Freed by task 1805:
>  kasan_save_stack mm/kasan/common.c:47 [inline]
>  kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
>  kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579
>  poison_slab_object+0xe0/0x150 mm/kasan/common.c:240
>  __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256
>  kasan_slab_free include/linux/kasan.h:184 [inline]
>  slab_free_hook mm/slub.c:2190 [inline]
>  slab_free mm/slub.c:4393 [inline]
>  kmem_cache_free+0x145/0x340 mm/slub.c:4468
>  sk_prot_free net/core/sock.c:2114 [inline]
>  __sk_destruct+0x467/0x5f0 net/core/sock.c:2208
>  sock_put include/net/sock.h:1948 [inline]
>  unix_release_sock+0xa8b/0xd20 net/unix/af_unix.c:665
>  unix_release+0x91/0xc0 net/unix/af_unix.c:1049
>  __sock_release net/socket.c:659 [inline]
>  sock_close+0xbc/0x240 net/socket.c:1421
>  __fput+0x406/0x8b0 fs/file_table.c:422
>  delayed_fput+0x59/0x80 fs/file_table.c:445
>  process_one_work kernel/workqueue.c:3218 [inline]
>  process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299
>  worker_thread+0x86d/0xd70 kernel/workqueue.c:3380
>  kthread+0x2f0/0x390 kernel/kthread.c:389
>  ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
>  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

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

* Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
  2024-04-19  9:39 [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges syzbot
  2024-04-19 11:54 ` Hillf Danton
  2024-04-19 19:17 ` Kuniyuki Iwashima
@ 2024-04-19 20:39 ` Kuniyuki Iwashima
  2024-04-19 21:13   ` syzbot
  2024-04-21  4:06 ` syzbot
  3 siblings, 1 reply; 7+ messages in thread
From: Kuniyuki Iwashima @ 2024-04-19 20:39 UTC (permalink / raw)
  To: syzbot+f3f3eef1d2100200e593
  Cc: davem, edumazet, kuba, linux-kernel, netdev, pabeni,
	syzkaller-bugs, kuniyu

From: syzbot <syzbot+f3f3eef1d2100200e593@syzkaller.appspotmail.com>
Date: Fri, 19 Apr 2024 02:39:21 -0700
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    7b4f2bc91c15 Add linux-next specific files for 20240418
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=14a54a53180000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=ae644165a243bf62
> dashboard link: https://syzkaller.appspot.com/bug?extid=f3f3eef1d2100200e593
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=155e53af180000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=128b1d53180000
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/524a18e6c5be/disk-7b4f2bc9.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/029f1b84d653/vmlinux-7b4f2bc9.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/c02d1542e886/bzImage-7b4f2bc9.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+f3f3eef1d2100200e593@syzkaller.appspotmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main

diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index 95240a59808f..039c1c8c73f4 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -158,11 +158,14 @@ static void unix_add_edge(struct scm_fp_list *fpl, struct unix_edge *edge)
 	unix_update_graph(unix_edge_successor(edge));
 }
 
+static bool gc_in_progress;
+
 static void unix_del_edge(struct scm_fp_list *fpl, struct unix_edge *edge)
 {
 	struct unix_vertex *vertex = edge->predecessor->vertex;
 
-	unix_update_graph(unix_edge_successor(edge));
+	if (!gc_in_progress)
+		unix_update_graph(unix_edge_successor(edge));
 
 	list_del(&edge->vertex_entry);
 	vertex->out_degree--;
@@ -237,8 +240,10 @@ void unix_del_edges(struct scm_fp_list *fpl)
 		unix_del_edge(fpl, edge);
 	} while (i < fpl->count_unix);
 
-	receiver = fpl->edges[0].successor;
-	receiver->scm_stat.nr_unix_fds -= fpl->count_unix;
+	if (!gc_in_progress) {
+		receiver = fpl->edges[0].successor;
+		receiver->scm_stat.nr_unix_fds -= fpl->count_unix;
+	}
 	WRITE_ONCE(unix_tot_inflight, unix_tot_inflight - fpl->count_unix);
 out:
 	WRITE_ONCE(fpl->user->unix_inflight, fpl->user->unix_inflight - fpl->count);
@@ -550,8 +555,6 @@ static void unix_walk_scc_fast(struct sk_buff_head *hitlist)
 	list_replace_init(&unix_visited_vertices, &unix_unvisited_vertices);
 }
 
-static bool gc_in_progress;
-
 static void __unix_gc(struct work_struct *work)
 {
 	struct sk_buff_head hitlist;

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

* Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
  2024-04-19 20:39 ` Kuniyuki Iwashima
@ 2024-04-19 21:13   ` syzbot
  0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-04-19 21:13 UTC (permalink / raw)
  To: davem, edumazet, kuba, kuniyu, linux-kernel, netdev, pabeni,
	syzkaller-bugs

Hello,

syzbot tried to test the proposed patch but the build/boot failed:

registered new interface driver rtsx_usb
[    7.654500][    T1] usbcore: registered new interface driver viperboard
[    7.656820][    T1] usbcore: registered new interface driver dln2
[    7.658229][    T1] usbcore: registered new interface driver pn533_usb
[    7.665094][    T1] nfcsim 0.2 initialized
[    7.666287][    T1] usbcore: registered new interface driver port100
[    7.667860][    T1] usbcore: registered new interface driver nfcmrvl
[    7.677894][    T1] Loading iSCSI transport class v2.0-870.
[    7.691826][    T1] virtio_scsi virtio0: 1/0/0 default/read/poll queues
[    7.700510][    T1] ------------[ cut here ]------------
[    7.701647][    T1] refcount_t: decrement hit 0; leaking memory.
[    7.702712][    T1] WARNING: CPU: 1 PID: 1 at lib/refcount.c:31 refcount_warn_saturate+0xfa/0x1d0
[    7.705030][    T1] Modules linked in:
[    7.705931][    T1] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc4-syzkaller-00895-g4cad4efa6eb2-dirty #0
[    7.707420][    T1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
[    7.708867][    T1] RIP: 0010:refcount_warn_saturate+0xfa/0x1d0
[    7.709787][    T1] Code: b2 00 00 00 e8 97 ee e6 fc 5b 5d c3 cc cc cc cc e8 8b ee e6 fc c6 05 92 84 e4 0a 01 90 48 c7 c7 80 33 1f 8c e8 f7 6a a9 fc 90 <0f> 0b 90 90 eb d9 e8 6b ee e6 fc c6 05 6f 84 e4 0a 01 90 48 c7 c7
[    7.712924][    T1] RSP: 0000:ffffc90000066e18 EFLAGS: 00010246
[    7.714098][    T1] RAX: 802fad55264ab500 RBX: ffff888146ad6b3c RCX: ffff8880166d0000
[    7.715583][    T1] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[    7.717186][    T1] RBP: 0000000000000004 R08: ffffffff81588082 R09: fffffbfff1c39b48
[    7.718689][    T1] R10: dffffc0000000000 R11: fffffbfff1c39b48 R12: ffffea0000850dc0
[    7.720446][    T1] R13: ffffea0000850dc8 R14: 1ffffd400010a1b9 R15: 0000000000000000
[    7.721919][    T1] FS:  0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
[    7.723283][    T1] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    7.724203][    T1] CR2: 0000000000000000 CR3: 000000000e134000 CR4: 00000000003506f0
[    7.725329][    T1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    7.726405][    T1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    7.727490][    T1] Call Trace:
[    7.727952][    T1]  <TASK>
[    7.728408][    T1]  ? __warn+0x163/0x4e0
[    7.729132][    T1]  ? refcount_warn_saturate+0xfa/0x1d0
[    7.729918][    T1]  ? report_bug+0x2b3/0x500
[    7.730722][    T1]  ? refcount_warn_saturate+0xfa/0x1d0
[    7.731598][    T1]  ? handle_bug+0x3e/0x70
[    7.732470][    T1]  ? exc_invalid_op+0x1a/0x50
[    7.733180][    T1]  ? asm_exc_invalid_op+0x1a/0x20
[    7.734321][    T1]  ? __warn_printk+0x292/0x360
[    7.735110][    T1]  ? refcount_warn_saturate+0xfa/0x1d0
[    7.736046][    T1]  ? refcount_warn_saturate+0xf9/0x1d0
[    7.737157][    T1]  __free_pages_ok+0xc60/0xd90
[    7.737974][    T1]  make_alloc_exact+0xa3/0xf0
[    7.739152][    T1]  vring_alloc_queue_split+0x20a/0x600
[    7.739921][    T1]  ? __pfx_vring_alloc_queue_split+0x10/0x10
[    7.740857][    T1]  ? vp_find_vqs+0x4c/0x4e0
[    7.742030][    T1]  ? virtscsi_probe+0x3ea/0xf60
[    7.743130][    T1]  ? virtio_dev_probe+0x991/0xaf0
[    7.744156][    T1]  ? really_probe+0x2b8/0xad0
[    7.745411][    T1]  ? driver_probe_device+0x50/0x430
[    7.746481][    T1]  vring_create_virtqueue_split+0xc6/0x310
[    7.747395][    T1]  ? ret_from_fork+0x4b/0x80
[    7.748185][    T1]  ? __pfx_vring_create_virtqueue_split+0x10/0x10
[    7.749718][    T1]  vring_create_virtqueue+0xca/0x110
[    7.750680][    T1]  ? __pfx_vp_notify+0x10/0x10
[    7.751352][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.752127][    T1]  setup_vq+0xe9/0x2d0
[    7.752740][    T1]  ? __pfx_vp_notify+0x10/0x10
[    7.753739][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.754582][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.755808][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.756624][    T1]  vp_setup_vq+0xbf/0x330
[    7.757294][    T1]  ? __pfx_vp_config_changed+0x10/0x10
[    7.758740][    T1]  ? ioread16+0x2f/0x90
[    7.759423][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.760184][    T1]  vp_find_vqs_msix+0x8b2/0xc80
[    7.761570][    T1]  vp_find_vqs+0x4c/0x4e0
[    7.762347][    T1]  virtscsi_init+0x8db/0xd00
[    7.763210][    T1]  ? __pfx_virtscsi_init+0x10/0x10
[    7.764163][    T1]  ? __pfx_default_calc_sets+0x10/0x10
[    7.765029][    T1]  ? scsi_host_alloc+0xa57/0xea0
[    7.765845][    T1]  ? vp_get+0xfd/0x140
[    7.766595][    T1]  virtscsi_probe+0x3ea/0xf60
[    7.767420][    T1]  ? __pfx_virtscsi_probe+0x10/0x10
[    7.768268][    T1]  ? kernfs_add_one+0x156/0x8b0
[    7.769025][    T1]  ? virtio_no_restricted_mem_acc+0x9/0x10
[    7.769838][    T1]  ? virtio_features_ok+0x10c/0x270
[    7.770612][    T1]  virtio_dev_probe+0x991/0xaf0
[    7.771348][    T1]  ? __pfx_virtio_dev_probe+0x10/0x10
[    7.772249][    T1]  really_probe+0x2b8/0xad0
[    7.773081][    T1]  __driver_probe_device+0x1a2/0x390
[    7.774142][    T1]  driver_probe_device+0x50/0x430
[    7.775055][    T1]  __driver_attach+0x45f/0x710
[    7.775738][    T1]  ? __pfx___driver_attach+0x10/0x10
[    7.777068][    T1]  bus_for_each_dev+0x239/0x2b0
[    7.778013][    T1]  ? __pfx___driver_attach+0x10/0x10
[    7.778935][    T1]  ? __pfx_bus_for_each_dev+0x10/0x10
[    7.779835][    T1]  ? do_raw_spin_unlock+0x13c/0x8b0
[    7.780678][    T1]  bus_add_driver+0x347/0x620
[    7.781572][    T1]  driver_register+0x23a/0x320
[    7.782416][    T1]  virtio_scsi_init+0x69/0xe0
[    7.783114][    T1]  ? __pfx_virtio_scsi_init+0x10/0x10
[    7.783862][    T1]  do_one_initcall+0x248/0x880
[    7.784838][    T1]  ? __pfx_virtio_scsi_init+0x10/0x10
[    7.785602][    T1]  ? __pfx_lockdep_hardirqs_on_prepare+0x10/0x10
[    7.786590][    T1]  ? __pfx_do_one_initcall+0x10/0x10
[    7.787715][    T1]  ? __pfx_parse_args+0x10/0x10
[    7.788740][    T1]  ? do_initcalls+0x1c/0x80
[    7.789436][    T1]  ? rcu_is_watching+0x15/0xb0
[    7.790134][    T1]  do_initcall_level+0x157/0x210
[    7.791134][    T1]  do_initcalls+0x3f/0x80
[    7.791963][    T1]  kernel_init_freeable+0x435/0x5d0
[    7.792838][    T1]  ? __pfx_kernel_init_freeable+0x10/0x10
[    7.793797][    T1]  ? __pfx_lockdep_hardirqs_on_prepare+0x10/0x10
[    7.794852][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.795572][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.796447][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.797205][    T1]  kernel_init+0x1d/0x2b0
[    7.797981][    T1]  ret_from_fork+0x4b/0x80
[    7.798980][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.799980][    T1]  ret_from_fork_asm+0x1a/0x30
[    7.801171][    T1]  </TASK>
[    7.801810][    T1] Kernel panic - not syncing: kernel: panic_on_warn set ...
[    7.802882][    T1] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc4-syzkaller-00895-g4cad4efa6eb2-dirty #0
[    7.804509][    T1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
[    7.804834][    T1] Call Trace:
[    7.804834][    T1]  <TASK>
[    7.804834][    T1]  dump_stack_lvl+0x241/0x360
[    7.804834][    T1]  ? __pfx_dump_stack_lvl+0x10/0x10
[    7.804834][    T1]  ? __pfx__printk+0x10/0x10
[    7.804834][    T1]  ? _printk+0xd5/0x120
[    7.804834][    T1]  ? vscnprintf+0x5d/0x90
[    7.804834][    T1]  panic+0x349/0x860
[    7.804834][    T1]  ? __warn+0x172/0x4e0
[    7.804834][    T1]  ? __pfx_panic+0x10/0x10
[    7.804834][    T1]  ? show_trace_log_lvl+0x4e6/0x520
[    7.814431][    T1]  ? ret_from_fork_asm+0x1a/0x30
[    7.814431][    T1]  __warn+0x346/0x4e0
[    7.814431][    T1]  ? refcount_warn_saturate+0xfa/0x1d0
[    7.814431][    T1]  report_bug+0x2b3/0x500
[    7.814431][    T1]  ? refcount_warn_saturate+0xfa/0x1d0
[    7.814431][    T1]  handle_bug+0x3e/0x70
[    7.814431][    T1]  exc_invalid_op+0x1a/0x50
[    7.814431][    T1]  asm_exc_invalid_op+0x1a/0x20
[    7.814431][    T1] RIP: 0010:refcount_warn_saturate+0xfa/0x1d0
[    7.814431][    T1] Code: b2 00 00 00 e8 97 ee e6 fc 5b 5d c3 cc cc cc cc e8 8b ee e6 fc c6 05 92 84 e4 0a 01 90 48 c7 c7 80 33 1f 8c e8 f7 6a a9 fc 90 <0f> 0b 90 90 eb d9 e8 6b ee e6 fc c6 05 6f 84 e4 0a 01 90 48 c7 c7
[    7.814431][    T1] RSP: 0000:ffffc90000066e18 EFLAGS: 00010246
[    7.824572][    T1] RAX: 802fad55264ab500 RBX: ffff888146ad6b3c RCX: ffff8880166d0000
[    7.824572][    T1] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[    7.824572][    T1] RBP: 0000000000000004 R08: ffffffff81588082 R09: fffffbfff1c39b48
[    7.824572][    T1] R10: dffffc0000000000 R11: fffffbfff1c39b48 R12: ffffea0000850dc0
[    7.824572][    T1] R13: ffffea0000850dc8 R14: 1ffffd400010a1b9 R15: 0000000000000000
[    7.824572][    T1]  ? __warn_printk+0x292/0x360
[    7.824572][    T1]  ? refcount_warn_saturate+0xf9/0x1d0
[    7.824572][    T1]  __free_pages_ok+0xc60/0xd90
[    7.824572][    T1]  make_alloc_exact+0xa3/0xf0
[    7.824572][    T1]  vring_alloc_queue_split+0x20a/0x600
[    7.824572][    T1]  ? __pfx_vring_alloc_queue_split+0x10/0x10
[    7.834413][    T1]  ? vp_find_vqs+0x4c/0x4e0
[    7.834413][    T1]  ? virtscsi_probe+0x3ea/0xf60
[    7.834413][    T1]  ? virtio_dev_probe+0x991/0xaf0
[    7.834413][    T1]  ? really_probe+0x2b8/0xad0
[    7.834413][    T1]  ? driver_probe_device+0x50/0x430
[    7.834413][    T1]  vring_create_virtqueue_split+0xc6/0x310
[    7.834413][    T1]  ? ret_from_fork+0x4b/0x80
[    7.834413][    T1]  ? __pfx_vring_create_virtqueue_split+0x10/0x10
[    7.834413][    T1]  vring_create_virtqueue+0xca/0x110
[    7.834413][    T1]  ? __pfx_vp_notify+0x10/0x10
[    7.834413][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.834413][    T1]  setup_vq+0xe9/0x2d0
[    7.834413][    T1]  ? __pfx_vp_notify+0x10/0x10
[    7.844326][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.844326][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.844326][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.844326][    T1]  vp_setup_vq+0xbf/0x330
[    7.844326][    T1]  ? __pfx_vp_config_changed+0x10/0x10
[    7.844326][    T1]  ? ioread16+0x2f/0x90
[    7.844326][    T1]  ? __pfx_virtscsi_ctrl_done+0x10/0x10
[    7.844326][    T1]  vp_find_vqs_msix+0x8b2/0xc80
[    7.844326][    T1]  vp_find_vqs+0x4c/0x4e0
[    7.844326][    T1]  virtscsi_init+0x8db/0xd00
[    7.844326][    T1]  ? __pfx_virtscsi_init+0x10/0x10
[    7.844326][    T1]  ? __pfx_default_calc_sets+0x10/0x10
[    7.844326][    T1]  ? scsi_host_alloc+0xa57/0xea0
[    7.844326][    T1]  ? vp_get+0xfd/0x140
[    7.854405][    T1]  virtscsi_probe+0x3ea/0xf60
[    7.854405][    T1]  ? __pfx_virtscsi_probe+0x10/0x10
[    7.854405][    T1]  ? kernfs_add_one+0x156/0x8b0
[    7.854405][    T1]  ? virtio_no_restricted_mem_acc+0x9/0x10
[    7.854405][    T1]  ? virtio_features_ok+0x10c/0x270
[    7.854405][    T1]  virtio_dev_probe+0x991/0xaf0
[    7.854405][    T1]  ? __pfx_virtio_dev_probe+0x10/0x10
[    7.854405][    T1]  really_probe+0x2b8/0xad0
[    7.854405][    T1]  __driver_probe_device+0x1a2/0x390
[    7.854405][    T1]  driver_probe_device+0x50/0x430
[    7.854405][    T1]  __driver_attach+0x45f/0x710
[    7.854405][    T1]  ? __pfx___driver_attach+0x10/0x10
[    7.854405][    T1]  bus_for_each_dev+0x239/0x2b0
[    7.864323][    T1]  ? __pfx___driver_attach+0x10/0x10
[    7.864323][    T1]  ? __pfx_bus_for_each_dev+0x10/0x10
[    7.864323][    T1]  ? do_raw_spin_unlock+0x13c/0x8b0
[    7.864323][    T1]  bus_add_driver+0x347/0x620
[    7.864323][    T1]  driver_register+0x23a/0x320
[    7.864323][    T1]  virtio_scsi_init+0x69/0xe0
[    7.864323][    T1]  ? __pfx_virtio_scsi_init+0x10/0x10
[    7.864323][    T1]  do_one_initcall+0x248/0x880
[    7.864323][    T1]  ? __pfx_virtio_scsi_init+0x10/0x10
[    7.864323][    T1]  ? __pfx_lockdep_hardirqs_on_prepare+0x10/0x10
[    7.864323][    T1]  ? __pfx_do_one_initcall+0x10/0x10
[    7.864323][    T1]  ? __pfx_parse_args+0x10/0x10
[    7.864323][    T1]  ? do_initcalls+0x1c/0x80
[    7.864323][    T1]  ? rcu_is_watching+0x15/0xb0
[    7.874391][    T1]  do_initcall_level+0x157/0x210
[    7.874391][    T1]  do_initcalls+0x3f/0x80
[    7.874391][    T1]  kernel_init_freeable+0x435/0x5d0
[    7.874391][    T1]  ? __pfx_kernel_init_freeable+0x10/0x10
[    7.874391][    T1]  ? __pfx_lockdep_hardirqs_on_prepare+0x10/0x10
[    7.874391][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.874391][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.874391][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.874391][    T1]  kernel_init+0x1d/0x2b0
[    7.874391][    T1]  ret_from_fork+0x4b/0x80
[    7.874391][    T1]  ? __pfx_kernel_init+0x10/0x10
[    7.874391][    T1]  ret_from_fork_asm+0x1a/0x30
[    7.874391][    T1]  </TASK>
[    7.884330][    T1] Kernel Offset: disabled
[    7.884330][    T1] Rebooting in 86400 seconds..


syzkaller build log:
go env (err=<nil>)
GO111MODULE='auto'
GOARCH='amd64'
GOBIN=''
GOCACHE='/syzkaller/.cache/go-build'
GOENV='/syzkaller/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/syzkaller/jobs/linux/gopath/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/syzkaller/jobs/linux/gopath'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/syzkaller/jobs/linux/gopath/src/github.com/google/syzkaller/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3954342966=/tmp/go-build -gno-record-gcc-switches'

git status (err=<nil>)
HEAD detached at af24b0505
nothing to commit, working tree clean


tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
make .descriptions
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
bin/syz-sysgen
touch .descriptions
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=af24b0505c748561efb50f1d03c824d6642f6c0b -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240418-062732'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-fuzzer github.com/google/syzkaller/syz-fuzzer
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=af24b0505c748561efb50f1d03c824d6642f6c0b -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240418-062732'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-execprog github.com/google/syzkaller/tools/syz-execprog
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=af24b0505c748561efb50f1d03c824d6642f6c0b -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240418-062732'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-stress github.com/google/syzkaller/tools/syz-stress
mkdir -p ./bin/linux_amd64
gcc -o ./bin/linux_amd64/syz-executor executor/executor.cc \
	-m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w -DGOOS_linux=1 -DGOARCH_amd64=1 \
	-DHOSTGOOS_linux=1 -DGIT_REVISION=\"af24b0505c748561efb50f1d03c824d6642f6c0b\"


Error text is too large and was truncated, full error text is at:
https://syzkaller.appspot.com/x/error.txt?x=11617880980000


Tested on:

commit:         4cad4efa Merge branch 'net-neigh-rcu'
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main
kernel config:  https://syzkaller.appspot.com/x/.config?x=ecd971c4c871c35d
dashboard link: https://syzkaller.appspot.com/bug?extid=f3f3eef1d2100200e593
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=15ef206f180000


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

* Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
  2024-04-19  9:39 [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges syzbot
                   ` (2 preceding siblings ...)
  2024-04-19 20:39 ` Kuniyuki Iwashima
@ 2024-04-21  4:06 ` syzbot
  3 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-04-21  4:06 UTC (permalink / raw)
  To: axboe, davem, edumazet, hdanton, kuba, kuni1840, kuniyu,
	linux-kernel, netdev, pabeni, syzkaller-bugs

syzbot has bisected this issue to:

commit 77e5593aebba823bcbcf2c4b58b07efcd63933b8
Author: Kuniyuki Iwashima <kuniyu@amazon.com>
Date:   Mon Mar 25 20:24:20 2024 +0000

    af_unix: Skip GC if no cycle exists.

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=14bbda4f180000
start commit:   7b4f2bc91c15 Add linux-next specific files for 20240418
git tree:       linux-next
final oops:     https://syzkaller.appspot.com/x/report.txt?x=16bbda4f180000
console output: https://syzkaller.appspot.com/x/log.txt?x=12bbda4f180000
kernel config:  https://syzkaller.appspot.com/x/.config?x=ae644165a243bf62
dashboard link: https://syzkaller.appspot.com/bug?extid=f3f3eef1d2100200e593
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=155e53af180000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=128b1d53180000

Reported-by: syzbot+f3f3eef1d2100200e593@syzkaller.appspotmail.com
Fixes: 77e5593aebba ("af_unix: Skip GC if no cycle exists.")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

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

end of thread, other threads:[~2024-04-21  4:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19  9:39 [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges syzbot
2024-04-19 11:54 ` Hillf Danton
2024-04-19 14:36   ` syzbot
2024-04-19 19:17 ` Kuniyuki Iwashima
2024-04-19 20:39 ` Kuniyuki Iwashima
2024-04-19 21:13   ` syzbot
2024-04-21  4:06 ` 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.