1. 09 4月, 2021 1 次提交
  2. 18 1月, 2021 2 次提交
  3. 13 10月, 2020 1 次提交
    • D
      module: statically initialize init section freeing data · fdf09ab8
      Daniel Jordan 提交于
      Corentin hit the following workqueue warning when running with
      CRYPTO_MANAGER_EXTRA_TESTS:
      
        WARNING: CPU: 2 PID: 147 at kernel/workqueue.c:1473 __queue_work+0x3b8/0x3d0
        Modules linked in: ghash_generic
        CPU: 2 PID: 147 Comm: modprobe Not tainted
            5.6.0-rc1-next-20200214-00068-g166c9264f0b1-dirty #545
        Hardware name: Pine H64 model A (DT)
        pc : __queue_work+0x3b8/0x3d0
        Call trace:
         __queue_work+0x3b8/0x3d0
         queue_work_on+0x6c/0x90
         do_init_module+0x188/0x1f0
         load_module+0x1d00/0x22b0
      
      I wasn't able to reproduce on x86 or rpi 3b+.
      
      This is
      
        WARN_ON(!list_empty(&work->entry))
      
      from __queue_work(), and it happens because the init_free_wq work item
      isn't initialized in time for a crypto test that requests the gcm
      module.  Some crypto tests were recently moved earlier in boot as
      explained in commit c4741b23 ("crypto: run initcalls for generic
      implementations earlier"), which went into mainline less than two weeks
      before the Fixes commit.
      
      Avoid the warning by statically initializing init_free_wq and the
      corresponding llist.
      
      Link: https://lore.kernel.org/lkml/20200217204803.GA13479@Red/
      Fixes: 1a7b7d92 ("modules: Use vmalloc special flag")
      Reported-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
      Tested-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
      Tested-on: sun50i-h6-pine-h64
      Tested-on: imx8mn-ddr4-evk
      Tested-on: sun50i-a64-bananapi-m64
      Reviewed-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NDaniel Jordan <daniel.m.jordan@oracle.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      fdf09ab8
  4. 05 10月, 2020 7 次提交
  5. 02 9月, 2020 1 次提交
    • Q
      module: Add more error message for failed kernel module loading · 14721add
      Qu Wenruo 提交于
      When kernel module loading failed, user space only get one of the
      following error messages:
      
      - ENOEXEC
        This is the most confusing one. From corrupted ELF header to bad
        WRITE|EXEC flags check introduced by in module_enforce_rwx_sections()
        all returns this error number.
      
      - EPERM
        This is for blacklisted modules. But mod doesn't do extra explain
        on this error either.
      
      - ENOMEM
        The only error which needs no explain.
      
      This means, if a user got "Exec format error" from modprobe, it provides
      no meaningful way for the user to debug, and will take extra time
      communicating to get extra info.
      
      So this patch will add extra error messages for -ENOEXEC and -EPERM
      errors, allowing user to do better debugging and reporting.
      Reviewed-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: NQu Wenruo <wqu@suse.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      14721add
  6. 01 9月, 2020 2 次提交
  7. 08 8月, 2020 1 次提交
  8. 05 8月, 2020 1 次提交
  9. 01 8月, 2020 7 次提交
  10. 24 7月, 2020 1 次提交
  11. 09 7月, 2020 3 次提交
  12. 04 7月, 2020 1 次提交
  13. 26 6月, 2020 1 次提交
  14. 09 6月, 2020 1 次提交
  15. 03 6月, 2020 1 次提交
    • C
      mm: remove the pgprot argument to __vmalloc · 88dca4ca
      Christoph Hellwig 提交于
      The pgprot argument to __vmalloc is always PAGE_KERNEL now, so remove it.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: Michael Kelley <mikelley@microsoft.com> [hyperv]
      Acked-by: Gao Xiang <xiang@kernel.org> [erofs]
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NWei Liu <wei.liu@kernel.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-22-hch@lst.deSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      88dca4ca
  16. 19 5月, 2020 2 次提交
  17. 12 5月, 2020 2 次提交
  18. 08 5月, 2020 3 次提交
    • J
      module: Make module_enable_ro() static again · e6eff437
      Josh Poimboeuf 提交于
      Now that module_enable_ro() has no more external users, make it static
      again.
      Suggested-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e6eff437
    • J
      module: Remove module_disable_ro() · 0d9fbf78
      Josh Poimboeuf 提交于
      module_disable_ro() has no more users.  Remove it.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NJoe Lawrence <joe.lawrence@redhat.com>
      Acked-by: NMiroslav Benes <mbenes@suse.cz>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      0d9fbf78
    • J
      livepatch: Apply vmlinux-specific KLP relocations early · 7c8e2bdd
      Josh Poimboeuf 提交于
      KLP relocations are livepatch-specific relocations which are applied to
      a KLP module's text or data.  They exist for two reasons:
      
        1) Unexported symbols: replacement functions often need to access
           unexported symbols (e.g. static functions), which "normal"
           relocations don't allow.
      
        2) Late module patching: this is the ability for a KLP module to
           bypass normal module dependencies, such that the KLP module can be
           loaded *before* a to-be-patched module.  This means that
           relocations which need to access symbols in the to-be-patched
           module might need to be applied to the KLP module well after it has
           been loaded.
      
      Non-late-patched KLP relocations are applied from the KLP module's init
      function.  That usually works fine, unless the patched code wants to use
      alternatives, paravirt patching, jump tables, or some other special
      section which needs relocations.  Then we run into ordering issues and
      crashes.
      
      In order for those special sections to work properly, the KLP
      relocations should be applied *before* the special section init code
      runs, such as apply_paravirt(), apply_alternatives(), or
      jump_label_apply_nops().
      
      You might think the obvious solution would be to move the KLP relocation
      initialization earlier, but it's not necessarily that simple.  The
      problem is the above-mentioned late module patching, for which KLP
      relocations can get applied well after the KLP module is loaded.
      
      To "fix" this issue in the past, we created .klp.arch sections:
      
        .klp.arch.{module}..altinstructions
        .klp.arch.{module}..parainstructions
      
      Those sections allow KLP late module patching code to call
      apply_paravirt() and apply_alternatives() after the module-specific KLP
      relocations (.klp.rela.{module}.{section}) have been applied.
      
      But that has a lot of drawbacks, including code complexity, the need for
      arch-specific code, and the (per-arch) danger that we missed some
      special section -- for example the __jump_table section which is used
      for jump labels.
      
      It turns out there's a simpler and more functional approach.  There are
      two kinds of KLP relocation sections:
      
        1) vmlinux-specific KLP relocation sections
      
           .klp.rela.vmlinux.{sec}
      
           These are relocations (applied to the KLP module) which reference
           unexported vmlinux symbols.
      
        2) module-specific KLP relocation sections
      
           .klp.rela.{module}.{sec}:
      
           These are relocations (applied to the KLP module) which reference
           unexported or exported module symbols.
      
      Up until now, these have been treated the same.  However, they're
      inherently different.
      
      Because of late module patching, module-specific KLP relocations can be
      applied very late, thus they can create the ordering headaches described
      above.
      
      But vmlinux-specific KLP relocations don't have that problem.  There's
      nothing to prevent them from being applied earlier.  So apply them at
      the same time as normal relocations, when the KLP module is being
      loaded.
      
      This means that for vmlinux-specific KLP relocations, we no longer have
      any ordering issues.  vmlinux-referencing jump labels, alternatives, and
      paravirt patching will work automatically, without the need for the
      .klp.arch hacks.
      
      All that said, for module-specific KLP relocations, the ordering
      problems still exist and we *do* still need .klp.arch.  Or do we?  Stay
      tuned.
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NJoe Lawrence <joe.lawrence@redhat.com>
      Acked-by: NMiroslav Benes <mbenes@suse.cz>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      7c8e2bdd
  19. 22 4月, 2020 1 次提交
  20. 21 4月, 2020 1 次提交