syzbot


KASAN: slab-use-after-free Read in tipc_aead_decrypt_done

Status: premoderation: reported on 2025/06/29 08:09
Reported-by: syzbot+51e57b64c85c74b14d5f@syzkaller.appspotmail.com
First crash: 64d, last: 64d

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in tipc_aead_decrypt_done+0x110/0x2a0 net/tipc/crypto.c:963
Read of size 8 at addr ffff888102bde8b8 by task kworker/1:4/515

CPU: 1 UID: 0 PID: 515 Comm: kworker/1:4 Not tainted 6.12.30-syzkaller-g68f4f0b0690a #0 d2d57a621586a6800997b547ec5ef233d70fc6ad
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: cryptd cryptd_queue_worker
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:94
 dump_stack_lvl+0x10c/0x190 lib/dump_stack.c:120
 print_address_description+0x71/0x220 mm/kasan/report.c:377
 print_report+0x4a/0x70 mm/kasan/report.c:488
 kasan_report+0x163/0x1a0 mm/kasan/report.c:601
 __asan_report_load8_noabort+0x18/0x20 mm/kasan/report_generic.c:381
 tipc_aead_decrypt_done+0x110/0x2a0 net/tipc/crypto.c:963
 crypto_request_complete include/crypto/algapi.h:266 [inline]
 aead_request_complete include/crypto/internal/aead.h:85 [inline]
 cryptd_aead_crypt+0x37e/0x580 crypto/cryptd.c:772
 cryptd_aead_decrypt+0xaf/0xc0 crypto/cryptd.c:804
 crypto_request_complete include/crypto/algapi.h:266 [inline]
 cryptd_queue_worker+0xd8/0x1b0 crypto/cryptd.c:180
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x7d2/0x1020 kernel/workqueue.c:3319
 worker_thread+0xc58/0x1250 kernel/workqueue.c:3400
 kthread+0x2ca/0x370 kernel/kthread.c:389
 ret_from_fork+0x64/0xa0 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Allocated by task 290:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0x96/0xb0 mm/kasan/common.c:394
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __kmalloc_cache_noprof+0x1a5/0x3c0 mm/slub.c:4378
 kmalloc_noprof include/linux/slab.h:881 [inline]
 kzalloc_noprof include/linux/slab.h:1017 [inline]
 tipc_crypto_start+0xad/0x800 net/tipc/crypto.c:1466
 tipc_init_net+0x225/0x360 net/tipc/core.c:72
 ops_init+0x1b2/0x5d0 net/core/net_namespace.c:139
 setup_net+0x20e/0x990 net/core/net_namespace.c:356
 copy_net_ns+0x513/0xa30 net/core/net_namespace.c:510
 create_new_namespaces+0x3b5/0x720 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x126/0x180 kernel/nsproxy.c:228
 ksys_unshare+0x4fe/0x880 kernel/fork.c:3351
 __do_sys_unshare kernel/fork.c:3422 [inline]
 __se_sys_unshare kernel/fork.c:3420 [inline]
 __x64_sys_unshare+0x3c/0x50 kernel/fork.c:3420
 x64_sys_call+0x2998/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:273
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x58/0xf0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x76/0x7e

Freed by task 12:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 kasan_save_free_info+0x4a/0x60 mm/kasan/generic.c:579
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2413 [inline]
 slab_free mm/slub.c:4662 [inline]
 kfree+0x156/0x400 mm/slub.c:4813
 kfree_sensitive+0x61/0x70 mm/slab_common.c:1311
 tipc_crypto_stop+0x39e/0x430 net/tipc/crypto.c:1539
 tipc_exit_net+0xf4/0x150 net/tipc/core.c:119
 ops_exit_list net/core/net_namespace.c:173 [inline]
 cleanup_net+0x6a7/0xc70 net/core/net_namespace.c:642
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x7d2/0x1020 kernel/workqueue.c:3319
 worker_thread+0xc58/0x1250 kernel/workqueue.c:3400
 kthread+0x2ca/0x370 kernel/kthread.c:389
 ret_from_fork+0x64/0xa0 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

The buggy address belongs to the object at ffff888102bde800
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 184 bytes inside of
 freed 512-byte region [ffff888102bde800, ffff888102bdea00)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102bdc
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x4000000000000040(head|zone=1)
page_type: f5(slab)
raw: 4000000000000040 ffff888100041c80 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000
head: 4000000000000040 ffff888100041c80 dead000000000122 0000000000000000
head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000
head: 4000000000000002 ffffea00040af701 ffffffffffffffff 0000000000000000
head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 291, tgid 291 (syz-executor), ts 21376085205, free_ts 21366701940
 set_page_owner include/linux/page_owner.h:35 [inline]
 post_alloc_hook+0x3b9/0x3f0 mm/page_alloc.c:1795
 prep_new_page+0x1c/0x120 mm/page_alloc.c:1803
 get_page_from_freelist+0x46bb/0x4750 mm/page_alloc.c:3854
 __alloc_pages_noprof+0x30d/0x6c0 mm/page_alloc.c:5186
 alloc_slab_page+0x6b/0x1f0 mm/slub.c:-1
 allocate_slab+0x69/0x440 mm/slub.c:2655
 new_slab mm/slub.c:2709 [inline]
 ___slab_alloc+0x59a/0x8b0 mm/slub.c:3897
 __slab_alloc mm/slub.c:3987 [inline]
 __slab_alloc_node mm/slub.c:4040 [inline]
 slab_alloc_node mm/slub.c:4201 [inline]
 __do_kmalloc_node mm/slub.c:4346 [inline]
 __kmalloc_node_noprof+0x23e/0x450 mm/slub.c:4353
 __kvmalloc_node_noprof+0x11d/0x300 mm/util.c:671
 netif_alloc_netdev_queues net/core/dev.c:10370 [inline]
 alloc_netdev_mqs+0x880/0x13e0 net/core/dev.c:11242
 __ip_tunnel_create+0x2e0/0x4d0 net/ipv4/ip_tunnel.c:254
 ip_tunnel_init_net+0x302/0x860 net/ipv4/ip_tunnel.c:1160
 ipgre_init_net+0x28/0x30 net/ipv4/ip_gre.c:1059
 ops_init+0x1b2/0x5d0 net/core/net_namespace.c:139
 setup_net+0x20e/0x990 net/core/net_namespace.c:356
 copy_net_ns+0x513/0xa30 net/core/net_namespace.c:510
page last free pid 290 tgid 290 stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1321 [inline]
 free_unref_page+0xae5/0xdd0 mm/page_alloc.c:2810
 __free_pages+0x6b/0x3b0 mm/page_alloc.c:5273
 __free_slab+0xb6/0x110 mm/slub.c:2726
 free_slab+0x18/0xf0 mm/slub.c:2749
 discard_slab mm/slub.c:2755 [inline]
 __put_partials+0x11b/0x150 mm/slub.c:3224
 put_cpu_partial+0x91/0xc0 mm/slub.c:3299
 __slab_free+0x1d3/0x2b0 mm/slub.c:4532
 do_slab_free mm/slub.c:4614 [inline]
 ___cache_free+0xc9/0xe0 mm/slub.c:4723
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0xb5/0x130 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x14f/0x180 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x28/0x90 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4164 [inline]
 slab_alloc_node mm/slub.c:4213 [inline]
 __kmalloc_cache_noprof+0x13e/0x3c0 mm/slub.c:4373
 kmalloc_noprof include/linux/slab.h:881 [inline]
 kzalloc_noprof include/linux/slab.h:1017 [inline]
 ref_tracker_alloc+0x153/0x540 lib/ref_tracker.c:203
 __netdev_tracker_alloc include/linux/netdevice.h:4109 [inline]
 netdev_hold+0x80/0xd0 include/linux/netdevice.h:4138
 register_netdevice+0x1184/0x19d0 net/core/dev.c:10593
 register_netdev+0x42/0x60 net/core/dev.c:10710

Memory state around the buggy address:
 ffff888102bde780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888102bde800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888102bde880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff888102bde900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888102bde980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000025: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000128-0x000000000000012f]
CPU: 1 UID: 0 PID: 515 Comm: kworker/1:4 Tainted: G    B              6.12.30-syzkaller-g68f4f0b0690a #0 d2d57a621586a6800997b547ec5ef233d70fc6ad
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: cryptd cryptd_queue_worker
RIP: 0010:net_generic include/net/netns/generic.h:47 [inline]
RIP: 0010:tipc_net net/tipc/core.h:151 [inline]
RIP: 0010:tipc_crypto_key_synch net/tipc/crypto.c:1384 [inline]
RIP: 0010:tipc_crypto_rcv_complete+0x732/0x1880 net/tipc/crypto.c:1973
Code: e8 03 42 80 3c 30 00 74 08 4c 89 e7 e8 37 e0 72 fc 49 c1 e7 03 4d 03 3c 24 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 10 e0 72 fc 41 bc f8 11 00 00 4d 03
RSP: 0018:ffffc9000d6df9e0 EFLAGS: 00010202
RAX: 0000000000000025 RBX: ffff88811e3fb640 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88812e5b68a0
RBP: ffffc9000d6dfad0 R08: ffff88811df7e01b R09: 1ffff11023befc03
R10: dffffc0000000000 R11: ffffed1023befc04 R12: ffff88812e5b68a0
R13: 1ffff1102057bd00 R14: dffffc0000000000 R15: 0000000000000128
FS:  0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005646cc2c8b98 CR3: 00000000072a8000 CR4: 00000000003526b0
Call Trace:
 <TASK>
 tipc_aead_decrypt_done+0x1a8/0x2a0 net/tipc/crypto.c:978
 crypto_request_complete include/crypto/algapi.h:266 [inline]
 aead_request_complete include/crypto/internal/aead.h:85 [inline]
 cryptd_aead_crypt+0x37e/0x580 crypto/cryptd.c:772
 cryptd_aead_decrypt+0xaf/0xc0 crypto/cryptd.c:804
 crypto_request_complete include/crypto/algapi.h:266 [inline]
 cryptd_queue_worker+0x13d/0x1b0 crypto/cryptd.c:181
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x7d2/0x1020 kernel/workqueue.c:3319
 worker_thread+0xc58/0x1250 kernel/workqueue.c:3400
 kthread+0x2ca/0x370 kernel/kthread.c:389
 ret_from_fork+0x64/0xa0 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:net_generic include/net/netns/generic.h:47 [inline]
RIP: 0010:tipc_net net/tipc/core.h:151 [inline]
RIP: 0010:tipc_crypto_key_synch net/tipc/crypto.c:1384 [inline]
RIP: 0010:tipc_crypto_rcv_complete+0x732/0x1880 net/tipc/crypto.c:1973
Code: e8 03 42 80 3c 30 00 74 08 4c 89 e7 e8 37 e0 72 fc 49 c1 e7 03 4d 03 3c 24 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 10 e0 72 fc 41 bc f8 11 00 00 4d 03
RSP: 0018:ffffc9000d6df9e0 EFLAGS: 00010202
RAX: 0000000000000025 RBX: ffff88811e3fb640 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88812e5b68a0
RBP: ffffc9000d6dfad0 R08: ffff88811df7e01b R09: 1ffff11023befc03
R10: dffffc0000000000 R11: ffffed1023befc04 R12: ffff88812e5b68a0
R13: 1ffff1102057bd00 R14: dffffc0000000000 R15: 0000000000000128
FS:  0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005646cc2c8b98 CR3: 00000000072a8000 CR4: 00000000003526b0
----------------
Code disassembly (best guess):
   0:	e8 03 42 80 3c       	call   0x3c804208
   5:	30 00                	xor    %al,(%rax)
   7:	74 08                	je     0x11
   9:	4c 89 e7             	mov    %r12,%rdi
   c:	e8 37 e0 72 fc       	call   0xfc72e048
  11:	49 c1 e7 03          	shl    $0x3,%r15
  15:	4d 03 3c 24          	add    (%r12),%r15
  19:	4c 89 f8             	mov    %r15,%rax
  1c:	48 c1 e8 03          	shr    $0x3,%rax
  20:	48 b9 00 00 00 00 00 	movabs $0xdffffc0000000000,%rcx
  27:	fc ff df
* 2a:	80 3c 08 00          	cmpb   $0x0,(%rax,%rcx,1) <-- trapping instruction
  2e:	74 08                	je     0x38
  30:	4c 89 ff             	mov    %r15,%rdi
  33:	e8 10 e0 72 fc       	call   0xfc72e048
  38:	41 bc f8 11 00 00    	mov    $0x11f8,%r12d
  3e:	4d                   	rex.WRB
  3f:	03                   	.byte 0x3

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/29 08:08 android16-6.12 68f4f0b0690a fc9d8ee5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: slab-use-after-free Read in tipc_aead_decrypt_done
* Struck through repros no longer work on HEAD.