]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix the irq and nmi check in bpf_sk_storage for tracing usage
authorMartin KaFai Lau <kafai@fb.com>
Mon, 16 Nov 2020 20:01:13 +0000 (12:01 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 17 Nov 2020 00:46:01 +0000 (16:46 -0800)
commit9bff3fc58b2fb42f7ab391a268727c1cb0e78e3d
tree11b857e0b9e1c1e5ffb9cd4d8b467fd20d87ccd6
parent749f6fd576ab93e774afc27fd0d7e8c8e9451d4d
bpf: Fix the irq and nmi check in bpf_sk_storage for tracing usage

The intention of the current check is to avoid using bpf_sk_storage
in irq and nmi.  Jakub pointed out that the current check cannot
do that.  For example, in_serving_softirq() returns true
if the softirq handling is interrupted by hard irq.

Fixes: 4f334710744a ("bpf: Allow using bpf_sk_storage in FENTRY/FEXIT/RAW_TP")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201116200113.2868539-1-kafai@fb.com
net/core/bpf_sk_storage.c