Skip to content
  • Eric Dumazet's avatar
    kcm: disable preemption in kcm_parse_func_strparser() · 0355d6c1
    Eric Dumazet authored
    After commit a2c11b03 ("kcm: use BPF_PROG_RUN")
    syzbot easily triggers the warning in cant_sleep().
    
    As explained in commit 6cab5e90 ("bpf: run bpf programs
    with preemption disabled") we need to disable preemption before
    running bpf programs.
    
    BUG: assuming atomic context at net/kcm/kcmsock.c:382
    in_atomic(): 0, irqs_disabled(): 0, pid: 7, name: kworker/u4:0
    3 locks held by kworker/u4:0/7:
     #0: ffff888216726128 ((wq_completion)kstrp){+.+.}, at: __write_once_size include/linux/compiler.h:226 [inline]
     #0: ffff888216726128 ((wq_completion)kstrp){+.+.}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
     #0: ffff888216726128 ((wq_completion)kstrp){+.+.}, at: atomic64_set include/asm-generic/atomic-instrumented.h:855 [inline]
     #0: ffff888216726128 ((wq_completion)kstrp){+.+.}, at: atomic_long_set include/asm-generic/atomic-long.h:40 [inline]
     #0: ffff888216726128 ((wq_completion)kstrp){+.+.}, at: set_work_data kernel/workqueue.c:6...
    0355d6c1