1. 11 Jul, 2022 1 commit
    • 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
  2. 01 Jul, 2022 4 commits
    • Masahiro Yamada's avatar
      doc: module: update file references · 2cc39179
      Masahiro Yamada authored
      Adjust documents to the file moves made by commit cfc1d277 ("module:
      Move all into module/").
      
      Thanks to Yanteng Si for helping me to update
      Documentation/translations/zh_CN/core-api/kernel-api.rst
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      2cc39179
    • Christophe Leroy's avatar
      module: Fix "warning: variable 'exit' set but not used" · f963ef12
      Christophe Leroy authored
      When CONFIG_MODULE_UNLOAD is not selected, 'exit' is
      set but never used.
      
      It is not possible to replace the #ifdef CONFIG_MODULE_UNLOAD by
      IS_ENABLED(CONFIG_MODULE_UNLOAD) because mod->exit doesn't exist
      when CONFIG_MODULE_UNLOAD is not selected.
      
      And because of the rcu_read_lock_sched() section it is not easy
      to regroup everything in a single #ifdef. Let's regroup partially
      and add missing #ifdef to completely opt out the use of
      'exit' when CONFIG_MODULE_UNLOAD is not selected.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      f963ef12
    • Christophe Leroy's avatar
      module: Fix selfAssignment cppcheck warning · cfa94c53
      Christophe Leroy authored
      cppcheck reports the following warnings:
      
      kernel/module/main.c:1455:26: warning: Redundant assignment of 'mod->core_layout.size' to itself. [selfAssignment]
         mod->core_layout.size = strict_align(mod->core_layout.size);
                               ^
      kernel/module/main.c:1489:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
         mod->init_layout.size = strict_align(mod->init_layout.size);
                               ^
      kernel/module/main.c:1493:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
         mod->init_layout.size = strict_align(mod->init_layout.size);
                               ^
      kernel/module/main.c:1504:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
         mod->init_layout.size = strict_align(mod->init_layout.size);
                               ^
      kernel/module/main.c:1459:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
         mod->data_layout.size = strict_align(mod->data_layout.size);
                               ^
      kernel/module/main.c:1463:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
         mod->data_layout.size = strict_align(mod->data_layout.size);
                               ^
      kernel/module/main.c:1467:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
         mod->data_layout.size = strict_align(mod->data_layout.size);
                               ^
      
      This is due to strict_align() being a no-op when
      CONFIG_STRICT_MODULE_RWX is not selected.
      
      Transform strict_align() macro into an inline function. It will
      allow type checking and avoid the selfAssignment warning.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      cfa94c53
    • Adrian Hunter's avatar
      modules: Fix corruption of /proc/kallsyms · 35adf9a4
      Adrian Hunter authored
      The commit 91fb02f3 ("module: Move kallsyms support into a separate
      file") changed from using strlcpy() to using strscpy() which created a
      buffer overflow. That happened because:
       1) an incorrect value was passed as the buffer length
       2) strscpy() (unlike strlcpy()) may copy beyond the length of the
          input string when copying word-by-word.
      The assumption was that because it was already known that the strings
      being copied would fit in the space available, it was not necessary
      to correctly set the buffer length.  strscpy() breaks that assumption
      because although it will not touch bytes beyond the given buffer length
      it may write bytes beyond the input string length when writing
      word-by-word.
      
      The result of the buffer overflow is to corrupt the symbol type
      information that follows. e.g.
      
       $ sudo cat -v /proc/kallsyms | grep '\^' | head
       ffffffffc0615000 ^@ rfcomm_session_get  [rfcomm]
       ffffffffc061c060 ^@ session_list        [rfcomm]
       ffffffffc06150d0 ^@ rfcomm_send_frame   [rfcomm]
       ffffffffc0615130 ^@ rfcomm_make_uih     [rfcomm]
       ffffffffc07ed58d ^@ bnep_exit   [bnep]
       ffffffffc07ec000 ^@ bnep_rx_control     [bnep]
       ffffffffc07ec1a0 ^@ bnep_session        [bnep]
       ffffffffc07e7000 ^@ input_leds_event    [input_leds]
       ffffffffc07e9000 ^@ input_leds_handler  [input_leds]
       ffffffffc07e7010 ^@ input_leds_disconnect       [input_leds]
      
      Notably, the null bytes (represented above by ^@) can confuse tools.
      
      Fix by correcting the buffer length.
      
      Fixes: 91fb02f3 ("module: Move kallsyms support into a separate file")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      35adf9a4
  3. 30 Jun, 2022 3 commits
  4. 29 Jun, 2022 2 commits
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v5.19-3' of... · d9b2ba67
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
      
       - thinkpad_acpi/ideapad-laptop: mem-leak and platform-profile fixes
      
       - panasonic-laptop: missing hotkey presses regression fix
      
       - some hardware-id additions
      
       - some other small fixes
      
      * tag 'platform-drivers-x86-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: hp-wmi: Ignore Sanitization Mode event
        platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms
        platform/x86: thinkpad-acpi: profile capabilities as integer
        platform/x86: panasonic-laptop: filter out duplicate volume up/down/mute keypresses
        platform/x86: panasonic-laptop: don't report duplicate brightness key-presses
        platform/x86: panasonic-laptop: revert "Resolve hotkey double trigger bug"
        platform/x86: panasonic-laptop: sort includes alphabetically
        platform/x86: panasonic-laptop: de-obfuscate button codes
        ACPI: video: Change how we determine if brightness key-presses are handled
        platform/x86: ideapad-laptop: Add Ideapad 5 15ITL05 to ideapad_dytc_v4_allow_table[]
        platform/x86: ideapad-laptop: Add allow_v4_dytc module parameter
        platform/x86: thinkpad_acpi: Fix a memory leak of EFCH MMIO resource
        platform/mellanox: nvsw-sn2201: fix error code in nvsw_sn2201_create_static_devices()
        platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver
      d9b2ba67
    • Linus Torvalds's avatar
      Merge tag '5.19-rc4-ksmbd-server-fixes' of git://git.samba.org/ksmbd · 732f3069
      Linus Torvalds authored
      Pull ksmbd server fixes from Steve French:
      
       - seek null check (don't use f_seek op directly and blindly)
      
       - offset validation in FSCTL_SET_ZERO_DATA
      
       - fallocate fix (relates e.g. to xfstests generic/091 and 263)
      
       - two cleanup fixes
      
       - fix socket settings on some arch
      
      * tag '5.19-rc4-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
        ksmbd: use vfs_llseek instead of dereferencing NULL
        ksmbd: check invalid FileOffset and BeyondFinalZero in FSCTL_ZERO_DATA
        ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA
        ksmbd: remove duplicate flag set in smb2_write
        ksmbd: smbd: Remove useless license text when SPDX-License-Identifier is already used
        ksmbd: use SOCK_NONBLOCK type for kernel_accept()
      732f3069
  5. 28 Jun, 2022 11 commits
  6. 27 Jun, 2022 13 commits
  7. 26 Jun, 2022 6 commits
    • Linus Torvalds's avatar
      Linux 5.19-rc4 · 03c765b0
      Linus Torvalds authored
      03c765b0
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 1709b887
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "A number of fixes have accumulated, but they are largely for harmless
        issues:
      
         - Several OF node leak fixes
      
         - A fix to the Exynos7885 UART clock description
      
         - DTS fixes to prevent boot failures on TI AM64 and J721s2
      
         - Bus probe error handling fixes for Baikal-T1
      
         - A fixup to the way STM32 SoCs use separate dts files for different
           firmware stacks
      
         - Multiple code fixes for Arm SCMI firmware, all dealing with
           robustness of the implementation
      
         - Multiple NXP i.MX devicetree fixes, addressing incorrect data in DT
           nodes
      
         - Three updates to the MAINTAINERS file, including Florian Fainelli
           taking over BCM283x/BCM2711 (Raspberry Pi) from Nicolas Saenz
           Julienne"
      
      * tag 'soc-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (29 commits)
        ARM: dts: aspeed: nuvia: rename vendor nuvia to qcom
        arm: mach-spear: Add missing of_node_put() in time.c
        ARM: cns3xxx: Fix refcount leak in cns3xxx_init
        MAINTAINERS: Update email address
        arm64: dts: ti: k3-am64-main: Remove support for HS400 speed mode
        arm64: dts: ti: k3-j721s2: Fix overlapping GICD memory region
        ARM: dts: bcm2711-rpi-400: Fix GPIO line names
        bus: bt1-axi: Don't print error on -EPROBE_DEFER
        bus: bt1-apb: Don't print error on -EPROBE_DEFER
        ARM: Fix refcount leak in axxia_boot_secondary
        ARM: dts: stm32: move SCMI related nodes in a dedicated file for stm32mp15
        soc: imx: imx8m-blk-ctrl: fix display clock for LCDIF2 power domain
        ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity
        ARM: dts: imx6qdl: correct PU regulator ramp delay
        firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get
        firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary
        firmware: arm_scmi: Fix SENSOR_AXIS_NAME_GET behaviour when unsupported
        ARM: dts: imx7: Move hsic_phy power domain to HSIC PHY node
        soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe
        MAINTAINERS: Update BCM2711/BCM2835 maintainer
        ...
      1709b887
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · 413c1f14
      Linus Torvalds authored
      Pull hotfixes from Andrew Morton:
       "Minor things, mainly - mailmap updates, MAINTAINERS updates, etc.
      
        Fixes for this merge window:
      
         - fix for a damon boot hang, from SeongJae
      
         - fix for a kfence warning splat, from Jason Donenfeld
      
         - fix for zero-pfn pinning, from Alex Williamson
      
         - fix for fallocate hole punch clearing, from Mike Kravetz
      
        Fixes for previous releases:
      
         - fix for a performance regression, from Marcelo
      
         - fix for a hwpoisining BUG from zhenwei pi"
      
      * tag 'mm-hotfixes-stable-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        mailmap: add entry for Christian Marangi
        mm/memory-failure: disable unpoison once hw error happens
        hugetlbfs: zero partial pages during fallocate hole punch
        mm: memcontrol: reference to tools/cgroup/memcg_slabinfo.py
        mm: re-allow pinning of zero pfns
        mm/kfence: select random number before taking raw lock
        MAINTAINERS: add maillist information for LoongArch
        MAINTAINERS: update MM tree references
        MAINTAINERS: update Abel Vesa's email
        MAINTAINERS: add MEMORY HOT(UN)PLUG section and add David as reviewer
        MAINTAINERS: add Miaohe Lin as a memory-failure reviewer
        mailmap: add alias for jarkko@profian.com
        mm/damon/reclaim: schedule 'damon_reclaim_timer' only after 'system_wq' is initialized
        kthread: make it clear that kthread_create_on_node() might be terminated by any fatal signal
        mm: lru_cache_disable: use synchronize_rcu_expedited
        mm/page_isolation.c: fix one kernel-doc comment
      413c1f14
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.19-2022-06-26' of... · 893d1eaa
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.19-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Enable ignore_missing_thread in 'perf stat', enabling counting with
         '--pid' when threads disappear during counting session setup
      
       - Adjust output data offset for backward compatibility in 'perf inject'
      
       - Fix missing free in copy_kcore_dir() in 'perf inject'
      
       - Fix caching files with a wrong build ID
      
       - Sync drm, cpufeatures, vhost and svn headers with the kernel
      
      * tag 'perf-tools-fixes-for-v5.19-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        tools headers UAPI: Synch KVM's svm.h header with the kernel
        tools include UAPI: Sync linux/vhost.h with the kernel sources
        perf stat: Enable ignore_missing_thread
        perf inject: Adjust output data offset for backward compatibility
        perf trace beauty: Fix generation of errno id->str table on ALT Linux
        perf build-id: Fix caching files with a wrong build ID
        tools headers cpufeatures: Sync with the kernel sources
        tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
        perf inject: Fix missing free in copy_kcore_dir()
      893d1eaa
    • Linus Torvalds's avatar
      Merge tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 82708bb1
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - zoned relocation fixes:
            - fix critical section end for extent writeback, this could lead
              to out of order write
            - prevent writing to previous data relocation block group if space
              gets low
      
       - reflink fixes:
            - fix race between reflinking and ordered extent completion
            - proper error handling when block reserve migration fails
            - add missing inode iversion/mtime/ctime updates on each iteration
              when replacing extents
      
       - fix deadlock when running fsync/fiemap/commit at the same time
      
       - fix false-positive KCSAN report regarding pid tracking for read locks
         and data race
      
       - minor documentation update and link to new site
      
      * tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Documentation: update btrfs list of features and link to readthedocs.io
        btrfs: fix deadlock with fsync+fiemap+transaction commit
        btrfs: don't set lock_owner when locking extent buffer for reading
        btrfs: zoned: fix critical section of relocation inode writeback
        btrfs: zoned: prevent allocation from previous data relocation BG
        btrfs: do not BUG_ON() on failure to migrate space when replacing extents
        btrfs: add missing inode updates on each iteration when replacing extents
        btrfs: fix race between reflinking and ordered extent completion
      82708bb1
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.19-2022-06-26' of git://git.infradead.org/users/hch/dma-mapping · c898c67d
      Linus Torvalds authored
      Pull dma-mapping fix from Christoph Hellwig:
      
       - pass the correct size to dma_set_encrypted() when freeing memory
         (Dexuan Cui)
      
      * tag 'dma-mapping-5.19-2022-06-26' of git://git.infradead.org/users/hch/dma-mapping:
        dma-direct: use the correct size for dma_set_encrypted()
      c898c67d