Skip to content
  1. Jul 16, 2022
  2. Jul 14, 2022
  3. Jul 13, 2022
    • Juergen Gross's avatar
      x86/pat: Fix x86_has_pat_wp() · 230ec83d
      Juergen Gross authored
      x86_has_pat_wp() is using a wrong test, as it relies on the normal
      PAT configuration used by the kernel. In case the PAT MSR has been
      setup by another entity (e.g. Xen hypervisor) it might return false
      even if the PAT configuration is allowing WP mappings. This due to the
      fact that when running as Xen PV guest the PAT MSR is setup by the
      hypervisor and cannot be changed by the guest. This results in the WP
      related entry to be at a different position when running as Xen PV
      guest compared to the bare metal or fully virtualized case.
      
      The correct way to test for WP support is:
      
      1. Get the PTE protection bits needed to select WP mode by reading
         __cachemode2pte_tbl[_PAGE_CACHE_MODE_WP] (depending on the PAT MSR
         setting this might return protection bits for a stronger mode, e.g.
         UC-)
      2. Translate those bits back into the real cache mode selected by those
         PTE bits by reading __pte2cachemode_tbl[__pte2cm_idx(prot)]
      3. Test for the cache mode to be _PAGE_CACHE_MODE_WP
      
      Fixes: f88a68fa
      
       ("x86/mm: Extend early_memremap() support with additional attrs")
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: <stable@vger.kernel.org> # 4.14
      Link: https://lore.kernel.org/r/20220503132207.17234-1-jgross@suse.com
      230ec83d
    • Jiri Slaby's avatar
      x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit · 3131ef39
      Jiri Slaby authored
      The build on x86_32 currently fails after commit
      
        9bb2ec60 (objtool: Update Retpoline validation)
      
      with:
      
        arch/x86/kernel/../../x86/xen/xen-head.S:35: Error: no such instruction: `annotate_unret_safe'
      
      ANNOTATE_UNRET_SAFE is defined in nospec-branch.h. And head_32.S is
      missing this include. Fix this.
      
      Fixes: 9bb2ec60
      
       ("objtool: Update Retpoline validation")
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lore.kernel.org/r/63e23f80-033f-f64e-7522-2816debbc367@kernel.org
      3131ef39
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · b047602d
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Fixes and minor clean ups for tracing:
      
         - Fix memory leak by reverting what was thought to be a double free.
      
           A static tool had gave a false positive that a double free was
           possible in the error path, but it was actually a different
           location that confused the static analyzer (and those of us that
           reviewed it).
      
         - Move use of static buffers by ftrace_dump() to a location that can
           be used by kgdb's ftdump(), as it needs it for the same reasons.
      
         - Clarify in the Kconfig description that function tracing has
           negligible impact on x86, but may have a bit bigger impact on other
           architectures.
      
         - Remove unnecessary extra semicolon in trace event.
      
         - Make a local variable static that is used in the fprobes sample
      
         - Use KSYM_NAME_LEN for length of function in kprobe sample and get
           rid of unneeded macro for the same purpose"
      
      * tag 'trace-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        samples: Use KSYM_NAME_LEN for kprobes
        fprobe/samples: Make sample_probe static
        blk-iocost: tracing: atomic64_read(&ioc->vtime_rate) is assigned an extra semicolon
        ftrace: Be more specific about arch impact when function tracer is enabled
        tracing: Fix sleeping while atomic in kdb ftdump
        tracing/histograms: Fix memory leak problem
      b047602d
    • Tiezhu Yang's avatar
      samples: Use KSYM_NAME_LEN for kprobes · 1e1fb420
      Tiezhu Yang authored
      
      
      It is better and enough to use KSYM_NAME_LEN for kprobes
      in samples, no need to define and use the other values.
      
      Link: https://lkml.kernel.org/r/1654651402-21552-1-git-send-email-yangtiezhu@loongson.cn
      
      Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      1e1fb420
    • sunliming's avatar
      fprobe/samples: Make sample_probe static · e3655dfa
      sunliming authored
      
      
      This symbol is not used outside of fprobe_example.c, so marks it static.
      
      Fixes the following warning:
      
      sparse warnings: (new ones prefixed by >>)
      >> samples/fprobe/fprobe_example.c:23:15: sparse: sparse: symbol 'sample_probe'
      was not declared. Should it be static?
      
      Link: https://lkml.kernel.org/r/20220606075659.674556-1-sunliming@kylinos.cn
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarsunliming <sunliming@kylinos.cn>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      e3655dfa
    • Li kunyu's avatar
      blk-iocost: tracing: atomic64_read(&ioc->vtime_rate) is assigned an extra semicolon · 0bb7e14c
      Li kunyu authored
      
      
      Remove extra semicolon.
      
      Link: https://lkml.kernel.org/r/20220629030013.10362-1-kunyu@nfschina.com
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarLi kunyu <kunyu@nfschina.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      0bb7e14c
    • Steven Rostedt (Google)'s avatar
      ftrace: Be more specific about arch impact when function tracer is enabled · 0a6d7d45
      Steven Rostedt (Google) authored
      
      
      It was brought up that on ARMv7, that because the FUNCTION_TRACER does not
      use nops to keep function tracing disabled because of the use of a link
      register, it does have some performance impact.
      
      The start of functions when -pg is used to compile the kernel is:
      
      	push    {lr}
      	bl      8010e7c0 <__gnu_mcount_nc>
      
      When function tracing is tuned off, it becomes:
      
      	push    {lr}
      	add   sp, sp, #4
      
      Which just puts the stack back to its normal location. But these two
      instructions at the start of every function does incur some overhead.
      
      Be more honest in the Kconfig FUNCTION_TRACER description and specify that
      the overhead being in the noise was x86 specific, but other architectures
      may vary.
      
      Link: https://lore.kernel.org/all/20220705105416.GE5208@pengutronix.de/
      Link: https://lkml.kernel.org/r/20220706161231.085a83da@gandalf.local.home
      
      Reported-by: default avatarSascha Hauer <sha@pengutronix.de>
      Acked-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      0a6d7d45
    • Douglas Anderson's avatar
      tracing: Fix sleeping while atomic in kdb ftdump · 495fcec8
      Douglas Anderson authored
      If you drop into kdb and type "ftdump" you'll get a sleeping while
      atomic warning from memory allocation in trace_find_next_entry().
      
      This appears to have been caused by commit ff895103 ("tracing:
      Save off entry when peeking at next entry"), which added the
      allocation in that path. The problematic commit was already fixed by
      commit 8e99cf91 ("tracing: Do not allocate buffer in
      trace_find_next_entry() in atomic") but that fix missed the kdb case.
      
      The fix here is easy: just move the assignment of the static buffer to
      the place where it should have been to begin with:
      trace_init_global_iter(). That function is called in two places, once
      is right before the assignment of the static buffer added by the
      previous fix and once is in kdb.
      
      Note that it appears that there's a second static buffer that we need
      to assign that was added in commit efbbdaa2 ("tracing: Show real
      address for trace event arguments"), so we'll move that too.
      
      Link: https://lkml.kernel.org/r/20220708170919.1.I75844e5038d9425add2ad853a608cb44bb39df40@changeid
      
      Fixes: ff895103 ("tracing: Save off entry when peeking at next entry")
      Fixes: efbbdaa2
      
       ("tracing: Show real address for trace event arguments")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      495fcec8
    • Zheng Yejian's avatar
      tracing/histograms: Fix memory leak problem · 7edc3945
      Zheng Yejian authored
      This reverts commit 46bbe5c6.
      
      As commit 46bbe5c6 ("tracing: fix double free") said, the
      "double free" problem reported by clang static analyzer is:
        > In parse_var_defs() if there is a problem allocating
        > var_defs.expr, the earlier var_defs.name is freed.
        > This free is duplicated by free_var_defs() which frees
        > the rest of the list.
      
      However, if there is a problem allocating N-th var_defs.expr:
        + in parse_var_defs(), the freed 'earlier var_defs.name' is
          actually the N-th var_defs.name;
        + then in free_var_defs(), the names from 0th to (N-1)-th are freed;
      
                              IF ALLOCATING PROBLEM HAPPENED HERE!!! -+
                                                                       \
                                                                        |
                0th           1th                 (N-1)-th      N-th    V
                +-------------+-------------+-----+-------------+-----------
      var_defs: | name | expr | name | expr | ... | name | expr | name | ///
                +-------------+-------------+-----+-------------+-----------
      
      These two frees don't act on same name, so there was no "double free"
      problem before. Conversely, after that commit, we get a "memory leak"
      problem because the above "N-th var_defs.name" is not freed.
      
      If enable CONFIG_DEBUG_KMEMLEAK and inject a fault at where the N-th
      var_defs.expr allocated, then execute on shell like:
        $ echo 'hist:key=call_site:val=$v1,$v2:v1=bytes_req,v2=bytes_alloc' > \
      /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
      
      Then kmemleak reports:
        unreferenced object 0xffff8fb100ef3518 (size 8):
          comm "bash", pid 196, jiffies 4295681690 (age 28.538s)
          hex dump (first 8 bytes):
            76 31 00 00 b1 8f ff ff                          v1......
          backtrace:
            [<0000000038fe4895>] kstrdup+0x2d/0x60
            [<00000000c99c049a>] event_hist_trigger_parse+0x206f/0x20e0
            [<00000000ae70d2cc>] trigger_process_regex+0xc0/0x110
            [<0000000066737a4c>] event_trigger_write+0x75/0xd0
            [<000000007341e40c>] vfs_write+0xbb/0x2a0
            [<0000000087fde4c2>] ksys_write+0x59/0xd0
            [<00000000581e9cdf>] do_syscall_64+0x3a/0x80
            [<00000000cf3b065c>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      Link: https://lkml.kernel.org/r/20220711014731.69520-1-zhengyejian1@huawei.com
      
      Cc: stable@vger.kernel.org
      Fixes: 46bbe5c6
      
       ("tracing: fix double free")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Reviewed-by: default avatarTom Zanussi <tom.zanussi@linux.intel.com>
      Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      7edc3945
  4. Jul 12, 2022
    • Linus Torvalds's avatar
      Merge tag 'ovl-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · 72a8e05d
      Linus Torvalds authored
      Pull overlayfs fix from Miklos Szeredi:
       "Add a temporary fix for posix acls on idmapped mounts introduced in
        this cycle. A proper fix will be added in the next cycle"
      
      * tag 'ovl-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: turn off SB_POSIXACL with idmapped layers temporarily
      72a8e05d
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-07-12' of git://anongit.freedesktop.org/drm/drm · 29851567
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "I see you picked up one of the fbdev fixes, this is the other stuff
        that was queued up last week.
      
        A bit of a scattering of fixes, three for i915, one amdgpu, and a
        couple of panfrost, rockchip, panel and bridge ones.
      
        amdgpu:
         - Hibernation fix
      
        dma-buf:
         - fix use after free of fence
      
        i915:
         - Fix a possible refcount leak in DP MST connector (Hangyu)
         - Fix on loading guc on ADL-N (Daniele)
         - Fix vm use-after-free in vma destruction (Thomas)
      
        bridge:
         - fsl-ldb : 3 LVDS modesetting fixes
      
        rockchip:
         - iommu domain fix
      
        panfrost:
         - fix memory corruption
         - error path fix
      
        panel:
         - orientation quirk fix for Yoga tablet 2
      
        ssd130x:
         - fix pre-charge period setting"
      
      * tag 'drm-fixes-2022-07-12' of git://anongit.freedesktop.org/drm/drm:
        drm/ssd130x: Fix pre-charge period setting
        dma-buf: Fix one use-after-free of fence
        drm/i915: Fix vm use-after-free in vma destruction
        drm/i915/guc: ADL-N should use the same GuC FW as ADL-S
        drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()
        drm/amdgpu/display: disable prefer_shadow for generic fb helpers
        drm/amdgpu: keep fbdev buffers pinned during suspend
        drm/panfrost: Fix shrinker list corruption by madvise IOCTL
        drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error
        drm/rockchip: Detach from ARM DMA domain in attach_device
        drm/bridge: fsl-ldb: Drop DE signal polarity inversion
        drm/bridge: fsl-ldb: Enable split mode for LVDS dual link
        drm/bridge: fsl-ldb: Fix mode clock rate validation
        drm/aperture: Run fbdev removal before internal helpers
        drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Tablet 2 830
      29851567
    • Linus Torvalds's avatar
      Merge tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0d8ba24e
      Linus Torvalds authored
      Pull lockdep fix for x86 retbleed from Borislav Petkov:
      
       - Fix lockdep complaint for __static_call_fixup()
      
      * tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/static_call: Serialize __static_call_fixup() properly
      0d8ba24e
    • Thomas Gleixner's avatar
      x86/static_call: Serialize __static_call_fixup() properly · c27c753e
      Thomas Gleixner authored
      __static_call_fixup() invokes __static_call_transform() without holding
      text_mutex, which causes lockdep to complain in text_poke_bp().
      
      Adding the proper locking cures that, but as this is either used during
      early boot or during module finalizing, it's not required to use
      text_poke_bp(). Add an argument to __static_call_transform() which tells
      it to use text_poke_early() for it.
      
      Fixes: ee88d363
      
       ("x86,static_call: Use alternative RET encoding")
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      c27c753e
    • Linus Torvalds's avatar
      Merge tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ce114c86
      Linus Torvalds authored
      Pull x86 retbleed fixes from Borislav Petkov:
       "Just when you thought that all the speculation bugs were addressed and
        solved and the nightmare is complete, here's the next one: speculating
        after RET instructions and leaking privileged information using the
        now pretty much classical covert channels.
      
        It is called RETBleed and the mitigation effort and controlling
        functionality has been modelled similar to what already existing
        mitigations provide"
      
      * tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (54 commits)
        x86/speculation: Disable RRSBA behavior
        x86/kexec: Disable RET on kexec
        x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported
        x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry
        x86/bugs: Add Cannon lake to RETBleed affected CPU list
        x86/retbleed: Add fine grained Kconfig knobs
        x86/cpu/amd: Enumerate BTC_NO
        x86/common: Stamp out the stepping madness
        KVM: VMX: Prevent RSB underflow before vmenter
        x86/speculation: Fill RSB on vmexit for IBRS
        KVM: VMX: Fix IBRS handling after vmexit
        KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS
        KVM: VMX: Convert launched argument to flags
        KVM: VMX: Flatten __vmx_vcpu_run()
        objtool: Re-add UNWIND_HINT_{SAVE_RESTORE}
        x86/speculation: Remove x86_spec_ctrl_mask
        x86/speculation: Use cached host SPEC_CTRL value for guest entry/exit
        x86/speculation: Fix SPEC_CTRL write on SMT state change
        x86/speculation: Fix firmware entry SPEC_CTRL handling
        x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n
        ...
      ce114c86
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2022-07-07-1' of... · 3590b44b
      Dave Airlie authored
      
      Merge tag 'drm-misc-fixes-2022-07-07-1' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-fixes
      
      Three mode setting fixes for fsl-ldb, a fbdev removal use-after-free fix,
      a dma-buf fence use-after-free fix, a DMA setup fix for rockchip, an error
      path fix and memory corruption fix for panfrost and one more orientation
      quirk
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maxime Ripard <maxime@cerno.tech>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220708054306.wr6jcfdunuypftbq@houat
      3590b44b
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2022-07-07' of... · 42e0a872
      Dave Airlie authored
      
      Merge tag 'drm-intel-fixes-2022-07-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - Fix a possible refcount leak in DP MST connector (Hangyu)
      - Fix on loading guc on ADL-N (Daniele)
      - Fix vm use-after-free in vma destruction (Thomas)
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/YsbbgWnLTR8fr4lj@intel.com
      42e0a872
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.19-2022-07-06' of... · 7de96365
      Dave Airlie authored
      
      Merge tag 'amd-drm-fixes-5.19-2022-07-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.19-2022-07-06:
      
      amdgpu:
      - Hibernation fix
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220707024421.5773-1-alexander.deucher@amd.com
      7de96365
    • Linus Torvalds's avatar
      Merge tag 'for-5.19-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 5a29232d
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "A more fixes that seem to me to be important enough to get merged
        before release:
      
         - in zoned mode, fix leak of a structure when reading zone info, this
           happens on normal path so this can be significant
      
         - in zoned mode, revert an optimization added in 5.19-rc1 to finish a
           zone when the capacity is full, but this is not reliable in all
           cases
      
         - try to avoid short reads for compressed data or inline files when
           it's a NOWAIT read, applications should handle that but there are
           two, qemu and mariadb, that are affected"
      
      * tag 'for-5.19-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: zoned: drop optimization of zone finish
        btrfs: zoned: fix a leaked bioc in read_zone_info
        btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and inline extents
      5a29232d
    • Linus Torvalds's avatar
      Merge tags 'free-mq_sysctls-for-v5.19' and 'ptrace_unfreeze_fix-for-v5.19' of... · 23458ac9
      Linus Torvalds authored
      Merge tags 'free-mq_sysctls-for-v5.19' and 'ptrace_unfreeze_fix-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull ipc namespace fix from Eric Biederman:
       "This fixes a bug with error handling if ipc creation fails that was
        reported by syzbot"
      
      For completeness, this also pulls the ptrace_unfreeze_fix tag that
      contains the original version of one of the hotfixes that I manually
      applied earlier so that it would be fixed in rc6.
      
      * tag 'free-mq_sysctls-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        ipc: Free mq_sysctls if ipc namespace creation failed
      
      * tag 'ptrace_unfreeze_fix-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        ptrace: fix clearing of JOBCTL_TRACED in ptrace_unfreeze_traced()
      23458ac9
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2022-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · 8e59a6a7
      Linus Torvalds authored
      Pull hotfixes from Andrew Morton:
       "Mainly MM fixes. About half for issues which were introduced after
        5.18 and the remainder for longer-term issues"
      
      * tag 'mm-hotfixes-stable-2022-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        mm: split huge PUD on wp_huge_pud fallback
        nilfs2: fix incorrect masking of permission flags for symlinks
        mm/rmap: fix dereferencing invalid subpage pointer in try_to_migrate_one()
        riscv/mm: fix build error while PAGE_TABLE_CHECK enabled without MMU
        Documentation: highmem: use literal block for code example in highmem.h comment
        mm: sparsemem: fix missing higher order allocation splitting
        mm/damon: use set_huge_pte_at() to make huge pte old
        sh: convert nommu io{re,un}map() to static inline functions
        mm: userfaultfd: fix UFFDIO_CONTINUE on fallocated shmem pages
      8e59a6a7
    • Linus Torvalds's avatar
      Merge tag 'modules-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux · b5374396
      Linus Torvalds authored
      Pull module fixes from Luis Chamberlain:
       "Although most of the move of code in in v5.19-rc1 should have not
        introduced a regression patch review on one of the file changes
        captured a checkpatch warning which advised to use strscpy() and it
        caused a buffer overflow when an incorrect length is passed.
      
        Another change which checkpatch complained about was an odd RCU usage,
        but that was properly addressed in a separate patch to the move by
        Aaron. That caused a regression with PREEMPT_RT=y due to an unbounded
        latency.
      
        This series fixes both and adjusts documentation which we forgot to do
        for the move"
      
      * tag 'modules-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
        module: kallsyms: Ensure preemption in add_kallsyms() with PREEMPT_RT
        doc: module: update file references
        module: Fix "warning: variable 'exit' set but not used"
        module: Fix selfAssignment cppcheck warning
        modules: Fix corruption of /proc/kallsyms
      b5374396
    • Aaron Tomlin's avatar
      module: kallsyms: Ensure preemption in add_kallsyms() with PREEMPT_RT · e69a6614
      Aaron Tomlin authored
      The commit 08126db5
      
       ("module: kallsyms: Fix suspicious rcu usage")
      under PREEMPT_RT=y, disabling preemption introduced an unbounded
      latency since the loop is not fixed. This change caused a regression
      since previously preemption was not disabled and we would dereference
      RCU-protected pointers explicitly. That being said, these pointers
      cannot change.
      
      Before kallsyms-specific data is prepared/or set-up, we ensure that
      the unformed module is known to be unique i.e. does not already exist
      (see load_module()). Therefore, we can fix this by using the common and
      more appropriate RCU flavour as this section of code can be safely
      preempted.
      
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Fixes: 08126db5
      
       ("module: kallsyms: Fix suspicious rcu usage")
      Signed-off-by: default avatarAaron Tomlin <atomlin@redhat.com>
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      e69a6614
    • Linus Torvalds's avatar
      Merge tag 'vfio-v5.19-rc7' of https://github.com/awilliam/linux-vfio · 816e51df
      Linus Torvalds authored
      Pull VFIO fix from Alex Williamson:
      
       - Move IOMMU test to unbreak no-iommu support (Jason Gunthorpe)
      
      * tag 'vfio-v5.19-rc7' of https://github.com/awilliam/linux-vfio:
        vfio: Move IOMMU_CAP_CACHE_COHERENCY test to after we know we have a group
      816e51df
    • Oleg Nesterov's avatar
      fix race between exit_itimers() and /proc/pid/timers · d5b36a4d
      Oleg Nesterov authored
      
      
      As Chris explains, the comment above exit_itimers() is not correct,
      we can race with proc_timers_seq_ops. Change exit_itimers() to clear
      signal->posix_timers with ->siglock held.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatar <chris@accessvector.net>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d5b36a4d
  5. Jul 11, 2022
    • Linus Torvalds's avatar
      Linux 5.19-rc6 · 32346491
      Linus Torvalds authored
      32346491
    • Linus Torvalds's avatar
      Merge branch 'hot-fixes' (fixes for rc6) · 24f4b40e
      Linus Torvalds authored
      This is a collection of three fixes for small annoyances.
      
      Two of these are already pending in other trees, but I really don't want
      to release another -rc with these issues pending, so I picked up the
      patches for these things directly.  We'll end up with duplicate commits
      eventually, I prefer that over having these issues pending.
      
      The third one is just me getting rid of another BUG_ON() just because it
      was reported and I dislike those things so much.
      
      * merge 'hot-fixes' branch:
        ida: don't use BUG_ON() for debugging
        drm/aperture: Run fbdev removal before internal helpers
        ptrace: fix clearing of JOBCTL_TRACED in ptrace_unfreeze_traced()
      24f4b40e
    • Linus Torvalds's avatar
      ida: don't use BUG_ON() for debugging · fc82bbf4
      Linus Torvalds authored
      This is another old BUG_ON() that just shouldn't exist (see also commit
      a382f8fe: "signal handling: don't use BUG_ON() for debugging").
      
      In fact, as Matthew Wilcox points out, this condition shouldn't really
      even result in a warning, since a negative id allocation result is just
      a normal allocation failure:
      
        "I wonder if we should even warn here -- sure, the caller is trying to
         free something that wasn't allocated, but we don't warn for
         kfree(NULL)"
      
      and goes on to point out how that current error check is only causing
      people to unnecessarily do their own index range checking before freeing
      it.
      
      This was noted by Itay Iellin, because the bluetooth HCI socket cookie
      code does *not* do that range checking, and ends up just freeing the
      error case too, triggering the BUG_ON().
      
      The HCI code requires CAP_NET_RAW, and seems to just result in an ugly
      splat, but there really is no reason to BUG_ON() here, and we have
      generally striven for allocation models where it's always ok to just do
      
          free(alloc());
      
      even if the allocation were to fail for some random reason (usually
      obviously that "random" reason being some resource limit).
      
      Fixes: 88eca020
      
       ("ida: simplified functions for id allocation")
      Reported-by: default avatarItay Iellin <ieitayie@gmail.com>
      Suggested-by: default avatarMatthew Wilcox <willy@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fc82bbf4
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · 952c53cd
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "One core fix for DMA_INTERRUPT and rest driver fixes.
      
        Core:
      
         - Revert verification of DMA_INTERRUPT capability as that was
           incorrect
      
        Bunch of driver fixes for:
      
         - ti: refcount and put_device leak
      
         - qcom_bam: runtime pm overflow
      
         - idxd: force wq context cleanup and call idxd_enable_system_pasid()
           on success
      
         - dw-axi-dmac: RMW on channel suspend register
      
         - imx-sdma: restart cyclic channel when enabled
      
         - at_xdma: error handling for at_xdmac_alloc_desc
      
         - pl330: lockdep warning
      
         - lgm: error handling path in probe
      
         - allwinner: Fix min/max typo in binding"
      
      * tag 'dmaengine-fix-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dt-bindings: dma: allwinner,sun50i-a64-dma: Fix min/max typo
        dmaengine: lgm: Fix an error handling path in intel_ldma_probe()
        dmaengine: pl330: Fix lockdep warning about non-static key
        dmaengine: idxd: Only call idxd_enable_system_pasid() if succeeded in enabling SVA feature
        dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly
        dmaengine: imx-sdma: only restart cyclic channel when enabled
        dmaengine: dw-axi-dmac: Fix RMW on channel suspend register
        dmaengine: idxd: force wq context cleanup on device disable path
        dmaengine: qcom: bam_dma: fix runtime PM underflow
        dmaengine: imx-sdma: Allow imx8m for imx7 FW revs
        dmaengine: Revert "dmaengine: add verification of DMA_INTERRUPT capability for dmatest"
        dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate
        dmaengine: ti: Fix refcount leak in ti_dra7_xbar_route_allocate
      952c53cd
    • Linus Torvalds's avatar
      Merge tag 'staging-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 5867f3b8
      Linus Torvalds authored
      Pull staging driver fix from Greg KH:
       "Here is a single staging driver fix for a reported problem that showed
        up in 5.19-rc1 in the wlan-ng driver. It has been in linux-next for a
        week with no reported problems"
      
      * tag 'staging-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging/wlan-ng: get the correct struct hfa384x in work callback
      5867f3b8
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · b41362fd
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are four small char/misc driver fixes for 5.19-rc6 to resolve
        some reported issues. They only affect two drivers:
      
         - rtsx_usb: fix for of-reported DMA warning error, the driver was
           handling memory buffers in odd ways, it has now been fixed up to be
           much simpler and correct by Shuah.
      
         - at25 eeprom driver bugfix for reported problem
      
        All of these have been in linux-next for a week with no reported
        problems"
      
      * tag 'char-misc-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        misc: rtsx_usb: set return value in rsp_buf alloc err path
        misc: rtsx_usb: use separate command and response buffers
        misc: rtsx_usb: fix use of dma mapped buffer for usb bulk transfer
        eeprom: at25: Rework buggy read splitting
      b41362fd
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.19-2022-07-09' of git://git.kernel.dk/linux-block · d9919d43
      Linus Torvalds authored
      Pull io_uring fix from Jens Axboe:
       "A single fix for an issue that came up yesterday that we should plug
        for -rc6.
      
        This is a regression introduced in this cycle"
      
      * tag 'io_uring-5.19-2022-07-09' of git://git.kernel.dk/linux-block:
        io_uring: check that we have a file table when allocating update slots
      d9919d43
  6. Jul 10, 2022
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.19-3' of... · 2fbd36df
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Adjust gen_compile_commands.py to the format change of *.mod files
      
       - Remove unused macro in scripts/Makefile.modinst
      
      * tag 'kbuild-fixes-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: remove unused cmd_none in scripts/Makefile.modinst
        gen_compile_commands: handle multiple lines per .mod file
      2fbd36df
    • Linus Torvalds's avatar
      Merge tag 'irq_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2b9b31ce
      Linus Torvalds authored
      Pull irq fixes from Borislav Petkov:
      
       - Gracefully handle failure to request MMIO resources in the GICv3
         driver
      
       - Make a static key static in the Apple AIC driver
      
       - Fix the Xilinx intc driver dependency on OF_ADDRESS
      
      * tag 'irq_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/apple-aic: Make symbol 'use_fast_ipi' static
        irqchip/xilinx: Add explicit dependency on OF_ADDRESS
        irqchip/gicv3: Handle resource request failure consistently
      2b9b31ce
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 74a0032b
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Prepare for and clear .brk early in order to address XenPV guests
         failures where the hypervisor verifies page tables and uninitialized
         data in that range leads to bogus failures in those checks
      
       - Add any potential setup_data entries supplied at boot to the identity
         pagetable mappings to prevent kexec kernel boot failures. Usually,
         this is not a problem for the normal kernel as those mappings are
         part of the initially mapped 2M pages but if kexec gets to allocate
         the second kernel somewhere else, those setup_data entries need to be
         mapped there too.
      
       - Fix objtool not to discard text references from the __tracepoints
         section so that ENDBR validation still works
      
       - Correct the setup_data types limit as it is user-visible, before 5.19
         releases
      
      * tag 'x86_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot: Fix the setup data types max limit
        x86/ibt, objtool: Don't discard text references from tracepoint section
        x86/compressed/64: Add identity mappings for setup_data entries
        x86: Fix .brk attribute in linker script
        x86: Clear .brk area at early boot
        x86/xen: Use clear_bss() for Xen PV guests
      74a0032b
    • Masahiro Yamada's avatar
      kbuild: remove unused cmd_none in scripts/Makefile.modinst · f5a46185
      Masahiro Yamada authored
      Commit 65ce9c38
      
       ("kbuild: move module strip/compression code into
      scripts/Makefile.modinst") added this unused code.
      
      Perhaps, I thought cmd_none was useful for CONFIG_MODULE_COMPRESS_NONE,
      but I did not use it after all.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      f5a46185
    • Borislav Petkov's avatar
      x86/boot: Fix the setup data types max limit · cb8a4bea
      Borislav Petkov authored
      Commit in Fixes forgot to change the SETUP_TYPE_MAX definition which
      contains the highest valid setup data type.
      
      Correct that.
      
      Fixes: 5ea98e01
      
       ("x86/boot: Add Confidential Computing type to setup_data")
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lore.kernel.org/r/ddba81dd-cc92-699c-5274-785396a17fb5@zytor.com
      cb8a4bea