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

====================
pull-request: bpf 2024-05-17

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

The main changes are:

1) Fix KASAN slab-out-of-bounds in percpu_array_map_gen_lookup and add
   BPF selftests to cover this case, from Andrii Nakryiko.
   (Report https://lore.kernel.org/bpf/20240514231155.1004295-1-kuba@kernel.org/)

2) Fix two BPF selftests to adjust for kernel changes after fast-forwarding
   Linus' tree to make BPF CI all green again, from Martin KaFai Lau.

3) Fix libbpf feature detectors when using token_fd by adjusting the
   attribute size for memset to cover the former, also from Andrii Nakryiko.

4) Fix the description of 'src' in ALU instructions for the BPF ISA
   standardization doc, from Puranjay Mohan.

* tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
  selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations
  selftests/bpf: Adjust test_access_variable_array after a kernel function name change
  selftests/bpf: add more variations of map-in-map situations
  bpf: save extended inner map info for percpu array maps as well
  MAINTAINERS: Update ARM64 BPF JIT maintainer
  bpf, docs: Fix the description of 'src' in ALU instructions
  libbpf: fix feature detectors when using token_fd
====================

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


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 83e93942 51e2b8d3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -301,8 +301,9 @@ Arithmetic instructions
``ALU`` uses 32-bit wide operands while ``ALU64`` uses 64-bit wide operands for
otherwise identical operations. ``ALU64`` instructions belong to the
base64 conformance group unless noted otherwise.
The 'code' field encodes the operation as below, where 'src' and 'dst' refer
to the values of the source and destination registers, respectively.
The 'code' field encodes the operation as below, where 'src' refers to the
the source operand and 'dst' refers to the value of the destination
register.

=====  =====  =======  ==========================================================
name   code   offset   description
+1 −1
Original line number Diff line number Diff line
@@ -3777,7 +3777,7 @@ F: arch/arm/net/
BPF JIT for ARM64
M:	Daniel Borkmann <daniel@iogearbox.net>
M:	Alexei Starovoitov <ast@kernel.org>
M:	Zi Shen Lim <zlim.lnx@gmail.com>
M:	Puranjay Mohan <puranjay@kernel.org>
L:	bpf@vger.kernel.org
S:	Supported
F:	arch/arm64/net/
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)

	inner_map_meta_size = sizeof(*inner_map_meta);
	/* In some cases verifier needs to access beyond just base map. */
	if (inner_map->ops == &array_map_ops)
	if (inner_map->ops == &array_map_ops || inner_map->ops == &percpu_array_map_ops)
		inner_map_meta_size = sizeof(struct bpf_array);

	inner_map_meta = kzalloc(inner_map_meta_size, GFP_USER);
@@ -68,7 +68,7 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)

	/* Misc members not needed in bpf_map_meta_equal() check. */
	inner_map_meta->ops = inner_map->ops;
	if (inner_map->ops == &array_map_ops) {
	if (inner_map->ops == &array_map_ops || inner_map->ops == &percpu_array_map_ops) {
		struct bpf_array *inner_array_meta =
			container_of(inner_map_meta, struct bpf_array, map);
		struct bpf_array *inner_array = container_of(inner_map, struct bpf_array, map);
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size, int attempts)
 */
int probe_memcg_account(int token_fd)
{
	const size_t attr_sz = offsetofend(union bpf_attr, attach_btf_obj_fd);
	const size_t attr_sz = offsetofend(union bpf_attr, prog_token_fd);
	struct bpf_insn insns[] = {
		BPF_EMIT_CALL(BPF_FUNC_ktime_get_coarse_ns),
		BPF_EXIT_INSN(),
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ int probe_fd(int fd)

static int probe_kern_prog_name(int token_fd)
{
	const size_t attr_sz = offsetofend(union bpf_attr, prog_name);
	const size_t attr_sz = offsetofend(union bpf_attr, prog_token_fd);
	struct bpf_insn insns[] = {
		BPF_MOV64_IMM(BPF_REG_0, 0),
		BPF_EXIT_INSN(),
Loading