]> Git Repo - J-linux.git/commitdiff
Merge tag 'bpf-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf...
authorLinus Torvalds <[email protected]>
Thu, 21 Nov 2024 16:11:04 +0000 (08:11 -0800)
committerLinus Torvalds <[email protected]>
Thu, 21 Nov 2024 16:11:04 +0000 (08:11 -0800)
Pull bpf updates from Alexei Starovoitov:

 - Add BPF uprobe session support (Jiri Olsa)

 - Optimize uprobe performance (Andrii Nakryiko)

 - Add bpf_fastcall support to helpers and kfuncs (Eduard Zingerman)

 - Avoid calling free_htab_elem() under hash map bucket lock (Hou Tao)

 - Prevent tailcall infinite loop caused by freplace (Leon Hwang)

 - Mark raw_tracepoint arguments as nullable (Kumar Kartikeya Dwivedi)

 - Introduce uptr support in the task local storage map (Martin KaFai
   Lau)

 - Stringify errno log messages in libbpf (Mykyta Yatsenko)

 - Add kmem_cache BPF iterator for perf's lock profiling (Namhyung Kim)

 - Support BPF objects of either endianness in libbpf (Tony Ambardar)

 - Add ksym to struct_ops trampoline to fix stack trace (Xu Kuohai)

 - Introduce private stack for eligible BPF programs (Yonghong Song)

 - Migrate samples/bpf tests to selftests/bpf test_progs (Daniel T. Lee)

 - Migrate test_sock to selftests/bpf test_progs (Jordan Rife)

* tag 'bpf-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (152 commits)
  libbpf: Change hash_combine parameters from long to unsigned long
  selftests/bpf: Fix build error with llvm 19
  libbpf: Fix memory leak in bpf_program__attach_uprobe_multi
  bpf: use common instruction history across all states
  bpf: Add necessary migrate_disable to range_tree.
  bpf: Do not alloc arena on unsupported arches
  selftests/bpf: Set test path for token/obj_priv_implicit_token_envvar
  selftests/bpf: Add a test for arena range tree algorithm
  bpf: Introduce range_tree data structure and use it in bpf arena
  samples/bpf: Remove unused variable in xdp2skb_meta_kern.c
  samples/bpf: Remove unused variables in tc_l2_redirect_kern.c
  bpftool: Cast variable `var` to long long
  bpf, x86: Propagate tailcall info only for subprogs
  bpf: Add kernel symbol for struct_ops trampoline
  bpf: Use function pointers count as struct_ops links count
  bpf: Remove unused member rcu from bpf_struct_ops_map
  selftests/bpf: Add struct_ops prog private stack tests
  bpf: Support private stack for struct_ops progs
  selftests/bpf: Add tracing prog private stack tests
  bpf, x86: Support private stack in jit
  ...

1  2 
kernel/bpf/bpf_inode_storage.c
kernel/bpf/bpf_task_storage.c
kernel/bpf/core.c

index e16e79f8cd6dc395068354ba3ca5eebcdb3d3cb0,44ccebc745e53f5f6983ae3cc013cacd4612cbf6..a51c82dee1bd8fea98a3b39b3c6126f56ad56deb
@@@ -16,6 -16,7 +16,6 @@@
  #include <uapi/linux/btf.h>
  #include <linux/bpf_lsm.h>
  #include <linux/btf_ids.h>
 -#include <linux/fdtable.h>
  #include <linux/rcupdate_trace.h>
  
  DEFINE_BPF_STORAGE_CACHE(inode_cache);
@@@ -99,7 -100,7 +99,7 @@@ static long bpf_fd_inode_storage_update
  
        sdata = bpf_local_storage_update(file_inode(fd_file(f)),
                                         (struct bpf_local_storage_map *)map,
-                                        value, map_flags, GFP_ATOMIC);
+                                        value, map_flags, false, GFP_ATOMIC);
        return PTR_ERR_OR_ZERO(sdata);
  }
  
@@@ -153,7 -154,7 +153,7 @@@ BPF_CALL_5(bpf_inode_storage_get, struc
        if (flags & BPF_LOCAL_STORAGE_GET_F_CREATE) {
                sdata = bpf_local_storage_update(
                        inode, (struct bpf_local_storage_map *)map, value,
-                       BPF_NOEXIST, gfp_flags);
+                       BPF_NOEXIST, false, gfp_flags);
                return IS_ERR(sdata) ? (unsigned long)NULL :
                                             (unsigned long)sdata->data;
        }
index 1eb9852a9f8ebb8cb1b08cce0ac68b8665d60d33,09705f9988f38bb8bc6a36e408aa20ab9a9bec9e..bf7fa15fdcc6cc79d141ab5b004fecf88dd11d06
@@@ -16,6 -16,7 +16,6 @@@
  #include <linux/filter.h>
  #include <uapi/linux/btf.h>
  #include <linux/btf_ids.h>
 -#include <linux/fdtable.h>
  #include <linux/rcupdate_trace.h>
  
  DEFINE_BPF_STORAGE_CACHE(task_cache);
@@@ -128,6 -129,9 +128,9 @@@ static long bpf_pid_task_storage_update
        struct pid *pid;
        int fd, err;
  
+       if ((map_flags & BPF_F_LOCK) && btf_record_has_field(map->record, BPF_UPTR))
+               return -EOPNOTSUPP;
        fd = *(int *)key;
        pid = pidfd_get_pid(fd, &f_flags);
        if (IS_ERR(pid))
        bpf_task_storage_lock();
        sdata = bpf_local_storage_update(
                task, (struct bpf_local_storage_map *)map, value, map_flags,
-               GFP_ATOMIC);
+               true, GFP_ATOMIC);
        bpf_task_storage_unlock();
  
        err = PTR_ERR_OR_ZERO(sdata);
@@@ -218,7 -222,7 +221,7 @@@ static void *__bpf_task_storage_get(str
            (flags & BPF_LOCAL_STORAGE_GET_F_CREATE) && nobusy) {
                sdata = bpf_local_storage_update(
                        task, (struct bpf_local_storage_map *)map, value,
-                       BPF_NOEXIST, gfp_flags);
+                       BPF_NOEXIST, false, gfp_flags);
                return IS_ERR(sdata) ? NULL : sdata->data;
        }
  
diff --combined kernel/bpf/core.c
index e303626bdb2f3d628a7b4fe9e493e0d70f07e86d,14d9288441f21d6c38184979c654c8c3a147dbfb..a2327c4fdc8bc67d42bb5518f6499430f660676a
@@@ -21,7 -21,7 +21,7 @@@
  #include <linux/filter.h>
  #include <linux/skbuff.h>
  #include <linux/vmalloc.h>
 -#include <linux/random.h>
 +#include <linux/prandom.h>
  #include <linux/bpf.h>
  #include <linux/btf.h>
  #include <linux/objtool.h>
@@@ -131,6 -131,7 +131,7 @@@ struct bpf_prog *bpf_prog_alloc_no_stat
        INIT_LIST_HEAD_RCU(&fp->aux->ksym_prefix.lnode);
  #endif
        mutex_init(&fp->aux->used_maps_mutex);
+       mutex_init(&fp->aux->ext_mutex);
        mutex_init(&fp->aux->dst_mutex);
  
        return fp;
@@@ -3044,6 -3045,11 +3045,11 @@@ bool __weak bpf_jit_supports_exceptions
        return false;
  }
  
+ bool __weak bpf_jit_supports_private_stack(void)
+ {
+       return false;
+ }
  void __weak arch_bpf_stack_walk(bool (*consume_fn)(void *cookie, u64 ip, u64 sp, u64 bp), void *cookie)
  {
  }
This page took 0.067725 seconds and 4 git commands to generate.