Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Mar 24, 2022
  2. Mar 23, 2022
  3. Mar 22, 2022
  4. Mar 21, 2022
    • Kees Cook's avatar
      lib: stackinit: Convert to KUnit · 02788ebc
      Kees Cook authored
      
      Convert stackinit unit tests to KUnit, for better integration
      into the kernel self test framework. Includes a rename of
      test_stackinit.c to stackinit_kunit.c, and CONFIG_TEST_STACKINIT to
      CONFIG_STACKINIT_KUNIT_TEST.
      
      Adjust expected test results based on which stack initialization method
      was chosen:
      
       $ CMD="./tools/testing/kunit/kunit.py run stackinit --raw_output \
              --arch=x86_64 --kconfig_add"
      
       $ $CMD | grep stackinit:
       # stackinit: pass:36 fail:0 skip:29 total:65
      
       $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_USER=y | grep stackinit:
       # stackinit: pass:37 fail:0 skip:28 total:65
      
       $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF=y | grep stackinit:
       # stackinit: pass:55 fail:0 skip:10 total:65
      
       $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y | grep stackinit:
       # stackinit: pass:62 fail:0 skip:3 total:65
      
       $ $CMD CONFIG_INIT_STACK_ALL_PATTERN=y --make_option LLVM=1 | grep stackinit:
       # stackinit: pass:60 fail:0 skip:5 total:65
      
       $ $CMD CONFIG_INIT_STACK_ALL_ZERO=y --make_option LLVM=1 | grep stackinit:
       # stackinit: pass:60 fail:0 skip:5 total:65
      
      Temporarily remove the userspace-build mode, which will be restored in a
      later patch.
      
      Expand the size of the pre-case switch variable so it doesn't get
      accidentally cleared.
      
      Cc: David Gow <davidgow@google.com>
      Cc: Daniel Latypov <dlatypov@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      ---
      v1: https://lore.kernel.org/lkml/20220224055145.1853657-1-keescook@chromium.org
      v2:
       - split "userspace KUnit stub" into separate header and patch (Daniel)
       - Improve commit log and comments (David)
       - Provide mapping of expected XFAIL tests to CONFIGs (David)
      02788ebc
  5. Mar 17, 2022
  6. Mar 12, 2022
    • Jason A. Donenfeld's avatar
      random: replace custom notifier chain with standard one · 5acd3548
      Jason A. Donenfeld authored
      
      We previously rolled our own randomness readiness notifier, which only
      has two users in the whole kernel. Replace this with a more standard
      atomic notifier block that serves the same purpose with less code. Also
      unexport the symbols, because no modules use it, only unconditional
      builtins. The only drawback is that it's possible for a notification
      handler returning the "stop" code to prevent further processing, but
      given that there are only two users, and that we're unexporting this
      anyway, that doesn't seem like a significant drawback for the
      simplification we receive here.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      5acd3548
  7. Mar 08, 2022
    • Paul Menzel's avatar
      lib/raid6: Include <asm/ppc-opcode.h> for VPERMXOR · 5b401e4e
      Paul Menzel authored
      
      On Ubuntu 21.10 (ppc64le) building raid6test with gcc (Ubuntu
      11.2.0-7ubuntu2) 11.2.0 fails with the error below.
      
          gcc -I.. -I ../../../include -g -O2                       \
                   -I../../../arch/powerpc/include -DCONFIG_ALTIVEC \
                   -c -o vpermxor1.o vpermxor1.c
          vpermxor1.c: In function ‘raid6_vpermxor1_gen_syndrome_real’:
          vpermxor1.c:64:29: error: expected string literal before ‘VPERMXOR’
             64 |   asm(VPERMXOR(%0,%1,%2,%3):"=v"(wq0):"v"(gf_high), "v"(gf_low), "v"(wq0));
                |       ^~~~~~~~
          make: *** [Makefile:58: vpermxor1.o] Error 1
      
      So, include the header asm/ppc-opcode.h defining this macro also when
      not building the Linux kernel but only this too.
      
      Cc: Matt Brown <matthew.brown.dev@gmail.com>
      Signed-off-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      5b401e4e
    • Paul Menzel's avatar
      lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3 · 633174a7
      Paul Menzel authored
      Buidling raid6test on Ubuntu 21.10 (ppc64le) with GNU Make 4.3 shows the
      errors below:
      
          $ cd lib/raid6/test/
          $ make
          <stdin>:1:1: error: stray ‘\’ in program
          <stdin>:1:2: error: stray ‘#’ in program
          <stdin>:1:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ \
              before ‘<’ token
      
          [...]
      
      The errors come from the HAS_ALTIVEC test, which fails, and the POWER
      optimized versions are not built. That’s also reason nobody noticed on the
      other architectures.
      
      GNU Make 4.3 does not remove the backslash anymore. From the 4.3 release
      announcment:
      
      > * WARNING: Backward-incompatibility!
      >   Number signs (#) appearing inside a macro reference or function invocation
      >   no longer introduce comments and should not be escaped with backslashes:
      >   thus a call such as:
      >     foo := $(shell echo '#')
      >   is legal.  Previously the number sign needed to be escaped, for example:
      >     foo := $(shell echo '\#')
      >   Now this latter will resolve to "\#".  If you want to write makefiles
      >   portable to both versions, assign the number sign to a variable:
      >     H := \#
      >     foo := $(shell echo '$H')
      >   This was claimed to be fixed in 3.81, but wasn't, for some reason.
      >   To detect this change search for 'nocomment' in the .FEATURES variable.
      
      So, do the same as commit 9564a8cf ("Kbuild: fix # escaping in .cmd
      files for future Make") and commit 929bef46 ("bpf: Use $(pound) instead
      of \# in Makefiles") and define and use a $(pound) variable.
      
      Reference for the change in make:
      https://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b57
      
      
      
      Cc: Matt Brown <matthew.brown.dev@gmail.com>
      Signed-off-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      633174a7
    • Dirk Müller's avatar
      lib/raid6/test: fix multiple definition linking error · a5359ddd
      Dirk Müller authored
      
      GCC 10+ defaults to -fno-common, which enforces proper declaration of
      external references using "extern". without this change a link would
      fail with:
      
        lib/raid6/test/algos.c:28: multiple definition of `raid6_call';
        lib/raid6/test/test.c:22: first defined here
      
      the pq.h header that is included already includes an extern declaration
      so we can just remove the redundant one here.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarDirk Müller <dmueller@suse.de>
      Reviewed-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      a5359ddd
  8. Mar 07, 2022
  9. Mar 03, 2022
  10. Mar 02, 2022
  11. Feb 28, 2022
  12. Feb 27, 2022
  13. Feb 26, 2022
  14. Feb 25, 2022
  15. Feb 24, 2022
  16. Feb 21, 2022