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] [day] [month] [year] [list]
Date:   Mon, 22 Aug 2016 09:57:23 -0700
From:   Joe Perches <joe@...ches.com>
To:     "Luck, Tony" <tony.luck@...el.com>
Cc:     Doug Thompson <dougthompson@...ssion.com>,
        Borislav Petkov <bp@...en8.de>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] skx_edac: Move a few hundred bytes to text from data
 using const

On Mon, 2016-08-22 at 09:46 -0700, Luck, Tony wrote:
> On Sun, Aug 21, 2016 at 05:02:41PM -0700, Joe Perches wrote:
> > Marking arrays as const makes for smaller data.
> Joe,

Hi Tony

> "a few hundred" seems to be exaggeration.
> 
> Before:
> $ size drivers/edac/skx_edac.ko
>    text	   data	    bss	    dec	    hex	filename
>    8435	   1024	     24	   9483	   250b	drivers/edac/skx_edac.ko
> 
> After:
> $ size drivers/edac/skx_edac.ko
>    text    data     bss     dec     hex filename
>    8531	    944	     24	   9499	   251b	drivers/edac/skx_edac.ko
> 
> so "data" was reduced by 80 bytes, but "text" went up by 96.


Yeah, it was a few hundred in an allyesconfig
and I neglected to test the defconfig.

$ size drivers/edac/skx_edac.o* (x86-64)
   text	   data	    bss	    dec	    hex	filename
   6677	     64	     24	   6765	   1a6d	drivers/edac/skx_edac.o.defconfig.new
   6546	    176	     24	   6746	   1a5a	drivers/edac/skx_edac.o.defconfig.old
  20609	   5744	    320	  26673	   6831	drivers/edac/skx_edac.o.new
  20273	   6064	    320	  26657	   6821	drivers/edac/skx_edac.o.old

> Net increase of 16 (perhaps because some padding for alignment???)
> 
> Making read-only data const is a good idea in general, but
> do we want to do it if it *increases* kernel footprint?

Marking all data const that can be const is a good thing.
It reduces exposure and eliminates unintentional overwriting.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ