1. 21 Feb, 2024 5 commits
    • Kees Cook's avatar
      um: Convert strscpy() usage to 2-argument style · 1e065898
      Kees Cook authored
      The ARCH=um build has its own idea about strscpy()'s definition. Adjust
      the callers to remove the redundant sizeof() arguments ahead of treewide
      changes, since it needs a manual adjustment for the newly named
      sized_strscpy() export.
      
      Cc: Richard Weinberger <richard@nod.at>
      Cc: linux-um@lists.infradead.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      1e065898
    • Kees Cook's avatar
      string: Allow 2-argument strscpy_pad() · 8366d124
      Kees Cook authored
      Similar to strscpy(), update strscpy_pad()'s 3rd argument to be
      optional when the destination is a compile-time known size array.
      
      Cc: Andy Shevchenko <andy@kernel.org>
      Cc:  <linux-hardening@vger.kernel.org>
      Reviewed-by: default avatarJustin Stitt <justinstitt@google.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      8366d124
    • Kees Cook's avatar
      string: Allow 2-argument strscpy() · e6584c39
      Kees Cook authored
      Using sizeof(dst) for the "size" argument in strscpy() is the
      overwhelmingly common case. Instead of requiring this everywhere, allow a
      2-argument version to be used that will use the sizeof() internally. There
      are other functions in the kernel with optional arguments[1], so this
      isn't unprecedented, and improves readability. Update and relocate the
      kern-doc for strscpy() too, and drop __HAVE_ARCH_STRSCPY as it is unused.
      
      Adjust ARCH=um build to notice the changed export name, as it doesn't
      do full header includes for the string helpers.
      
      This could additionally let us save a few hundred lines of code:
       1177 files changed, 2455 insertions(+), 3026 deletions(-)
      with a treewide cleanup using Coccinelle:
      
      @needless_arg@
      expression DST, SRC;
      @@
      
              strscpy(DST, SRC
      -, sizeof(DST)
              )
      
      Link: https://elixir.bootlin.com/linux/v6.7/source/include/linux/pci.h#L1517 [1]
      Reviewed-by: default avatarJustin Stitt <justinstitt@google.com>
      Cc: Andy Shevchenko <andy@kernel.org>
      Cc: linux-hardening@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      e6584c39
    • Kees Cook's avatar
      string: Redefine strscpy_pad() as a macro · f478898e
      Kees Cook authored
      In preparation for making strscpy_pad()'s 3rd argument optional, redefine
      it as a macro. This also has the benefit of allowing greater FORITFY
      introspection, as it couldn't see into the strscpy() nor the memset()
      within strscpy_pad().
      
      Cc: Andy Shevchenko <andy@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc:  <linux-hardening@vger.kernel.org>
      Reviewed-by: default avatarJustin Stitt <justinstitt@google.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      f478898e
    • Kees Cook's avatar
      ubsan: Reintroduce signed overflow sanitizer · 557f8c58
      Kees Cook authored
      In order to mitigate unexpected signed wrap-around[1], bring back the
      signed integer overflow sanitizer. It was removed in commit 6aaa31ae
      ("ubsan: remove overflow checks") because it was effectively a no-op
      when combined with -fno-strict-overflow (which correctly changes signed
      overflow from being "undefined" to being explicitly "wrap around").
      
      Compilers are adjusting their sanitizers to trap wrap-around and to
      detecting common code patterns that should not be instrumented
      (e.g. "var + offset < var"). Prepare for this and explicitly rename
      the option from "OVERFLOW" to "WRAP" to more accurately describe the
      behavior.
      
      To annotate intentional wrap-around arithmetic, the helpers
      wrapping_add/sub/mul_wrap() can be used for individual statements. At
      the function level, the __signed_wrap attribute can be used to mark an
      entire function as expecting its signed arithmetic to wrap around. For a
      single object file the Makefile can use "UBSAN_SIGNED_WRAP_target.o := n"
      to mark it as wrapping, and for an entire directory, "UBSAN_SIGNED_WRAP :=
      n" can be used.
      
      Additionally keep these disabled under CONFIG_COMPILE_TEST for now.
      
      Link: https://github.com/KSPP/linux/issues/26 [1]
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Hao Luo <haoluo@google.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Reviewed-by: default avatarJustin Stitt <justinstitt@google.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      557f8c58
  2. 06 Feb, 2024 4 commits
  3. 01 Feb, 2024 8 commits
  4. 29 Jan, 2024 1 commit
  5. 28 Jan, 2024 7 commits
  6. 27 Jan, 2024 9 commits
  7. 26 Jan, 2024 6 commits
    • Linus Torvalds's avatar
      Merge tag 'ata-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux · 3a5879d4
      Linus Torvalds authored
      Pull ata updates from Niklas Cassel:
      
       - Fix an incorrect link_power_management_policy sysfs attribute value.
      
         We were previously using the same attribute value for two different
         LPM policies (me)
      
       - Add a ASMedia ASM1166 quirk.
      
         The SATA host controller always reports that it has 32 ports, even
         though it only has six ports. Add a quirk that overrides the value
         reported by the controller (Conrad)
      
       - Add a ASMedia ASM1061 quirk.
      
         The SATA host controller completely ignores the upper 21 bits of the
         DMA address. This causes IOMMU error events when a (valid) DMA
         address actually has any of the upper 21 bits set. Add a quirk that
         limits the dma_mask to 43-bits (Lennert)
      
      * tag 'ata-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
        ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers
        ahci: asm1166: correct count of reported ports
        ata: libata-sata: improve sysfs description for ATA_LPM_UNKNOWN
      3a5879d4
    • Linus Torvalds's avatar
      Merge tag 'block-6.8-2024-01-26' of git://git.kernel.dk/linux · 914e1708
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - RCU warning fix for md (Mikulas)
      
       - Fix for an aoe issue that lockdep rightfully complained about
         (Maksim)
      
       - Fix for an error code change in partitioning that caused a regression
         with some tools (Li)
      
       - Fix for a data direction warning with bi-direction commands
         (Christian)
      
      * tag 'block-6.8-2024-01-26' of git://git.kernel.dk/linux:
        md: fix a suspicious RCU usage warning
        aoe: avoid potential deadlock at set_capacity
        block: Fix WARNING in _copy_from_iter
        block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
      914e1708
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.8-2024-01-26' of git://git.kernel.dk/linux · cced1c5e
      Linus Torvalds authored
      Pull io_uring fix from Jens Axboe:
       "Just a single tweak to the newly added IORING_OP_FIXED_FD_INSTALL from
        Paul, ensuring it goes via the audit path and playing it safe by
        excluding it from using registered creds"
      
      * tag 'io_uring-6.8-2024-01-26' of git://git.kernel.dk/linux:
        io_uring: enable audit and restrict cred override for IORING_OP_FIXED_FD_INSTALL
      cced1c5e
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 667c8893
      Linus Torvalds authored
      Pull thermal control update from Rafael Wysocki:
       "Remove some dead code from the Intel powerclamp thermal control driver
        (Srinivas Pandruvada)"
      
      * tag 'thermal-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: intel: powerclamp: Remove dead code for target mwait value
      667c8893
    • Linus Torvalds's avatar
      Merge tag 'pm-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 0c879d88
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix two cpufreq drivers and the cpupower utility.
      
        Specifics:
      
         - Fix the handling of scaling_max/min_freq sysfs attributes in the
           AMD P-state cpufreq driver (Mario Limonciello)
      
         - Make the intel_pstate cpufreq driver avoid unnecessary computation
           of the HWP performance level corresponding to a given frequency in
           the cases when it is known already, which also helps to avoid
           reducing the maximum CPU capacity artificially on some systems
           (Rafael J. Wysocki)
      
         - Fix compilation of the cpupower utility when CFLAGS is passed as a
           make argument for cpupower, but it does not take effect as expected
           due to mishandling (Stanley Chan)"
      
      * tag 'pm-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq/amd-pstate: Fix setting scaling max/min freq values
        cpufreq: intel_pstate: Refine computation of P-state for given frequency
        tools cpupower bench: Override CFLAGS assignments
      0c879d88
    • Linus Torvalds's avatar
      Merge tag 'docs-6.8-fixes' of git://git.lwn.net/linux · 70da22eb
      Linus Torvalds authored
      Pull documentation fixes from Jonathan Corbet:
       "A handful of relatively boring documentation fixes"
      
      * tag 'docs-6.8-fixes' of git://git.lwn.net/linux:
        docs: admin-guide: remove obsolete advice related to SLAB allocator
        doc: admin-guide/kernel-parameters: remove useless comment
        docs/accel: correct links to mailing list archives
        docs/sphinx: Fix TOC scroll hack for the home page
      70da22eb