Skip to content

Commit 77b1b8b

Browse files
committed
Daniel Borkmann says: ==================== pull-request: bpf 2022-02-03 We've added 6 non-merge commits during the last 10 day(s) which contain a total of 7 files changed, 11 insertions(+), 236 deletions(-). The main changes are: 1) Fix BPF ringbuf to allocate its area with VM_MAP instead of VM_ALLOC flag which otherwise trips over KASAN, from Hou Tao. 2) Fix unresolved symbol warning in resolve_btfids due to LSM callback rename, from Alexei Starovoitov. 3) Fix a possible race in inc_misses_counter() when IRQ would trigger during counter update, from He Fengqing. 4) Fix tooling infra for cross-building with clang upon probing whether gcc provides the standard libraries, from Jean-Philippe Brucker. 5) Fix silent mode build for resolve_btfids, from Nathan Chancellor. 6) Drop unneeded and outdated lirc.h header copy from tooling infra as BPF does not require it anymore, from Sean Young. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: tools/resolve_btfids: Do not print any commands when building silently bpf: Use VM_MAP instead of VM_ALLOC for ringbuf tools: Ignore errors from `which' when searching a GCC toolchain tools headers UAPI: remove stale lirc.h bpf: Fix possible race in inc_misses_counter bpf: Fix renaming task_getsecid_subj->current_getsecid_subj. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 0166556 + 7f3bdbc commit 77b1b8b

File tree

7 files changed

+11
-236
lines changed

7 files changed

+11
-236
lines changed

kernel/bpf/bpf_lsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ BTF_ID(func, bpf_lsm_socket_socketpair)
207207

208208
BTF_ID(func, bpf_lsm_syslog)
209209
BTF_ID(func, bpf_lsm_task_alloc)
210-
BTF_ID(func, bpf_lsm_task_getsecid_subj)
210+
BTF_ID(func, bpf_lsm_current_getsecid_subj)
211211
BTF_ID(func, bpf_lsm_task_getsecid_obj)
212212
BTF_ID(func, bpf_lsm_task_prctl)
213213
BTF_ID(func, bpf_lsm_task_setscheduler)

kernel/bpf/ringbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static struct bpf_ringbuf *bpf_ringbuf_area_alloc(size_t data_sz, int numa_node)
104104
}
105105

106106
rb = vmap(pages, nr_meta_pages + 2 * nr_data_pages,
107-
VM_ALLOC | VM_USERMAP, PAGE_KERNEL);
107+
VM_MAP | VM_USERMAP, PAGE_KERNEL);
108108
if (rb) {
109109
kmemleak_not_leak(pages);
110110
rb->pages = pages;

kernel/bpf/trampoline.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,11 +550,12 @@ static __always_inline u64 notrace bpf_prog_start_time(void)
550550
static void notrace inc_misses_counter(struct bpf_prog *prog)
551551
{
552552
struct bpf_prog_stats *stats;
553+
unsigned int flags;
553554

554555
stats = this_cpu_ptr(prog->stats);
555-
u64_stats_update_begin(&stats->syncp);
556+
flags = u64_stats_update_begin_irqsave(&stats->syncp);
556557
u64_stats_inc(&stats->misses);
557-
u64_stats_update_end(&stats->syncp);
558+
u64_stats_update_end_irqrestore(&stats->syncp, flags);
558559
}
559560

560561
/* The logic is similar to bpf_prog_run(), but with an explicit

tools/bpf/resolve_btfids/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ ifeq ($(V),1)
99
msg =
1010
else
1111
Q = @
12-
msg = @printf ' %-8s %s%s\n' "$(1)" "$(notdir $(2))" "$(if $(3), $(3))";
12+
ifeq ($(silent),1)
13+
msg =
14+
else
15+
msg = @printf ' %-8s %s%s\n' "$(1)" "$(notdir $(2))" "$(if $(3), $(3))";
16+
endif
1317
MAKEFLAGS=--no-print-directory
1418
endif
1519

tools/include/uapi/linux/lirc.h

Lines changed: 0 additions & 229 deletions
This file was deleted.

tools/scripts/Makefile.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ EXTRA_WARNINGS += -Wstrict-aliasing=3
9090

9191
else ifneq ($(CROSS_COMPILE),)
9292
CLANG_CROSS_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
93-
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc))
93+
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null))
9494
ifneq ($(GCC_TOOLCHAIN_DIR),)
9595
CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
9696
CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot)

tools/testing/selftests/bpf/test_lirc_mode2_user.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
// 5. We can read keycode from same /dev/lirc device
2929

3030
#include <linux/bpf.h>
31-
#include <linux/lirc.h>
3231
#include <linux/input.h>
3332
#include <errno.h>
3433
#include <stdio.h>

0 commit comments

Comments
 (0)