Skip to content
Snippets Groups Projects
  1. Mar 04, 2019
    • Kees Cook's avatar
      gcc-plugins: structleak: Generalize to all variable types · 81a56f6d
      Kees Cook authored
      
      This adjusts structleak to also work with non-struct types when they
      are passed by reference, since those variables may leak just like
      anything else. This is exposed via an improved set of Kconfig options.
      (This does mean structleak is slightly misnamed now.)
      
      Building with CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL should give the
      kernel complete initialization coverage of all stack variables passed
      by reference, including padding (see lib/test_stackinit.c).
      
      Using CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE to count added initializations
      under defconfig:
      
      	..._BYREF:      5945 added initializations
      	..._BYREF_ALL: 16606 added initializations
      
      There is virtually no change to text+data size (both have less than 0.05%
      growth):
      
         text    data     bss     dec     hex filename
      19502103        5051456 1917000 26470559        193e89f vmlinux.stock
      19513412        5051456 1908808 26473676        193f4cc vmlinux.byref
      19516974        5047360 1900616 26464950        193d2b6 vmlinux.byref_all
      
      The measured performance difference is in the noise for hackbench and
      kernel build benchmarks:
      
      Stock:
      
      	5x hackbench -g 20 -l 1000
      	Mean:   10.649s
      	Std Dev: 0.339
      
      	5x kernel build (4-way parallel)
      	Mean:  261.98s
      	Std Dev: 1.53
      
      CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF:
      
      	5x hackbench -g 20 -l 1000
      	Mean:   10.540s
      	Std Dev: 0.233
      
      	5x kernel build (4-way parallel)
      	Mean:  260.52s
      	Std Dev: 1.31
      
      CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL:
      
      	5x hackbench -g 20 -l 1000
      	Mean:   10.320
      	Std Dev: 0.413
      
      	5x kernel build (4-way parallel)
      	Mean:  260.10
      	Std Dev: 0.86
      
      This does not yet solve missing padding initialization for structures
      on the stack that are never passed by reference (which should be a tiny
      minority). Hopefully this will be more easily addressed by upstream
      compiler fixes after clarifying the C11 padding initialization
      specification.
      
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      81a56f6d
  2. Jan 20, 2019
  3. Jan 14, 2019
  4. Jan 09, 2019
    • WANG Chao's avatar
      x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE · e4f35891
      WANG Chao authored
      
      Commit
      
        4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      
      replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the
      remaining pieces.
      
       [ bp: Massage commit message. ]
      
      Fixes: 4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      Signed-off-by: default avatarWANG Chao <chao.wang@ucloud.cn>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarZhenzhong Duan <zhenzhong.duan@oracle.com>
      Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Woodhouse <dwmw@amazon.co.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: linux-kbuild@vger.kernel.org
      Cc: srinivas.eeda@oracle.com
      Cc: stable <stable@vger.kernel.org>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn
      e4f35891
  5. Jan 08, 2019
  6. Jan 06, 2019
  7. Jan 04, 2019
  8. Dec 28, 2018
  9. Dec 21, 2018
Loading