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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161223072026.GA23895@kroah.com>
Date:   Fri, 23 Dec 2016 08:20:26 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     linux-serial@...r.kernel.org, linux-parisc@...r.kernel.org,
        Jiri Slaby <jslaby@...e.com>,
        "James E.J. Bottomley" <jejb@...isc-linux.org>,
        Helge Deller <deller@....de>, linux-kernel@...r.kernel.org,
        Joachim Eastwood <manabian@...il.com>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] serial: 8250: use initializer instead of memset to clear
 local struct

On Fri, Dec 23, 2016 at 12:21:48PM +0900, Masahiro Yamada wrote:
> Leave the way of zero-out to the compiler's decision; the compiler
> may know a more optimized way than calling memset().

But no, it doesn't, it will leave "blank" areas in the structure with
bad data in it, which is why we do memset.  See the tree-wide fixups we
made about a year ago for this very issue.  Are you sure none of these
structures get copied to userspace?

> It may end up with memset() for big structures like this after all,
> but the code will be cleaner at least.

Please leave it as-is, unless you see a measured speedup.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ