Skip to content
Snippets Groups Projects
  1. Aug 19, 2017
  2. Jun 23, 2017
  3. Jun 22, 2017
    • Kees Cook's avatar
      gcc-plugins: Add the randstruct plugin · 313dd1b6
      Kees Cook authored
      
      This randstruct plugin is modified from Brad Spengler/PaX Team's code
      in the last public patch of grsecurity/PaX based on my understanding
      of the code. Changes or omissions from the original code are mine and
      don't reflect the original grsecurity/PaX code.
      
      The randstruct GCC plugin randomizes the layout of selected structures
      at compile time, as a probabilistic defense against attacks that need to
      know the layout of structures within the kernel. This is most useful for
      "in-house" kernel builds where neither the randomization seed nor other
      build artifacts are made available to an attacker. While less useful for
      distribution kernels (where the randomization seed must be exposed for
      third party kernel module builds), it still has some value there since now
      all kernel builds would need to be tracked by an attacker.
      
      In more performance sensitive scenarios, GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
      can be selected to make a best effort to restrict randomization to
      cacheline-sized groups of elements, and will not randomize bitfields. This
      comes at the cost of reduced randomization.
      
      Two annotations are defined,__randomize_layout and __no_randomize_layout,
      which respectively tell the plugin to either randomize or not to
      randomize instances of the struct in question. Follow-on patches enable
      the auto-detection logic for selecting structures for randomization
      that contain only function pointers. It is disabled here to assist with
      bisection.
      
      Since any randomized structs must be initialized using designated
      initializers, __randomize_layout includes the __designated_init annotation
      even when the plugin is disabled so that all builds will require
      the needed initialization. (With the plugin enabled, annotations for
      automatically chosen structures are marked as well.)
      
      The main differences between this implemenation and grsecurity are:
      - disable automatic struct selection (to be enabled in follow-up patch)
      - add designated_init attribute at runtime and for manual marking
      - clarify debugging output to differentiate bad cast warnings
      - add whitelisting infrastructure
      - support gcc 7's DECL_ALIGN and DECL_MODE changes (Laura Abbott)
      - raise minimum required GCC version to 4.7
      
      Earlier versions of this patch series were ported by Michael Leibowitz.
      
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      313dd1b6
  4. Jan 26, 2017
  5. Dec 14, 2016
  6. Jun 07, 2016
    • Emese Revfy's avatar
      GCC plugin infrastructure · 6b90bd4b
      Emese Revfy authored
      
      This patch allows to build the whole kernel with GCC plugins. It was ported from
      grsecurity/PaX. The infrastructure supports building out-of-tree modules and
      building in a separate directory. Cross-compilation is supported too.
      Currently the x86, arm, arm64 and uml architectures enable plugins.
      
      The directory of the gcc plugins is scripts/gcc-plugins. You can use a file or a directory
      there. The plugins compile with these options:
       * -fno-rtti: gcc is compiled with this option so the plugins must use it too
       * -fno-exceptions: this is inherited from gcc too
       * -fasynchronous-unwind-tables: this is inherited from gcc too
       * -ggdb: it is useful for debugging a plugin (better backtrace on internal
          errors)
       * -Wno-narrowing: to suppress warnings from gcc headers (ipa-utils.h)
       * -Wno-unused-variable: to suppress warnings from gcc headers (gcc_version
          variable, plugin-version.h)
      
      The infrastructure introduces a new Makefile target called gcc-plugins. It
      supports all gcc versions from 4.5 to 6.0. The scripts/gcc-plugin.sh script
      chooses the proper host compiler (gcc-4.7 can be built by either gcc or g++).
      This script also checks the availability of the included headers in
      scripts/gcc-plugins/gcc-common.h.
      
      The gcc-common.h header contains frequently included headers for GCC plugins
      and it has a compatibility layer for the supported gcc versions.
      
      The gcc-generate-*-pass.h headers automatically generate the registration
      structures for GIMPLE, SIMPLE_IPA, IPA and RTL passes.
      
      Note that 'make clean' keeps the *.so files (only the distclean or mrproper
      targets clean all) because they are needed for out-of-tree modules.
      
      Based on work created by the PaX Team.
      
      Signed-off-by: default avatarEmese Revfy <re.emese@gmail.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
      6b90bd4b
  7. Nov 11, 2015
  8. Apr 09, 2014
  9. Nov 19, 2012
  10. Sep 01, 2012
  11. Jul 13, 2012
  12. Mar 30, 2012
  13. Dec 27, 2011
  14. May 23, 2011
  15. Jan 06, 2011
  16. Dec 12, 2009
  17. Oct 24, 2009
  18. Oct 07, 2009
    • Dick Streefland's avatar
      kconfig: simplification of scripts/extract-ikconfig · 7b76bfc8
      Dick Streefland authored
      
      I've rewritten the extract-ikconfig script to extract the kernel
      configuration from a kernel compiled with CONFIG_IKCONFIG. The main
      motivation for the rewrite was to remove the dependency on the
      external C program binoffset.c, which is compiled on the initial run.
      
      The binoffset executable is invoked with a relative path, which means
      that the old script can only be run from the top of the kernel tree,
      and only when you have write permission in the scripts directory.
      
      The new script uses tr/grep/tail/zcat only, and can be invoked from
      anywhere. The binoffset.c program has been removed. This script
      requires GNU grep 2.5 (released 2002-03-13) or higher, because the -o
      option was introduced in that version.
      
      Signed-off-by: default avatarDick Streefland <dick@streefland.net>
      LKML-Reference: <20091006203540.GA14634@streefland.net>
      Tested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      7b76bfc8
  19. Sep 16, 2009
    • David S. Miller's avatar
      sparc: Kill PROM console driver. · 09d3f3f0
      David S. Miller authored
      
      Many years ago when this driver was written, it had a use, but these
      days it's nothing but trouble and distributions should not enable it
      in any situation.
      
      Pretty much every console device a sparc machine could see has a
      bonafide real driver, making the PROM console hack unnecessary.
      
      If any new device shows up, we should write a driver instead of
      depending upon this crutch to save us.  We've been able to take care
      of this even when no chip documentation exists (sunxvr500, sunxvr2500)
      so there are no excuses.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09d3f3f0
  20. Mar 26, 2009
  21. Oct 16, 2008
    • Randy Dunlap's avatar
      dontdiff: more updates to be closer to gitignore · 929f37cb
      Randy Dunlap authored
      
      defkeymap.c_shipped should be diffed if it is changed.
      Reported-by: default avatarMike Galbraith <efault@gmx.de>
      
      COPYING, CREDITS, .mailmap should be diffed if they are changed.
      keywords.c_shipped & lex.c_shipped should be diffed when changed.
      parse.[ch]_shipped should be diffed when changed.
      Reported-by: default avatarSam Ravnborg <sam@ravnborg.org>
      
      vsyscall* updates from a .gitignore patch by "Denis V. Lunev" <den@openvz.org>.
      
      *.so.dbg from a .gitignore patch by Thomas Gleixner <tglx@linutronix.de>.
      
      binoffset from a .gitignore patch by Uwe Kleine-Koenig
      <Uwe.Kleine-Koenig@digi.com>.
      
      Module.markers from a .gitignore patch by Matthew Wilcox
      <willy@linux.intel.com>.
      
      vmlinux*.lds* should be diffed if changed.
      Reported-by: default avatarEtienne Lorrain <etienne_lorrain@yahoo.fr>
      
      vmlinux.lds from a .gitignore patch by Daniel Guilak
      <daniel@danielguilak.com>.
      
      *.scr should be diffed if changed.
      
      Lots of updates from http://lkml.org/lkml/2008/5/20/32
      
       Reported-by: Bart
      Van Assche <bart.vanassche@gmail.com>
      
      Use ncscope.* instead of *cscope* since the latter may catch too many files.
      
      Add *.elf, from a .gitignore patch by Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>.
      
      Make firmware entries match .gitignore entries.
      
      Make some entries less greedy by removing trailing '*'.
      
      Remove "make_times_h" (no such file).
      Remove "filelist" (no such file).
      Remove "dummy_sym.c" (no such file).
      Remove "gen-kdb_cmds.c" (no such file).
      Remove "gentbl" (no such file).
      Remove "kconfig.tk" (no such file).
      Remove "tkparse" (no such file).
      Remove "sim710_d.h" (no such file).
      Remove "53c8xx_d.h" (no such file).
      Add "syscalltab.h" (generated file).
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      929f37cb
  22. Sep 02, 2008
  23. Apr 28, 2008
  24. Apr 21, 2008
  25. Jan 12, 2008
  26. Oct 17, 2007
  27. Jul 31, 2007
  28. May 24, 2007
  29. May 02, 2007
  30. Sep 25, 2006
  31. Sep 13, 2005
  32. Aug 03, 2005
  33. Jul 16, 2005
  34. Jun 23, 2005
  35. May 05, 2005
  36. May 01, 2005
  37. Apr 16, 2005
Loading