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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 19 Aug 2020 17:06:34 +0000
From:   "Keller, Jacob E" <jacob.e.keller@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [net-next v3 3/4] devlink: introduce flash update overwrite mask



> -----Original Message-----
> From: netdev-owner@...r.kernel.org <netdev-owner@...r.kernel.org> On
> Behalf Of Jakub Kicinski
> Sent: Wednesday, August 19, 2020 9:31 AM
> To: Keller, Jacob E <jacob.e.keller@...el.com>
> Cc: netdev@...r.kernel.org
> Subject: Re: [net-next v3 3/4] devlink: introduce flash update overwrite mask
> 
> On Wed, 19 Aug 2020 16:01:02 +0000 Keller, Jacob E wrote:
> > > > -#define DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT	BIT(0)
> > > > +#define DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT
> 	BIT(0)
> > > > +#define DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK	BIT(1)
> > >
> > > Since core will check supported flags, I'd be tempted to have a flag
> > > for each override type. Saves an 'if' in every driver.
> >
> > Combinations might not be valid (as in ice where identifiers alone
> > isn't supportable) but I suppose I could add something for it.
> 
> I see, looking at the i40e patch it does seem to not matter in practice
> if core checks this or not.
> 

Right, I have it checking to make sure if you don't support the overwrite at all, then the attribute will be rejected but I expect that ultimately drivers will have to check the exact set of combinations they support, and convert them to the driver/firmware-specific values they have.

> > Would it make sense to just add them to the
> > supported_flash_update_params? This results in a bit offset where the
> > "supported" bits don't match the actual used bits in overwrite_mask,
> > so we could also introduce a separate "supported_overwrite_mask" but
> > that might just be overkill since I doubt we'll need to add more than
> > a handlful of overwrite bits...
> >
> > > >  struct devlink_region;
> > > >  struct devlink_info_req;
> > > > diff --git a/include/uapi/linux/devlink.h
> > > > b/include/uapi/linux/devlink.h index cfef4245ea5a..1d8bbe9c1ae1
> > > > 100644 --- a/include/uapi/linux/devlink.h
> > > > +++ b/include/uapi/linux/devlink.h
> > > > @@ -228,6 +228,28 @@ enum {
> > > >  	DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATTR_STATS_MAX - 1
> > > >  };
> > > >
> > > > +/* Specify what sections of a flash component can be overwritten
> > > > when
> > > > + * performing an update. Overwriting of firmware binary sections
> > > > is always
> > > > + * implicitly assumed to be allowed.
> > > > + *
> > > > + * Each section must be documented in
> > > > + * Documentation/networking/devlink/devlink-flash.rst
> > > > + *
> > > > + */
> > > > +enum {
> > > > +	DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT,
> > > > +	DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT,
> > >
> > > IMHO generally a good practice to have 0 be undefined.
> >
> > Even for bits? I saw that for attribute values 0 was undefined, but
> > that didn't seem right for a bit position. sending the bitfield with
> > zero bit set means the same as not sending the bitfield.
> 
> Ah, misread the code, sorry.

Powered by blists - more mailing lists