From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Zhiling Zou" <zhilinz@nebusec.ai>, <netdev@vger.kernel.org>,
<bpf@vger.kernel.org>
Cc: <davem@davemloft.net>, <edumazet@kernel.org>, <pabeni@redhat.com>,
<horms@kernel.org>, <martin.lau@kernel.org>,
<kafai.wan@linux.dev>, <yhs@fb.com>, <vega@nebusec.ai>
Subject: Re: [PATCH net 1/1] bpf: reject unsafe pointers in TCP congestion control access
Date: Fri, 16 Oct 2026 02:25:04 +0000 [thread overview]
Message-ID: <DM5WMW2M6YYO.2X4FN4OPSQGJH@gmail.com> (raw)
In-Reply-To: <ae0f5aedfff54432f75c7bd4d369166c028497b0.1791978740.git.zhilinz@nebusec.ai>
On Wed, Oct 14, 2026 at 07:57 PM Zhiling Zou <zhilinz@nebusec.ai> wrote:
> bpf_tcp_ca_btf_struct_access() authorizes writes based on the BTF type
> and member offset, but does not check pointer modifiers. A BPF program
> can use bpf_rdonly_cast() to create an untrusted tcp_sock pointer and
> write through an allowlisted member, bypassing the read-only cast.
Not anymore. It was fixed in July. See
commit ac65c710cc64 ("bpf: Reject writes through untrusted BTF pointers")
and the follow up
commit ee9ad135b208 ("bpf: Reject a store through a fault prone pointer").
check_ptr_to_btf_access() rejects such store with
"only read is supported" before it calls any btf_struct_access callback.
progs/tcp_ca_untrusted_btf_write.c is the same prog as your PoC.
All of that is in 7.3-rc1, so net tree has it and this hunk is dead code.
The splat in the cover letter is from 6.12.95.
6.18.y and 7.2.y have ac65c710cc64. 6.12.y and 6.6.y don't.
nf_conn, sched_ext and hid-bpf callbacks in 6.12.y have the same issue,
so patching tcp_ca alone doesn't help there either.
Pls send the backport of ac65c710cc64 to stable instead.
pw-bot: cr
next prev parent reply other threads:[~2026-10-16 2:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 11:57 [PATCH net 0/1] bpf: reject unsafe pointers in TCP congestion control access Zhiling Zou
2026-10-14 11:57 ` [PATCH net 1/1] " Zhiling Zou
2026-10-15 11:58 ` sashiko-bot
2026-10-16 2:25 ` Alexei Starovoitov [this message]
2026-10-16 4:55 ` zhilin zou
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=DM5WMW2M6YYO.2X4FN4OPSQGJH@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kafai.wan@linux.dev \
--cc=martin.lau@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vega@nebusec.ai \
--cc=yhs@fb.com \
--cc=zhilinz@nebusec.ai \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.