• Zqiang's avatar
    irq_work: use kasan_record_aux_stack_noalloc() record callstack · a78cb080
    Zqiang authored
    [ Upstream commit 25934fcf ]
    
    On PREEMPT_RT kernel and KASAN is enabled.  the kasan_record_aux_stack()
    may call alloc_pages(), and the rt-spinlock will be acquired, if currently
    in atomic context, will trigger warning:
    
      BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
      in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 239, name: bootlogd
      Preemption disabled at:
      [<ffffffffbab1a531>] rt_mutex_slowunlock+0xa1/0x4e0
      CPU: 3 PID: 239 Comm: bootlogd Tainted: G        W 5.17.1-rt17-yocto-preempt-rt+ #105
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
      Call Trace:
         __might_resched.cold+0x13b/0x173
         rt_spin_lock+0x5b/0xf0
         get_page_from_freelist+0x20c/0x1610
         __alloc_pages+0x25e/0x5e0
         __stack_depot_save+0x3c0/0x4a0
         kasan_save_stack+0x3a/0x50
         __kasan_record_aux_stack+0xb6/0...
    a78cb080
irq_work.c 7.46 KB