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:   Wed, 13 Mar 2019 16:12:58 -0600
From:   Keith Busch <kbusch@...nel.org>
To:     "Elliott, Robert (Persistent Memory)" <elliott@....com>
Cc:     Arnd Bergmann <arnd@...db.de>, Jiri Kosina <jikos@...nel.org>,
        Jens Axboe <axboe@...nel.dk>, Omar Sandoval <osandov@...com>,
        Hannes Reinecke <hare@...e.de>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] floppy: fix harmless clang build warning

On Wed, Mar 13, 2019 at 10:01:43PM +0000, Elliott, Robert (Persistent Memory) wrote:
> > @@ -3899,7 +3899,7 @@ static void __init config_types(void)
> >  	if (!UDP->cmos)
> >  		UDP->cmos = FLOPPY0_TYPE;
> >  	drive = 1;
> > -	if (!UDP->cmos && FLOPPY1_TYPE)
> > +	if (!UDP->cmos)
> >  		UDP->cmos = FLOPPY1_TYPE;
> > 
> >  	/* FIXME: additional physical CMOS drive detection should go here */
> > --
> > 2.20.0
> 
> On x86 it expands to a hardware read, so this would change the control flow.
> 
> #define FLOPPY1_TYPE                                    \
> ({                                                      \
>         unsigned long flags;                            \
>         unsigned char val;                              \
>         spin_lock_irqsave(&rtc_lock, flags);            \
>         val = CMOS_READ(0x10) & 15;                     \
>         spin_unlock_irqrestore(&rtc_lock, flags);       \
>         val;                                            \
> })

The end result is still the same, though. It just doesn't read the
hardware twice when FLOPPY1_TYPE is non-zero.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ