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: <20200114175647.GA2055173@kroah.com>
Date:   Tue, 14 Jan 2020 18:56:47 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Dmitry Safonov <dima@...sta.com>
Cc:     Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Iurii Zaikin <yzaikin@...gle.com>,
        Jiri Slaby <jslaby@...e.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Vasiliy Khoruzhick <vasilykh@...sta.com>,
        linux-serial@...r.kernel.org
Subject: Re: [PATCHv2-next 3/3] serial_core: Remove unused member in uart_port

On Tue, Jan 14, 2020 at 05:47:33PM +0000, Dmitry Safonov wrote:
> On 1/14/20 5:36 PM, Joe Perches wrote:
> > On Tue, 2020-01-14 at 17:19 +0000, Dmitry Safonov wrote:
> >> It should remove the align-padding before @name.
> > []
> >> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> > []
> >> @@ -247,7 +247,6 @@ struct uart_port {
> >>  
> >>  	unsigned char		hub6;			/* this should be in the 8250 driver */
> >>  	unsigned char		suspended;
> >> -	unsigned char		unused;
> > 
> > I suggest this not be applied as this is just to let
> > readers know that there is an unused 1 byte alignment
> > hole here that could be used for something else.
> 
> Heh, 2/3 adds another `unsigned char`, so the neighbours look like:
> 
> : unsigned long sysrq;		/* sysrq timeout */
> : unsigned int	sysrq_ch;	/* char for sysrq */
> : unsigned char	has_sysrq;
> : unsigned char	sysrq_seq;	/* index in sysrq_toggle_seq */
> :
> : unsigned char	hub6;		/* this should be in the 8250 driver */
> : unsigned char	suspended;
> : unsigned char	unused;
> : const char	*name;		/* port name */
> 
> So the hole became 4 bytes on 64-bit.
> 
> I can make it unused[4], but..
> 
> Separated the patch per Greg's review and I think it makes sense to have
> it separately from 2/3 because last time I've touched it, it actually
> was in use by drivers (regardless the name).

Yes, it makes sense to remove it now.  And then we can properly
reorginize the structure if people really care about the padding issues
(hint, I really doubt it).  Someone can run pahole on the structure if
they care, but getting rid of "unused" is good as it has been abused in
the past.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ