[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5qpEkXq-X6ci9UU@google.com>
Date: Wed, 29 Jan 2025 22:17:54 +0000
From: Peilin Ye <yepeilin@...gle.com>
To: Eduard Zingerman <eddyz87@...il.com>
Cc: bpf@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, bpf@...f.org,
Xu Kuohai <xukuohai@...weicloud.com>,
David Vernet <void@...ifault.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
Jonathan Corbet <corbet@....net>,
"Paul E. McKenney" <paulmck@...nel.org>,
Puranjay Mohan <puranjay@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Quentin Monnet <qmo@...nel.org>,
Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>,
Josh Don <joshdon@...gle.com>, Barret Rhoden <brho@...gle.com>,
Neel Natu <neelnatu@...gle.com>,
Benjamin Segall <bsegall@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v1 3/8] bpf: Introduce load-acquire and
store-release instructions
On Tue, Jan 28, 2025 at 05:30:19PM -0800, Eduard Zingerman wrote:
> On Sat, 2025-01-25 at 02:18 +0000, Peilin Ye wrote:
> > +static int check_atomic_store(struct bpf_verifier_env *env, int insn_idx,
> > + struct bpf_insn *insn)
> > +{
> > + int err;
> > +
> > + err = check_reg_arg(env, insn->src_reg, SRC_OP);
> > + if (err)
> > + return err;
> > +
> > + err = check_reg_arg(env, insn->dst_reg, SRC_OP);
> > + if (err)
> > + return err;
> > +
> > + if (is_pointer_value(env, insn->src_reg)) {
> > + verbose(env, "R%d leaks addr into mem\n", insn->src_reg);
> > + return -EACCES;
> > + }
>
> Nit: this check is done by check_mem_access(), albeit only for
> PTR_TO_MEM, I think it's better to be consistent with
> what happens for regular stores and avoid this check here.
Got it. Unprivileged programs will be able to store-release pointers to
the stack, then. I'll update selftests accordingly.
Thanks,
Peilin Ye
Powered by blists - more mailing lists