[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQLL_5NHxNJytDrZCKkQpHx6zLTJYVFzYwPxyWVJZHE-FQ@mail.gmail.com>
Date: Fri, 10 Jun 2022 16:56:54 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: KP Singh <kpsingh@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Roberto Sassu <roberto.sassu@...wei.com>,
"ast@...nel.org" <ast@...nel.org>,
"andrii@...nel.org" <andrii@...nel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
kernel test robot <lkp@...el.com>,
"john.fastabend@...il.com" <john.fastabend@...il.com>
Subject: Re: [PATCH v3 1/2] bpf: Add bpf_verify_signature() helper
On Fri, Jun 10, 2022 at 4:53 PM KP Singh <kpsingh@...nel.org> wrote:
> > >>> +static const struct bpf_func_proto bpf_verify_signature_proto = {
> > >>> + .func = bpf_verify_signature,
> > >>> + .gpl_only = false,
> > >>> + .ret_type = RET_INTEGER,
> > >>> + .arg1_type = ARG_PTR_TO_MEM,
> > >>> + .arg2_type = ARG_CONST_SIZE_OR_ZERO,
> > >>
> > >> Can verify_pkcs7_signature() handle null/0 len for data* args?
> > >
> > > Shouldn't ARG_PTR_TO_MEM require valid memory? 0 len should
> > > not be a problem.
> >
> > check_helper_mem_access() has:
> >
> > /* Allow zero-byte read from NULL, regardless of pointer type */
> > if (zero_size_allowed && access_size == 0 &&
> > register_is_null(reg))
> > return 0;
>
> Daniel, makes a fair point here. Alexei, what do you think?
>
> I wonder if some "future" signature verification would need even more
> / different arguments so a unified bpf_verify_signature might get more
> complex / not easy to extend.
You mean a pkcs7 specific helper for now?
Makes sense.
Powered by blists - more mailing lists