Skip to content
Snippets Groups Projects
  1. Dec 28, 2018
  2. Dec 19, 2018
  3. Dec 14, 2018
  4. Dec 12, 2018
    • Ard Biesheuvel's avatar
      ARM: smp: add support for per-task stack canaries · 189af465
      Ard Biesheuvel authored
      
      On ARM, we currently only change the value of the stack canary when
      switching tasks if the kernel was built for UP. On SMP kernels, this
      is impossible since the stack canary value is obtained via a global
      symbol reference, which means
      a) all running tasks on all CPUs must use the same value
      b) we can only modify the value when no kernel stack frames are live
         on any CPU, which is effectively never.
      
      So instead, use a GCC plugin to add a RTL pass that replaces each
      reference to the address of the __stack_chk_guard symbol with an
      expression that produces the address of the 'stack_canary' field
      that is added to struct thread_info. This way, each task will use
      its own randomized value.
      
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Emese Revfy <re.emese@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: kernel-hardening@lists.openwall.com
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      189af465
  5. Dec 10, 2018
  6. Dec 06, 2018
  7. Nov 30, 2018
    • Linus Torvalds's avatar
      unifdef: use memcpy instead of strncpy · 38c7b224
      Linus Torvalds authored
      
      New versions of gcc reasonably warn about the odd pattern of
      
      	strncpy(p, q, strlen(q));
      
      which really doesn't make sense: the strncpy() ends up being just a slow
      and odd way to write memcpy() in this case.
      
      There was a comment about _why_ the code used strncpy - to avoid the
      terminating NUL byte, but memcpy does the same and avoids the warning.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      38c7b224
  8. Nov 28, 2018
  9. Nov 24, 2018
  10. Nov 18, 2018
  11. Nov 12, 2018
  12. Nov 11, 2018
  13. Nov 05, 2018
    • Masahiro Yamada's avatar
      kbuild: deb-pkg: fix bindeb-pkg breakage when O= is used · 02826a6b
      Masahiro Yamada authored
      
      Ard Biesheuvel reports bindeb-pkg with O= option is broken in the
      following way:
      
        ...
          LD [M]  sound/soc/rockchip/snd-soc-rk3399-gru-sound.ko
          LD [M]  sound/soc/rockchip/snd-soc-rockchip-pcm.ko
          LD [M]  sound/soc/rockchip/snd-soc-rockchip-rt5645.ko
          LD [M]  sound/soc/rockchip/snd-soc-rockchip-spdif.ko
          LD [M]  sound/soc/sh/rcar/snd-soc-rcar.ko
         fakeroot -u debian/rules binary
        make KERNELRELEASE=4.19.0-12677-g19beffaf7a99-dirty ARCH=arm64 KBUILD_SRC= intdeb-pkg
        /bin/bash /home/ard/linux/scripts/package/builddeb
        Makefile:600: include/config/auto.conf: No such file or directory
        ***
        *** Configuration file ".config" not found!
        ***
        *** Please run some configurator (e.g. "make oldconfig" or
        *** "make menuconfig" or "make xconfig").
        ***
        make[12]: *** [syncconfig] Error 1
        make[11]: *** [syncconfig] Error 2
        make[10]: *** [include/config/auto.conf] Error 2
        make[9]: *** [__sub-make] Error 2
        ...
      
      Prior to commit 80463f1b ("kbuild: add --include-dir flag only
      for out-of-tree build"), both srctree and objtree were added to
      --include-dir redundantly, and the wrong code '$MAKE image_name'
      was working by relying on that. Now, the potential issue that had
      previously been hidden just showed up.
      
      '$MAKE image_name' recurses to the generated $(objtree)/Makefile and
      ends up with running in srctree, which is incorrect. It should be
      invoked with '-f $srctree/Makefile' (or KBUILD_SRC=) to be executed
      in objtree.
      
      Fixes: 80463f1b ("kbuild: add --include-dir flag only for out-of-tree build")
      Reported-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      02826a6b
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: fix binrpm-pkg breakage when O= is used · 21b42eb4
      Masahiro Yamada authored
      
      Zhenzhong Duan reported that running 'make O=/build/kernel binrpm-pkg'
      failed with the following errors:
      
        Running 'make O=/build/kernel binrpm-pkg' failed with below two errors.
      
        Makefile:600: include/config/auto.conf: No such file or directory
      
        + cp make -C /mnt/root/kernel O=/build/kernel image_name make -f
        /mnt/root/kernel/Makefile ...
        cp: invalid option -- 'C'
        Try 'cp --help' for more information.
      
      Prior to commit 80463f1b ("kbuild: add --include-dir flag only
      for out-of-tree build"), both srctree and objtree were added to
      --include-dir redundantly, and the wrong code 'make image_name'
      was working by relying on that. Now, the potential issue that had
      previously been hidden just showed up.
      
      'make image_name' recurses to the generated $(objtree)/Makefile and
      ends up with running in srctree, which is incorrect. It should be
      invoked with '-f $srctree/Makefile' (or KBUILD_SRC=) to be executed
      in objtree.
      
      Fixes: 80463f1b ("kbuild: add --include-dir flag only for out-of-tree build")
      Reported-by: default avatarZhenzhong Duan <zhenzhong.duan@oracle.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      21b42eb4
  14. Nov 02, 2018
  15. Nov 01, 2018
  16. Oct 31, 2018
  17. Oct 28, 2018
  18. Oct 26, 2018
  19. Oct 19, 2018
  20. Oct 18, 2018
    • Randy Dunlap's avatar
      kernel-doc: fix declaration type determination · cf419d54
      Randy Dunlap authored
      
      Make declaration type determination more robust.
      
      When scripts/kernel-doc is deciding if some kernel-doc notation
      contains an enum, a struct, a union, a typedef, or a function,
      it does a pattern match on the beginning of the string, looking
      for a match with one of "struct", "union", "enum", or "typedef",
      and otherwise defaults to a function declaration type.
      However, if a function or a function-like macro has a name that
      begins with "struct" (e.g., struct_size()), then kernel-doc
      incorrectly decides that this is a struct declaration.
      
      Fix this by looking for the declaration type keywords having an
      ending word boundary (\b), so that "struct_size" will not match
      a struct declaration.
      
      I compared lots of html before/after output from core-api, driver-api,
      and networking.  There were no differences in any of the files that
      I checked.
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Tested-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      cf419d54
Loading