1. 06 1月, 2022 3 次提交
  2. 20 12月, 2021 14 次提交
  3. 19 12月, 2021 4 次提交
  4. 18 12月, 2021 17 次提交
    • A
      perf inject: Fix segfault due to perf_data__fd() without open · c271a55b
      Adrian Hunter 提交于
      The fixed commit attempts to get the output file descriptor even if the
      file was never opened e.g.
      
        $ perf record uname
        Linux
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.002 MB perf.data (7 samples) ]
        $ perf inject -i perf.data --vm-time-correlation=dry-run
        Segmentation fault (core dumped)
        $ gdb --quiet perf
        Reading symbols from perf...
        (gdb) r inject -i perf.data --vm-time-correlation=dry-run
        Starting program: /home/ahunter/bin/perf inject -i perf.data --vm-time-correlation=dry-run
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
      
        Program received signal SIGSEGV, Segmentation fault.
        __GI___fileno (fp=0x0) at fileno.c:35
        35      fileno.c: No such file or directory.
        (gdb) bt
        #0  __GI___fileno (fp=0x0) at fileno.c:35
        #1  0x00005621e48dd987 in perf_data__fd (data=0x7fff4c68bd08) at util/data.h:72
        #2  perf_data__fd (data=0x7fff4c68bd08) at util/data.h:69
        #3  cmd_inject (argc=<optimized out>, argv=0x7fff4c69c1f0) at builtin-inject.c:1017
        #4  0x00005621e4936783 in run_builtin (p=0x5621e4ee6878 <commands+600>, argc=4, argv=0x7fff4c69c1f0) at perf.c:313
        #5  0x00005621e4897d5c in handle_internal_command (argv=<optimized out>, argc=<optimized out>) at perf.c:365
        #6  run_argv (argcp=<optimized out>, argv=<optimized out>) at perf.c:409
        #7  main (argc=4, argv=0x7fff4c69c1f0) at perf.c:539
        (gdb)
      
      Fixes: 0ae03893 ("perf tools: Pass a fd to perf_file_header__read_pipe()")
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: stable@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20211213084829.114772-3-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c271a55b
    • A
      perf inject: Fix segfault due to close without open · 0c8e32fe
      Adrian Hunter 提交于
      The fixed commit attempts to close inject.output even if it was never
      opened e.g.
      
        $ perf record uname
        Linux
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.002 MB perf.data (7 samples) ]
        $ perf inject -i perf.data --vm-time-correlation=dry-run
        Segmentation fault (core dumped)
        $ gdb --quiet perf
        Reading symbols from perf...
        (gdb) r inject -i perf.data --vm-time-correlation=dry-run
        Starting program: /home/ahunter/bin/perf inject -i perf.data --vm-time-correlation=dry-run
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
      
        Program received signal SIGSEGV, Segmentation fault.
        0x00007eff8afeef5b in _IO_new_fclose (fp=0x0) at iofclose.c:48
        48      iofclose.c: No such file or directory.
        (gdb) bt
        #0  0x00007eff8afeef5b in _IO_new_fclose (fp=0x0) at iofclose.c:48
        #1  0x0000557fc7b74f92 in perf_data__close (data=data@entry=0x7ffcdafa6578) at util/data.c:376
        #2  0x0000557fc7a6b807 in cmd_inject (argc=<optimized out>, argv=<optimized out>) at builtin-inject.c:1085
        #3  0x0000557fc7ac4783 in run_builtin (p=0x557fc8074878 <commands+600>, argc=4, argv=0x7ffcdafb6a60) at perf.c:313
        #4  0x0000557fc7a25d5c in handle_internal_command (argv=<optimized out>, argc=<optimized out>) at perf.c:365
        #5  run_argv (argcp=<optimized out>, argv=<optimized out>) at perf.c:409
        #6  main (argc=4, argv=0x7ffcdafb6a60) at perf.c:539
        (gdb)
      
      Fixes: 02e6246f ("perf inject: Close inject.output on exit")
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: stable@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20211213084829.114772-2-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0c8e32fe
    • M
      perf expr: Fix missing check for return value of hashmap__new() · 0a515a06
      Miaoqian Lin 提交于
      The hashmap__new() function may return ERR_PTR(-ENOMEM) when malloc()
      fails, add IS_ERR() checking for ctx->ids.
      Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20211212062504.25841-1-linmq006@gmail.com
      [ s/kfree()/free()/ and add missing linux/err.h include ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a515a06
    • Z
      locking/rtmutex: Fix incorrect condition in rtmutex_spin_on_owner() · 8f556a32
      Zqiang 提交于
      Optimistic spinning needs to be terminated when the spinning waiter is not
      longer the top waiter on the lock, but the condition is negated. It
      terminates if the waiter is the top waiter, which is defeating the whole
      purpose.
      
      Fixes: c3123c43 ("locking/rtmutex: Dont dereference waiter lockless")
      Signed-off-by: NZqiang <qiang1.zhang@intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20211217074207.77425-1-qiang1.zhang@intel.com
      8f556a32
    • L
      Merge tag 'libata-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · 9eaa88c7
      Linus Torvalds 提交于
      Pull libata fix from Damien Le Moal:
       "A single fix for this cycle:
      
         - Check that ATA16 passthrough commands that do not transfer any data
           have a DMA direction set to DMA_NONE (From George)"
      
      * tag 'libata-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        libata: if T_LENGTH is zero, dma direction should be DMA_NONE
      9eaa88c7
    • L
      Merge tag 'zonefs-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs · 1887bf5c
      Linus Torvalds 提交于
      Pull zonefs fixes from Damien Le Moal:
       "One fix and one trivial update for rc6:
      
         - Add MODULE_ALIAS_FS to get automatic module loading on mount
           (Naohiro)
      
         - Update Damien's email address in the MAINTAINERS file (me)"
      
      * tag 'zonefs-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
        MAITAINERS: Change zonefs maintainer email address
        zonefs: add MODULE_ALIAS_FS
      1887bf5c
    • T
      cifs: sanitize multiple delimiters in prepath · a3108089
      Thiago Rafael Becker 提交于
      mount.cifs can pass a device with multiple delimiters in it. This will
      cause rename(2) to fail with ENOENT.
      
      V2:
        - Make sanitize_path more readable.
        - Fix multiple delimiters between UNC and prepath.
        - Avoid a memory leak if a bad user starts putting a lot of delimiters
          in the path on purpose.
      
      BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2031200
      Fixes: 24e0a1ef ("cifs: switch to new mount api")
      Cc: stable@vger.kernel.org # 5.11+
      Acked-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NThiago Rafael Becker <trbecker@gmail.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      a3108089
    • S
      cifs: ignore resource_id while getting fscache super cookie · b774302e
      Shyam Prasad N 提交于
      We have a cyclic dependency between fscache super cookie
      and root inode cookie. The super cookie relies on
      tcon->resource_id, which gets populated from the root inode
      number. However, fetching the root inode initializes inode
      cookie as a child of super cookie, which is yet to be populated.
      
      resource_id is only used as auxdata to check the validity of
      super cookie. We can completely avoid setting resource_id to
      remove the circular dependency. Since vol creation time and
      vol serial numbers are used for auxdata, we should be fine.
      Additionally, there will be auxiliary data check for each
      inode cookie as well.
      
      Fixes: 5bf91ef0 ("cifs: wait for tcon resource_id before getting fscache super")
      CC: David Howells <dhowells@redhat.com>
      Signed-off-by: NShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      b774302e
    • Y
      timekeeping: Really make sure wall_to_monotonic isn't positive · 4e8c11b6
      Yu Liao 提交于
      Even after commit e1d7ba87 ("time: Always make sure wall_to_monotonic
      isn't positive") it is still possible to make wall_to_monotonic positive
      by running the following code:
      
          int main(void)
          {
              struct timespec time;
      
              clock_gettime(CLOCK_MONOTONIC, &time);
              time.tv_nsec = 0;
              clock_settime(CLOCK_REALTIME, &time);
              return 0;
          }
      
      The reason is that the second parameter of timespec64_compare(), ts_delta,
      may be unnormalized because the delta is calculated with an open coded
      substraction which causes the comparison of tv_sec to yield the wrong
      result:
      
        wall_to_monotonic = { .tv_sec = -10, .tv_nsec =  900000000 }
        ts_delta 	    = { .tv_sec =  -9, .tv_nsec = -900000000 }
      
      That makes timespec64_compare() claim that wall_to_monotonic < ts_delta,
      but actually the result should be wall_to_monotonic > ts_delta.
      
      After normalization, the result of timespec64_compare() is correct because
      the tv_sec comparison is not longer misleading:
      
        wall_to_monotonic = { .tv_sec = -10, .tv_nsec =  900000000 }
        ts_delta 	    = { .tv_sec = -10, .tv_nsec =  100000000 }
      
      Use timespec64_sub() to ensure that ts_delta is normalized, which fixes the
      issue.
      
      Fixes: e1d7ba87 ("time: Always make sure wall_to_monotonic isn't positive")
      Signed-off-by: NYu Liao <liaoyu15@huawei.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20211213135727.1656662-1-liaoyu15@huawei.com
      4e8c11b6
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 5d65f6f3
      Linus Torvalds 提交于
      Pull SCSI fix from James Bottomley:
       "One driver fix: the pm8001 has never actually worked on a system with
        an IOMMU and this fixes that use case"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: pm8001: Fix phys_to_virt() usage on dma_addr_t
      5d65f6f3
    • L
      Merge tag 'for-5.16-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 96091341
      Linus Torvalds 提交于
      Pull btrfs fixes from David Sterba:
       "A few more fixes, almost all error handling one-liners and for stable.
      
         - regression fix in directory logging items
      
         - regression fix of extent buffer status bits handling after an error
      
         - fix memory leak in error handling path in tree-log
      
         - fix freeing invalid anon device number when handling errors during
           subvolume creation
      
         - fix warning when freeing leaf after subvolume creation failure
      
         - fix missing blkdev put in device scan error handling
      
         - fix invalid delayed ref after subvolume creation failure"
      
      * tag 'for-5.16-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix missing blkdev_put() call in btrfs_scan_one_device()
        btrfs: fix warning when freeing leaf after subvolume creation failure
        btrfs: fix invalid delayed ref after subvolume creation failure
        btrfs: check WRITE_ERR when trying to read an extent buffer
        btrfs: fix missing last dir item offset update when logging directory
        btrfs: fix double free of anon_dev after failure to create subvolume
        btrfs: fix memory leak in __add_inode_ref()
      96091341
    • L
      Merge tag 'selinux-pr-20211217' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux · f1f05ef3
      Linus Torvalds 提交于
      Pull selinux fix from Paul Moore:
       "Another small SELinux fix for v5.16 to ensure that we don't block on
        memory allocations while holding a spinlock.
      
        This passes all our tests without problem"
      
      * tag 'selinux-pr-20211217' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
        selinux: fix sleeping function called from invalid context
      f1f05ef3
    • L
      Merge tag 'riscv-for-linus-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 0bb43aec
      Linus Torvalds 提交于
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A handful of DT updates for the SiFive HiFive Unmatched, that fix the
         regulator handling. These should stop some warning spew.
      
       - A pair of fixes for both the SiFive Hifive Unleashed and Unmatched,
         that correctly hook up the MMC card detect signal.
      
      * tag 'riscv-for-linus-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: dts: sifive unmatched: Link the tmp451 with its power supply
        riscv: dts: sifive unmatched: Fix regulator for board rev3
        riscv: dts: sifive unmatched: Expose the PMIC sub-functions
        riscv: dts: sifive unmatched: Expose the board ID eeprom
        riscv: dts: sifive unmatched: Name gpio lines
        riscv: dts: unmatched: Add gpio card detect to mmc-spi-slot
        riscv: dts: unleashed: Add gpio card detect to mmc-spi-slot
      0bb43aec
    • L
      Merge tag 'block-5.16-2021-12-17' of git://git.kernel.dk/linux-block · fa09ca5e
      Linus Torvalds 提交于
      Pull block fixes from Jens Axboe:
      
       - Fix for hammering on the delayed run queue timer (me)
      
       - bcache regression fix for this merge window (Lin)
      
       - Fix a divide-by-zero in the blk-iocost code (Tejun)
      
      * tag 'block-5.16-2021-12-17' of git://git.kernel.dk/linux-block:
        bcache: fix NULL pointer reference in cached_dev_detach_finish
        block: reduce kblockd_mod_delayed_work_on() CPU consumption
        iocost: Fix divide-by-zero on donation from low hweight cgroup
      fa09ca5e
    • L
      Merge tag 'io_uring-5.16-2021-12-17' of git://git.kernel.dk/linux-block · cb29eee3
      Linus Torvalds 提交于
      Pull io_uring fix from Jens Axboe:
       "Just a single fix, fixing an issue with the worker creation change
        that was merged last week"
      
      * tag 'io_uring-5.16-2021-12-17' of git://git.kernel.dk/linux-block:
        io-wq: drop wqe lock before creating new worker
      cb29eee3
    • L
      Merge tag 'dmaengine-fix-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · 43d1c6a6
      Linus Torvalds 提交于
      Pull dmaengine fixes from Vinod Koul:
       "A bunch of driver fixes, notably:
      
         - uninit variable fix for dw-axi-dmac driver
      
         - return value check dw-edma driver
      
         - calling wq quiesce inside spinlock and missed completion for idxd
           driver
      
         - mod alias fix for st_fdma driver"
      
      * tag 'dmaengine-fix-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: st_fdma: fix MODULE_ALIAS
        dmaengine: idxd: fix missed completion on abort path
        dmaengine: ti: k3-udma: Fix smatch warnings
        dmaengine: idxd: fix calling wq quiesce inside spinlock
        dmaengine: dw-edma: Fix return value check for dma_set_mask_and_coherent()
        dmaengine: dw-axi-dmac: Fix uninitialized variable in axi_chan_block_xfer_start()
      43d1c6a6
    • L
      Merge tag 'drm-fixes-2021-12-17-1' of git://anongit.freedesktop.org/drm/drm · 4f549bf3
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Mostly amdgpu fixes this week scattered around the driver, otherwise
        one i915, one ast, one simpledrm. There is a revert in the fb-helper
        for places userspace was using a string that we tried to change.
      
        i915:
         - Fix a bound check in the DMC fw load.
      
        ast:
         - NULL ptr deref fix
      
        simpledrm:
         - pixel clock units fix
      
        fb-helper:
         - userspace regression revert
      
        amdgpu:
         - Fix RLC register offset
         - GMC fix
         - Properly cache SMU FW version on Yellow Carp
         - Fix missing callback on DCN3.1
         - Reset DMCUB before HW init
         - Fix for GMC powergating on PCO
         - Fix a possible memory leak in GPU metrics table handling on RN"
      
      * tag 'drm-fixes-2021-12-17-1' of git://anongit.freedesktop.org/drm/drm:
        drm/amd/pm: fix a potential gpu_metrics_table memory leak
        drm/amdgpu: correct the wrong cached state for GMC on PICASSO
        drm/amd/display: Reset DMCUB before HW init
        drm/amd/display: Set exit_optimized_pwr_state for DCN31
        drm/amd/pm: fix reading SMU FW version from amdgpu_firmware_info on YC
        drm/amdgpu: don't override default ECO_BITs setting
        drm/amdgpu: correct register access for RLC_JUMP_TABLE_RESTORE
        drm/i915/display: Fix an unsigned subtraction which can never be negative.
        drm/ast: potential dereference of null pointer
        drm: simpledrm: fix wrong unit with pixel clock
        Revert "drm/fb-helper: improve DRM fbdev emulation device names"
      4f549bf3
  5. 17 12月, 2021 2 次提交