Closed matttbe closed 1 year ago
it doesn't seem to be due to MPTCP code, closing for now.
(this bug has been opened just to be able to track issues reported by the public CI that affect results when testing our own patches)
it seems easy to reproduce this bug because we had it in export-net
too:
[ 1502.520319][T14140] ==================================================================
[1502.527398][T14140] BUG: KASAN: slab-use-after-free in kernfs_test_super (fs/kernfs/mount.c:286)
[ 1502.534436][T14140] Read of size 8 at addr ffff88800853aa88 by task ip/14140
[ 1502.541084][T14140]
[ 1502.543122][T14140] CPU: 1 PID: 14140 Comm: ip Tainted: G N 6.5.0-g7088bf643393 #1
[ 1502.550591][T14140] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[ 1502.558322][T14140] Call Trace:
[ 1502.561155][T14140] <TASK>
[1502.563628][T14140] dump_stack_lvl (lib/dump_stack.c:107)
[1502.567645][T14140] print_address_description.constprop.0 (mm/kasan/report.c:365)
[1502.573319][T14140] ? kernfs_test_super (fs/kernfs/mount.c:286)
[1502.577712][T14140] print_report (mm/kasan/report.c:476)
[1502.581903][T14140] ? kasan_addr_to_slab (arch/x86/include/asm/bitops.h:207)
[1502.586379][T14140] kasan_report (mm/kasan/report.c:590)
[1502.590618][T14140] ? kernfs_test_super (fs/kernfs/mount.c:286)
[1502.595539][T14140] ? kernfs_encode_fh (fs/kernfs/mount.c:282)
[1502.599965][T14140] kernfs_test_super (fs/kernfs/mount.c:286)
[1502.604124][T14140] ? kernfs_encode_fh (fs/kernfs/mount.c:282)
[1502.608634][T14140] sget_fc (fs/super.c:778)
[1502.612390][T14140] ? kernfs_sop_show_path (fs/kernfs/mount.c:290)
[1502.617166][T14140] ? kasan_set_track (mm/kasan/common.c:52)
[1502.621288][T14140] kernfs_get_tree (fs/kernfs/mount.c:337)
[1502.625359][T14140] ? _raw_spin_unlock (arch/x86/include/asm/preempt.h:95)
[1502.629431][T14140] sysfs_get_tree (fs/sysfs/mount.c:32)
[1502.633411][T14140] vfs_get_tree (fs/super.c:1712)
[1502.637319][T14140] ? ns_capable (kernel/capability.c:362)
[1502.641074][T14140] do_new_mount (fs/namespace.c:3335)
[1502.644983][T14140] ? do_add_mount (fs/namespace.c:3296)
[1502.649066][T14140] ? security_capable (security/security.c:945 (discriminator 13))
[1502.653405][T14140] path_mount (fs/namespace.c:3662)
[1502.657363][T14140] ? user_path_at_empty (fs/namei.c:2914)
[1502.661377][T14140] ? finish_automount (fs/namespace.c:3589)
[1502.665271][T14140] __x64_sys_mount (fs/namespace.c:3676)
[1502.669846][T14140] ? copy_mnt_ns (fs/namespace.c:3861)
[1502.673806][T14140] do_syscall_64 (arch/x86/entry/common.c:50)
[1502.677653][T14140] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
[ 1502.682596][T14140] RIP: 0033:0x7fbec04d7eae
[ 1502.686381][T14140] Code: 48 8b 0d 85 1f 0f 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 52 1f 0f 00 f7 d8 64 89 01 48
All code
========
0: 48 8b 0d 85 1f 0f 00 mov 0xf1f85(%rip),%rcx # 0xf1f8c
7: f7 d8 neg %eax
9: 64 89 01 mov %eax,%fs:(%rcx)
c: 48 83 c8 ff or $0xffffffffffffffff,%rax
10: c3 ret
11: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1)
18: 00 00 00
1b: 90 nop
1c: f3 0f 1e fa endbr64
20: 49 89 ca mov %rcx,%r10
23: b8 a5 00 00 00 mov $0xa5,%eax
28: 0f 05 syscall
2a:* 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction
30: 73 01 jae 0x33
32: c3 ret
33: 48 8b 0d 52 1f 0f 00 mov 0xf1f52(%rip),%rcx # 0xf1f8c
3a: f7 d8 neg %eax
3c: 64 89 01 mov %eax,%fs:(%rcx)
3f: 48 rex.W
Code starting with the faulting instruction
===========================================
0: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax
6: 73 01 jae 0x9
8: c3 ret
9: 48 8b 0d 52 1f 0f 00 mov 0xf1f52(%rip),%rcx # 0xf1f62
10: f7 d8 neg %eax
12: 64 89 01 mov %eax,%fs:(%rcx)
15: 48 rex.W
[ 1502.702790][T14140] RSP: 002b:00007ffe03c33328 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
[ 1502.709819][T14140] RAX: ffffffffffffffda RBX: 0000561a01988b1a RCX: 00007fbec04d7eae
[ 1502.716234][T14140] RDX: 0000561a01999a4a RSI: 0000561a01999a45 RDI: 00007ffe03c37e4f
[ 1502.722692][T14140] RBP: 0000561a01999a45 R08: 0000000000000000 R09: 0000000000000000
[ 1502.729362][T14140] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe03c36680
[ 1502.735506][T14140] R13: 0000561a01984020 R14: 00007ffe03c37e4f R15: 00007ffe03c37e48
[ 1502.742037][T14140] </TASK>
[ 1502.744918][T14140]
[ 1502.746995][T14140] Allocated by task 14128:
[1502.750851][T14140] kasan_save_stack (mm/kasan/common.c:46)
[1502.755027][T14140] kasan_set_track (mm/kasan/common.c:52)
[1502.759331][T14140] __kasan_kmalloc (mm/kasan/common.c:384)
[1502.763380][T14140] kernfs_get_tree (include/linux/slab.h:582)
[1502.767417][T14140] sysfs_get_tree (fs/sysfs/mount.c:32)
[1502.771271][T14140] vfs_get_tree (fs/super.c:1712)
[1502.775134][T14140] do_new_mount (fs/namespace.c:3335)
[1502.779247][T14140] path_mount (fs/namespace.c:3662)
[1502.783143][T14140] __x64_sys_mount (fs/namespace.c:3676)
[1502.787832][T14140] do_syscall_64 (arch/x86/entry/common.c:50)
[1502.791680][T14140] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
[ 1502.796807][T14140]
[ 1502.798986][T14140] Freed by task 14128:
[1502.802368][T14140] kasan_save_stack (mm/kasan/common.c:46)
[1502.806474][T14140] kasan_set_track (mm/kasan/common.c:52)
[1502.810442][T14140] kasan_save_free_info (mm/kasan/generic.c:524)
[1502.814751][T14140] ____kasan_slab_free (mm/kasan/common.c:238)
[1502.819413][T14140] slab_free_freelist_hook (mm/slub.c:1818)
[1502.823676][T14140] __kmem_cache_free (mm/slub.c:3801)
[1502.827932][T14140] sysfs_kill_sb (fs/sysfs/mount.c:87)
[1502.831531][T14140] deactivate_locked_super (fs/super.c:461)
[1502.836323][T14140] cleanup_mnt (fs/namespace.c:139)
[1502.840232][T14140] task_work_run (kernel/task_work.c:181 (discriminator 1))
[1502.843986][T14140] do_exit (kernel/exit.c:875)
[1502.847377][T14140] do_group_exit (kernel/exit.c:1005)
[1502.851029][T14140] __x64_sys_exit_group (kernel/exit.c:1033)
[1502.855401][T14140] do_syscall_64 (arch/x86/entry/common.c:50)
[1502.859259][T14140] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
[ 1502.864303][T14140]
[ 1502.866468][T14140] Last potentially related work creation:
[1502.871587][T14140] kasan_save_stack (mm/kasan/common.c:46)
[1502.875716][T14140] __kasan_record_aux_stack (mm/kasan/generic.c:492)
[1502.880531][T14140] __call_rcu_common.constprop.0 (arch/x86/include/asm/irqflags.h:26)
[1502.885671][T14140] nf_unregister_net_hook (net/netfilter/core.c:536)
[1502.890273][T14140] __nf_tables_abort+0x1843/0x2e30 nf_tables]
[1502.896320][T14140] nf_tables_abort+0x73/0xd0 nf_tables]
[1502.901484][T14140] nfnetlink_rcv_batch (net/netfilter/nfnetlink.c:564)
[1502.905883][T14140] nfnetlink_rcv (net/netfilter/nfnetlink.c:639)
[1502.909716][T14140] netlink_unicast (net/netlink/af_netlink.c:1343)
[1502.913569][T14140] netlink_sendmsg (net/netlink/af_netlink.c:1910)
==========================================
From what I read, this has already been reported on lore:
It should be fixed by this series: https://lore.kernel.org/all/20230828-vfs-super-fixes-v1-0-b37a4a04a88f@kernel.org/
It should be fixed by this series: https://lore.kernel.org/all/20230828-vfs-super-fixes-v1-0-b37a4a04a88f@kernel.org/
I just applied this series not to have our CI being impacted by these external issues:
New patches for t/upstream-net and t/upstream:
Tests are now in progress:
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export-net/20230831T090704 https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230831T090704
Cheers, Matt
The public CI just reported the following bug: