The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@google.com>
To: Suyuan Wang <shyckless@gmail.com>
Cc: pabeni@redhat.com, edumazet@kernel.org, davem@davemloft.net,
	 kuba@kernel.org, willemb@google.com, netdev@vger.kernel.org,
	 bpf@vger.kernel.org, martin.lau@linux.dev,
	linux-kernel@vger.kernel.org,  horms@kernel.org
Subject: Re: [PATCH net] net: reuseport: honour SO_LOCK_FILTER in SO_DETACH_REUSEPORT_BPF
Date: Sat, 28 Nov 2026 11:16:36 +0000	[thread overview]
Message-ID: <awq4A4oFnegEB9rO@google.com> (raw)
In-Reply-To: <20261122-reuseport-lock-filter-v1-1-a3e5324c8d55@gmail.com>

On Sun, 22 Nov 2026 08:17:26 +0000, Suyuan Wang wrote:
> From: Suyuan Wang <stevewong@hust.edu.cn>
> 
> SO_LOCK_FILTER lets a process lock the filters on a socket before
> handing it to a less privileged one. Once it is set, the existing attach
> and detach paths reject changes to the socket's BPF filters with -EPERM,
> but SO_DETACH_REUSEPORT_BPF does not check SOCK_FILTER_LOCKED. So an
> unprivileged process that receives a locked socket can still remove the
> reuseport program, which then changes how packets and connections are
> spread over the whole reuseport group.
> 
> Return -EPERM from reuseport_detach_prog() when the filter is locked,
> like sk_detach_filter() does.
> 
> Found with a static analysis tool and checked by hand.
> 
> Fixes: 99f3a064bc2e ("bpf: net: Add SO_DETACH_REUSEPORT_BPF")
> Cc: stable@vger.kernel.org
> Co-developed-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Suyuan Wang <stevewong@hust.edu.cn>

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

      parent reply	other threads:[~2026-11-28 11:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  8:17 [PATCH net] net: reuseport: honour SO_LOCK_FILTER in SO_DETACH_REUSEPORT_BPF Suyuan Wang via B4 Relay
2026-11-23  8:47 ` netdev-bot+sashiko
2026-11-23  9:01   ` Wong Steve
2026-11-23  9:04     ` Wong Steve
2026-11-28 11:16 ` Kuniyuki Iwashima [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=awq4A4oFnegEB9rO@google.com \
    --to=kuniyu@google.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shyckless@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