1. 15 Jul, 2022 1 commit
  2. 12 Jul, 2022 1 commit
    • Christophe Leroy's avatar
      module: Move module's Kconfig items in kernel/module/ · 73b4fc92
      Christophe Leroy authored
      In init/Kconfig, the part dedicated to modules is quite large.
      
      Move it into a dedicated Kconfig in kernel/module/
      
      MODULES_TREE_LOOKUP was outside of the 'if MODULES', but as it is
      only used when MODULES are set, move it in with everything else to
      avoid confusion.
      
      MODULE_SIG_FORMAT is left in init/Kconfig because this configuration
      item is not used in kernel/modules/ but in kernel/ and can be
      selected independently from CONFIG_MODULES. It is for instance
      selected from security/integrity/ima/Kconfig.
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      73b4fc92
  3. 11 Jul, 2022 7 commits
  4. 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
  5. 30 Jun, 2022 3 commits
  6. 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
  7. 28 Jun, 2022 11 commits
  8. 27 Jun, 2022 11 commits