lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 17 Jun 2022 10:06:49 -0700 From: Alexei Starovoitov <alexei.starovoitov@...il.com> To: Roberto Sassu <roberto.sassu@...wei.com> Cc: "ast@...nel.org" <ast@...nel.org>, "daniel@...earbox.net" <daniel@...earbox.net>, "andrii@...nel.org" <andrii@...nel.org>, "kpsingh@...nel.org" <kpsingh@...nel.org>, "john.fastabend@...il.com" <john.fastabend@...il.com>, "songliubraving@...com" <songliubraving@...com>, "kafai@...com" <kafai@...com>, "yhs@...com" <yhs@...com>, "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>, "keyrings@...r.kernel.org" <keyrings@...r.kernel.org>, "dhowells@...hat.com" <dhowells@...hat.com> Subject: Re: [RESEND][PATCH v4 2/4] bpf: Add bpf_request_key_by_id() helper On Fri, Jun 17, 2022 at 2:11 AM Roberto Sassu <roberto.sassu@...wei.com> wrote: > > > From: Alexei Starovoitov <alexei.starovoitov@...il.com> > > Sent: Friday, June 17, 2022 5:46 AM > > Adding in CC the keyring mailing list and David. > > Sort summary: we are adding an eBPF helper, to let eBPF programs > verify PKCS#7 signatures. The helper simply calls verify_pkcs7_signature(). > > The problem is how to pass the key for verification. > > For hardcoded keyring IDs, it is easy, pass 0, 1 or 2 for respectively > the built-in, secondary and platform keyring. > > If you want to pass another keyring, you need to do a lookup, > which returns a key with reference count increased. > > While in the kernel you can call key_put() to decrease the > reference count, that is not guaranteed with an eBPF program, > if the developer forgets about it. What probably is necessary, > is to add the capability to the verifier to check whether the > reference count is decreased, or adding a callback mechanism > to call automatically key_put() when the eBPF program is > terminated. Nothing special here. See acquire/release logic in the verifier and relevant helpers. Like bpf_sk_lookup_tcp and others. > Is there an alternative solution? > > Thanks > > Roberto > > HUAWEI TECHNOLOGIES Duesseldorf GmbH, > HRB 56063 Managing Director: Li Peng, Yang Xi, Li He Please remove this footer from your emails.
Powered by blists - more mailing lists