1. 10 9月, 2019 7 次提交
    • M
      modpost: add support for generating namespace dependencies · 1d082773
      Matthias Maennich 提交于
      This patch adds an option to modpost to generate a <module>.ns_deps file
      per module, containing the namespace dependencies for that module.
      
      E.g. if the linked module my-module.ko would depend on the symbol
      myfunc.MY_NS in the namespace MY_NS, the my-module.ns_deps file created
      by modpost would contain the entry MY_NS to express the namespace
      dependency of my-module imposed by using the symbol myfunc.
      
      These files can subsequently be used by static analysis tools (like
      coccinelle scripts) to address issues with missing namespace imports. A
      later patch of this series will introduce such a script 'nsdeps' and a
      corresponding make target to automatically add missing
      MODULE_IMPORT_NS() definitions to the module's sources. For that it uses
      the information provided in the generated .ns_deps files.
      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>
      1d082773
    • M
      export: allow definition default namespaces in Makefiles or sources · 8e2adc6a
      Matthias Maennich 提交于
      To avoid excessive usage of EXPORT_SYMBOL_NS(sym, MY_NAMESPACE), where
      MY_NAMESPACE will always be the namespace we are exporting to, allow
      exporting all definitions of EXPORT_SYMBOL() and friends by defining
      DEFAULT_SYMBOL_NAMESPACE.
      
      For example, to export all symbols defined in usb-common into the
      namespace USB_COMMON, add a line like this to drivers/usb/common/Makefile:
      
        ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON
      
      That is equivalent to changing all EXPORT_SYMBOL(sym) definitions to
      EXPORT_SYMBOL_NS(sym, USB_COMMON). Subsequently all symbol namespaces
      functionality will apply.
      
      Another way of making use of this feature is to define the namespace
      within source or header files similar to how TRACE_SYSTEM defines are
      used:
        #undef DEFAULT_SYMBOL_NAMESPACE
        #define DEFAULT_SYMBOL_NAMESPACE USB_COMMON
      
      Please note that, as opposed to TRACE_SYSTEM, DEFAULT_SYMBOL_NAMESPACE
      has to be defined before including include/linux/export.h.
      
      If DEFAULT_SYMBOL_NAMESPACE is defined, a symbol can still be exported
      to another namespace by using EXPORT_SYMBOL_NS() and friends with
      explicitly specifying the namespace.
      Suggested-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-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>
      8e2adc6a
    • M
      module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS · 3d52ec5e
      Matthias Maennich 提交于
      If MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is enabled (default=n), the
      requirement for modules to import all namespaces that are used by
      the module is relaxed.
      
      Enabling this option effectively allows (invalid) modules to be loaded
      while only a warning is emitted.
      
      Disabling this option keeps the enforcement at module loading time and
      loading is denied if the module's imports are not satisfactory.
      Reviewed-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>
      3d52ec5e
    • M
      modpost: add support for symbol namespaces · cb9b55d2
      Matthias Maennich 提交于
      Add support for symbols that are exported into namespaces. For that,
      extract any namespace suffix from the symbol name. In addition, emit a
      warning whenever a module refers to an exported symbol without
      explicitly importing the namespace that it is defined in. This patch
      consistently adds the namespace suffix to symbol names exported into
      Module.symvers.
      
      Example warning emitted by modpost in case of the above violation:
      
       WARNING: module ums-usbat uses symbol usb_stor_resume from namespace
       USB_STORAGE, but does not import it.
      Co-developed-by: NMartijn Coenen <maco@android.com>
      Signed-off-by: NMartijn Coenen <maco@android.com>
      Reviewed-by: NJoel Fernandes (Google) <joel@joelfernandes.org>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NMatthias Maennich <maennich@google.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      cb9b55d2
    • 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
    • M
      export: explicitly align struct kernel_symbol · ed13fc33
      Matthias Maennich 提交于
      This change allows growing struct kernel_symbol without wasting bytes to
      alignment. It also concretized the alignment of ksymtab entries if
      relative references are used for ksymtab entries.
      
      struct kernel_symbol was already implicitly being aligned to the word
      size, except on x86_64 and m68k, where it is aligned to 16 and 2 bytes,
      respectively.
      
      As far as I can tell there is no requirement for aligning struct
      kernel_symbol to 16 bytes on x86_64, but gcc aligns structs to their
      size, and the linker aligns the custom __ksymtab sections to the largest
      data type contained within, so setting KSYM_ALIGN to 16 was necessary to
      stay consistent with the code generated for non-ASM EXPORT_SYMBOL(). Now
      that non-ASM EXPORT_SYMBOL() explicitly aligns to word size (8),
      KSYM_ALIGN is no longer necessary.
      
      In case of relative references, the alignment has been changed
      accordingly to not waste space when adding new struct members.
      
      As for m68k, struct kernel_symbol is aligned to 2 bytes even though the
      structure itself is 8 bytes; using a 4-byte alignment shouldn't hurt.
      
      I manually verified the output of the __ksymtab sections didn't change
      on x86, x86_64, arm, arm64 and m68k. As expected, the section contents
      didn't change, and the ELF section alignment only changed on x86_64 and
      m68k. Feedback from other archs more than welcome.
      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>
      ed13fc33
    • M
      module: support reading multiple values per modinfo tag · c5e4a062
      Matthias Maennich 提交于
      Similar to modpost's get_next_modinfo(), introduce get_next_modinfo() in
      kernel/module.c to acquire any further values associated with the same
      modinfo tag name. That is useful for any tags that have multiple
      occurrences (such as 'alias'), but is in particular introduced here as
      part of the symbol namespaces patch series to read the (potentially)
      multiple namespaces a module is importing.
      Reviewed-by: NJoel Fernandes (Google) <joel@joelfernandes.org>
      Reviewed-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>
      c5e4a062
  2. 03 9月, 2019 3 次提交
    • L
      Linux 5.3-rc7 · 089cf7f6
      Linus Torvalds 提交于
      089cf7f6
    • L
      Merge tag 'char-misc-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 49ffdb4c
      Linus Torvalds 提交于
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char and misc driver fixes for reported issues for
        5.3-rc7
      
        Also included in here is the documentation for how we are handling
        hardware issues under embargo that everyone has finally agreed on, as
        well as a MAINTAINERS update for the suckers who agreed to handle the
        LICENSES/ files.
      
        All of these have been in linux-next last week with no reported
        issues"
      
      * tag 'char-misc-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        fsi: scom: Don't abort operations for minor errors
        vmw_balloon: Fix offline page marking with compaction
        VMCI: Release resource if the work is already queued
        Documentation/process: Embargoed hardware security issues
        lkdtm/bugs: fix build error in lkdtm_EXHAUST_STACK
        mei: me: add Tiger Lake point LP device ID
        intel_th: pci: Add Tiger Lake support
        intel_th: pci: Add support for another Lewisburg PCH
        stm class: Fix a double free of stm_source_device
        MAINTAINERS: add entry for LICENSES and SPDX stuff
        fpga: altera-ps-spi: Fix getting of optional confd gpio
      49ffdb4c
    • L
      Merge tag 'usb-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 2c248f92
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes that have been in linux-next this past
        week for 5.3-rc7
      
        They fix the usual xhci, syzbot reports, and other small issues that
        have come up last week.
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: cdc-wdm: fix race between write and disconnect due to flag abuse
        usb: host: xhci: rcar: Fix typo in compatible string matching
        usb: host: xhci-tegra: Set DMA mask correctly
        USB: storage: ums-realtek: Whitelist auto-delink support
        USB: storage: ums-realtek: Update module parameter description for auto_delink_en
        usb: host: ohci: fix a race condition between shutdown and irq
        usb: hcd: use managed device resources
        typec: tcpm: fix a typo in the comparison of pdo_max_voltage
        usb-storage: Add new JMS567 revision to unusual_devs
        usb: chipidea: udc: don't do hardware access if gadget has stopped
        usbtmc: more sanity checking for packet size
        usb: udc: lpc32xx: silence fall-through warning
      2c248f92
  3. 02 9月, 2019 5 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 345464fb
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix some length checks during OGM processing in batman-adv, from
          Sven Eckelmann.
      
       2) Fix regression that caused netfilter conntrack sysctls to not be
          per-netns any more. From Florian Westphal.
      
       3) Use after free in netpoll, from Feng Sun.
      
       4) Guard destruction of pfifo_fast per-cpu qdisc stats with
          qdisc_is_percpu_stats(), from Davide Caratti. Similar bug is fixed
          in pfifo_fast_enqueue().
      
       5) Fix memory leak in mld_del_delrec(), from Eric Dumazet.
      
       6) Handle neigh events on internal ports correctly in nfp, from John
          Hurley.
      
       7) Clear SKB timestamp in NF flow table code so that it does not
          confuse fq scheduler. From Florian Westphal.
      
       8) taprio destroy can crash if it is invoked in a failure path of
          taprio_init(), because the list head isn't setup properly yet and
          the list del is unconditional. Perform the list add earlier to
          address this. From Vladimir Oltean.
      
       9) Make sure to reapply vlan filters on device up, in aquantia driver.
          From Dmitry Bogdanov.
      
      10) sgiseeq driver releases DMA memory using free_page() instead of
          dma_free_attrs(). From Christophe JAILLET.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (58 commits)
        net: seeq: Fix the function used to release some memory in an error handling path
        enetc: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions
        net: bcmgenet: use ethtool_op_get_ts_info()
        tc-testing: don't hardcode 'ip' in nsPlugin.py
        net: dsa: microchip: add KSZ8563 compatibility string
        dt-bindings: net: dsa: document additional Microchip KSZ8563 switch
        net: aquantia: fix out of memory condition on rx side
        net: aquantia: linkstate irq should be oneshot
        net: aquantia: reapply vlan filters on up
        net: aquantia: fix limit of vlan filters
        net: aquantia: fix removal of vlan 0
        net/sched: cbs: Set default link speed to 10 Mbps in cbs_set_port_rate
        taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte
        taprio: Fix kernel panic in taprio_destroy
        net: dsa: microchip: fill regmap_config name
        rxrpc: Fix lack of conn cleanup when local endpoint is cleaned up [ver #2]
        net: stmmac: dwmac-rk: Don't fail if phy regulator is absent
        amd-xgbe: Fix error path in xgbe_mod_init()
        netfilter: nft_meta_bridge: Fix get NFT_META_BRI_IIFVPROTO in network byteorder
        mac80211: Correctly set noencrypt for PAE frames
        ...
      345464fb
    • C
      net: seeq: Fix the function used to release some memory in an error handling path · e1e54ec7
      Christophe JAILLET 提交于
      In commit 99cd149e ("sgiseeq: replace use of dma_cache_wback_inv"),
      a call to 'get_zeroed_page()' has been turned into a call to
      'dma_alloc_coherent()'. Only the remove function has been updated to turn
      the corresponding 'free_page()' into 'dma_free_attrs()'.
      The error hndling path of the probe function has not been updated.
      
      Fix it now.
      
      Rename the corresponding label to something more in line.
      
      Fixes: 99cd149e ("sgiseeq: replace use of dma_cache_wback_inv")
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Reviewed-by: NThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1e54ec7
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9f159ae0
      Linus Torvalds 提交于
      Pull x86 fixes from Thomas Gleixner:
       "A set of fixes for x86:
      
         - Fix the bogus detection of 32bit user mode for uretprobes which
           caused corruption of the user return address resulting in
           application crashes. In the uprobes handler in_ia32_syscall() is
           obviously always returning false on a 64bit kernel. Use
           user_64bit_mode() instead which works correctly.
      
         - Prevent large page splitting when ftrace flips RW/RO on the kernel
           text which caused iTLB performance issues. Ftrace wants to be
           converted to text_poke() which avoids the problem, but for now
           allow large page preservation in the static protections check when
           the change request spawns a full large page.
      
         - Prevent arch_dynirq_lower_bound() from returning 0 when the IOAPIC
           is configured via device tree. In the device tree case the GSI 1:1
           mapping is meaningless therefore the lower bound which protects the
           GSI range on ACPI machines is irrelevant. Return the lower bound
           which the core hands to the function instead of blindly returning 0
           which causes the core to allocate the invalid virtual interupt
           number 0 which in turn prevents all drivers from allocating and
           requesting an interrupt.
      
         - Remove the bogus initialization of LDR and DFR in the 32bit bigsmp
           APIC driver. That uses physical destination mode where LDR/DFR are
           ignored, but the initialization and the missing clear of LDR caused
           the APIC to be left in a inconsistent state on kexec/reboot.
      
         - Clear LDR when clearing the APIC registers so the APIC is in a well
           defined state.
      
         - Initialize variables proper in the find_trampoline_placement()
           code.
      
         - Silence GCC( build warning for the real mode part of the build"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm/cpa: Prevent large page split when ftrace flips RW on kernel text
        x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning
        x86/boot/compressed/64: Fix missing initialization in find_trampoline_placement()
        x86/apic: Include the LDR when clearing out APIC registers
        x86/apic: Do not initialize LDR and DFR for bigsmp
        uprobes/x86: Fix detection of 32-bit user mode
        x86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines
      9f159ae0
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5fb181cb
      Linus Torvalds 提交于
      Pull perf fixes from Thomas Gleixner:
       "Two fixes for perf x86 hardware implementations:
      
         - Restrict the period on Nehalem machines to prevent perf from
           hogging the CPU
      
         - Prevent the AMD IBS driver from overwriting the hardwre controlled
           and pre-seeded reserved bits (0-6) in the count register which
           caused a sample bias for dispatched micro-ops"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/amd/ibs: Fix sample bias for dispatched micro-ops
        perf/x86/intel: Restrict period on Nehalem
      5fb181cb
    • L
      Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · 5358e6e7
      Linus Torvalds 提交于
      Pull turbostat updates from Len Brown:
       "User-space turbostat (and x86_energy_perf_policy) patches.
      
        They are primarily bug fixes from users"
      
      * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
        tools/power turbostat: update version number
        tools/power turbostat: Add support for Hygon Fam 18h (Dhyana) RAPL
        tools/power turbostat: Fix caller parameter of get_tdp_amd()
        tools/power turbostat: Fix CPU%C1 display value
        tools/power turbostat: do not enforce 1ms
        tools/power turbostat: read from pipes too
        tools/power turbostat: Add Ice Lake NNPI support
        tools/power turbostat: rename has_hsw_msrs()
        tools/power turbostat: Fix Haswell Core systems
        tools/power turbostat: add Jacobsville support
        tools/power turbostat: fix buffer overrun
        tools/power turbostat: fix file descriptor leaks
        tools/power turbostat: fix leak of file descriptor on error return path
        tools/power turbostat: Make interval calculation per thread to reduce jitter
        tools/power turbostat: remove duplicate pc10 column
        tools/power x86_energy_perf_policy: Fix argument parsing
        tools/power: Fix typo in man page
        tools/power/x86: Enable compiler optimisations and Fortify by default
        tools/power x86_energy_perf_policy: Fix "uninitialized variable" warnings at -O2
      5358e6e7
  4. 01 9月, 2019 25 次提交
新手
引导
客服 返回
顶部