Skip to content
Snippets Groups Projects
Select Git revision
  • 232f0ba4d69263af5912e279fcc32fef2882b1dc
  • bpf-spectre default protected
  • vf-baseline
  • bpf-spectre-baseline
  • pkt-ptr-revert-v1
  • v6.5-rc6-bpf-spectre-nospec
  • master
  • spectector-bpf
  • bpftask protected
  • bpftask-no-unused-args
  • bpftask-master
  • v5.9-bpftask
  • v5.8-amd-17h-em protected
  • v5.8-amd-17h-eas protected
  • freqinv-amd3950x-v5.8
  • v5.8-scale-inv-acc-amd-ryzen-3950x
  • 23186e43-amd-17h-eas protected
  • caffb99b6929-perf-x86-rapl-Enable-RAPL-for-AMD-Fam17h
  • 6a9ee74800a1-amd-17h-eas protected
  • add2fae34926-amd_17h_em
  • 3643c88e5545-Add-support-for-frequency-invariance-for-some-x86
  • v5.7-rc6
22 results

queue_stack_maps.c

Blame
  • user avatar
    Toke Høiland-Jørgensen authored and Greg Kroah-Hartman committed
    [ Upstream commit a34a9f1a ]
    
    Sysbot discovered that the queue and stack maps can deadlock if they are
    being used from a BPF program that can be called from NMI context (such as
    one that is attached to a perf HW counter event). To fix this, add an
    in_nmi() check and use raw_spin_trylock() in NMI context, erroring out if
    grabbing the lock fails.
    
    Fixes: f1a2e44a ("bpf: add queue and stack maps")
    Reported-by: default avatarHsin-Wei Hung <hsinweih@uci.edu>
    Tested-by: default avatarHsin-Wei Hung <hsinweih@uci.edu>
    Co-developed-by: default avatarHsin-Wei Hung <hsinweih@uci.edu>
    Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
    Link: https://lore.kernel.org/r/20230911132815.717240-1-toke@redhat.com
    
    
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    232f0ba4
    History
    queue_stack_maps.c 7.08 KiB