Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Greg Kroah-Hartman
On Mon, Aug 26, 2019 at 11:46:11AM -0400, Nayna wrote: > > > On 08/26/2019 10:56 AM, Greg Kroah-Hartman wrote: > > On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: > > > +static struct kobj_attribute size_attr = __ATTR_RO(size); > > Wait, why not just normal ATTR_RO()? > > Oh!! Sorry.

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna
On 08/26/2019 10:56 AM, Greg Kroah-Hartman wrote: On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: +static struct kobj_attribute size_attr = __ATTR_RO(size); Wait, why not just normal ATTR_RO()? Oh!! Sorry. I am not seeing this macro in sysfs.h. am I missing something ? +sta

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Greg Kroah-Hartman
On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: > +static struct kobj_attribute size_attr = __ATTR_RO(size); Wait, why not just normal ATTR_RO()? > +static struct bin_attribute data_attr = __BIN_ATTR_RO(data, > VARIABLE_MAX_SIZE); And BIN_ATTR_RO() here? Do those not work for you s

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna
On 08/26/2019 10:01 AM, Greg Kroah-Hartman wrote: On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: +static struct bin_attribute update_attr = { + .attr = {.name = "update", .mode = 0200}, + .size = VARIABLE_MAX_SIZE, + .write = update_write, +}; Ah, do we need a

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Greg Kroah-Hartman
On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: > +static struct bin_attribute update_attr = { > + .attr = {.name = "update", .mode = 0200}, > + .size = VARIABLE_MAX_SIZE, > + .write = update_write, > +}; Ah, do we need a __BIN_ATTR_WO() macro for you? That would make this

[PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna Jain
PowerNV secure variables, which store the keys used for OS kernel verification, are managed by the firmware. These secure variables need to be accessed by the userspace for addition/deletion of the certificates. This patch adds the sysfs interface to expose secure variables for PowerNV secureboot.