[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260207230720.2542943-1-kuniyu@google.com>
Date: Sat, 7 Feb 2026 23:07:09 +0000
From: Kuniyuki Iwashima <kuniyu@...gle.com>
To: Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, Martin KaFai Lau <martin.lau@...ux.dev>
Cc: John Fastabend <john.fastabend@...il.com>, Eduard Zingerman <eddyz87@...il.com>,
Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
Michal Luczaj <mhal@...x.co>, Kuniyuki Iwashima <kuniyu@...gle.com>, Kuniyuki Iwashima <kuni1840@...il.com>,
bpf@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH v1 bpf 0/2] bpf: Reject access to unix_sk(sk)->{peer,listener}.
Accessing unix_sk(sk)->{peer,listener} is only safe under
unix_state_lock().
There are many functions where bpf prog can access the fields
locklessly via fentry/fexit or bpf iter.
unix_sk(sk)->{peer,listener} could go away during such lockless
access by bpf.
This seires marks the fields with PTR_UNTRUSTED to prevent
such use-after-free.
Kuniyuki Iwashima (2):
bpf: Reject access to unix_sk(sk)->peer.
bpf: Reject access to unix_sk(sk)->listener.
kernel/bpf/verifier.c | 19 +++++++
.../selftests/bpf/progs/verifier_sock.c | 49 +++++++++++++++++++
2 files changed, 68 insertions(+)
--
2.53.0.rc2.204.g2597b5adb4-goog
Powered by blists - more mailing lists