1. 10 Jun, 2022 5 commits
    • Jason A. Donenfeld's avatar
      random: credit cpu and bootloader seeds by default · 846bb97e
      Jason A. Donenfeld authored
      This commit changes the default Kconfig values of RANDOM_TRUST_CPU and
      RANDOM_TRUST_BOOTLOADER to be Y by default. It does not change any
      existing configs or change any kernel behavior. The reason for this is
      several fold.
      
      As background, I recently had an email thread with the kernel
      maintainers of Fedora/RHEL, Debian, Ubuntu, Gentoo, Arch, NixOS, Alpine,
      SUSE, and Void as recipients. I noted that some distros trust RDRAND,
      some trust EFI, and some trust both, and I asked why or why not. There
      wasn't really much of a "debate" but rather an interesting discussion of
      what the historical reasons have been for this, and it came up that some
      distros just missed the introduction of the bootloader Kconfig knob,
      while another didn't want to enable it until there was a boot time
      switch to turn it off for more concerned users (which has since been
      added). The result of the rather uneventful discussion is that every
      major Linux distro enables these two options by default.
      
      While I didn't have really too strong of an opinion going into this
      thread -- and I mostly wanted to learn what the distros' thinking was
      one way or another -- ultimately I think their choice was a decent
      enough one for a default option (which can be disabled at boot time).
      I'll try to summarize the pros and cons:
      
      Pros:
      
      - The RNG machinery gets initialized super quickly, and there's no
        messing around with subsequent blocking behavior.
      
      - The bootloader mechanism is used by kexec in order for the prior
        kernel to initialize the RNG of the next kernel, which increases
        the entropy available to early boot daemons of the next kernel.
      
      - Previous objections related to backdoors centered around
        Dual_EC_DRBG-like kleptographic systems, in which observing some
        amount of the output stream enables an adversary holding the right key
        to determine the entire output stream.
      
        This used to be a partially justified concern, because RDRAND output
        was mixed into the output stream in varying ways, some of which may
        have lacked pre-image resistance (e.g. XOR or an LFSR).
      
        But this is no longer the case. Now, all usage of RDRAND and
        bootloader seeds go through a cryptographic hash function. This means
        that the CPU would have to compute a hash pre-image, which is not
        considered to be feasible (otherwise the hash function would be
        terribly broken).
      
      - More generally, if the CPU is backdoored, the RNG is probably not the
        realistic vector of choice for an attacker.
      
      - These CPU or bootloader seeds are far from being the only source of
        entropy. Rather, there is generally a pretty huge amount of entropy,
        not all of which is credited, especially on CPUs that support
        instructions like RDRAND. In other words, assuming RDRAND outputs all
        zeros, an attacker would *still* have to accurately model every single
        other entropy source also in use.
      
      - The RNG now reseeds itself quite rapidly during boot, starting at 2
        seconds, then 4, then 8, then 16, and so forth, so that other sources
        of entropy get used without much delay.
      
      - Paranoid users can set random.trust_{cpu,bootloader}=no in the kernel
        command line, and paranoid system builders can set the Kconfig options
        to N, so there's no reduction or restriction of optionality.
      
      - It's a practical default.
      
      - All the distros have it set this way. Microsoft and Apple trust it
        too. Bandwagon.
      
      Cons:
      
      - RDRAND *could* still be backdoored with something like a fixed key or
        limited space serial number seed or another indexable scheme like
        that. (However, it's hard to imagine threat models where the CPU is
        backdoored like this, yet people are still okay making *any*
        computations with it or connecting it to networks, etc.)
      
      - RDRAND *could* be defective, rather than backdoored, and produce
        garbage that is in one way or another insufficient for crypto.
      
      - Suggesting a *reduction* in paranoia, as this commit effectively does,
        may cause some to question my personal integrity as a "security
        person".
      
      - Bootloader seeds and RDRAND are generally very difficult if not all
        together impossible to audit.
      
      Keep in mind that this doesn't actually change any behavior. This
      is just a change in the default Kconfig value. The distros already are
      shipping kernels that set things this way.
      
      Ard made an additional argument in [1]:
      
          We're at the mercy of firmware and micro-architecture anyway, given
          that we are also relying on it to ensure that every instruction in
          the kernel's executable image has been faithfully copied to memory,
          and that the CPU implements those instructions as documented. So I
          don't think firmware or ISA bugs related to RNGs deserve special
          treatment - if they are broken, we should quirk around them like we
          usually do. So enabling these by default is a step in the right
          direction IMHO.
      
      In [2], Phil pointed out that having this disabled masked a bug that CI
      otherwise would have caught:
      
          A clean 5.15.45 boots cleanly, whereas a downstream kernel shows the
          static key warning (but it does go on to boot). The significant
          difference is that our defconfigs set CONFIG_RANDOM_TRUST_BOOTLOADER=y
          defining that on top of multi_v7_defconfig demonstrates the issue on
          a clean 5.15.45. Conversely, not setting that option in a
          downstream kernel build avoids the warning
      
      [1] https://lore.kernel.org/lkml/CAMj1kXGi+ieviFjXv9zQBSaGyyzeGW_VpMpTLJK8PJb2QHEQ-w@mail.gmail.com/
      [2] https://lore.kernel.org/lkml/c47c42e3-1d56-5859-a6ad-976a1a3381c6@raspberrypi.com/
      
      Cc: Theodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      846bb97e
    • Jason A. Donenfeld's avatar
      random: do not use jump labels before they are initialized · 60e5b288
      Jason A. Donenfeld authored
      Stephen reported that a static key warning splat appears during early
      boot on systems that credit randomness from device trees that contain an
      "rng-seed" property, because because setup_machine_fdt() is called
      before jump_label_init() during setup_arch():
      
       static_key_enable_cpuslocked(): static key '0xffffffe51c6fcfc0' used before call to jump_label_init()
       WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:166 static_key_enable_cpuslocked+0xb0/0xb8
       Modules linked in:
       CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0+ #224 44b43e377bfc84bc99bb5ab885ff694984ee09ff
       pstate: 600001c9 (nZCv dAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
       pc : static_key_enable_cpuslocked+0xb0/0xb8
       lr : static_key_enable_cpuslocked+0xb0/0xb8
       sp : ffffffe51c393cf0
       x29: ffffffe51c393cf0 x28: 000000008185054c x27: 00000000f1042f10
       x26: 0000000000000000 x25: 00000000f10302b2 x24: 0000002513200000
       x23: 0000002513200000 x22: ffffffe51c1c9000 x21: fffffffdfdc00000
       x20: ffffffe51c2f0831 x19: ffffffe51c6fcfc0 x18: 00000000ffff1020
       x17: 00000000e1e2ac90 x16: 00000000000000e0 x15: ffffffe51b710708
       x14: 0000000000000066 x13: 0000000000000018 x12: 0000000000000000
       x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000
       x8 : 0000000000000000 x7 : 61632065726f6665 x6 : 6220646573752027
       x5 : ffffffe51c641d25 x4 : ffffffe51c13142c x3 : ffff0a00ffffff05
       x2 : 40000000ffffe003 x1 : 00000000000001c0 x0 : 0000000000000065
       Call trace:
        static_key_enable_cpuslocked+0xb0/0xb8
        static_key_enable+0x2c/0x40
        crng_set_ready+0x24/0x30
        execute_in_process_context+0x80/0x90
        _credit_init_bits+0x100/0x154
        add_bootloader_randomness+0x64/0x78
        early_init_dt_scan_chosen+0x140/0x184
        early_init_dt_scan_nodes+0x28/0x4c
        early_init_dt_scan+0x40/0x44
        setup_machine_fdt+0x7c/0x120
        setup_arch+0x74/0x1d8
        start_kernel+0x84/0x44c
        __primary_switched+0xc0/0xc8
       ---[ end trace 0000000000000000 ]---
       random: crng init done
       Machine model: Google Lazor (rev1 - 2) with LTE
      
      A trivial fix went in to address this on arm64, 73e2d827 ("arm64:
      Initialize jump labels before setup_machine_fdt()"). I wrote patches as
      well for arm32 and risc-v. But still patches are needed on xtensa,
      powerpc, arc, and mips. So that's 7 platforms where things aren't quite
      right. This sort of points to larger issues that might need a larger
      solution.
      
      Instead, this commit just defers setting the static branch until later
      in the boot process. random_init() is called after jump_label_init() has
      been called, and so is always a safe place from which to adjust the
      static branch.
      
      Fixes: f5bda35f ("random: use static branch for crng_ready()")
      Reported-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reported-by: default avatarPhil Elwell <phil@raspberrypi.com>
      Tested-by: default avatarPhil Elwell <phil@raspberrypi.com>
      Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      60e5b288
    • Jason A. Donenfeld's avatar
      random: account for arch randomness in bits · 77fc95f8
      Jason A. Donenfeld authored
      Rather than accounting in bytes and multiplying (shifting), we can just
      account in bits and avoid the shift. The main motivation for this is
      there are other patches in flux that expand this code a bit, and
      avoiding the duplication of "* 8" everywhere makes things a bit clearer.
      
      Cc: stable@vger.kernel.org
      Fixes: 12e45a2a ("random: credit architectural init the exact amount")
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      77fc95f8
    • Jason A. Donenfeld's avatar
      random: mark bootloader randomness code as __init · 39e0f991
      Jason A. Donenfeld authored
      add_bootloader_randomness() and the variables it touches are only used
      during __init and not after, so mark these as __init. At the same time,
      unexport this, since it's only called by other __init code that's
      built-in.
      
      Cc: stable@vger.kernel.org
      Fixes: 428826f5 ("fdt: add support for rng-seed")
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      39e0f991
    • Jason A. Donenfeld's avatar
      random: avoid checking crng_ready() twice in random_init() · 9b29b6b2
      Jason A. Donenfeld authored
      The current flow expands to:
      
          if (crng_ready())
             ...
          else if (...)
              if (!crng_ready())
                  ...
      
      The second crng_ready() call is redundant, but can't so easily be
      optimized out by the compiler.
      
      This commit simplifies that to:
      
          if (crng_ready()
              ...
          else if (...)
              ...
      
      Fixes: 560181c2 ("random: move initialization functions out of hot pages")
      Cc: stable@vger.kernel.org
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      9b29b6b2
  2. 07 Jun, 2022 2 commits
  3. 06 Jun, 2022 3 commits
  4. 05 Jun, 2022 20 commits
    • Linus Torvalds's avatar
      Merge tag 'mm-nonmm-stable-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · e17fee89
      Linus Torvalds authored
      Pull delay-accounting update from Andrew Morton:
       "A single featurette for delay accounting.
      
        Delayed a bit because, unusually, it had dependencies on both the
        mm-stable and mm-nonmm-stable queues"
      
      * tag 'mm-nonmm-stable-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        delayacct: track delays from write-protect copy
      e17fee89
    • Linus Torvalds's avatar
      bluetooth: don't use bitmaps for random flag accesses · e1cff700
      Linus Torvalds authored
      The bluetooth code uses our bitmap infrastructure for the two bits (!)
      of connection setup flags, and in the process causes odd problems when
      it converts between a bitmap and just the regular values of said bits.
      
      It's completely pointless to do things like bitmap_to_arr32() to convert
      a bitmap into a u32.  It shoudln't have been a bitmap in the first
      place.  The reason to use bitmaps is if you have arbitrary number of
      bits you want to manage (not two!), or if you rely on the atomicity
      guarantees of the bitmap setting and clearing.
      
      The code could use an "atomic_t" and use "atomic_or/andnot()" to set and
      clear the bit values, but considering that it then copies the bitmaps
      around with "bitmap_to_arr32()" and friends, there clearly cannot be a
      lot of atomicity requirements.
      
      So just use a regular integer.
      
      In the process, this avoids the warnings about erroneous use of
      bitmap_from_u64() which were triggered on 32-bit architectures when
      conversion from a u64 would access two words (and, surprise, surprise,
      only one word is needed - and indeed overkill - for a 2-bit bitmap).
      
      That was always problematic, but the compiler seems to notice it and
      warn about the invalid pattern only after commit 0a97953f ("lib: add
      bitmap_{from,to}_arr64") changed the exact implementation details of
      'bitmap_from_u64()', as reported by Sudip Mukherjee and Stephen Rothwell.
      
      Fixes: fe92ee64 ("Bluetooth: hci_core: Rework hci_conn_params flags")
      Link: https://lore.kernel.org/all/YpyJ9qTNHJzz0FHY@debian/
      Link: https://lore.kernel.org/all/20220606080631.0c3014f2@canb.auug.org.au/
      Link: https://lore.kernel.org/all/20220605162537.1604762-1-yury.norov@gmail.com/Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Reported-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
      Reviewed-by: default avatarYury Norov <yury.norov@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e1cff700
    • Al Viro's avatar
      fix the breakage in close_fd_get_file() calling conventions change · 40a19260
      Al Viro authored
      It used to grab an extra reference to struct file rather than
      just transferring to caller the one it had removed from descriptor
      table.  New variant doesn't, and callers need to be adjusted.
      
      Reported-and-tested-by: syzbot+47dd250f527cb7bebf24@syzkaller.appspotmail.com
      Fixes: 6319194e ("Unify the primitives for file descriptor closing")
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      40a19260
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d717180e
      Linus Torvalds authored
      Pull x86 SGX fix from Thomas Gleixner:
       "A single fix for x86/SGX to prevent that memory which is allocated for
        an SGX enclave is accounted to the wrong memory control group"
      
      * tag 'x86-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/sgx: Set active memcg prior to shmem allocation
      d717180e
    • Linus Torvalds's avatar
      Merge tag 'x86-mm-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0b7da15c
      Linus Torvalds authored
      Pull x86 mm cleanup from Thomas Gleixner:
       "Use PAGE_ALIGNED() instead of open coding it in the x86/mm code"
      
      * tag 'x86-mm-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE)
      0b7da15c
    • Linus Torvalds's avatar
      Merge tag 'x86-microcode-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9784edd7
      Linus Torvalds authored
      Pull x86 microcode updates from Thomas Gleixner:
      
       - Disable late microcode loading by default. Unless the HW people get
         their act together and provide a required minimum version in the
         microcode header for making a halfways informed decision its just
         lottery and broken.
      
       - Warn and taint the kernel when microcode is loaded late
      
       - Remove the old unused microcode loader interface
      
       - Remove a redundant perf callback from the microcode loader
      
      * tag 'x86-microcode-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/microcode: Remove unnecessary perf callback
        x86/microcode: Taint and warn on late loading
        x86/microcode: Default-disable late loading
        x86/microcode: Rip out the OLD_INTERFACE
      9784edd7
    • Linus Torvalds's avatar
      Merge tag 'x86-cleanups-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a9251280
      Linus Torvalds authored
      Pull x86 cleanups from Thomas Gleixner:
       "A set of small x86 cleanups:
      
         - Remove unused headers in the IDT code
      
         - Kconfig indendation and comment fixes
      
         - Fix all 'the the' typos in one go instead of waiting for bots to
           fix one at a time"
      
      * tag 'x86-cleanups-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86: Fix all occurences of the "the the" typo
        x86/idt: Remove unused headers
        x86/Kconfig: Fix indentation of arch/x86/Kconfig.debug
        x86/Kconfig: Fix indentation and add endif comments to arch/x86/Kconfig
      a9251280
    • Linus Torvalds's avatar
      Merge tag 'x86-boot-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1fd9f4ce
      Linus Torvalds authored
      Pull x86 boot update from Thomas Gleixner:
       "Use strlcpy() instead of strscpy() in arch_setup()"
      
      * tag 'x86-boot-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/setup: Use strscpy() to replace deprecated strlcpy()
      1fd9f4ce
    • Linus Torvalds's avatar
      Merge tag 'timers-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c049ecc5
      Linus Torvalds authored
      Pull clockevent/clocksource updates from Thomas Gleixner:
      
       - Device tree bindings for MT8186
      
       - Tell the kernel that the RISC-V SBI timer stops in deeper power
         states
      
       - Make device tree parsing in sp804 more robust
      
       - Dead code removal and tiny fixes here and there
      
       - Add the missing SPDX identifiers
      
      * tag 'timers-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource/drivers/oxnas-rps: Fix irq_of_parse_and_map() return value
        clocksource/drivers/timer-ti-dm: Remove unnecessary NULL check
        clocksource/drivers/timer-sun5i: Convert to SPDX identifier
        clocksource/drivers/timer-sun4i: Convert to SPDX identifier
        clocksource/drivers/pistachio: Convert to SPDX identifier
        clocksource/drivers/orion: Convert to SPDX identifier
        clocksource/drivers/lpc32xx: Convert to SPDX identifier
        clocksource/drivers/digicolor: Convert to SPDX identifier
        clocksource/drivers/armada-370-xp: Convert to SPDX identifier
        clocksource/drivers/mips-gic-timer: Convert to SPDX identifier
        clocksource/drivers/jcore: Convert to SPDX identifier
        clocksource/drivers/bcm_kona: Convert to SPDX identifier
        clocksource/drivers/sp804: Avoid error on multiple instances
        clocksource/drivers/riscv: Events are stopped during CPU suspend
        clocksource/drivers/ixp4xx: Drop boardfile probe path
        dt-bindings: timer: Add compatible for Mediatek MT8186
      c049ecc5
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · bc1e02c3
      Linus Torvalds authored
      Pull scheduler fix from Thomas Gleixner:
       "Fix the fallout of sysctl code move which placed the init function
        wrong"
      
      * tag 'sched-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/autogroup: Fix sysctl move
      bc1e02c3
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fa11c280
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
      
        - Make the ICL event constraints match reality
      
        - Remove a unused local variable
      
      * tag 'perf-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Remove unused local variable
        perf/x86/intel: Fix event constraints for ICL
      fa11c280
    • Linus Torvalds's avatar
      Merge tag 'perf-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5cc47d4a
      Linus Torvalds authored
      Pull perf fixlet from Thomas Gleixner:
       "Trivial indentation fix in Kconfig"
      
      * tag 'perf-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/Kconfig: Fix indentation in the Kconfig file
      5cc47d4a
    • Linus Torvalds's avatar
      Merge tag 'objtool-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 44688ffd
      Linus Torvalds authored
      Pull objtool fixes from Thomas Gleixner:
      
       - Handle __ubsan_handle_builtin_unreachable() correctly and treat it as
         noreturn
      
       - Allow architectures to select uaccess validation
      
       - Use the non-instrumented bit test for test_cpu_has() to prevent
         escape from non-instrumentable regions
      
       - Use arch_ prefixed atomics for JUMP_LABEL=n builds to prevent escape
         from non-instrumentable regions
      
       - Mark a few tiny inline as __always_inline to prevent GCC from
         bringing them out of line and instrumenting them
      
       - Mark the empty stub context_tracking_enabled() as always inline as
         GCC brings them out of line and instruments the empty shell
      
       - Annotate ex_handler_msr_mce() as dead end
      
      * tag 'objtool-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/extable: Annotate ex_handler_msr_mce() as a dead end
        context_tracking: Always inline empty stubs
        x86: Always inline on_thread_stack() and current_top_of_stack()
        jump_label,noinstr: Avoid instrumentation for JUMP_LABEL=n builds
        x86/cpu: Elide KCSAN for cpu_has() and friends
        objtool: Mark __ubsan_handle_builtin_unreachable() as noreturn
        objtool: Add CONFIG_HAVE_UACCESS_VALIDATION
      44688ffd
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · b2c9a83d
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "Mostly small bug fixes plus other trivial updates.
      
        The major change of note is moving ufs out of scsi and a minor update
        to lpfc vmid handling"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits)
        scsi: qla2xxx: Remove unused 'ql_dm_tgt_ex_pct' parameter
        scsi: qla2xxx: Remove setting of 'req' and 'rsp' parameters
        scsi: mpi3mr: Fix kernel-doc
        scsi: lpfc: Add support for ATTO Fibre Channel devices
        scsi: core: Return BLK_STS_TRANSPORT for ALUA transitioning
        scsi: sd_zbc: Prevent zone information memory leak
        scsi: sd: Fix potential NULL pointer dereference
        scsi: mpi3mr: Rework mrioc->bsg_device model to fix warnings
        scsi: myrb: Fix up null pointer access on myrb_cleanup()
        scsi: core: Unexport scsi_bus_type
        scsi: sd: Don't call blk_cleanup_disk() in sd_probe()
        scsi: ufs: ufshcd: Delete unnecessary NULL check
        scsi: isci: Fix typo in comment
        scsi: pmcraid: Fix typo in comment
        scsi: smartpqi: Fix typo in comment
        scsi: qedf: Fix typo in comment
        scsi: esas2r: Fix typo in comment
        scsi: storvsc: Fix typo in comment
        scsi: ufs: Split the drivers/scsi/ufs directory
        scsi: qla1280: Remove redundant variable
        ...
      b2c9a83d
    • Linus Torvalds's avatar
      Merge tag 'hte/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux · 29814363
      Linus Torvalds authored
      Pull hardware timestamping subsystem from Thierry Reding:
       "This contains the new HTE (hardware timestamping engine) subsystem
        that has been in the works for a couple of months now.
      
        The infrastructure provided allows for drivers to register as hardware
        timestamp providers, while consumers will be able to request events
        that they are interested in (such as GPIOs and IRQs) to be timestamped
        by the hardware providers.
      
        Note that this currently supports only one provider, but there seems
        to be enough interest in this functionality and we expect to see more
        drivers added once this is merged"
      
      [ Linus Walleij mentions the Intel PMC in the Elkhart and Tiger Lake
        platforms as another future timestamp provider ]
      
      * tag 'hte/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
        dt-bindings: timestamp: Correct id path
        dt-bindings: Renamed hte directory to timestamp
        hte: Uninitialized variable in hte_ts_get()
        hte: Fix off by one in hte_push_ts_ns()
        hte: Fix possible use-after-free in tegra_hte_test_remove()
        hte: Remove unused including <linux/version.h>
        MAINTAINERS: Add HTE Subsystem
        hte: Add Tegra HTE test driver
        tools: gpio: Add new hardware clock type
        gpiolib: cdev: Add hardware timestamp clock type
        gpio: tegra186: Add HTE support
        gpiolib: Add HTE support
        dt-bindings: Add HTE bindings
        hte: Add Tegra194 HTE kernel provider
        drivers: Add hardware timestamp engine (HTE) subsystem
        Documentation: Add HTE subsystem guide
      29814363
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · 71e80720
      Linus Torvalds authored
      Pull more Kbuild updates from Masahiro Yamada:
      
       - Fix build regressions for parisc, csky, nios2, openrisc
      
       - Simplify module builds for CONFIG_LTO_CLANG and CONFIG_X86_KERNEL_IBT
      
       - Remove arch/parisc/nm, which was presumably a workaround for old
         tools
      
       - Check the odd combination of EXPORT_SYMBOL and 'static' precisely
      
       - Make external module builds robust against "too long argument error"
      
       - Support j, k keys for moving the cursor in nconfig
      
      * tag 'kbuild-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
        kbuild: Allow to select bash in a modified environment
        scripts: kconfig: nconf: make nconfig accept jk keybindings
        modpost: use fnmatch() to simplify match()
        modpost: simplify mod->name allocation
        kbuild: factor out the common objtool arguments
        kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_o
        kbuild: clean .tmp_* pattern by make clean
        kbuild: remove redundant cleanups in scripts/link-vmlinux.sh
        kbuild: rebuild multi-object modules when objtool is updated
        kbuild: add cmd_and_savecmd macro
        kbuild: make *.mod rule robust against too long argument error
        kbuild: make built-in.a rule robust against too long argument error
        kbuild: check static EXPORT_SYMBOL* by script instead of modpost
        parisc: remove arch/parisc/nm
        kbuild: do not create *.prelink.o for Clang LTO or IBT
        kbuild: replace $(linked-object) with CONFIG options
        kbuild: do not try to parse *.cmd files for objects provided by compiler
        kbuild: replace $(if A,A,B) with $(or A,B) in scripts/Makefile.modpost
        modpost: squash if...else-if in find_elf_symbol2()
        modpost: reuse ARRAY_SIZE() macro for section_mismatch()
        ...
      71e80720
    • Linus Torvalds's avatar
      Merge tag 'pull-18-rc1-work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 952923dd
      Linus Torvalds authored
      Pull vfs pathname updates from Al Viro:
       "Several cleanups in fs/namei.c"
      
      * tag 'pull-18-rc1-work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        namei: cleanup double word in comment
        get rid of dead code in legitimize_root()
        fs/namei.c:reserve_stack(): tidy up the call of try_to_unlazy()
      952923dd
    • Linus Torvalds's avatar
      Merge tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · cbd76ede
      Linus Torvalds authored
      Pull mount handling updates from Al Viro:
       "Cleanups (and one fix) around struct mount handling.
      
        The fix is usermode_driver.c one - once you've done kern_mount(), you
        must kern_unmount(); simple mntput() will end up with a leak. Several
        failure exits in there messed up that way... In practice you won't hit
        those particular failure exits without fault injection, though"
      
      * tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        move mount-related externs from fs.h to mount.h
        blob_to_mnt(): kern_unmount() is needed to undo kern_mount()
        m->mnt_root->d_inode->i_sb is a weird way to spell m->mnt_sb...
        linux/mount.h: trim includes
        uninline may_mount() and don't opencode it in fspick(2)/fsopen(2)
      cbd76ede
    • Linus Torvalds's avatar
      Merge tag 'pull-18-rc1-work.fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · dbe0ee46
      Linus Torvalds authored
      Pull file descriptor updates from Al Viro.
      
       - Descriptor handling cleanups
      
      * tag 'pull-18-rc1-work.fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        Unify the primitives for file descriptor closing
        fs: remove fget_many and fput_many interface
        io_uring_enter(): don't leave f.flags uninitialized
      dbe0ee46
    • Linus Torvalds's avatar
      Merge tag '5.19-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · d66016c5
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
       "Nine cifs/smb3 client fixes.
      
        Includes DFS fixes, some cleanup of leagcy SMB1 code, duplicated
        message cleanup and a double free and deadlock fix"
      
      * tag '5.19-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: fix uninitialized pointer in error case in dfs_cache_get_tgt_share
        cifs: skip trailing separators of prefix paths
        cifs: update internal module number
        cifs: version operations for smb20 unneeded when legacy support disabled
        cifs: do not build smb1ops if legacy support is disabled
        cifs: fix potential deadlock in direct reclaim
        cifs: when extending a file with falloc we should make files not-sparse
        cifs: remove repeated debug message on cifs_put_smb_ses()
        cifs: fix potential double free during failed mount
      d66016c5
  5. 04 Jun, 2022 10 commits
    • Schspa Shi's avatar
      kbuild: Allow to select bash in a modified environment · 42ce60aa
      Schspa Shi authored
      This fixes the build error when the system has a default bash version
      which is too old to support associative array variables.
      
      The build error log as fellowing:
      linux/scripts/check-local-export: line 11: declare: -A: invalid option
      declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
      Signed-off-by: default avatarSchspa Shi <schspa@gmail.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      42ce60aa
    • Isak Ellmer's avatar
      scripts: kconfig: nconf: make nconfig accept jk keybindings · 2bbb4861
      Isak Ellmer authored
      Make nconfig accept jk keybindings for movement in addition to arrow
      keys.
      Signed-off-by: default avatarIsak Ellmer <isak01@gmail.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      2bbb4861
    • Masahiro Yamada's avatar
      modpost: use fnmatch() to simplify match() · a89227d7
      Masahiro Yamada authored
      Replace the own implementation for wildcard (glob) matching with
      a function call to fnmatch().
      
      Also, change the return type to 'bool'.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      a89227d7
    • Masahiro Yamada's avatar
      modpost: simplify mod->name allocation · 8c9ce89c
      Masahiro Yamada authored
      mod->name is set to the ELF filename with the suffix ".o" stripped.
      
      The current code calls strdup() and free() to manipulate the string,
      but a simpler approach is to pass new_module() with the name length
      subtracted by 2.
      
      Also, check if the passed filename ends with ".o" before stripping it.
      
      The current code blindly chops the suffix:
      
          tmp[strlen(tmp) - 2] = '\0'
      
      It will cause buffer under-run if strlen(tmp) < 2;
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      8c9ce89c
    • Masahiro Yamada's avatar
      kbuild: factor out the common objtool arguments · b42d2306
      Masahiro Yamada authored
      scripts/Makefile.build and scripts/link-vmlinux.sh have similar setups
      for the objtool arguments.
      
      It was difficult to factor out them because all the vmlinux build rules
      were written in a shell script. It is somewhat tedious to touch the two
      files every time a new objtool option is supported.
      
      To reduce the code duplication, move the objtool for vmlinux.o into
      scripts/Makefile.vmlinux_o. Then, move the common macros to Makefile.lib
      so they are shared between Makefile.build and Makefile.vmlinux_o.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
      b42d2306
    • Masahiro Yamada's avatar
      kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_o · 5d45950d
      Masahiro Yamada authored
      This is a preparation for moving the objtool rule in the next commit.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
      5d45950d
    • Masahiro Yamada's avatar
      kbuild: clean .tmp_* pattern by make clean · b0d6207b
      Masahiro Yamada authored
      Change the "make clean" rule to remove all the .tmp_* files.
      
      .tmp_objdiff is the only exception, which should be removed by
      "make mrproper".
      
      Rename the record directory of objdiff, .tmp_objdiff to .objdiff to
      avoid the removal by "make clean".
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
      b0d6207b
    • Linus Torvalds's avatar
      Merge tag 'bitmap-for-5.19-rc1' of https://github.com/norov/linux · d0e60d46
      Linus Torvalds authored
      Pull bitmap updates from Yury Norov:
      
       - bitmap: optimize bitmap_weight() usage, from me
      
       - lib/bitmap.c make bitmap_print_bitmask_to_buf parseable, from Mauro
         Carvalho Chehab
      
       - include/linux/find: Fix documentation, from Anna-Maria Behnsen
      
       - bitmap: fix conversion from/to fix-sized arrays, from me
      
       - bitmap: Fix return values to be unsigned, from Kees Cook
      
      It has been in linux-next for at least a week with no problems.
      
      * tag 'bitmap-for-5.19-rc1' of https://github.com/norov/linux: (31 commits)
        nodemask: Fix return values to be unsigned
        bitmap: Fix return values to be unsigned
        KVM: x86: hyper-v: replace bitmap_weight() with hweight64()
        KVM: x86: hyper-v: fix type of valid_bank_mask
        ia64: cleanup remove_siblinginfo()
        drm/amd/pm: use bitmap_{from,to}_arr32 where appropriate
        KVM: s390: replace bitmap_copy with bitmap_{from,to}_arr64 where appropriate
        lib/bitmap: add test for bitmap_{from,to}_arr64
        lib: add bitmap_{from,to}_arr64
        lib/bitmap: extend comment for bitmap_(from,to)_arr32()
        include/linux/find: Fix documentation
        lib/bitmap.c make bitmap_print_bitmask_to_buf parseable
        MAINTAINERS: add cpumask and nodemask files to BITMAP_API
        arch/x86: replace nodes_weight with nodes_empty where appropriate
        mm/vmstat: replace cpumask_weight with cpumask_empty where appropriate
        clocksource: replace cpumask_weight with cpumask_empty in clocksource.c
        genirq/affinity: replace cpumask_weight with cpumask_empty where appropriate
        irq: mips: replace cpumask_weight with cpumask_empty where appropriate
        drm/i915/pmu: replace cpumask_weight with cpumask_empty where appropriate
        arch/x86: replace cpumask_weight with cpumask_empty where appropriate
        ...
      d0e60d46
    • Linus Torvalds's avatar
      Merge tag 'for-5.19/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 23df9ba6
      Linus Torvalds authored
      Pull more parisc architecture updates from Helge Deller:
       "A fix to prevent crash at bootup if CONFIG_SCHED_MC is enabled, and
        add auto-detection of primary graphics card for framebuffer driver"
      
      * tag 'for-5.19/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc/stifb: Keep track of hardware path of graphics card
        parisc/stifb: Implement fb_is_primary_device()
        parisc: fix a crash with multicore scheduler
      23df9ba6
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.19-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 4ccbe91d
      Linus Torvalds authored
      Pull more xen updates from Juergen Gross:
       "Two cleanup patches for Xen related code and (more important) an
        update of MAINTAINERS for Xen, as Boris Ostrovsky decided to step
        down"
      
      * tag 'for-linus-5.19-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen: replace xen_remap() with memremap()
        MAINTAINERS: Update Xen maintainership
        xen: switch gnttab_end_foreign_access() to take a struct page pointer
      4ccbe91d