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: <YX/ouT/hi5ccaxsz@kroah.com>
Date:   Mon, 1 Nov 2021 14:16:41 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Chen Yu <yu.c.chen@...el.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...el.com>,
        linux-acpi@...r.kernel.org,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Ard Biesheuvel <ardb@...nel.org>, Len Brown <lenb@...nel.org>,
        Ashok Raj <ashok.raj@...el.com>,
        Mike Rapoport <rppt@...nel.org>,
        Aubrey Li <aubrey.li@...el.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 2/4] drivers/acpi: Introduce Platform Firmware Runtime
 Update device driver

On Mon, Nov 01, 2021 at 09:14:34PM +0800, Chen Yu wrote:
> On Mon, Nov 01, 2021 at 01:21:36PM +0200, Andy Shevchenko wrote:
> > On Mon, Nov 01, 2021 at 05:33:20PM +0800, Chen Yu wrote:
> > > On Wed, Oct 27, 2021 at 01:20:33PM +0300, Andy Shevchenko wrote:
> > > > On Wed, Oct 27, 2021 at 03:07:51PM +0800, Chen Yu wrote:
> > 
> > ...
> > 
> > > > > +	guid_t *image_type_id = &img_hdr->image_type_id;
> > > > 
> > > > efi_guid_t ?
> > > >
> > > efi_guid_t is a 32-bit aligned guid_t, which is for the case when
> > > efi_guid_t* arguments are 32-bit aligned. And it is for 32-bit ARM.
> > > Since this code injection is only for 64-bit, the guid is not required
> > > to be strictly 32-bit aligned I suppose?
> > 
> > But the type of that member may not be guid_t. So, I expect not to see guid_t
> > at all here or as a internal member with the export/import GUID API in place.
> >
> > See, for example
> > d1c6e08e7503 ("libnvdimm/labels: Add uuid helpers")
> >
> 8b03aa0e0e5a ("libnvdimm/labels: Add type-guid helpers") I suppose. Do you
> mean, since the label is not delcared as uuid type, then need to treat the
> data region as a uuid. But it is actually not a formal 'uuid' type, so uuid_t
> is not applicable here. And this also applys to the case in this patch?
> > ...
> > 
> > > > > +	ret = guid_parse(PFRU_UUID, &pfru_dev->uuid);
> > 
> > > > > +	ret = guid_parse(PFRU_CODE_INJ_UUID, &pfru_dev->code_uuid);
> > 
> > > > > +	ret = guid_parse(PFRU_DRV_UPDATE_UUID, &pfru_dev->drv_uuid);
> > 
> > > > Why do you need to keep zillions of copies of the data which seems
> > > > is not going to be changed? Three global variables should be enough,
> > > > no?
> > > >
> > > The guid information is embedded in each pfru_dev and only calculated
> > > once during probe. I thought people try to avoid using global variables
> > > if possible?
> > 
> > Use your common sense. You might have a lot of data duplication,
> > and this data is definitely not something that needs any kind of
> > serialization / personification / etc.
> > 
> Ok, I'll switch to global variables in next version.

Wait, no, why?  Keep them per-device unless you can somehow be
guaranteed there will never be more than one of these ACPI devices in a
system.  It's simpler this way, no need to worry about global state at
all.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ