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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <CPVRLZNI6WWQ.1AZVH3NCPCOYL@bobo>
Date:   Thu, 19 Jan 2023 11:10:58 +1000
From:   "Nicholas Piggin" <npiggin@...il.com>
To:     "Andrew Donnellan" <ajd@...ux.ibm.com>,
        <linuxppc-dev@...ts.ozlabs.org>, <linux-integrity@...r.kernel.org>
Cc:     <sudhakar@...ux.ibm.com>, <bgray@...ux.ibm.com>,
        <erichte@...ux.ibm.com>, <gregkh@...uxfoundation.org>,
        <nayna@...ux.ibm.com>, <linux-kernel@...r.kernel.org>,
        <zohar@...ux.ibm.com>, <gjoyce@...ux.ibm.com>,
        <gcwilson@...ux.ibm.com>
Subject: Re: [PATCH v3 08/24] powerpc/secvar: Allow backend to populate
 static list of variable names

On Wed Jan 18, 2023 at 4:10 PM AEST, Andrew Donnellan wrote:
> Currently, the list of variables is populated by calling
> secvar_ops->get_next() repeatedly, which is explicitly modelled on the
> OPAL API (including the keylen parameter).
>
> For the upcoming PLPKS backend, we have a static list of variable names.
> It is messy to fit that into get_next(), so instead, let the backend put
> a NULL-terminated array of variable names into secvar_ops->var_names,
> which will be used if get_next() is undefined.
>
> Signed-off-by: Andrew Donnellan <ajd@...ux.ibm.com>
> Signed-off-by: Russell Currey <ruscur@...sell.cc>
>
> ---
>
> v3: New patch (ajd/mpe)
> ---
>  arch/powerpc/include/asm/secvar.h  |  4 ++
>  arch/powerpc/kernel/secvar-sysfs.c | 67 ++++++++++++++++++++----------
>  2 files changed, 50 insertions(+), 21 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/secvar.h b/arch/powerpc/include/asm/secvar.h
> index ebf95386d720..c8bee1834b54 100644
> --- a/arch/powerpc/include/asm/secvar.h
> +++ b/arch/powerpc/include/asm/secvar.h
> @@ -23,6 +23,10 @@ struct secvar_operations {
>  	ssize_t (*format)(char *buf);
>  	int (*max_size)(u64 *max_size);
>  	const struct attribute **config_attrs;
> +
> +	// NULL-terminated array of fixed variable names
> +	// Only used if get_next() isn't provided
> +	const char * const *var_names;

The other way you could go is provide a sysfs_init() ops call here,
and export the add_var as a library function that backends can use.

Thanks,
Nick

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ