🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
59 messages
59 total messages Page 2 of 2 Started by Alexei Starovoitov Sat, 17 Oct 2026 16:37
Page 2 of 2 • 59 total messages
Re: [PATCH bpf-next v2 39/43] bpf: Refuse the prologue for an extension that cannot take it
#4407
Author: bot+bpf-ci
Date: Sat, 17 Oct 2026 17:16
90 lines
8921 bytes
--===============0799593762278955704==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

> bpf: Refuse the prologue for an extension that cannot take it

TL;DR: The new check may wrongly reject XDP, SK_MSG and CGROUP_SOCKOPT
extensions that write packet data, since their prologues emit nothing.
Programs that loaded before could fail with -EINVAL, including on stable.

> diff --git a/kernel/bpf/fixups.c b/kernel/bpf/fixups.c
> --- a/kernel/bpf/fixups.c
> +++ b/kernel/bpf/fixups.c

[ ... ]

> @@ -909,6 +928,13 @@ int bpf_convert_ctx_accesses(struct bpf_verifier_env *env)
>  			verifier_bug(env, "gen_prologue is null");
>  			return -EFAULT;
>  		}
> +		if (env->seen_direct_write &&
> +		    env->prog->type == BPF_PROG_TYPE_EXT &&
> +		    !ext_prog_takes_prologue(env)) {
> +			verbose(env,
> +				"Extension writing packet data must take ctx and scalars only\n");
> +			return -EINVAL;
> +		}
>  		cnt = ops->gen_prologue(insn_buf, env->seen_direct_write,
>  					env->prog);
>  		if (cnt >= INSN_BUF_SIZE) {

Does this check reject extensions that never get a register-touching
prologue?

An extension inherits the verifier ops of its target, and
may_access_direct_pkt_data() sets seen_direct_write for SCHED_CLS,
SCHED_ACT, LWT_XMIT, SK_SKB, XDP, SK_MSG and CGROUP_SOCKOPT.  Only the
first four end up in bpf_unclone_prologue(), through tc_cls_act_prologue()
or sk_skb_prologue().

XDP and SK_MSG use bpf_noop_prologue(), and CGROUP_SOCKOPT uses
cg_sockopt_get_prologue().  Both return 0 and emit no instructions:

    static int bpf_noop_prologue(struct bpf_insn *insn_buf, bool direct_write,
                                 const struct bpf_prog *prog)
    {
            /* Neither direct read nor direct write requires any preliminary
             * action.
             */
            return 0;
    }

The new check runs before gen_prologue() and never looks at what the
prologue is, so for these types nothing is patched in front of the
extension and no register is read or clobbered.

An XDP extension that writes packet data is now refused with -EINVAL if its
first argument is not the ctx, or if any other argument is not a scalar.
For example, freplace of:

    int f(__u32 idx, struct xdp_md *ctx)
    int f(struct xdp_md *ctx, struct cfg *cfg)   (ARG_PTR_TO_MEM)

or of any function taking a struct bpf_dynptr * argument.
check_special_kfunc() also sets seen_direct_write for bpf_dynptr_slice_rdwr()
on any dynptr type.

These programs loaded and ran correctly before this patch.  Since the patch
carries a Fixes: tag, the load failure would also reach stable kernels.

The commit message says "A program that writes to packet data starts with
bpf_unclone_prologue()".  Is that accurate for XDP, SK_MSG and
CGROUP_SOCKOPT?

Would it be better to run the check after ops->gen_prologue() and only
when it returned a non-zero cnt, i.e. when a prologue that assumes R1 is
the ctx is actually emitted?

No later commit in the series (222dc092c64e..64e0b112d688) touches this
check.


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/39051545464
--===============0799593762278955704==--
Re: [PATCH bpf-next v2 16/43] bpf: Link the first element after its storage is published
#4405
Author: bot+bpf-ci
Date: Sat, 17 Oct 2026 17:17
68 lines
8728 bytes
--===============1420937528216665879==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

> bpf: Link the first element after its storage is published

TL;DR: Commit message only: the Fixes: tag may point at the wrong commit; the
lockless iterator exposure looks introduced by c69d2ddb2072, not 5ce6e77c7edf.
The code change itself isn't questioned.

>     bpf: Link the first element after its storage is published
>
>     bpf_local_storage_alloc() links the first element of a new storage to the
>     bucket of its map, and then publishes the storage in the owner with
>     cmpxchg().  If another cpu has been faster, the element is taken out of
>     the bucket again and is freed together with the storage.
>
>     In between the iterator over a sk_storage map can find the element.  It
>     stays linked to a storage that points to the socket, but the socket knows
>     nothing of that storage: bpf_sk_storage_free() neither unlinks the element
>     nor waits for anybody who uses the storage.  So nothing tells the iterator
>     that the socket has gone away.
>
>     Three cpus that create the first storage of a new AF_UNIX socket at the
>     same time, and a fourth that reads the iterator, are enough: in 20 seconds
>     its program was shown some 4000 elements of storages that had lost.  If the
>     socket is closed in time, the program is handed a freed socket.
>
>     Link the element once the storage is published.  Both happens under the
>     lock of the bucket, which holds off whoever finds the element through the
>     owner and wants to unlink it.
>
>     Fixes: 5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map")
>     Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Is this the right commit for the Fixes: tag?

5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map")
held the bucket lock (raw_spin_lock_bh(&b->lock)) for the whole time it
handed an element to the program.  The losing sk_storage_alloc() could
therefore not run selem_unlink_map() and free the storage until the
iterator had moved on, and the socket stayed alive because the allocating
caller still held it.

The element was already linked before the cmpxchg() back then, but nothing
walked the bucket list locklessly.  The old comment in the alloc path even
says that nobody accesses first_selem from the bucket list under
rcu_read_lock().

The lockless exposure looks like it came from c69d2ddb2072 ("bpf: Using
rcu_read_lock for bpf_sk_storage_map iterator"), which replaced the bucket
lock in bpf_sk_storage_map_seq_find_next()/seq_stop() with rcu_read_lock().
From then on the iterator can see the transiently linked first_selem of a
losing storage without excluding its unlink and free.

Should this be:

  Fixes: c69d2ddb2072 ("bpf: Using rcu_read_lock for bpf_sk_storage_map iterator")


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/39051545464
--===============1420937528216665879==--
Re: [PATCH bpf-next v2 26/43] bpf: Don't take an extension for an iterator program
#4411
Author: bot+bpf-ci
Date: Sat, 17 Oct 2026 17:17
93 lines
9224 bytes
--===============6818153484382916465==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

> bpf: Don't take an extension for an iterator program

TL;DR: The new EXT check in bpf_iter_prog_supported() may be incomplete: a
TRACING/BPF_TRACE_ITER program attached to a JITed program's function can
still reach it, possibly corrupting the iterator target's btf_id cache and
ctx_arg_info.

> diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
> index 4668c1696a08..5fd376bd210b 100644
> --- a/kernel/bpf/bpf_iter.c
> +++ b/kernel/bpf/bpf_iter.c
> @@ -351,6 +351,13 @@ int bpf_iter_prog_supported(struct bpf_prog *prog)
>  	const char *prefix = BPF_ITER_FUNC_PREFIX;
>  	int prefix_len = strlen(prefix);
>  
> +	/*
> +	 * The attach function of an extension is a subprogram of the iterator
> +	 * program that it extends, whatever its name is.
> +	 */
> +	if (prog->type == BPF_PROG_TYPE_EXT)
> +		return -EINVAL;
> +
>  	if (strncmp(attach_fname, prefix, prefix_len))
>  		return -EINVAL;

Is this check enough, or can the same problem be reached without an
extension?

A BPF_PROG_TYPE_TRACING program loaded with expected_attach_type set to
BPF_TRACE_ITER, attach_prog_fd pointing at a JITed program P1, and
attach_btf_id set to a global function of P1 named bpf_iter_bpf_map_elem
looks like it gets here too.  bpf_prog_load_check_attach() has no
BPF_PROG_TYPE_TRACING case that rejects it, and in
bpf_check_attach_target() the BPF_TRACE_ITER case with tgt_prog set only
does:

    btf_type_is_func() / func_proto checks
    btf_distill_func_proto()

Unlike the BPF_TRACE_RAW_TP case just above it, it never rejects tgt_prog.

check_attach_btf_id() then stores the subprogram name of P1 in
prog->aux->attach_func_name and calls bpf_iter_prog_supported().  Since
prog->type is BPF_PROG_TYPE_TRACING here, the new check does not refuse it:

    bpf_check()
      check_attach_btf_id()
        bpf_check_attach_target()
        bpf_iter_prog_supported()
          cache_btf_id()
            tinfo->btf_id = prog->aux->attach_btf_id

The 'bpf_iter_' prefix matches and strcmp() against reg_info->target
matches, so cache_btf_id() caches an id from P1's BTF as the btf_id of the
target, and bpf_prog_ctx_arg_info_init() copies the target's ctx_arg_info.
This happens at check_attach_btf_id() time, so it persists even if the load
fails later.

After that, bpf_iter_link_attach() compares iter->btf_id with the poisoned
id, so already loaded programs of that target fail with -ENOENT.  A vmlinux
BTF program whose attach_btf_id equals the forged id would be matched to the
wrong target (and the wrong ctx_arg_info) by the first branch of the loop in
bpf_iter_prog_supported().

The out-of-bounds buffer access described in the commit message does not
seem to apply to this route, since the program being attached is the one
whose max_rdonly_access is recorded.  Only the btf_id cache corruption and
the ctx_arg_info mix-up remain.  It needs CAP_BPF and CAP_PERFMON, the same
as the extension case.

Would it be better to refuse any program that has a dst_prog here, for
example:

    if (prog->aux->dst_prog)
        return -EINVAL;

That also covers all extensions, since they always have one.  Alternatively,
could bpf_check_attach_target() reject tgt_prog for BPF_TRACE_ITER, as it
does for BPF_TRACE_RAW_TP?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/39051545464
--===============6818153484382916465==--
Re: [PATCH bpf-next v2 40/43] bpf: Unclone the skb for kfuncs that write through a dynptr
#4409
Author: bot+bpf-ci
Date: Sat, 17 Oct 2026 17:17
96 lines
9535 bytes
--===============5053280035690465242==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

> bpf: Unclone the skb for kfuncs that write through a dynptr

TL;DR: Dynptr-writing kfuncs may set seen_direct_write for programs with no
skb (XDP, global functions, callbacks), so freplace extensions with non-scalar
args that loaded before may now fail with -EINVAL.

> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index d384b9ec3d93..47e2969928a4 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c

[ ... ]

> @@ -15689,6 +15689,14 @@ static int check_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
>  	    bpf_is_kfunc_pkt_changing(&meta))
>  		clear_all_pkt_pointers(env);
>
> +	/*
> +	 * These kfuncs write to the head of the skb in place if what they write
> +	 * to is linear. Like a direct write that takes bpf_unclone_prologue().
> +	 */
> +	if (is_kfunc_dynptr_write(&meta) &&
> +	    dynptr_write_changes_pkt_data(meta.dynptr_write_type))
> +		may_access_direct_pkt_data(env, NULL, BPF_WRITE);

Can this set env->seen_direct_write for a program that has no skb to
write to, and make an extension fail to load?

Since commit 19b8e38bcd08 ("bpf: Don't take a dynptr argument for a local
dynptr"), process_dynptr_func() reports every CONST_PTR_TO_DYNPTR argument
as an skb dynptr:

    meta->dynptr.type = is_arg ? BPF_DYNPTR_TYPE_SKB : reg->dynptr.type;

That covers dynptr arguments of global functions and extensions, and
callback dynptrs, in any program type.

may_access_direct_pkt_data(env, NULL, BPF_WRITE) also sets seen_direct_write
for XDP, SK_MSG and CGROUP_SOCKOPT.  None of those can hold an skb or
skb_meta dynptr, since bpf_kfunc_set_skb and bpf_kfunc_set_skb_meta are not
registered for them.  Their gen_prologue is bpf_noop_prologue() or
cg_sockopt_get_prologue(), which emit nothing.

seen_direct_write is now also read by the extension check that commit
222dc092c64e ("bpf: Refuse the prologue for an extension that cannot take
it") added to bpf_convert_ctx_accesses():

    if (env->seen_direct_write &&
        env->prog->type == BPF_PROG_TYPE_EXT &&
        !ext_prog_takes_prologue(env)) {
            verbose(env, "Extension writing packet data must take ctx and scalars only\n");
            return -EINVAL;
    }

This runs before gen_prologue(), so it fires even when the prologue would be
empty.

For example, take an XDP target with a global function:

    int f(struct xdp_md *ctx, struct bpf_dynptr *d)

that calls bpf_dynptr_memset(d, ...), and an freplace program for f that
does the same.  In the extension R2 is CONST_PTR_TO_DYNPTR, so
meta.dynptr_write_type becomes BPF_DYNPTR_TYPE_SKB and the new code sets
seen_direct_write.  ext_prog_takes_prologue() then fails because args[1] is
ARG_PTR_TO_DYNPTR and not ARG_SCALAR, and the load fails with -EINVAL.
Before this patch the program loaded, and nothing in it can touch an skb.

The same applies to bpf_dynptr_copy() and the probe_read/copy_from_user
dynptr kfuncs, and to callback dynptrs (for example bpf_user_ringbuf_drain())
in an extension whose signature has a non-scalar argument.  Extensions on tc
programs with such signatures are refused as well, even when every caller
passes a local dynptr.

Commit 19b8e38bcd08 says "nothing becomes forbidden for the dynptr itself",
but this makes the load fail for those programs.

Should seen_direct_write only be set for program types whose skb dynptr is
writable?  Alternatively, could the extension refusal depend on
gen_prologue() actually emitting instructions?

I did not find a later patch in this series that changes this.


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/39051545464
--===============5053280035690465242==--
Re: [PATCH bpf-next v2 38/43] bpf: Don't take a dynptr argument for a local dynptr
#4406
Author: bot+bpf-ci
Date: Sat, 17 Oct 2026 17:17
115 lines
10222 bytes
--===============8715040808449314494==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

> bpf: Don't take a dynptr argument for a local dynptr

TL;DR: Treating every CONST_PTR_TO_DYNPTR as an skb dynptr also hits the
bpf_user_ringbuf_drain() callback's local dynptr, so the verifier may falsely
reject valid programs; nothing unsafe.

> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c

[ ... ]

> @@ -8416,6 +8416,7 @@ static int process_dynptr_func(struct bpf_verifier_env *env, struct bpf_reg_stat
>  			       argno_t argno, int insn_idx, enum bpf_arg_type arg_type,
>  			       struct bpf_call_arg_meta *meta)
>  {
> +	bool is_arg = reg->type == CONST_PTR_TO_DYNPTR;
>  	int spi, err = 0;

[ ... ]

> @@ -8502,7 +8503,12 @@ static int process_dynptr_func(struct bpf_verifier_env *env, struct bpf_reg_stat
>  			reg = &bpf_stack_slot(state, spi)->spilled_ptr;
>  		}
>
> -		meta->dynptr.type = reg->dynptr.type;
> +		/*
> +		 * The callers of a global function may hand in a dynptr of any
> +		 * type. Take it for that of an skb, so that a write through it
> +		 * and its slices are treated with care.
> +		 */
> +		meta->dynptr.type = is_arg ? BPF_DYNPTR_TYPE_SKB : reg->dynptr.type;
>  		meta->dynptr.id = reg->id;
>  		meta->dynptr.parent_id = reg->parent_id;
>  	}

Is is_arg limited to global function arguments?

It is just reg->type == CONST_PTR_TO_DYNPTR, and global subprog arguments
are not the only registers of that type.  set_user_ringbuf_callback_state()
also creates one for the bpf_user_ringbuf_drain() callback:

    mark_dynptr_cb_reg(env, &callee->regs[BPF_REG_1], BPF_DYNPTR_TYPE_LOCAL);

and the type of that dynptr is known.  bpf_user_ringbuf_drain() always
passes a local dynptr over the ring sample (kernel/bpf/ringbuf.c):

    bpf_dynptr_init(&dynptr, sample, BPF_DYNPTR_TYPE_LOCAL, 0, size);

After this patch, every consumer of meta->dynptr.type seems to treat the
callback sample as an skb dynptr:

- bpf_dynptr_write(sample, ...) in the callback hits

      if (dynptr_write_changes_pkt_data(dynptr_type))
              changes_data = true;

  in check_helper_call(), which ends up in clear_all_pkt_pointers().  The
  callback is a sync callback verified inside the caller's state, and
  bpf_for_each_reg_in_vstate() walks every frame, so packet pointers held
  by a calling tc/XDP program across bpf_user_ringbuf_drain() would be
  invalidated.  The dynptr-writing kfuncs (bpf_dynptr_memset(),
  bpf_dynptr_copy() on the sample) go through dynptr_write_type and behave
  the same way.

- bpf_dynptr_slice(sample, ...) now returns PTR_TO_MEM | DYNPTR_TYPE_SKB,
  which makes reg_is_dynptr_slice_pkt() true.  In any program type, that
  slice is then invalidated by a call to a global function marked
  changes_pkt_data.  Since c84400f5fe42 earlier in this series, that mark
  covers any global function that calls bpf_dynptr_write(), even just to
  fill a ringbuf record.  Passing the slice to such a function is also
  refused ("cannot pass packet pointer ... function may change packet
  data").

- bpf_dynptr_clone(sample, &c) now makes an SKB-typed clone, which carries
  the same effects.

For example, a syscall or tracing program whose drain callback does:

    m = bpf_dynptr_slice(d, 0, &buf, sizeof(buf));
    if (m)
            handle(m);

where handle(const struct msg *) is a global function that copies *m into
a ringbuf with bpf_dynptr_write(), was accepted before this patch and
looks like it is rejected after it, although no skb is involved.  Nothing
is unsafe here, but it is a false rejection of valid programs that the
commit message does not describe.

Could the SKB assumption be applied only to dynptrs set up as global
subprog arguments, for example by marking them differently where the
subprog argument setup currently calls:

    __mark_dynptr_reg(reg, BPF_DYNPTR_TYPE_LOCAL, true, ++env->id_gen, 0)

and leaving the type of the callback dynptr as BPF_DYNPTR_TYPE_LOCAL?  That
would also make the new comment match the code.

None of the later commits in this series (222dc092c64e, e17707d54c68,
0bd8e7a834ac, c04474b8dc8d, 64e0b112d688) change this, and e17707d54c68
and 64e0b112d688 add more consumers of the SKB classification.


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/39051545464
--===============8715040808449314494==--
Re: [PATCH bpf-next v2 00/43] bpf: Memory safety, lifetime and locking fixes
#4429
Author: patchwork-bot+netdevbpf
Date: Sat, 17 Oct 2026 22:10
110 lines
11688 bytes
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Sat, 17 Oct 2026 16:37:02 +0000 you wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> This series collects fixes for bugs in the BPF core, the verifier and the
> BPF side of the networking stack. Most of them are from Josef.
> 
> Every bug was reproduced in a VM on top of bpf-next, on the kernel right
> before and right after the patch that fixes it. The splats are in the
> commit logs. That goes for what the reviews of v1 have found as well.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,01/43] bpf: use the frame mem type in devmap egress XDP
    https://git.kernel.org/bpf/bpf-next/c/b3ca872947ef
  - [bpf-next,v2,02/43] bpf: forbid sleeping in hash map for_each callbacks
    https://git.kernel.org/bpf/bpf-next/c/9bdd5e7f5d83
  - [bpf-next,v2,03/43] bpf: don't leak the inode when token creation fails
    https://git.kernel.org/bpf/bpf-next/c/f52b699c8863
  - [bpf-next,v2,04/43] bpf: don't hand out a linked element as extra element
    https://git.kernel.org/bpf/bpf-next/c/ccb88db8dac8
  - [bpf-next,v2,05/43] bpf: reject sleepable programs for task_vma iterator
    https://git.kernel.org/bpf/bpf-next/c/dfcd17659112
  - [bpf-next,v2,06/43] bpf: forbid sleeping in bpf_find_vma() callbacks
    https://git.kernel.org/bpf/bpf-next/c/c6dc0a288d4e
  - [bpf-next,v2,07/43] bpf: look at all 64 bits of a BPF_JSET mask on 32-bit
    https://git.kernel.org/bpf/bpf-next/c/ee4f44e0e3c8
  - [bpf-next,v2,08/43] bpf: don't let bpf_skb_adjust_room() use up the MSS
    https://git.kernel.org/bpf/bpf-next/c/12d07c38e1b0
  - [bpf-next,v2,09/43] bpf: Read the probe of a perf event under event_mutex
    https://git.kernel.org/bpf/bpf-next/c/3ccd700543f1
  - [bpf-next,v2,10/43] bpf: Don't saturate owner_refcnt on the last unpin
    https://git.kernel.org/bpf/bpf-next/c/30a140c9d479
  - [bpf-next,v2,11/43] bpf: Validate the SRH which End.DT6 uncovers in End.BPF
    https://git.kernel.org/bpf/bpf-next/c/e8b084646b94
  - [bpf-next,v2,12/43] bpf: Pull the inner header for End.DT6 in End.BPF
    https://git.kernel.org/bpf/bpf-next/c/434324c611a9
  - [bpf-next,v2,13/43] bpf: Update the SRH state if End.B6 fails late
    https://git.kernel.org/bpf/bpf-next/c/427e751a231a
  - [bpf-next,v2,14/43] bpf: Clear sk_refcnt of a clone before its storage is linked
    https://git.kernel.org/bpf/bpf-next/c/22f100bd0134
  - [bpf-next,v2,15/43] bpf: Fix NULL deref in the sk_storage map iterator
    https://git.kernel.org/bpf/bpf-next/c/6186c9711ac6
  - [bpf-next,v2,16/43] bpf: Link the first element after its storage is published
    https://git.kernel.org/bpf/bpf-next/c/bd897919e4dc
  - [bpf-next,v2,17/43] bpf: Hold the socket in the sk_storage map iterator
    https://git.kernel.org/bpf/bpf-next/c/070a96b2a98f
  - [bpf-next,v2,18/43] bpf: Bound the nesting that the BTF show code follows
    https://git.kernel.org/bpf/bpf-next/c/13ac7c05bc45
  - [bpf-next,v2,19/43] bpf: Check the new program of an iterator link update
    https://git.kernel.org/bpf/bpf-next/c/45e912fb1db0
  - [bpf-next,v2,20/43] bpf: Fix stale offload->prog pointer after realloc
    https://git.kernel.org/bpf/bpf-next/c/8e83d5359644
  - [bpf-next,v2,21/43] bpf: Don't bind a program to a netdev that goes away
    https://git.kernel.org/bpf/bpf-next/c/af929bc938e0
  - [bpf-next,v2,22/43] bpf: Keep a program until its bpf_wq callback has ended
    https://git.kernel.org/bpf/bpf-next/c/1e28a5e52d32
  - [bpf-next,v2,23/43] bpf: Count sleepable callbacks as sleepable map users
    https://git.kernel.org/bpf/bpf-next/c/927c9c985f3e
  - [bpf-next,v2,24/43] bpf: Check the maps that sleepable callbacks use
    https://git.kernel.org/bpf/bpf-next/c/3e6d7522af2c
  - [bpf-next,v2,25/43] bpf: Assume no bounds for buffers behind a tail call
    https://git.kernel.org/bpf/bpf-next/c/7fa323d77688
  - [bpf-next,v2,26/43] bpf: Don't take an extension for an iterator program
    https://git.kernel.org/bpf/bpf-next/c/7cc639dc45c5
  - [bpf-next,v2,27/43] bpf: Assume no bounds for a writable tp with tail calls
    https://git.kernel.org/bpf/bpf-next/c/cd0490e671d7
  - [bpf-next,v2,28/43] bpf: Don't take an extension for a writable raw tracepoint program
    https://git.kernel.org/bpf/bpf-next/c/7fe348f18b37
  - [bpf-next,v2,29/43] bpf: Keep iterator programs off special map fields
    https://git.kernel.org/bpf/bpf-next/c/8d0358f6e8b3
  - [bpf-next,v2,30/43] bpf: Free what map_free() unlinks for sleepable readers
    https://git.kernel.org/bpf/bpf-next/c/5bdd61e98da5
  - [bpf-next,v2,31/43] bpf: Keep values of a dead owner for sleepable programs
    (no matching commit)
  - [bpf-next,v2,32/43] bpf: Don't take an extension for a function that runs sleepable
    (no matching commit)
  - [bpf-next,v2,33/43] bpf: Keep the symbols of a program until it has ended
    (no matching commit)
  - [bpf-next,v2,34/43] bpf: Use the socket of a sk_lookup test run under RCU
    (no matching commit)
  - [bpf-next,v2,35/43] bpf, cpumap: Hold the device of frames in the queue
    (no matching commit)
  - [bpf-next,v2,36/43] bpf: Drop packet pointers behind kfuncs writing an skb
    (no matching commit)
  - [bpf-next,v2,37/43] bpf: Let bpf_dynptr_write() mark a global function
    (no matching commit)
  - [bpf-next,v2,38/43] bpf: Don't take a dynptr argument for a local dynptr
    (no matching commit)
  - [bpf-next,v2,39/43] bpf: Refuse the prologue for an extension that cannot take it
    (no matching commit)
  - [bpf-next,v2,40/43] bpf: Unclone the skb for kfuncs that write through a dynptr
    (no matching commit)
  - [bpf-next,v2,41/43] bpf: Follow the head if an skb is written from a slice
    (no matching commit)
  - [bpf-next,v2,42/43] bpf: Use memmove() to store bytes in an skb
    (no matching commit)
  - [bpf-next,v2,43/43] bpf: Refuse packet slices for packet-changing helpers
    (no matching commit)

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH bpf-next v2 04/43] bpf: don't hand out a linked element as extra element
#4515
Author: kernel test robot
Date: Sun, 18 Oct 2026 09:39
86 lines
11654 bytes
Hi Alexei,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 458575e1f2ddea944d679fe778c92e370a9b61a4]

url:    https://github.com/intel-lab-lkp/linux/commits/Alexei-Starovoitov/bpf-use-the-frame-mem-type-in-devmap-egress-XDP/20261017-163703
base:   458575e1f2ddea944d679fe778c92e370a9b61a4
patch link:    https://lore.kernel.org/r/20261017163745.3341787-5-alexei.starovoitov%40gmail.com
patch subject: [PATCH bpf-next v2 04/43] bpf: don't hand out a linked element as extra element
config: arc-randconfig-1000-20261018 (https://download.01.org/0day-ci/archive/20261018/202610181750.BoqAddaF-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261018/202610181750.BoqAddaF-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610181750.BoqAddaF-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/atomic.h:80,
                    from include/asm-generic/bitops/lock.h:5,
                    from arch/arc/include/asm/bitops.h:190,
                    from include/linux/bitops.h:67,
                    from include/linux/log2.h:12,
                    from include/asm-generic/div64.h:55,
                    from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/math.h:6,
                    from include/linux/math64.h:6,
                    from include/linux/time64.h:5,
                    from include/linux/restart_block.h:9,
                    from include/linux/thread_info.h:14,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/arc/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:107,
                    from include/linux/alloc_tag.h:11,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:12,
                    from kernel/bpf/hashtab.c:5:
   kernel/bpf/hashtab.c: In function 'alloc_htab_elem':
   include/linux/atomic/atomic-arch-fallback.h:384:27: error: implicit declaration of function 'arch_cmpxchg_local'; did you mean 'raw_cmpxchg_local'? [-Werror=implicit-function-declaration]
     384 | #define raw_cmpxchg_local arch_cmpxchg_local
         |                           ^~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:392:16: note: in expansion of macro 'raw_cmpxchg_local'
     392 |         ___r = raw_cmpxchg_local((_ptr), ___o, (_new)); \
         |                ^~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:5022:9: note: in expansion of macro 'raw_try_cmpxchg_local'
    5022 |         raw_try_cmpxchg_local(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/hashtab.c:1292:35: note: in expansion of macro 'try_cmpxchg_local'
    1292 |                         } while (!try_cmpxchg_local(pl_new, &l_new, NULL));
         |                                   ^~~~~~~~~~~~~~~~~
>> include/linux/atomic/atomic-arch-fallback.h:392:14: warning: assignment to 'struct htab_elem *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     392 |         ___r = raw_cmpxchg_local((_ptr), ___o, (_new)); \
         |              ^
   include/linux/atomic/atomic-instrumented.h:5022:9: note: in expansion of macro 'raw_try_cmpxchg_local'
    5022 |         raw_try_cmpxchg_local(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/hashtab.c:1292:35: note: in expansion of macro 'try_cmpxchg_local'
    1292 |                         } while (!try_cmpxchg_local(pl_new, &l_new, NULL));
         |                                   ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +392 include/linux/atomic/atomic-arch-fallback.h

8c8b096a23d12f Peter Zijlstra 2023-05-31  385  
9257959a6e5b4f Mark Rutland   2023-06-05  386  #ifdef arch_try_cmpxchg_local
9257959a6e5b4f Mark Rutland   2023-06-05  387  #define raw_try_cmpxchg_local arch_try_cmpxchg_local
9257959a6e5b4f Mark Rutland   2023-06-05  388  #else
9257959a6e5b4f Mark Rutland   2023-06-05  389  #define raw_try_cmpxchg_local(_ptr, _oldp, _new) \
9257959a6e5b4f Mark Rutland   2023-06-05  390  ({ \
9257959a6e5b4f Mark Rutland   2023-06-05  391  	typeof(*(_ptr)) *___op = (_oldp), ___o = *___op, ___r; \
9257959a6e5b4f Mark Rutland   2023-06-05 @392  	___r = raw_cmpxchg_local((_ptr), ___o, (_new)); \
9257959a6e5b4f Mark Rutland   2023-06-05  393  	if (unlikely(___r != ___o)) \
9257959a6e5b4f Mark Rutland   2023-06-05  394  		*___op = ___r; \
9257959a6e5b4f Mark Rutland   2023-06-05  395  	likely(___r == ___o); \
9257959a6e5b4f Mark Rutland   2023-06-05  396  })
8c8b096a23d12f Peter Zijlstra 2023-05-31  397  #endif
8c8b096a23d12f Peter Zijlstra 2023-05-31  398  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH bpf-next v2 04/43] bpf: don't hand out a linked element as extra element
#4540
Author: kernel test robot
Date: Sun, 18 Oct 2026 12:06
75 lines
10844 bytes
Hi Alexei,

kernel test robot noticed the following build errors:

[auto build test ERROR on 458575e1f2ddea944d679fe778c92e370a9b61a4]

url:    https://github.com/intel-lab-lkp/linux/commits/Alexei-Starovoitov/bpf-use-the-frame-mem-type-in-devmap-egress-XDP/20261017-163703
base:   458575e1f2ddea944d679fe778c92e370a9b61a4
patch link:    https://lore.kernel.org/r/20261017163745.3341787-5-alexei.starovoitov%40gmail.com
patch subject: [PATCH bpf-next v2 04/43] bpf: don't hand out a linked element as extra element
config: arc-randconfig-1000-20261018 (https://download.01.org/0day-ci/archive/20261018/202610182013.abPmS8oP-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261018/202610182013.abPmS8oP-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610182013.abPmS8oP-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/atomic.h:80,
                    from include/asm-generic/bitops/lock.h:5,
                    from arch/arc/include/asm/bitops.h:190,
                    from include/linux/bitops.h:67,
                    from include/linux/log2.h:12,
                    from include/asm-generic/div64.h:55,
                    from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/math.h:6,
                    from include/linux/math64.h:6,
                    from include/linux/time64.h:5,
                    from include/linux/restart_block.h:9,
                    from include/linux/thread_info.h:14,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/arc/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:107,
                    from include/linux/alloc_tag.h:11,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:12,
                    from kernel/bpf/hashtab.c:5:
   kernel/bpf/hashtab.c: In function 'alloc_htab_elem':
>> include/linux/atomic/atomic-arch-fallback.h:384:27: error: implicit declaration of function 'arch_cmpxchg_local'; did you mean 'raw_cmpxchg_local'? [-Werror=implicit-function-declaration]
     384 | #define raw_cmpxchg_local arch_cmpxchg_local
         |                           ^~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:392:16: note: in expansion of macro 'raw_cmpxchg_local'
     392 |         ___r = raw_cmpxchg_local((_ptr), ___o, (_new)); \
         |                ^~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:5022:9: note: in expansion of macro 'raw_try_cmpxchg_local'
    5022 |         raw_try_cmpxchg_local(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/hashtab.c:1292:35: note: in expansion of macro 'try_cmpxchg_local'
    1292 |                         } while (!try_cmpxchg_local(pl_new, &l_new, NULL));
         |                                   ^~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:392:14: warning: assignment to 'struct htab_elem *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     392 |         ___r = raw_cmpxchg_local((_ptr), ___o, (_new)); \
         |              ^
   include/linux/atomic/atomic-instrumented.h:5022:9: note: in expansion of macro 'raw_try_cmpxchg_local'
    5022 |         raw_try_cmpxchg_local(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/hashtab.c:1292:35: note: in expansion of macro 'try_cmpxchg_local'
    1292 |                         } while (!try_cmpxchg_local(pl_new, &l_new, NULL));
         |                                   ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +384 include/linux/atomic/atomic-arch-fallback.h

8c8b096a23d12f Peter Zijlstra 2023-05-31  383  
9257959a6e5b4f Mark Rutland   2023-06-05 @384  #define raw_cmpxchg_local arch_cmpxchg_local
8c8b096a23d12f Peter Zijlstra 2023-05-31  385  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Page 2 of 2 • 59 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads