1. 12 Jan, 2023 2 commits
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-6.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · e58f087e
      Linus Torvalds authored
      Pull MTD fixes from Miquel Raynal:
      
       - cfi: Allow building spi-intel standalone to avoid build issues
      
       - parsers: scpart: Fix __udivdi3 undefined on mips
      
       - parsers: tplink_safeloader: Fix potential memory leak during parsing
      
       - Update email of Tudor Ambarus
      
      * tag 'mtd/fixes-for-6.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        MAINTAINERS: Update email of Tudor Ambarus
        mtd: cfi: allow building spi-intel standalone
        mtd: parsers: scpart: fix __udivdi3 undefined on mips
        mtd: parsers: Fix potential memory leak in mtd_parser_tplink_safeloader_parse()
      e58f087e
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 23025cbc
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Ten small fixes (less the one that cleaned up a reverted removal),
        nine in drivers of which the ufs one is the most critical.
      
        The single core patch is a minor speedup to error handling"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: libsas: Grab the ATA port lock in sas_ata_device_link_abort()
        scsi: hisi_sas: Fix tag freeing for reserved tags
        scsi: ufs: core: WLUN suspend SSU/enter hibern8 fail recovery
        scsi: scsi_debug: Delete unreachable code in inquiry_vpd_b0()
        scsi: mpi3mr: Refer CONFIG_SCSI_MPI3MR in Makefile
        scsi: core: scsi_error: Do not queue pointless abort workqueue functions
        scsi: storvsc: Fix swiotlb bounce buffer leak in confidential VM
        scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace
        scsi: mpi3mr: Remove usage of dma_get_required_mask() API
        scsi: mpt3sas: Remove usage of dma_get_required_mask() API
      23025cbc
  2. 11 Jan, 2023 2 commits
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v6.2-2-2023-01-11' of... · e8f60cd7
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v6.2-2-2023-01-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Make 'perf kmem' cope with the removal of some
         kmem:kmem_cache_alloc_node and kmem:kmalloc_node in the
         11e9734b ("mm/slab_common: unify NUMA and UMA version of
         tracepoints") commit, making sure it works with Linux >= 6.2 as well
         as with older kernels where those tracepoints are present.
      
       - Also make it handle the new "node" kmem:kmalloc and
         kmem:kmem_cache_alloc tracepoint field introduced in that same
         commit.
      
       - Fix hardware tracing PMU address filter duplicate symbol selection,
         that was preventing to match with static functions with the same name
         present in different object files.
      
       - Fix regression on what linux/types.h file gets used to build the "BPF
         prologue" 'perf test' entry, the system one lacks the fmode_t
         definition used in this test, so provide that type in the test
         itself.
      
       - Avoid build breakage with libbpf < 0.8.0 + LIBBPF_DYNAMIC=1. If the
         user asks for linking with the libbpf package provided by the distro,
         then it has to be >= 0.8.0. Using the libbpf supplied with the kernel
         would be a fallback in that case.
      
       - Fix the build when libbpf isn't available or explicitly disabled via
         NO_LIBBPF=1.
      
       - Don't try to install libtraceevent plugins as its not anymore in the
         kernel sources and will thus always fail.
      
      * tag 'perf-tools-fixes-for-v6.2-2-2023-01-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf auxtrace: Fix address filter duplicate symbol selection
        perf bpf: Avoid build breakage with libbpf < 0.8.0 + LIBBPF_DYNAMIC=1
        perf build: Fix build error when NO_LIBBPF=1
        perf tools: Don't install libtraceevent plugins as its not anymore in the kernel sources
        perf kmem: Support field "node" in evsel__process_alloc_event() coping with recent tracepoint restructuring
        perf kmem: Support legacy tracepoints
        perf build: Properly guard libbpf includes
        perf tests bpf prologue: Fix bpf-script-test-prologue test compile issue with clang
      e8f60cd7
    • Adrian Hunter's avatar
      perf auxtrace: Fix address filter duplicate symbol selection · cf129830
      Adrian Hunter authored
      When a match has been made to the nth duplicate symbol, return
      success not error.
      
      Example:
      
        Before:
      
          $ cat file.c
          cat: file.c: No such file or directory
          $ cat file1.c
          #include <stdio.h>
      
          static void func(void)
          {
                  printf("First func\n");
          }
      
          void other(void);
      
          int main()
          {
                  func();
                  other();
                  return 0;
          }
          $ cat file2.c
          #include <stdio.h>
      
          static void func(void)
          {
                  printf("Second func\n");
          }
      
          void other(void)
          {
                  func();
          }
      
          $ gcc -Wall -Wextra -o test file1.c file2.c
          $ perf record -e intel_pt//u --filter 'filter func @ ./test' -- ./test
          Multiple symbols with name 'func'
          #1      0x1149  l       func
                          which is near           main
          #2      0x1179  l       func
                          which is near           other
          Disambiguate symbol name by inserting #n after the name e.g. func #2
          Or select a global symbol by inserting #0 or #g or #G
          Failed to parse address filter: 'filter func @ ./test'
          Filter format is: filter|start|stop|tracestop <start symbol or address> [/ <end symbol or size>] [@<file name>]
          Where multiple filters are separated by space or comma.
          $ perf record -e intel_pt//u --filter 'filter func #2 @ ./test' -- ./test
          Failed to parse address filter: 'filter func #2 @ ./test'
          Filter format is: filter|start|stop|tracestop <start symbol or address> [/ <end symbol or size>] [@<file name>]
          Where multiple filters are separated by space or comma.
      
        After:
      
          $ perf record -e intel_pt//u --filter 'filter func #2 @ ./test' -- ./test
          First func
          Second func
          [ perf record: Woken up 1 times to write data ]
          [ perf record: Captured and wrote 0.016 MB perf.data ]
          $ perf script --itrace=b -Ftime,flags,ip,sym,addr --ns
          1231062.526977619:   tr strt                               0 [unknown] =>     558495708179 func
          1231062.526977619:   tr end  call               558495708188 func =>     558495708050 _init
          1231062.526979286:   tr strt                               0 [unknown] =>     55849570818d func
          1231062.526979286:   tr end  return             55849570818f func =>     55849570819d other
      
      Fixes: 1b36c03e ("perf record: Add support for using symbols in address filters")
      Reported-by: default avatarDmitrii Dolgov <9erthalion6@gmail.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: default avatarDmitry Dolgov <9erthalion6@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20230110185659.15979-1-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cf129830
  3. 10 Jan, 2023 10 commits
  4. 09 Jan, 2023 2 commits
    • Linus Torvalds's avatar
      gcc: disable -Warray-bounds for gcc-11 too · 5a41237a
      Linus Torvalds authored
      We had already disabled this warning for gcc-12 due to bugs in the value
      range analysis, but it turns out we end up having some similar problems
      with gcc-11.3 too, so let's disable it there too.
      
      Older gcc versions end up being increasingly less relevant, and
      hopefully clang and newer version of gcc (ie gcc-13) end up working
      reliably enough that we still get the build coverage even when we
      disable this for some versions.
      
      Link: https://lore.kernel.org/all/20221227002941.GA2691687@roeck-us.net/
      Link: https://lore.kernel.org/all/D8BDBF66-E44C-45D4-9758-BAAA4F0C1998@kernel.org/
      Cc: Kees Cook <kees@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5a41237a
    • Athira Rajeev's avatar
      perf tests bpf prologue: Fix bpf-script-test-prologue test compile issue with clang · 6f9aba7f
      Athira Rajeev authored
      While running 'perf test' for bpf, observed that "BPF prologue
      generation" test case fails to compile with clang. Logs below from
      powerpc:
      
        <stdin>:33:2: error: use of undeclared identifier 'fmode_t'
                fmode_t f_mode = (fmode_t)_f_mode;
                ^
        <stdin>:37:6: error: use of undeclared identifier 'f_mode'; did you mean '_f_mode'?
                if (f_mode & FMODE_WRITE)
                    ^~~~~~
                    _f_mode
        <stdin>:30:60: note: '_f_mode' declared here
        int bpf_func__null_lseek(void *ctx, int err, unsigned long _f_mode,
                                                                   ^
        2 errors generated.
      
      The test code tests/bpf-script-test-prologue.c uses fmode_t.  And the
      error above is for "fmode_t" which is defined in include/linux/types.h
      as part of kernel build directory: "/lib/modules/<kernel_version>/build"
      that comes from kernel devel [ soft link to /usr/src/<kernel_version> ].
      
      Clang picks this header file from "-working-directory" build option that
      specifies this build folder.
      
      But the commit 14e4b9f4 ("perf trace: Raw augmented syscalls fix
      libbpf 1.0+ compatibility") changed the include directory to use:
      "/usr/include".
      
      Post this change, types.h from /usr/include/ is getting picked upwhich
      doesn’t contain definition of "fmode_t" and hence fails to compile.
      
      Compilation command before this commit:
      
        /usr/bin/clang -D__KERNEL__ -D__NR_CPUS__=72 -DLINUX_VERSION_CODE=0x50e00 -xc  -I/root/lib/perf/include/bpf -nostdinc -I./arch/powerpc/include -I./arch/powerpc/include/generated  -I./include -I./arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h  -Wno-unused-value -Wno-pointer-sign -working-directory /lib/modules/<ver>/build -c - -target bpf  -g -O2 -o -
      
      Compilation command after this commit:
      
        /usr/bin/clang -D__KERNEL__ -D__NR_CPUS__=72 -DLINUX_VERSION_CODE=0x50e00 -xc  -I/usr/include/ -nostdinc -I./arch/powerpc/include -I./arch/powerpc/include/generated  -I./include -I./arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h  -Wno-unused-value -Wno-pointer-sign -working-directory /lib/modules/<ver>/build -c - -target bpf  -g -O2 -o -
      
      The difference is addition of -I/usr/include/  in the first line which
      is causing the error. Fix this by adding typedef for "fmode_t" in the
      testcase to solve the compile issue.
      
      Fixes: 14e4b9f4 ("perf trace: Raw augmented syscalls fix libbpf 1.0+ compatibility")
      Signed-off-by: default avatarAthira Jajeev <atrajeev@linux.vnet.ibm.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Disha Goel <disgoel@linux.ibm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/linux-perf-users/20230105120436.92051-1-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6f9aba7f
  5. 08 Jan, 2023 4 commits
  6. 07 Jan, 2023 11 commits
  7. 06 Jan, 2023 9 commits
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2023-01-06' of git://anongit.freedesktop.org/drm/drm · 0a715535
      Linus Torvalds authored
      Pull drm fixes from Daniel Vetter:
       "Still not much, but more than last week. Dave should be back next week
        from the beaching.
      
        drivers:
         - i915-gvt fixes
         - amdgpu/kfd fixes
         - panfrost bo refcounting fix
         - meson afbc corruption fix
         - imx plane width fix
      
        core:
         - drm/sched fixes
         - drm/mm kunit test fix
         - dma-buf export error handling fixes"
      
      * tag 'drm-fixes-2023-01-06' of git://anongit.freedesktop.org/drm/drm:
        Revert "drm/amd/display: Enable Freesync Video Mode by default"
        drm/i915/gvt: fix double free bug in split_2MB_gtt_entry
        drm/i915/gvt: use atomic operations to change the vGPU status
        drm/i915/gvt: fix vgpu debugfs clean in remove
        drm/i915/gvt: fix gvt debugfs destroy
        drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()
        drm/amd/display: Uninitialized variables causing 4k60 UCLK to stay at DPM1 and not DPM0
        drm/amdkfd: Fix kernel warning during topology setup
        drm/scheduler: Fix lockup in drm_sched_entity_kill()
        drm/imx: ipuv3-plane: Fix overlay plane width
        drm/scheduler: Fix lockup in drm_sched_entity_kill()
        drm/virtio: Fix memory leak in virtio_gpu_object_create()
        drm/meson: Reduce the FIFO lines held when AFBC is not used
        drm/tests: reduce drm_mm_test stack usage
        drm/panfrost: Fix GEM handle creation ref-counting
        drm/plane-helper: Add the missing declaration of drm_atomic_state
        dma-buf: fix dma_buf_export init order v2
      0a715535
    • Jason A. Donenfeld's avatar
      tpm: Allow system suspend to continue when TPM suspend fails · 1382999a
      Jason A. Donenfeld authored
      TPM 1 is sometimes broken across system suspends, due to races or
      locking issues or something else that haven't been diagnosed or fixed
      yet, most likely having to do with concurrent reads from the TPM's
      hardware random number generator driver. These issues prevent the system
      from actually suspending, with errors like:
      
        tpm tpm0: A TPM error (28) occurred continue selftest
        ...
        tpm tpm0: A TPM error (28) occurred attempting get random
        ...
        tpm tpm0: Error (28) sending savestate before suspend
        tpm_tis 00:08: PM: __pnp_bus_suspend(): tpm_pm_suspend+0x0/0x80 returns 28
        tpm_tis 00:08: PM: dpm_run_callback(): pnp_bus_suspend+0x0/0x10 returns 28
        tpm_tis 00:08: PM: failed to suspend: error 28
        PM: Some devices failed to suspend, or early wake event detected
      
      This issue was partially fixed by 23393c64 ("char: tpm: Protect
      tpm_pm_suspend with locks"), in a last minute 6.1 commit that Linus took
      directly because the TPM maintainers weren't available. However, it
      seems like this just addresses the most common cases of the bug, rather
      than addressing it entirely. So there are more things to fix still,
      apparently.
      
      In lieu of actually fixing the underlying bug, just allow system suspend
      to continue, so that laptops still go to sleep fine. Later, this can be
      reverted when the real bug is fixed.
      
      Link: https://lore.kernel.org/lkml/7cbe96cf-e0b5-ba63-d1b4-f63d2e826efa@suse.cz/
      Cc: stable@vger.kernel.org # 6.1+
      Reported-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: default avatarLuigi Semenzato <semenzato@chromium.org>
      Cc: Peter Huewe <peterhuewe@gmx.de>
      Cc: Jarkko Sakkinen <jarkko@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Johannes Altmanninger <aclopte@gmail.com>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1382999a
    • Linus Torvalds's avatar
      hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling · cb7a95af
      Linus Torvalds authored
      Commit 55d1cbbb ("hfs/hfsplus: use WARN_ON for sanity check") fixed
      a build warning by turning a comment into a WARN_ON(), but it turns out
      that syzbot then complains because it can trigger said warning with a
      corrupted hfs image.
      
      The warning actually does warn about a bad situation, but we are much
      better off just handling it as the error it is.  So rather than warn
      about us doing bad things, stop doing the bad things and return -EIO.
      
      While at it, also fix a memory leak that was introduced by an earlier
      fix for a similar syzbot warning situation, and add a check for one case
      that historically wasn't handled at all (ie neither comment nor
      subsequent WARN_ON).
      
      Reported-by: syzbot+7bb7cd3595533513a9e7@syzkaller.appspotmail.com
      Fixes: 55d1cbbb ("hfs/hfsplus: use WARN_ON for sanity check")
      Fixes: 8d824e69 ("hfs: fix OOB Read in __hfs_brec_find")
      Link: https://lore.kernel.org/lkml/000000000000dbce4e05f170f289@google.com/Tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Viacheslav Dubeyko <slava@dubeyko.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cb7a95af
    • Linus Torvalds's avatar
      Merge tag 'block-2023-01-06' of git://git.kernel.dk/linux · a689b938
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "The big change here is obviously the revert of the pktcdvd driver
        removal. Outside of that, just minor tweaks. In detail:
      
         - Re-instate the pktcdvd driver, which necessitates adding back
           bio_copy_data_iter() and the fops->devnode() hook for now (me)
      
         - Fix for splitting of a bio marked as NOWAIT, causing either nowait
           reads or writes to error with EAGAIN even if parts of the IO
           completed (me)
      
         - Fix for ublk, punting management commands to io-wq as they can all
           easily block for extended periods of time (Ming)
      
         - Removal of SRCU dependency for the block layer (Paul)"
      
      * tag 'block-2023-01-06' of git://git.kernel.dk/linux:
        block: Remove "select SRCU"
        Revert "pktcdvd: remove driver."
        Revert "block: remove devnode callback from struct block_device_operations"
        Revert "block: bio_copy_data_iter"
        ublk: honor IO_URING_F_NONBLOCK for handling control command
        block: don't allow splitting of a REQ_NOWAIT bio
        block: handle bio_split_to_limits() NULL return
      a689b938
    • Linus Torvalds's avatar
      Merge tag 'io_uring-2023-01-06' of git://git.kernel.dk/linux · ef1a4a77
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few minor fixes that should go into the 6.2 release:
      
         - Fix for a memory leak in io-wq worker creation, if we ultimately
           end up canceling the worker creation before it gets created (me)
      
         - lockdep annotations for the CQ locking (Pavel)
      
         - A regression fix for CQ timeout handling (Pavel)
      
         - Ring pinning around deferred task_work fix (Pavel)
      
         - A trivial member move in struct io_ring_ctx, saving us some memory
           (me)"
      
      * tag 'io_uring-2023-01-06' of git://git.kernel.dk/linux:
        io_uring: fix CQ waiting timeout handling
        io_uring: move 'poll_multi_queue' bool in io_ring_ctx
        io_uring: lockdep annotate CQ locking
        io_uring: pin context while queueing deferred tw
        io_uring/io-wq: free worker if task_work creation is canceled
      ef1a4a77
    • Linus Torvalds's avatar
      Merge tag 'tif-notify-signal-2023-01-06' of git://git.kernel.dk/linux · 93387d49
      Linus Torvalds authored
      Pull arm TIF_NOTIFY_SIGNAL fixup from Jens Axboe:
       "Hui Tang reported a performance regressions with _TIF_WORK_MASK in
        newer kernels, which he tracked to a change that went into 5.11. After
        this change, we'll call do_work_pending() more often than we need to,
        because we're now testing bits 0..15 rather than just 0..7.
      
        Shuffle the bits around to avoid this"
      
      * tag 'tif-notify-signal-2023-01-06' of git://git.kernel.dk/linux:
        ARM: renumber bits related to _TIF_WORK_MASK
      93387d49
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-6.2-rc3' of https://github.com/ceph/ceph-client · 5c1a712f
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "Two file locking fixes from Xiubo"
      
      * tag 'ceph-for-6.2-rc3' of https://github.com/ceph/ceph-client:
        ceph: avoid use-after-free in ceph_fl_release_lock()
        ceph: switch to vfs_inode_has_locks() to fix file lock bug
      5c1a712f
    • Linus Torvalds's avatar
      Merge tag 'fixes_for_v6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 7b8c854c
      Linus Torvalds authored
      Pull UDF fixes from Jan Kara:
       "Two fixups of the UDF changes that went into 6.2-rc1"
      
      * tag 'fixes_for_v6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        udf: initialize newblock to 0
        udf: Fix extension of the last extent in the file
      7b8c854c
    • Linus Torvalds's avatar
      Merge tag 'for-6.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · fc7b76c4
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "A few more regression and regular fixes:
      
         - regressions:
             - fix assertion condition using = instead of ==
             - fix false alert on bad tree level check
             - fix off-by-one error in delalloc search during lseek
      
         - fix compat ro feature check at read-write remount
      
         - handle case when read-repair happens with ongoing device replace
      
         - updated error messages"
      
      * tag 'for-6.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix compat_ro checks against remount
        btrfs: always report error in run_one_delayed_ref()
        btrfs: handle case when repair happens with dev-replace
        btrfs: fix off-by-one in delalloc search during lseek
        btrfs: fix false alert on bad tree level check
        btrfs: add error message for metadata level mismatch
        btrfs: fix ASSERT em->len condition in btrfs_get_extent
      fc7b76c4