1. Sep 15, 2022
  2. Sep 08, 2022
  3. Sep 01, 2022
  4. Aug 30, 2022
  5. Aug 27, 2022
  6. Aug 23, 2022
  7. Aug 12, 2022
    • Ingo Molnar's avatar
      sched/all: Change all BUG_ON() instances in the scheduler to WARN_ON_ONCE() · 09348d75
      Ingo Molnar authored
      
      
      There's no good reason to crash a user's system with a BUG_ON(),
      chances are high that they'll never even see the crash message on
      Xorg, and it won't make it into the syslog either.
      
      By using a WARN_ON_ONCE() we at least give the user a chance to report
      any bugs triggered here - instead of getting silent hangs.
      
      None of these WARN_ON_ONCE()s are supposed to trigger, ever - so we ignore
      cases where a NULL check is done via a BUG_ON() and we let a NULL
      pointer through after a WARN_ON_ONCE().
      
      There's one exception: WARN_ON_ONCE() arguments with side-effects,
      such as locking - in this case we use the return value of the
      WARN_ON_ONCE(), such as in:
      
       -       BUG_ON(!lock_task_sighand(p, &flags));
       +       if (WARN_ON_ONCE(!lock_task_sighand(p, &flags)))
       +               return;
      
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/YvSsKcAXISmshtHo@gmail.com
      09348d75
  8. Aug 11, 2022
    • Nick Desaulniers's avatar
      x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments · ffcf9c57
      Nick Desaulniers authored
      Users of GNU ld (BFD) from binutils 2.39+ will observe multiple
      instances of a new warning when linking kernels in the form:
      
        ld: warning: arch/x86/boot/pmjump.o: missing .note.GNU-stack section implies executable stack
        ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
        ld: warning: arch/x86/boot/compressed/vmlinux has a LOAD segment with RWX permissions
      
      Generally, we would like to avoid the stack being executable.  Because
      there could be a need for the stack to be executable, assembler sources
      have to opt-in to this security feature via explicit creation of the
      .note.GNU-stack feature (which compilers create by default) or command
      line flag --noexecstack.  Or we can simply tell the linker the
      production of such sections is irrelevant and to link the stack as
      --noexecstack.
      
      LLVM's LLD linker defaults to -z noexecstack, so this flag isn't
      strictly necessary when linking with LLD, only BFD, but it doesn't hurt
      to be explicit here for all linkers IMO.  --no-warn-rwx-segments is
      currently BFD specific and only available in the current latest release,
      so it's wrapped in an ld-option check.
      
      While the kernel makes extensive usage of ELF sections, it doesn't use
      permissions from ELF segments.
      
      Link: https://lore.kernel.org/linux-block/3af4127a-f453-4cf7-f133-a181cce06f73@kernel.dk/
      Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
      Link: https://github.com/llvm/llvm-project/issues/57009
      
      
      Reported-and-tested-by: default avatarJens Axboe <axboe@kernel.dk>
      Suggested-by: default avatarFangrui Song <maskray@google.com>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ffcf9c57
    • Nick Desaulniers's avatar
      Makefile: link with -z noexecstack --no-warn-rwx-segments · 0d362be5
      Nick Desaulniers authored
      Users of GNU ld (BFD) from binutils 2.39+ will observe multiple
      instances of a new warning when linking kernels in the form:
      
        ld: warning: vmlinux: missing .note.GNU-stack section implies executable stack
        ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
        ld: warning: vmlinux has a LOAD segment with RWX permissions
      
      Generally, we would like to avoid the stack being executable.  Because
      there could be a need for the stack to be executable, assembler sources
      have to opt-in to this security feature via explicit creation of the
      .note.GNU-stack feature (which compilers create by default) or command
      line flag --noexecstack.  Or we can simply tell the linker the
      production of such sections is irrelevant and to link the stack as
      --noexecstack.
      
      LLVM's LLD linker defaults to -z noexecstack, so this flag isn't
      strictly necessary when linking with LLD, only BFD, but it doesn't hurt
      to be explicit here for all linkers IMO.  --no-warn-rwx-segments is
      currently BFD specific and only available in the current latest release,
      so it's wrapped in an ld-option check.
      
      While the kernel makes extensive usage of ELF sections, it doesn't use
      permissions from ELF segments.
      
      Link: https://lore.kernel.org/linux-block/3af4127a-f453-4cf7-f133-a181cce06f73@kernel.dk/
      Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
      Link: https://github.com/llvm/llvm-project/issues/57009
      
      
      Reported-and-tested-by: default avatarJens Axboe <axboe@kernel.dk>
      Suggested-by: default avatarFangrui Song <maskray@google.com>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0d362be5
    • Linus Torvalds's avatar
      crypto: blake2b: effectively disable frame size warning · 1d3551ce
      Linus Torvalds authored
      It turns out that gcc-12.1 has some nasty problems with register
      allocation on a 32-bit x86 build for the 64-bit values used in the
      generic blake2b implementation, where the pattern of 64-bit rotates and
      xor operations ends up making gcc generate horrible code.
      
      As a result it ends up with a ridiculously large stack frame for all the
      spills it generates, resulting in the following build problem:
      
          crypto/blake2b_generic.c: In function ‘blake2b_compress_one_generic’:
          crypto/blake2b_generic.c:109:1: error: the frame size of 2640 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
      
      on the same test-case, clang ends up generating a stack frame that is
      just 296 bytes (and older gcc versions generate a slightly bigger one at
      428 bytes - still nowhere near that almost 3kB monster stack frame of
      gcc-12.1).
      
      The issue is fixed both in mainline and the GCC 12 release branch [1],
      but current release compilers end up failing the i386 allmodco...
      1d3551ce
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · aeb6e6ac
      Linus Torvalds authored
      Pull NFS client updates from Trond Myklebust:
       "Highlights include:
      
        Stable fixes:
         - pNFS/flexfiles: Fix infinite looping when the RDMA connection
           errors out
      
        Bugfixes:
         - NFS: fix port value parsing
         - SUNRPC: Reinitialise the backchannel request buffers before reuse
         - SUNRPC: fix expiry of auth creds
         - NFSv4: Fix races in the legacy idmapper upcall
         - NFS: O_DIRECT fixes from Jeff Layton
         - NFSv4.1: Fix OP_SEQUENCE error handling
         - SUNRPC: Fix an RPC/RDMA performance regression
         - NFS: Fix case insensitive renames
         - NFSv4/pnfs: Fix a use-after-free bug in open
         - NFSv4.1: RECLAIM_COMPLETE must handle EACCES
      
        Features:
         - NFSv4.1: session trunking enhancements
         - NFSv4.2: READ_PLUS performance optimisations
         - NFS: relax the rules for rsize/wsize mount options
         - NFS: don't unhash dentry during unlink/rename
         - SUNRPC: Fail faster on bad verifier
         - NFS/SUNRPC: Various tracing improvements"
      
      * tag 'nfs-for-5.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (46 commits)
        NFS: Improve readpage/writepage tracing
        NFS: Improve O_DIRECT tracing
        NFS: Improve write error tracing
        NFS: don't unhash dentry during unlink/rename
        NFSv4/pnfs: Fix a use-after-free bug in open
        NFS: nfs_async_write_reschedule_io must not recurse into the writeback code
        SUNRPC: Don't reuse bvec on retransmission of the request
        SUNRPC: Reinitialise the backchannel request buffers before reuse
        NFSv4.1: RECLAIM_COMPLETE must handle EACCES
        NFSv4.1 probe offline transports for trunking on session creation
        SUNRPC create a function that probes only offline transports
        SUNRPC export xprt_iter_rewind function
        SUNRPC restructure rpc_clnt_setup_test_and_add_xprt
        NFSv4.1 remove xprt from xprt_switch if session trunking test fails
        SUNRPC create an rpc function that allows xprt removal from rpc_clnt
        SUNRPC enable back offline transports in trunking discovery
        SUNRPC create an iterator to list only OFFLINE xprts
        NFSv4.1 offline trunkable transports on DESTROY_SESSION
        SUNRPC add function to offline remove trunkable transports
        SUNRPC expose functions for offline remote xprt functionality
        ...
      aeb6e6ac
    • Linus Torvalds's avatar
      Merge tag 'hwmon-fixes-for-v6.0-rc1' of... · f4144564
      Linus Torvalds authored
      Merge tag 'hwmon-fixes-for-v6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
       "Fix two regressions in nct6775 and lm90 drivers"
      
      * tag 'hwmon-fixes-for-v6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (nct6775) Fix platform driver suspend regression
        hwmon: (lm90) Fix error return value from detect function
      f4144564
    • Linus Torvalds's avatar
      Merge tag 'rpmsg-v5.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux · b196f3d1
      Linus Torvalds authored
      Pull rpmsg fixes from Bjorn Andersson:
       "This fixes schema validation warnings in the Devicetree bindings for
        SMD and SMD RPM"
      
      * tag 'rpmsg-v5.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
        dt-bindings: soc: qcom: smd-rpm: extend example
        dt-bindings: soc: qcom: smd: reference SMD edge schema
      b196f3d1
    • Linus Torvalds's avatar
      Merge tag 'mm-stable-2022-08-09' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · b1701d5e
      Linus Torvalds authored
      Pull remaining MM updates from Andrew Morton:
       "Three patch series - two that perform cleanups and one feature:
      
         - hugetlb_vmemmap cleanups from Muchun Song
      
         - hardware poisoning support for 1GB hugepages, from Naoya Horiguchi
      
         - highmem documentation fixups from Fabio De Francesco"
      
      * tag 'mm-stable-2022-08-09' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (23 commits)
        Documentation/mm: add details about kmap_local_page() and preemption
        highmem: delete a sentence from kmap_local_page() kdocs
        Documentation/mm: rrefer kmap_local_page() and avoid kmap()
        Documentation/mm: avoid invalid use of addresses from kmap_local_page()
        Documentation/mm: don't kmap*() pages which can't come from HIGHMEM
        highmem: specify that kmap_local_page() is callable from interrupts
        highmem: remove unneeded spaces in kmap_local_page() kdocs
        mm, hwpoison: enable memory error handling on 1GB hugepage
        mm, hwp...
      b1701d5e