Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: shlomojune6@gmail.com
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, edumazet@kernel.org,
	kuniyu@google.com, pabeni@redhat.com, willemb@google.com,
	davem@davemloft.net, kuba@kernel.org, horms@kernel.org,
	audit@example.invalid
Subject: Re: [PATCH v1] net: sock_reuseport: check program type on the migration path
Date: Tue, 17 Nov 2026 15:27:09 +0000	[thread overview]
Message-ID: <179492922969.3136.7887984434455212903@kernel.org> (raw)
In-Reply-To: <20261115152408.48205-1-shlomojune6@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 0 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] net: sock_reuseport: placeholder Signed-off-by trailer in commit
  message
- [Low] The commit message says loading a BPF_PROG_TYPE_SOCKET_FILTER
  program with expected_attach_type=BPF_SK_REUSEPORT_SELECT_OR_MIGRATE…

--

net: sock_reuseport: check program type on the migration path

This commit makes reuseport_migrate_sock() and reuseport_stop_listen_sock()
treat a reuseport program as migration capable only when its type is
BPF_PROG_TYPE_SK_REUSEPORT. Checking expected_attach_type alone allowed a
SOCKET_FILTER program to run with a struct sk_reuseport_kern context.

> A BPF_PROG_TYPE_SOCKET_FILTER program can be loaded with
> expected_attach_type set to BPF_SK_REUSEPORT_SELECT_OR_MIGRATE and
> attached to a SO_REUSEPORT TCP group; both steps are allowed without
> CAP_BPF.

[Severity: Low]
Is "both steps are allowed without CAP_BPF" accurate for a default
configuration?

In bpf_prog_load() in kernel/bpf/syscall.c, this check runs before the
SOCKET_FILTER/CGROUP_SKB exemption for unprivileged loads:

kernel/bpf/syscall.c:bpf_prog_load() {
    ...
	if (sysctl_unprivileged_bpf_disabled && !bpf_cap)
		goto put_token;
    ...
}

The sysctl starts at 2 when CONFIG_BPF_UNPRIV_DEFAULT_OFF is enabled:

int sysctl_unprivileged_bpf_disabled __read_mostly =
	IS_BUILTIN(CONFIG_BPF_UNPRIV_DEFAULT_OFF) ? 2 : 0;

That Kconfig option is "default y" in kernel/bpf/Kconfig. So on a default
kernel, a task without CAP_BPF (or a BPF token granting it) can't load the
socket filter in the first place. Unprivileged users can only reach the
out-of-bounds access when kernel.unprivileged_bpf_disabled has been set
to 0.

Could the commit message mention that the unprivileged case depends on
this sysctl? That would help backporters and security triage judge the
exposure. The code change itself is not affected by this.

[Severity: High]
The author and Signed-off-by trailer both use the identity
Linux kernel audit <audit@example.invalid>. That isn't a person, and
the .invalid TLD is reserved (RFC 2606), so the address can never
receive mail.

Signed-off-by is the Developer's Certificate of Origin described in
Documentation/process/submitting-patches.rst. It certifies that a
specific person wrote the change or has the right to pass it on under
the kernel's license. A placeholder identity can't make that
certification. Nobody can be reached at this address if questions
about the patch come up later, so this can't be applied as is.

Could you resend with the author and Signed-off-by set to your real
name and a working email address? If you're forwarding a change
written by someone else, it needs the original author's sign-off
followed by your own. The code change itself is not affected by this.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261115152408.48205-1-shlomojune6%40gmail.com

      parent reply	other threads:[~2026-11-17 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 15:24 [PATCH v1] net: sock_reuseport: check program type on the migration path Shihuang Liu
2026-11-15 15:28 ` netdev-bot+sinfo
2026-11-15 15:43 ` J4f J4f
2026-11-17 15:27 ` netdev-bot+sashiko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179492922969.3136.7887984434455212903@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=audit@example.invalid \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shlomojune6@gmail.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox