syzbot


KCSAN: data-race in yama_relation_cleanup / yama_task_free (3)

Status: auto-closed as invalid on 2021/03/02 05:29
Subsystems: lsm
[Documentation on labels]
Reported-by: syzbot+5f3dcb2d7c7b062f7bae@syzkaller.appspotmail.com
First crash: 1210d, last: 1147d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in yama_relation_cleanup / yama_task_free (2) lsm 1 1255d 1255d 0/26 auto-closed as invalid on 2020/11/14 15:11
upstream KCSAN: data-race in yama_relation_cleanup / yama_task_free (4) lsm 2 1080d 1084d 0/26 auto-closed as invalid on 2021/05/17 10:12
upstream KCSAN: data-race in yama_relation_cleanup / yama_task_free lsm 4 1327d 1348d 0/26 auto-closed as invalid on 2020/09/04 02:18

Sample crash report:
==================================================================
BUG: KCSAN: data-race in yama_relation_cleanup / yama_task_free

write to 0xffff88802c5cdb50 of 1 bytes by interrupt on cpu 1:
 yama_ptracer_del security/yama/yama_lsm.c:191 [inline]
 yama_task_free+0xc3/0x160 security/yama/yama_lsm.c:207
 security_task_free+0x3f/0xa0 security/security.c:1597
 __put_task_struct+0xc2/0x3a0 kernel/fork.c:736
 put_task_struct include/linux/sched/task.h:111 [inline]
 delayed_put_task_struct+0x4e/0x130 kernel/exit.c:173
 rcu_do_batch kernel/rcu/tree.c:2489 [inline]
 rcu_core+0x69b/0xb90 kernel/rcu/tree.c:2723
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2736
 __do_softirq+0x13c/0x2c3 kernel/softirq.c:343
 asm_call_irq_on_stack+0xf/0x20
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
 do_softirq_own_stack+0x32/0x40 arch/x86/kernel/irq_64.c:77
 invoke_softirq kernel/softirq.c:226 [inline]
 __irq_exit_rcu+0xb4/0xc0 kernel/softirq.c:420
 sysvec_apic_timer_interrupt+0x74/0x90 arch/x86/kernel/apic/apic.c:1096
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628
 native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline]
 arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline]
 kcsan_setup_watchpoint+0x1fc/0x4e0 kernel/kcsan/core.c:591
 page_memcg include/linux/memcontrol.h:368 [inline]
 lock_page_memcg+0x48/0xf0 mm/memcontrol.c:2175
 page_remove_rmap+0x1e/0x610 mm/rmap.c:1334
 zap_pte_range+0x5af/0x13c0 mm/memory.c:1264
 zap_pmd_range mm/memory.c:1368 [inline]
 zap_pud_range mm/memory.c:1397 [inline]
 zap_p4d_range mm/memory.c:1418 [inline]
 unmap_page_range+0x560/0x660 mm/memory.c:1439
 unmap_single_vma+0x157/0x210 mm/memory.c:1484
 unmap_vmas+0xbf/0x150 mm/memory.c:1516
 exit_mmap+0x1c7/0x400 mm/mmap.c:3220
 __mmput+0xa2/0x220 kernel/fork.c:1082
 mmput+0x38/0x40 kernel/fork.c:1103
 exit_mm+0x32f/0x420 kernel/exit.c:501
 do_exit+0x41f/0x1690 kernel/exit.c:812
 do_group_exit+0xc8/0x170 kernel/exit.c:922
 get_signal+0xd7e/0x1470 kernel/signal.c:2773
 arch_do_signal_or_restart+0x2a/0x270 arch/x86/kernel/signal.c:811
 handle_signal_work kernel/entry/common.c:147 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x109/0x1a0 kernel/entry/common.c:201
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x20/0x40 kernel/entry/common.c:302
 do_syscall_64+0x45/0x80 arch/x86/entry/common.c:56
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

read to 0xffff88802c5cdb50 of 1 bytes by task 9557 on cpu 0:
 yama_relation_cleanup+0x69/0x150 security/yama/yama_lsm.c:122
 process_one_work+0x3e1/0x950 kernel/workqueue.c:2275
 worker_thread+0x64a/0xaa0 kernel/workqueue.c:2421
 kthread+0x1fd/0x220 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 9557 Comm: kworker/0:4 Not tainted 5.11.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events yama_relation_cleanup
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/26 05:28 upstream f8ad8187c3b5 52e37319 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in yama_relation_cleanup / yama_task_free
2021/01/05 09:02 upstream 36bbbd0e234d 2a28ff1f .config console log report info ci2-upstream-kcsan-gce
2020/12/25 16:59 upstream 71c5f03154ac b982b3ea .config console log report info ci2-upstream-kcsan-gce
2020/12/10 10:50 upstream a2f5ea9e314b c090b4da .config console log report info ci2-upstream-kcsan-gce
2020/11/24 11:51 upstream d5beb3140f91 1ab681a4 .config console log report info ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.