Skip to content
  1. Jun 14, 2018
    • Masahiro Yamada's avatar
      kconfig: tinyconfig: remove stale stack protector fixups · a0f8c297
      Masahiro Yamada authored
      
      
      Prior to commit 2a61f474 ("stack-protector: test compiler capability
      in Kconfig and drop AUTO mode"), the stack protector was configured by
      the choice of NONE, REGULAR, STRONG, AUTO.
      
      tiny.config needed to explicitly set NONE because the default value of
      choice, AUTO, did not produce the tiniest kernel.
      
      Now that there are only two boolean symbols, STACKPROTECTOR and
      STACKPROTECTOR_STRONG, they are naturally disabled by "make
      allnoconfig", which "make tinyconfig" is based on.  Remove unnecessary
      lines from the tiny.config fragment file.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a0f8c297
    • Linus Torvalds's avatar
      Kbuild: rename CC_STACKPROTECTOR[_STRONG] config variables · 050e9baa
      Linus Torvalds authored
      
      
      The changes to automatically test for working stack protector compiler
      support in the Kconfig files removed the special STACKPROTECTOR_AUTO
      option that picked the strongest stack protector that the compiler
      supported.
      
      That was all a nice cleanup - it makes no sense to have the AUTO case
      now that the Kconfig phase can just determine the compiler support
      directly.
      
      HOWEVER.
      
      It also meant that doing "make oldconfig" would now _disable_ the strong
      stackprotector if you had AUTO enabled, because in a legacy config file,
      the sane stack protector configuration would look like
      
        CONFIG_HAVE_CC_STACKPROTECTOR=y
        # CONFIG_CC_STACKPROTECTOR_NONE is not set
        # CONFIG_CC_STACKPROTECTOR_REGULAR is not set
        # CONFIG_CC_STACKPROTECTOR_STRONG is not set
        CONFIG_CC_STACKPROTECTOR_AUTO=y
      
      and when you ran this through "make oldconfig" with the Kbuild changes,
      it would ask you about the regular CONFIG_CC_STACKPROTECTOR (that had
      been renamed from CONFIG_CC_STACKPROTECTOR_REGULAR to just
      CONFIG_CC_STACKPROTECTOR), but it would think that the STRONG version
      used to be disabled (because it was really enabled by AUTO), and would
      disable it in the new config, resulting in:
      
        CONFIG_HAVE_CC_STACKPROTECTOR=y
        CONFIG_CC_HAS_STACKPROTECTOR_NONE=y
        CONFIG_CC_STACKPROTECTOR=y
        # CONFIG_CC_STACKPROTECTOR_STRONG is not set
        CONFIG_CC_HAS_SANE_STACKPROTECTOR=y
      
      That's dangerously subtle - people could suddenly find themselves with
      the weaker stack protector setup without even realizing.
      
      The solution here is to just rename not just the old RECULAR stack
      protector option, but also the strong one.  This does that by just
      removing the CC_ prefix entirely for the user choices, because it really
      is not about the compiler support (the compiler support now instead
      automatially impacts _visibility_ of the options to users).
      
      This results in "make oldconfig" actually asking the user for their
      choice, so that we don't have any silent subtle security model changes.
      The end result would generally look like this:
      
        CONFIG_HAVE_CC_STACKPROTECTOR=y
        CONFIG_CC_HAS_STACKPROTECTOR_NONE=y
        CONFIG_STACKPROTECTOR=y
        CONFIG_STACKPROTECTOR_STRONG=y
        CONFIG_CC_HAS_SANE_STACKPROTECTOR=y
      
      where the "CC_" versions really are about internal compiler
      infrastructure, not the user selections.
      
      Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      050e9baa
  2. Feb 07, 2018
    • Kees Cook's avatar
      Makefile: introduce CONFIG_CC_STACKPROTECTOR_AUTO · 44c6dc94
      Kees Cook authored
      Nearly all modern compilers support a stack-protector option, and nearly
      all modern distributions enable the kernel stack-protector, so enabling
      this by default in kernel builds would make sense.  However, Kconfig does
      not have knowledge of available compiler features, so it isn't safe to
      force on, as this would unconditionally break builds for the compilers or
      architectures that don't have support.  Instead, this introduces a new
      option, CONFIG_CC_STACKPROTECTOR_AUTO, which attempts to discover the best
      possible stack-protector available, and will allow builds to proceed even
      if the compiler doesn't support any stack-protector.
      
      This option is made the default so that kernels built with modern
      compilers will be protected-by-default against stack buffer overflows,
      avoiding things like the recent BlueBorne attack.  Selection of a specific
      stack-protector option remains available, including disabling it.
      
      Additionally, tiny.config is adjusted to use CC_STACKPROTECTOR_NONE, since
      that's the option with the least code size (and it used to be the default,
      so we have to explicitly choose it there now).
      
      Link: http://lkml.kernel.org/r/1510076320-69931-4-git-send-email-keescook@chromium.org
      
      
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Tested-by: default avatarLaura Abbott <labbott@redhat.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      44c6dc94
  3. Jan 16, 2018
  4. Dec 04, 2017
    • Mark Brown's avatar
      PM: Provide a config snippet for disabling PM · 4ab53fe6
      Mark Brown authored
      
      
      A frequent source of build problems is poor handling of optional PM
      support, almost all development is done with the PM options enabled
      but they can be turned off.  Currently few if any of the build test
      services do this as standard as there is no standard config for it and
      the use of selects and def_bool means that simply setting CONFIG_PM=n
      doesn't do what is expected.  To make this easier provide a fragement
      that can be used with KCONFIG_ALLCONFIG to force PM off.
      
      CONFIG_XEN is disabled as Xen uses hibernation callbacks which end up
      turning on power management on architectures with Xen.  Some cpuidle
      implementations on ARM select PM so CONFIG_CPU_IDLE is disabled, and
      some ARM architectures unconditionally enable PM so they are also
      disabled.
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4ab53fe6
  5. Aug 23, 2017
  6. Jun 09, 2017
  7. Feb 28, 2017
  8. Feb 07, 2017
  9. Oct 11, 2016
  10. Sep 22, 2016
  11. Sep 02, 2016
  12. Aug 02, 2016
    • Rob Herring's avatar
      config: add android config fragments · 27eb6622
      Rob Herring authored
      Copy the config fragments from the AOSP common kernel android-4.4
      branch.  It is becoming possible to run mainline kernels with Android,
      but the kernel defconfigs don't work as-is and debugging missing config
      options is a pain.  Adding the config fragments into the kernel tree,
      makes configuring a mainline kernel as simple as:
      
        make ARCH=arm multi_v7_defconfig android-base.config android-recommended.config
      
      The following non-upstream config options were removed:
      
        CONFIG_NETFILTER_XT_MATCH_QTAGUID
        CONFIG_NETFILTER_XT_MATCH_QUOTA2
        CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG
        CONFIG_PPPOLAC
        CONFIG_PPPOPNS
        CONFIG_SECURITY_PERF_EVENTS_RESTRICT
        CONFIG_USB_CONFIGFS_F_MTP
        CONFIG_USB_CONFIGFS_F_PTP
        CONFIG_USB_CONFIGFS_F_ACC
        CONFIG_USB_CONFIGFS_F_AUDIO_SRC
        CONFIG_USB_CONFIGFS_UEVENT
        CONFIG_INPUT_KEYCHORD
        CONFIG_INPUT_KEYRESET
      
      Link: http://lkml.kernel.org/r/1466708235-28593-1-git-send-email-robh@kernel.org
      
      
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Cc: Amit Pundir <amit.pundir@linaro.org>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Dmitry Shmidt <dimitrysh@google.com>
      Cc: Rom Lemarchand <romlem@android.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      27eb6622
  13. Jun 16, 2015
    • Luis R. Rodriguez's avatar
      kconfig: add xenconfig defconfig helper · 6c668505
      Luis R. Rodriguez authored
      
      
      This lets you build a kernel which can support xen dom0
      or xen guests on i386, x86-64 and arm64 by just using:
      
         make xenconfig
      
      You can start from an allnoconfig and then switch to xenconfig.
      This also splits out the options which are available currently
      to be built with x86 and 'make ARCH=arm64' under a shared config.
      
      Technically xen supports a dom0 kernel and also a guest
      kernel configuration but upon review with the xen team
      since we don't have many dom0 options its best to just
      combine these two into one.
      
      A few generic notes: we enable both of these:
      
      CONFIG_INET=y
      CONFIG_BINFMT_ELF=y
      
      although technically not required given you likely will
      end up with a pretty useless system otherwise.
      
      A few architectural differences worth noting:
      
      $ make allnoconfig; make xenconfig > /dev/null ; \
      	grep XEN .config > 64-bit-config
      $ make ARCH=i386 allnoconfig; make ARCH=i386 xenconfig > /dev/null; \
      	grep XEN .config > 32-bit-config
      $ make ARCH=arm64 allnoconfig; make ARCH=arm64 xenconfig > /dev/null; \
      	grep XEN .config > arm64-config
      
      Since the options are already split up with a generic config and
      architecture specific configs you anything on the x86 configs
      are known to only work right now on x86. For instance arm64 doesn't
      support MEMORY_HOTPLUG yet as such although we try to enabe it
      generically arm64 doesn't have it yet, so we leave the xen
      specific kconfig option XEN_BALLOON_MEMORY_HOTPLUG on x86's config
      file to set expecations correctly.
      
      Then on x86 we have differences between i386 and x86-64. The difference
      between 64-bit-config and 32-bit-config is you don't get XEN_MCE_LOG as
      this is only supported on 64-bit. You also do not get on i386
      XEN_BALLOON_MEMORY_HOTPLUG, there does not seem to be any technical
      reasons to not allow this but I gave up after a few attempts.
      
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: penberg@kernel.org
      Cc: levinsasha928@gmail.com
      Cc: mtosatti@redhat.com
      Cc: fengguang.wu@intel.com
      Cc: David Vrabel <david.vrabel@citrix.com>
      Cc: Ian Campbell <Ian.Campbell@citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: xen-devel@lists.xenproject.org
      Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Acked-by: default avatarJulien Grall <julien.grall@linaro.org>
      Acked-by: default avatarMichal Marek <mmarek@suse.cz>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      6c668505
  14. Aug 08, 2014
    • Josh Triplett's avatar
      x86: Add "make tinyconfig" to configure the tiniest possible kernel · 0da1d4a0
      Josh Triplett authored
      
      
      Since commit 5d2acfc7 ("kconfig: make
      allnoconfig disable options behind EMBEDDED and EXPERT") in 3.15-rc1,
      "make allnoconfig" disables every possible config option.
      
      However, a few configuration options (CC_OPTIMIZE_FOR_SIZE,
      OPTIMIZE_INLINING) produce a smaller kernel when turned on, and a few
      choices exist (compression, highmem, allocator) for which a non-default
      option produces a smaller kernel.
      
      Add a "tinyconfig" option, which starts from allnoconfig and then sets
      these options to configure the tiniest possible kernel.  This provides a
      better baseline for embedded systems or efforts to reduce kernel size.
      
      Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
      0da1d4a0
Loading