1. 08 2月, 2021 6 次提交
  2. 07 12月, 2020 1 次提交
  3. 25 11月, 2020 2 次提交
    • J
      module: simplify version-attribute handling · b112082c
      Johan Hovold 提交于
      Instead of using the array-of-pointers trick to avoid having gcc mess up
      the built-in module-version array stride, specify type alignment when
      declaring entries to prevent gcc from increasing alignment.
      
      This is essentially an alternative (one-line) fix to the problem
      addressed by commit b4bc8428 ("module: deal with alignment issues in
      built-in module versions").
      
      gcc can increase the alignment of larger objects with static extent as
      an optimisation, but this can be suppressed by using the aligned
      attribute when declaring variables.
      
      Note that we have been relying on this behaviour for kernel parameters
      for 16 years and it indeed hasn't changed since the introduction of the
      aligned attribute in gcc-3.1.
      
      Link: https://lore.kernel.org/lkml/20201103175711.10731-1-johan@kernel.orgSigned-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      b112082c
    • J
      module: drop version-attribute alignment · 0801a007
      Johan Hovold 提交于
      Commit 98562ad8 ("module: explicitly align module_version_attribute
      structure") added an alignment attribute to the struct
      module_version_attribute type in order to fix an alignment issue on m68k
      where the structure is 2-byte aligned while MODULE_VERSION() forced the
      __modver section entries to be 4-byte aligned (sizeof(void *)).
      
      This was essentially an alternative fix to the problem addressed by
      b4bc8428 ("module: deal with alignment issues in built-in module
      versions") which used the array-of-pointer trick to prevent gcc from
      increasing alignment of the version attribute entries. And with the
      pointer indirection in place there's no need to increase the alignment
      of the type.
      
      Link: https://lore.kernel.org/lkml/20201103175711.10731-1-johan@kernel.orgSigned-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      0801a007
  4. 11 11月, 2020 1 次提交
    • A
      bpf: Load and verify kernel module BTFs · 36e68442
      Andrii Nakryiko 提交于
      Add kernel module listener that will load/validate and unload module BTF.
      Module BTFs gets ID generated for them, which makes it possible to iterate
      them with existing BTF iteration API. They are given their respective module's
      names, which will get reported through GET_OBJ_INFO API. They are also marked
      as in-kernel BTFs for tooling to distinguish them from user-provided BTFs.
      
      Also, similarly to vmlinux BTF, kernel module BTFs are exposed through
      sysfs as /sys/kernel/btf/<module-name>. This is convenient for user-space
      tools to inspect module BTF contents and dump their types with existing tools:
      
      [vmuser@archvm bpf]$ ls -la /sys/kernel/btf
      total 0
      drwxr-xr-x  2 root root       0 Nov  4 19:46 .
      drwxr-xr-x 13 root root       0 Nov  4 19:46 ..
      
      ...
      
      -r--r--r--  1 root root     888 Nov  4 19:46 irqbypass
      -r--r--r--  1 root root  100225 Nov  4 19:46 kvm
      -r--r--r--  1 root root   35401 Nov  4 19:46 kvm_intel
      -r--r--r--  1 root root     120 Nov  4 19:46 pcspkr
      -r--r--r--  1 root root     399 Nov  4 19:46 serio_raw
      -r--r--r--  1 root root 4094095 Nov  4 19:46 vmlinux
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Link: https://lore.kernel.org/bpf/20201110011932.3201430-5-andrii@kernel.org
      36e68442
  5. 28 10月, 2020 1 次提交
    • A
      module: use hidden visibility for weak symbol references · 13150bc5
      Ard Biesheuvel 提交于
      Geert reports that commit be288182 ("arm64/build: Assert for
      unwanted sections") results in build errors on arm64 for configurations
      that have CONFIG_MODULES disabled.
      
      The commit in question added ASSERT()s to the arm64 linker script to
      ensure that linker generated sections such as .got.plt etc are empty,
      but as it turns out, there are corner cases where the linker does emit
      content into those sections. More specifically, weak references to
      function symbols (which can remain unsatisfied, and can therefore not
      be emitted as relative references) will be emitted as GOT and PLT
      entries when linking the kernel in PIE mode (which is the case when
      CONFIG_RELOCATABLE is enabled, which is on by default).
      
      What happens is that code such as
      
      	struct device *(*fn)(struct device *dev);
      	struct device *iommu_device;
      
      	fn = symbol_get(mdev_get_iommu_device);
      	if (fn) {
      		iommu_device = fn(dev);
      
      essentially gets converted into the following when CONFIG_MODULES is off:
      
      	struct device *iommu_device;
      
      	if (&mdev_get_iommu_device) {
      		iommu_device = mdev_get_iommu_device(dev);
      
      where mdev_get_iommu_device is emitted as a weak symbol reference into
      the object file. The first reference is decorated with an ordinary
      ABS64 data relocation (which yields 0x0 if the reference remains
      unsatisfied). However, the indirect call is turned into a direct call
      covered by a R_AARCH64_CALL26 relocation, which is converted into a
      call via a PLT entry taking the target address from the associated
      GOT entry.
      
      Given that such GOT and PLT entries are unnecessary for fully linked
      binaries such as the kernel, let's give these weak symbol references
      hidden visibility, so that the linker knows that the weak reference
      via R_AARCH64_CALL26 can simply remain unsatisfied.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: NFangrui Song <maskray@google.com>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Link: https://lore.kernel.org/r/20201027151132.14066-1-ardb@kernel.orgSigned-off-by: NWill Deacon <will@kernel.org>
      13150bc5
  6. 26 10月, 2020 1 次提交
  7. 01 9月, 2020 1 次提交
  8. 05 8月, 2020 1 次提交
  9. 01 8月, 2020 5 次提交
  10. 19 5月, 2020 1 次提交
  11. 12 5月, 2020 2 次提交
  12. 08 5月, 2020 2 次提交
  13. 24 1月, 2020 1 次提交
  14. 07 1月, 2020 1 次提交
    • M
      kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf · 8b41fc44
      Masahiro Yamada 提交于
      Commit bc081dd6 ("kbuild: generate modules.builtin") added
      infrastructure to generate modules.builtin, the list of all
      builtin modules.
      
      Basically, it works like this:
      
        - Kconfig generates include/config/tristate.conf, the list of
          tristate CONFIG options with a value in a capital letter.
      
        - scripts/Makefile.modbuiltin makes Kbuild descend into
          directories to collect the information of builtin modules.
      
      I am not a big fan of it because Kbuild ends up with traversing
      the source tree twice.
      
      I am not sure how perfectly it should work, but this approach cannot
      avoid false positives; even if the relevant CONFIG option is tristate,
      some Makefiles forces obj-m to obj-y.
      
      Some examples are:
      
        arch/powerpc/platforms/powermac/Makefile:
          obj-$(CONFIG_NVRAM:m=y)         += nvram.o
      
        net/ipv6/Makefile:
          obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o
      
        net/netlabel/Makefile:
          obj-$(subst m,y,$(CONFIG_IPV6)) += netlabel_calipso.o
      
      Nobody has complained about (or noticed) it, so it is probably fine to
      have false positives in modules.builtin.
      
      This commit simplifies the implementation. Let's exploit the fact
      that every module has MODULE_LICENSE(). (modpost shows a warning if
      MODULE_LICENSE is missing. If so, 0-day bot would already have blocked
      such a module.)
      
      I added MODULE_FILE to <linux/module.h>. When the code is being compiled
      as builtin, it will be filled with the file path of the module, and
      collected into modules.builtin.info. Then, scripts/link-vmlinux.sh
      extracts the list of builtin modules out of it.
      
      This new approach fixes the false-positives above, but adds another
      type of false-positives; non-modular code may have MODULE_LICENSE()
      by mistake. This is not a big deal, it is just the code is always
      orphan. We can clean it up if we like. You can see cleanup examples by:
      
        $ git log --grep='make.* explicitly non-modular'
      
      To sum up, this commits deletes lots of code, but still produces almost
      equivalent results. Please note it does not increase the vmlinux size at
      all. As you can see in include/asm-generic/vmlinux.lds.h, the .modinfo
      section is discarded in the link stage.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      8b41fc44
  15. 27 11月, 2019 1 次提交
  16. 14 11月, 2019 1 次提交
  17. 23 9月, 2019 1 次提交
  18. 10 9月, 2019 1 次提交
    • M
      module: add support for symbol namespaces. · 8651ec01
      Matthias Maennich 提交于
      The EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL() macros can be used to
      export a symbol to a specific namespace.  There are no _GPL_FUTURE and
      _UNUSED variants because these are currently unused, and I'm not sure
      they are necessary.
      
      I didn't add EXPORT_SYMBOL_NS() for ASM exports; this patch sets the
      namespace of ASM exports to NULL by default. In case of relative
      references, it will be relocatable to NULL. If there's a need, this
      should be pretty easy to add.
      
      A module that wants to use a symbol exported to a namespace must add a
      MODULE_IMPORT_NS() statement to their module code; otherwise, modpost
      will complain when building the module, and the kernel module loader
      will emit an error and fail when loading the module.
      
      MODULE_IMPORT_NS() adds a modinfo tag 'import_ns' to the module. That
      tag can be observed by the modinfo command, modpost and kernel/module.c
      at the time of loading the module.
      
      The ELF symbols are renamed to include the namespace with an asm label;
      for example, symbol 'usb_stor_suspend' in namespace USB_STORAGE becomes
      'usb_stor_suspend.USB_STORAGE'.  This allows modpost to do namespace
      checking, without having to go through all the effort of parsing ELF and
      relocation records just to get to the struct kernel_symbols.
      
      On x86_64 I saw no difference in binary size (compression), but at
      runtime this will require a word of memory per export to hold the
      namespace. An alternative could be to store namespaced symbols in their
      own section and use a separate 'struct namespaced_kernel_symbol' for
      that section, at the cost of making the module loader more complex.
      Co-developed-by: NMartijn Coenen <maco@android.com>
      Signed-off-by: NMartijn Coenen <maco@android.com>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NMatthias Maennich <maennich@google.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      8651ec01
  19. 06 8月, 2019 1 次提交
  20. 29 5月, 2019 1 次提交
    • P
      srcu: Allocate per-CPU data for DEFINE_SRCU() in modules · fe15b50c
      Paul E. McKenney 提交于
      Adding DEFINE_SRCU() or DEFINE_STATIC_SRCU() to a loadable module requires
      that the size of the reserved region be increased, which is not something
      we want to be doing all that often.  One approach would be to require
      that loadable modules define an srcu_struct and invoke init_srcu_struct()
      from their module_init function and cleanup_srcu_struct() from their
      module_exit function.  However, this is more than a bit user unfriendly.
      
      This commit therefore creates an ___srcu_struct_ptrs linker section,
      and pointers to srcu_struct structures created by DEFINE_SRCU() and
      DEFINE_STATIC_SRCU() within a module are placed into that module's
      ___srcu_struct_ptrs section.  The required init_srcu_struct() and
      cleanup_srcu_struct() functions are then automatically invoked as needed
      when that module is loaded and unloaded, thus allowing modules to continue
      to use DEFINE_SRCU() and DEFINE_STATIC_SRCU() while avoiding the need
      to increase the size of the reserved region.
      
      Many of the algorithms and some of the code was cheerfully cherry-picked
      from other code making use of linker sections, perhaps most notably from
      tracepoints.  All bugs are nevertheless the sole property of the author.
      Suggested-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      [ paulmck: Use __section() and use "default" in srcu_module_notify()'s
        "switch" statement as suggested by Joel Fernandes. ]
      Signed-off-by: NPaul E. McKenney <paulmck@linux.ibm.com>
      Tested-by: NJoel Fernandes (Google) <joel@joelfernandes.org>
      fe15b50c
  21. 07 5月, 2019 1 次提交
    • A
      moduleparam: Save information about built-in modules in separate file · 898490c0
      Alexey Gladkov 提交于
      Problem:
      
      When a kernel module is compiled as a separate module, some important
      information about the kernel module is available via .modinfo section of
      the module.  In contrast, when the kernel module is compiled into the
      kernel, that information is not available.
      
      Information about built-in modules is necessary in the following cases:
      
      1. When it is necessary to find out what additional parameters can be
      passed to the kernel at boot time.
      
      2. When you need to know which module names and their aliases are in
      the kernel. This is very useful for creating an initrd image.
      
      Proposal:
      
      The proposed patch does not remove .modinfo section with module
      information from the vmlinux at the build time and saves it into a
      separate file after kernel linking. So, the kernel does not increase in
      size and no additional information remains in it. Information is stored
      in the same format as in the separate modules (null-terminated string
      array). Because the .modinfo section is already exported with a separate
      modules, we are not creating a new API.
      
      It can be easily read in the userspace:
      
      $ tr '\0' '\n' < modules.builtin.modinfo
      ext4.softdep=pre: crc32c
      ext4.license=GPL
      ext4.description=Fourth Extended Filesystem
      ext4.author=Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
      ext4.alias=fs-ext4
      ext4.alias=ext3
      ext4.alias=fs-ext3
      ext4.alias=ext2
      ext4.alias=fs-ext2
      md_mod.alias=block-major-9-*
      md_mod.alias=md
      md_mod.description=MD RAID framework
      md_mod.license=GPL
      md_mod.parmtype=create_on_open:bool
      md_mod.parmtype=start_dirty_degraded:int
      ...
      Co-Developed-by: NGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
      Signed-off-by: NGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
      Signed-off-by: NAlexey Gladkov <gladkov.alexey@gmail.com>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      898490c0
  22. 02 5月, 2019 1 次提交
  23. 28 3月, 2019 1 次提交
    • E
      kallsyms: store type information in its own array · 1c7651f4
      Eugene Loh 提交于
      When a module is loaded, its symbols' Elf_Sym information is stored
      in a symtab.  Further, type information is also captured.  Since
      Elf_Sym has no type field, historically the st_info field has been
      hijacked for storing type:  st_info was overwritten.
      
      commit 5439c985 ("module: Overwrite
      st_size instead of st_info") changes that practice, as its one-liner
      indicates.  Unfortunately, this change overwrites symbol size,
      information that a tool like DTrace expects to find.
      
      Allocate a typetab array to store type information so that no Elf_Sym
      field needs to be overwritten.
      
      Fixes: 5439c985 ("module: Overwrite st_size instead of st_info")
      Signed-off-by: NEugene Loh <eugene.loh@oracle.com>
      Reviewed-by: NNick Alcock <nick.alcock@oracle.com>
      [jeyu: renamed typeoff -> typeoffs ]
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      1c7651f4
  24. 27 3月, 2019 1 次提交
    • M
      x86/ima: require signed kernel modules · 8db5da0b
      Mimi Zohar 提交于
      Have the IMA architecture specific policy require signed kernel modules
      on systems with secure boot mode enabled; and coordinate the different
      signature verification methods, so only one signature is required.
      
      Requiring appended kernel module signatures may be configured, enabled
      on the boot command line, or with this patch enabled in secure boot
      mode.  This patch defines set_module_sig_enforced().
      
      To coordinate between appended kernel module signatures and IMA
      signatures, only define an IMA MODULE_CHECK policy rule if
      CONFIG_MODULE_SIG is not enabled.  A custom IMA policy may still define
      and require an IMA signature.
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      Reviewed-by: NLuis Chamberlain <mcgrof@kernel.org>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      8db5da0b
  25. 21 3月, 2019 1 次提交
    • D
      vfs: Implement logging through fs_context · 007ec26c
      David Howells 提交于
      Implement the ability for filesystems to log error, warning and
      informational messages through the fs_context.  These can be extracted by
      userspace by reading from an fd created by fsopen().
      
      Error messages are prefixed with "e ", warnings with "w " and informational
      messages with "i ".
      
      Inside the kernel, formatted messages are malloc'd but unformatted messages
      are not copied if they're either in the core .rodata section or in the
      .rodata section of the filesystem module pinned by fs_context::fs_type.
      The messages are only good till the fs_type is released.
      
      Note that the logging object is shared between duplicated fs_context
      structures.  This is so that such as NFS which do a mount within a mount
      can get at least some of the errors from the inner mount.
      
      Five logging functions are provided for this:
      
       (1) void logfc(struct fs_context *fc, const char *fmt, ...);
      
           This logs a message into the context.  If the buffer is full, the
           earliest message is discarded.
      
       (2) void errorf(fc, fmt, ...);
      
           This wraps logfc() to log an error.
      
       (3) void invalf(fc, fmt, ...);
      
           This wraps errorf() and returns -EINVAL for convenience.
      
       (4) void warnf(fc, fmt, ...);
      
           This wraps logfc() to log a warning.
      
       (5) void infof(fc, fmt, ...);
      
           This wraps logfc() to log an informational message.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      007ec26c
  26. 16 2月, 2019 1 次提交
    • M
      include/linux/module.h: copy __init/__exit attrs to init/cleanup_module · a6e60d84
      Miguel Ojeda 提交于
      The upcoming GCC 9 release extends the -Wmissing-attributes warnings
      (enabled by -Wall) to C and aliases: it warns when particular function
      attributes are missing in the aliases but not in their target.
      
      In particular, it triggers for all the init/cleanup_module
      aliases in the kernel (defined by the module_init/exit macros),
      ending up being very noisy.
      
      These aliases point to the __init/__exit functions of a module,
      which are defined as __cold (among other attributes). However,
      the aliases themselves do not have the __cold attribute.
      
      Since the compiler behaves differently when compiling a __cold
      function as well as when compiling paths leading to calls
      to __cold functions, the warning is trying to point out
      the possibly-forgotten attribute in the alias.
      
      In order to keep the warning enabled, we decided to silence
      this case. Ideally, we would mark the aliases directly
      as __init/__exit. However, there are currently around 132 modules
      in the kernel which are missing __init/__exit in their init/cleanup
      functions (either because they are missing, or for other reasons,
      e.g. the functions being called from somewhere else); and
      a section mismatch is a hard error.
      
      A conservative alternative was to mark the aliases as __cold only.
      However, since we would like to eventually enforce __init/__exit
      to be always marked,  we chose to use the new __copy function
      attribute (introduced by GCC 9 as well to deal with this).
      With it, we copy the attributes used by the target functions
      into the aliases. This way, functions that were not marked
      as __init/__exit won't have their aliases marked either,
      and therefore there won't be a section mismatch.
      
      Note that the warning would go away marking either the extern
      declaration, the definition, or both. However, we only mark
      the definition of the alias, since we do not want callers
      (which only see the declaration) to be compiled as if the function
      was __cold (and therefore the paths leading to those calls
      would be assumed to be unlikely).
      
      Link: https://lore.kernel.org/lkml/20190123173707.GA16603@gmail.com/
      Link: https://lore.kernel.org/lkml/20190206175627.GA20399@gmail.com/Suggested-by: NMartin Sebor <msebor@gcc.gnu.org>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      a6e60d84
  27. 11 2月, 2019 1 次提交
    • T
      module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity · bf7fbeea
      Thomas Gleixner 提交于
      The original MODULE_LICENSE string for kernel modules licensed under the
      GPL v2 (only / or later) was simply "GPL", which was - and still is -
      completely sufficient for the purpose of module loading and checking
      whether the module is free software or proprietary.
      
      In January 2003 this was changed with commit 3344ea3ad4b7 ("[PATCH]
      MODULE_LICENSE and EXPORT_SYMBOL_GPL support"). This commit can be found in
      the history git repository which holds the 1:1 import of Linus' bitkeeper
      repository:
      
        https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=3344ea3ad4b7c302c846a680dbaeedf96ed45c02
      
      The main intention of the patch was to refuse linking proprietary modules
      against symbols exported with EXPORT_SYMBOL_GPL() at module load time.
      
      As a completely undocumented side effect it also introduced the distinction
      between "GPL" and "GPL v2" MODULE_LICENSE() strings:
      
       *      "GPL"                           [GNU Public License v2 or later]
       *      "GPL v2"                        [GNU Public License v2]
       *      "GPL and additional rights"     [GNU Public License v2 rights and more]
       *      "Dual BSD/GPL"                  [GNU Public License v2
       *                                       or BSD license choice]
       *      "Dual MPL/GPL"                  [GNU Public License v2
       *                                       or Mozilla license choice]
      
      This distinction was and still is wrong in several aspects:
      
       1) It broke all modules which were using the "GPL" string in the
          MODULE_LICENSE() already and were licensed under GPL v2 only.
      
          A quick license scan over the tree at that time shows that at least 480
          out of 1484 modules have been affected by this change back then. The
          number is probably way higher as this was just a quick check for
          clearly identifiable license information.
      
          There was exactly ONE instance of a "GPL v2" module license string in
          the kernel back then - drivers/net/tulip/xircom_tulip_cb.c which
          otherwise had no license information at all. There is no indication
          that the change above is any way related to this driver. The change
          happend with the 2.4.11 release which was on Oct. 9 2001 - so quite
          some time before the above commit. Unfortunately there is no trace on
          the intertubes to any discussion of this.
      
       2) The dual licensed strings became ill defined as well because following
          the "GPL" vs. "GPL v2" distinction all dual licensed (or additional
          rights) MODULE_LICENSE strings would either require those dual licensed
          modules to be licensed under GPL v2 or later or just be unspecified for
          the dual licensing case. Neither choice is coherent with the GPL
          distinction.
      
      Due to the lack of a proper changelog and no real discussion on the patch
      submission other than a few implementation details, it's completely unclear
      why this distinction was introduced at all. Other than the comment in the
      module header file exists no documentation for this at all.
      
      From a license compliance and license scanning POV this distinction is a
      total nightmare.
      
      As of 5.0-rc2 2873 out of 9200 instances of MODULE_LICENSE() strings are
      conflicting with the actual license in the source code (either SPDX or
      license boilerplate/reference). A comparison between the scan of the
      history tree and a scan of current Linus tree shows to the extent that the
      git rename detection over Linus tree grafted with the history tree is
      halfways complete that almost none of the files which got broken in 2003
      have been cleaned up vs. the MODULE_LICENSE string. So subtracting those
      480 known instances from the conflicting 2800 of today more than 25% of the
      module authors got it wrong and it's a high propability that a large
      portion of the rest just got it right by chance.
      
      There is no value for the module loader to convey the detailed license
      information as the only decision to be made is whether the module is free
      software or not.
      
      The "and additional rights", "BSD" and "MPL" strings are not conclusive
      license information either. So there is no point in trying to make the GPL
      part conclusive and exact. As shown above it's already non conclusive for
      dual licensing and incoherent with a large portion of the module source.
      
      As an unintended side effect this distinction causes a major headache for
      license compliance, license scanners and the ongoing effort to clean up the
      license mess of the kernel.
      
      Therefore remove the well meant, but ill defined, distinction between "GPL"
      and "GPL v2" and document that:
      
        - "GPL" and "GPL v2" both express that the module is licensed under GPLv2
          (without a distinction of 'only' and 'or later') and is therefore kernel
          license compliant.
      
        - None of the MODULE_LICENSE strings can be used for expressing or
          determining the exact license
      
        - Their sole purpose is to decide whether the module is free software or
          not.
      
      Add a MODULE_LICENSE subsection to the license rule documentation as well.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Acked-by: NJoe Perches <joe@perches.com>
      [jc: Did s/merily/merely/ ]
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      bf7fbeea
  28. 09 1月, 2019 1 次提交
    • W
      x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE · e4f35891
      WANG Chao 提交于
      Commit
      
        4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      
      replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the
      remaining pieces.
      
       [ bp: Massage commit message. ]
      
      Fixes: 4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      Signed-off-by: NWANG Chao <chao.wang@ucloud.cn>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NZhenzhong Duan <zhenzhong.duan@oracle.com>
      Reviewed-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Woodhouse <dwmw@amazon.co.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: linux-kbuild@vger.kernel.org
      Cc: srinivas.eeda@oracle.com
      Cc: stable <stable@vger.kernel.org>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn
      e4f35891