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] [day] [month] [year] [list]
Date:   Mon, 24 Apr 2023 18:41:00 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc:     "Starke, Daniel" <daniel.starke@...mens.com>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "jirislaby@...nel.org" <jirislaby@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/8] tty: n_gsm: add restart parameter to DLC specific
 ioctl config

On Mon, Apr 24, 2023 at 04:20:00PM +0300, Ilpo Järvinen wrote:
> On Mon, 24 Apr 2023, Greg KH wrote:
> 
> > On Mon, Apr 24, 2023 at 11:03:26AM +0000, Starke, Daniel wrote:
> > > > > --- a/include/uapi/linux/gsmmux.h
> > > > > +++ b/include/uapi/linux/gsmmux.h
> > > > > @@ -58,7 +58,8 @@ struct gsm_dlci_config {
> > > > >  	__u32 priority;		/* Priority (0 for default value) */
> > > > >  	__u32 i;		/* Frame type (1 = UIH, 2 = UI) */
> > > > >  	__u32 k;		/* Window size (0 for default value) */
> > > > > -	__u32 reserved[8];	/* For future use, must be initialized to zero */
> > > > > +	__u32 restart;		/* Force DLCI channel reset? */
> > > > 
> > > > Why are you using a full 32 bits for just 1 bit of data here?  Why not
> > > > use a bitfield?
> > > 
> > > The ioctrl guide states:
> > >   Bitfields and enums generally work as one would expect them to,
> > >   but some properties of them are implementation-defined, so it is better
> > >   to avoid them completely in ioctl interfaces.
> > > 
> > > Therefore, I tried to avoid them here.
> > 
> > Then use a u8?
> 
> To add further, I think that the ioctl guidance tries to say that C 
> bitfields using :number postfix are not a good idea, not that much to 
> disallow flag like content within an integer type.

Agreed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ