Commit c64da10a authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Daniel Borkmann says:

====================
pull-request: bpf 2024-06-14

We've added 8 non-merge commits during the last 2 day(s) which contain
a total of 9 files changed, 92 insertions(+), 11 deletions(-).

The main changes are:

1) Silence a syzkaller splat under CONFIG_DEBUG_NET=y in pskb_pull_reason()
   triggered via __bpf_try_make_writable(), from Florian Westphal.

2) Fix removal of kfuncs during linking phase which then throws a kernel
   build warning via resolve_btfids about unresolved symbols,
   from Tony Ambardar.

3) Fix a UML x86_64 compilation failure from BPF as pcpu_hot symbol
   is not available on User Mode Linux, from Maciej Żenczykowski.

4) Fix a register corruption in reg_set_min_max triggering an invariant
   violation in BPF verifier, from Daniel Borkmann.

* tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
  bpf: Harden __bpf_kfunc tag against linker kfunc removal
  compiler_types.h: Define __retain for __attribute__((__retain__))
  bpf: Avoid splat in pskb_pull_reason
  bpf: fix UML x86_64 compile failure
  selftests/bpf: Add test coverage for reg_set_min_max handling
  bpf: Reduce stack consumption in check_stack_write_fixed_off
  bpf: Fix reg_set_min_max corruption of fake_reg
  MAINTAINERS: mailmap: Update Stanislav's email address
====================

Link: https://lore.kernel.org/r/20240614203223.26500-1-daniel@iogearbox.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 1afe4a64 7bdcedd5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -608,6 +608,7 @@ Simon Kelley <simon@thekelleys.org.uk>
Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
Srinivas Ramana <quic_sramana@quicinc.com> <sramana@codeaurora.org>
Sriram R <quic_srirrama@quicinc.com> <srirrama@codeaurora.org>
Stanislav Fomichev <sdf@fomichev.me> <sdf@google.com>
Stefan Wahren <wahrenst@gmx.net> <stefan.wahren@i2se.com>
Stéphane Witzmann <stephane.witzmann@ubpmes.univ-bpclermont.fr>
Stephen Hemminger <stephen@networkplumber.org> <shemminger@linux-foundation.org>
+1 −1
Original line number Diff line number Diff line
@@ -3980,7 +3980,7 @@ R: Song Liu <song@kernel.org>
R:	Yonghong Song <yonghong.song@linux.dev>
R:	John Fastabend <john.fastabend@gmail.com>
R:	KP Singh <kpsingh@kernel.org>
R:	Stanislav Fomichev <sdf@google.com>
R:	Stanislav Fomichev <sdf@fomichev.me>
R:	Hao Luo <haoluo@google.com>
R:	Jiri Olsa <jolsa@kernel.org>
L:	bpf@vger.kernel.org
+2 −0
Original line number Diff line number Diff line
@@ -746,6 +746,8 @@ struct bpf_verifier_env {
	/* Same as scratched_regs but for stack slots */
	u64 scratched_stack_slots;
	u64 prev_log_pos, prev_insn_print_pos;
	/* buffer used to temporary hold constants as scalar registers */
	struct bpf_reg_state fake_reg[2];
	/* buffer used to generate temporary string representations,
	 * e.g., in reg_type_str() to generate reg_type string
	 */
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@
 * as to avoid issues such as the compiler inlining or eliding either a static
 * kfunc, or a global kfunc in an LTO build.
 */
#define __bpf_kfunc __used noinline
#define __bpf_kfunc __used __retain noinline

#define __bpf_kfunc_start_defs()					       \
	__diag_push();							       \
+23 −0
Original line number Diff line number Diff line
@@ -143,6 +143,29 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
# define __preserve_most
#endif

/*
 * Annotating a function/variable with __retain tells the compiler to place
 * the object in its own section and set the flag SHF_GNU_RETAIN. This flag
 * instructs the linker to retain the object during garbage-cleanup or LTO
 * phases.
 *
 * Note that the __used macro is also used to prevent functions or data
 * being optimized out, but operates at the compiler/IR-level and may still
 * allow unintended removal of objects during linking.
 *
 * Optional: only supported since gcc >= 11, clang >= 13
 *
 *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-retain-function-attribute
 * clang: https://clang.llvm.org/docs/AttributeReference.html#retain
 */
#if __has_attribute(__retain__) && \
	(defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || \
	 defined(CONFIG_LTO_CLANG))
# define __retain			__attribute__((__retain__))
#else
# define __retain
#endif

/* Compiler specific macros. */
#ifdef __clang__
#include <linux/compiler-clang.h>
Loading