28 Sep, 2019

1 commit

  • Pull integrity updates from Mimi Zohar:
    "The major feature in this time is IMA support for measuring and
    appraising appended file signatures. In addition are a couple of bug
    fixes and code cleanup to use struct_size().

    In addition to the PE/COFF and IMA xattr signatures, the kexec kernel
    image may be signed with an appended signature, using the same
    scripts/sign-file tool that is used to sign kernel modules.

    Similarly, the initramfs may contain an appended signature.

    This contained a lot of refactoring of the existing appended signature
    verification code, so that IMA could retain the existing framework of
    calculating the file hash once, storing it in the IMA measurement list
    and extending the TPM, verifying the file's integrity based on a file
    hash or signature (eg. xattrs), and adding an audit record containing
    the file hash, all based on policy. (The IMA support for appended
    signatures patch set was posted and reviewed 11 times.)

    The support for appended signature paves the way for adding other
    signature verification methods, such as fs-verity, based on a single
    system-wide policy. The file hash used for verifying the signature and
    the signature, itself, can be included in the IMA measurement list"

    * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
    ima: ima_api: Use struct_size() in kzalloc()
    ima: use struct_size() in kzalloc()
    sefltest/ima: support appended signatures (modsig)
    ima: Fix use after free in ima_read_modsig()
    MODSIGN: make new include file self contained
    ima: fix freeing ongoing ahash_request
    ima: always return negative code for error
    ima: Store the measurement again when appraising a modsig
    ima: Define ima-modsig template
    ima: Collect modsig
    ima: Implement support for module-style appended signatures
    ima: Factor xattr_verify() out of ima_appraise_measurement()
    ima: Add modsig appraise_type option for module-style appended signatures
    integrity: Select CONFIG_KEYS instead of depending on it
    PKCS#7: Introduce pkcs7_get_digest()
    PKCS#7: Refactor verify_pkcs7_signature()
    MODSIGN: Export module signature definitions
    ima: initialize the "template" field with the default template

    Linus Torvalds
     

26 Sep, 2019

10 commits

  • IS_ERR(), IS_ERR_OR_NULL(), IS_ERR_VALUE() and WARN*() already contain
    unlikely() optimization internally. Thus, there is no point in calling
    these functions and defines under likely()/unlikely().

    This check is based on the coccinelle rule developed by Enrico Weigelt
    https://lore.kernel.org/lkml/1559767582-11081-1-git-send-email-info@metux.net/

    Link: http://lkml.kernel.org/r/20190829165025.15750-1-efremov@linux.com
    Signed-off-by: Denis Efremov
    Cc: Joe Perches
    Cc: Alexander Viro
    Cc: Anton Altaparmakov
    Cc: Boris Ostrovsky
    Cc: Boris Pismenny
    Cc: Darrick J. Wong
    Cc: "David S. Miller"
    Cc: Denis Efremov
    Cc: Dennis Dalessandro
    Cc: Inaky Perez-Gonzalez
    Cc: Juergen Gross
    Cc: Leon Romanovsky
    Cc: Mike Marciniszyn
    Cc: Rob Clark
    Cc: Saeed Mahameed
    Cc: Sean Paul
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denis Efremov
     
  • Some systems (like Chrome OS) may use "split debug" for kernel modules.
    That means that the debug symbols are in a different file than the main
    elf file. Let's handle that by also searching for debug symbols that end
    in ".ko.debug".

    This is a packaging topic. You can take a normal elf file and split the
    debug out of it using objcopy. Try "man objcopy" and then take a look at
    the "--only-keep-debug" option. It'll give you a whole recipe for doing
    splitdebug. The suffix used for the debug symbols is arbitrary. If
    people have other another suffix besides ".ko.debug" then we could
    presumably support that too...

    For portage (which is the packaging system used by Chrome OS) split debug
    is supported by default (and the suffix is .ko.debug). ...and so in
    Chrome OS we always get the installed elf files stripped and then the
    symbols stashed away.

    At the moment we don't actually use the normal portage magic to do this
    for the kernel though since it affects our ability to get good stack dumps
    in the kernel. We instead pass a script as "strip" [1].

    [1] https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/master/eclass/cros-kernel/strip_splitdebug

    Link: http://lkml.kernel.org/r/20190730234052.148744-1-dianders@chromium.org
    Signed-off-by: Douglas Anderson
    Reviewed-by: Stephen Boyd
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Cc: Jason Wessel
    Cc: Daniel Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Douglas Anderson
     
  • git output parsing depends on the language being en_US english.

    Make the backtick execution of all `git ` commands set the
    LANGUAGE of the process to en_US.utf8 before executing the actual
    command using `export LANGUAGE=en_US.utf8; git `.

    Because the command is executed in a child process, the parent
    LANGUAGE is unchanged.

    Link: http://lkml.kernel.org/r/bb9f29988f3258281956680ff39c3e19e37dc0b8.camel@perches.com
    Signed-off-by: Joe Perches
    Reported-by: Sean Christopherson
    Reviewed-by: Sean Christopherson
    Tested-by: Sean Christopherson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Git dropped the period from its "ambiguous SHA1" error message in commit
    0c99171ad2 ("get_short_sha1: mark ambiguity error for translation"), circa
    2016. Drop the period from checkpatch's associated query so as to match
    both the old and new error messages.

    Link: http://lkml.kernel.org/r/20190830163103.15914-1-sean.j.christopherson@intel.com
    Signed-off-by: Sean Christopherson
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sean Christopherson
     
  • checkpatch allows consecutive open braces, so it should also allow
    consecutive close braces.

    Link: http://lkml.kernel.org/r/bfdb49ae2c3fa7b52fa168769e38b48f959880e2.camel@perches.com
    Signed-off-by: Joe Perches
    Acked-by: Jeff Kirsher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add another test for __attribute__((section("foo"))) uses that should be
    __section(foo)

    Link: http://lkml.kernel.org/r/2f374c3c27054b7f978115270d587c624d9962fc.camel@perches.com
    Suggested-by: Nick Desaulniers
    Signed-off-by: Joe Perches
    Tested-by: Nick Desaulniers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • The arguments of sizeof are not evaluated so arguments are safe to re-use
    in that context. Excluding sizeof subexpressions means macros like
    ARRAY_SIZE can pass checkpatch.

    Link: http://lkml.kernel.org/r/20190806070833.24423-1-brendan.jackman@bluwireless.co.uk
    Signed-off-by: Brendan Jackman
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brendan Jackman
     
  • It can happen that a commit message refers to an invalid commit id,
    because the referenced hash changed following a rebase, or simply by
    mistake. Add a check in checkpatch.pl which checks that an hash
    referenced by a Fixes tag, or just cited in the commit message, is a valid
    commit id.

    $ scripts/checkpatch.pl <
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matteo Croce
     
  • Use perl's m@@ match and not // comparisons to avoid
    an error using c90's // comment style.

    Miscellanea:

    o Use normal tab indentation and alignment

    Link: http://lkml.kernel.org/r/5e4a8fa7901148fbcd77ab391e6dd0e6bf95777f.camel@perches.com

    Link: http://lkml.kernel.org/r/f08eb62458407a145cfedf959d1091af151cd665.1563575364.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add more types of lines that appear to be stack dumps that also include
    hex lines that might otherwise be interpreted as commit IDs.

    Link: http://lkml.kernel.org/r/ff00208289224f0ca4eaf4ff7c9c6e087dad0a63.camel@perches.com

    Link: http://lkml.kernel.org/r/f7dc9727795db3802809a24162abe0b67e14123b.1563575364.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

23 Sep, 2019

1 commit

  • Pull modules updates from Jessica Yu:
    "The main bulk of this pull request introduces a new exported symbol
    namespaces feature. The number of exported symbols is increasingly
    growing with each release (we're at about 31k exports as of 5.3-rc7)
    and we currently have no way of visualizing how these symbols are
    "clustered" or making sense of this huge export surface.

    Namespacing exported symbols allows kernel developers to more
    explicitly partition and categorize exported symbols, as well as more
    easily limiting the availability of namespaced symbols to other parts
    of the kernel. For starters, we have introduced the USB_STORAGE
    namespace to demonstrate the API's usage. I have briefly summarized
    the feature and its main motivations in the tag below.

    Summary:

    - Introduce exported symbol namespaces.

    This new feature allows subsystem maintainers to partition and
    categorize their exported symbols into explicit namespaces. Module
    authors are now required to import the namespaces they need.

    Some of the main motivations of this feature include: allowing
    kernel developers to better manage the export surface, allow
    subsystem maintainers to explicitly state that usage of some
    exported symbols should only be limited to certain users (think:
    inter-module or inter-driver symbols, debugging symbols, etc), as
    well as more easily limiting the availability of namespaced symbols
    to other parts of the kernel.

    With the module import requirement, it is also easier to spot the
    misuse of exported symbols during patch review.

    Two new macros are introduced: EXPORT_SYMBOL_NS() and
    EXPORT_SYMBOL_NS_GPL(). The API is thoroughly documented in
    Documentation/kbuild/namespaces.rst.

    - Some small code and kbuild cleanups here and there"

    * tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
    module: Remove leftover '#undef' from export header
    module: remove unneeded casts in cmp_name()
    module: move CONFIG_UNUSED_SYMBOLS to the sub-menu of MODULES
    module: remove redundant 'depends on MODULES'
    module: Fix link failure due to invalid relocation on namespace offset
    usb-storage: export symbols in USB_STORAGE namespace
    usb-storage: remove single-use define for debugging
    docs: Add documentation for Symbol Namespaces
    scripts: Coccinelle script for namespace dependencies.
    modpost: add support for generating namespace dependencies
    export: allow definition default namespaces in Makefiles or sources
    module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
    modpost: add support for symbol namespaces
    module: add support for symbol namespaces.
    export: explicitly align struct kernel_symbol
    module: support reading multiple values per modinfo tag

    Linus Torvalds
     

22 Sep, 2019

1 commit


21 Sep, 2019

1 commit

  • Pull tracing updates from Steven Rostedt:

    - Addition of multiprobes to kprobe and uprobe events (allows for more
    than one probe attached to the same location)

    - Addition of adding immediates to probe parameters

    - Clean up of the recordmcount.c code. This brings us closer to merging
    recordmcount into objtool, and reuse code.

    - Other small clean ups

    * tag 'trace-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (33 commits)
    selftests/ftrace: Update kprobe event error testcase
    tracing/probe: Reject exactly same probe event
    tracing/probe: Fix to allow user to enable events on unloaded modules
    selftests/ftrace: Select an existing function in kprobe_eventname test
    tracing/kprobe: Fix NULL pointer access in trace_porbe_unlink()
    tracing: Make sure variable reference alias has correct var_ref_idx
    tracing: Be more clever when dumping hex in __print_hex()
    ftrace: Simplify ftrace hash lookup code in clear_func_from_hash()
    tracing: Add "gfp_t" support in synthetic_events
    tracing: Rename tracing_reset() to tracing_reset_cpu()
    tracing: Document the stack trace algorithm in the comments
    tracing/arm64: Have max stack tracer handle the case of return address after data
    recordmcount: Clarify what cleanup() does
    recordmcount: Remove redundant cleanup() calls
    recordmcount: Kernel style formatting
    recordmcount: Kernel style function signature formatting
    recordmcount: Rewrite error/success handling
    selftests/ftrace: Add syntax error test for multiprobe
    selftests/ftrace: Add syntax error test for immediates
    selftests/ftrace: Add a testcase for kprobe multiprobe event
    ...

    Linus Torvalds
     

20 Sep, 2019

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - add modpost warn exported symbols marked as 'static' because 'static'
    and EXPORT_SYMBOL is an odd combination

    - break the build early if gold linker is used

    - optimize the Bison rule to produce .c and .h files by a single
    pattern rule

    - handle PREEMPT_RT in the module vermagic and UTS_VERSION

    - warn CONFIG options leaked to the user-space except existing ones

    - make single targets work properly

    - rebuild modules when module linker scripts are updated

    - split the module final link stage into scripts/Makefile.modfinal

    - fix the missed error code in merge_config.sh

    - improve the error message displayed on the attempt of the O= build in
    unclean source tree

    - remove 'clean-dirs' syntax

    - disable -Wimplicit-fallthrough warning for Clang

    - add CONFIG_CC_OPTIMIZE_FOR_SIZE_O3 for ARC

    - remove ARCH_{CPP,A,C}FLAGS variables

    - add $(BASH) to run bash scripts

    - change *CFLAGS_.o to take the relative path to $(obj)
    instead of the basename

    - stop suppressing Clang's -Wunused-function warnings when W=1

    - fix linux/export.h to avoid genksyms calculating CRC of trimmed
    exported symbols

    - misc cleanups

    * tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (63 commits)
    genksyms: convert to SPDX License Identifier for lex.l and parse.y
    modpost: use __section in the output to *.mod.c
    modpost: use MODULE_INFO() for __module_depends
    export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols
    export.h: remove defined(__KERNEL__), which is no longer needed
    kbuild: allow Clang to find unused static inline functions for W=1 build
    kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN
    kbuild: refactor scripts/Makefile.extrawarn
    merge_config.sh: ignore unwanted grep errors
    kbuild: change *FLAGS_.o to take the path relative to $(obj)
    modpost: add NOFAIL to strndup
    modpost: add guid_t type definition
    kbuild: add $(BASH) to run scripts with bash-extension
    kbuild: remove ARCH_{CPP,A,C}FLAGS
    kbuild,arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC
    kbuild: Do not enable -Wimplicit-fallthrough for clang for now
    kbuild: clean up subdir-ymn calculation in Makefile.clean
    kbuild: remove unneeded '+' marker from cmd_clean
    kbuild: remove clean-dirs syntax
    kbuild: check clean srctree even earlier
    ...

    Linus Torvalds
     

19 Sep, 2019

2 commits

  • Pull networking updates from David Miller:

    1) Support IPV6 RA Captive Portal Identifier, from Maciej Żenczykowski.

    2) Use bio_vec in the networking instead of custom skb_frag_t, from
    Matthew Wilcox.

    3) Make use of xmit_more in r8169 driver, from Heiner Kallweit.

    4) Add devmap_hash to xdp, from Toke Høiland-Jørgensen.

    5) Support all variants of 5750X bnxt_en chips, from Michael Chan.

    6) More RTNL avoidance work in the core and mlx5 driver, from Vlad
    Buslov.

    7) Add TCP syn cookies bpf helper, from Petar Penkov.

    8) Add 'nettest' to selftests and use it, from David Ahern.

    9) Add extack support to drop_monitor, add packet alert mode and
    support for HW drops, from Ido Schimmel.

    10) Add VLAN offload to stmmac, from Jose Abreu.

    11) Lots of devm_platform_ioremap_resource() conversions, from
    YueHaibing.

    12) Add IONIC driver, from Shannon Nelson.

    13) Several kTLS cleanups, from Jakub Kicinski.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1930 commits)
    mlxsw: spectrum_buffers: Add the ability to query the CPU port's shared buffer
    mlxsw: spectrum: Register CPU port with devlink
    mlxsw: spectrum_buffers: Prevent changing CPU port's configuration
    net: ena: fix incorrect update of intr_delay_resolution
    net: ena: fix retrieval of nonadaptive interrupt moderation intervals
    net: ena: fix update of interrupt moderation register
    net: ena: remove all old adaptive rx interrupt moderation code from ena_com
    net: ena: remove ena_restore_ethtool_params() and relevant fields
    net: ena: remove old adaptive interrupt moderation code from ena_netdev
    net: ena: remove code duplication in ena_com_update_nonadaptive_moderation_interval _*()
    net: ena: enable the interrupt_moderation in driver_supported_features
    net: ena: reimplement set/get_coalesce()
    net: ena: switch to dim algorithm for rx adaptive interrupt moderation
    net: ena: add intr_moder_rx_interval to struct ena_com_dev and use it
    net: phy: adin: implement Energy Detect Powerdown mode via phy-tunable
    ethtool: implement Energy Detect Powerdown support via phy-tunable
    xen-netfront: do not assume sk_buff_head list is empty in error handling
    s390/ctcm: Delete unnecessary checks before the macro call “dev_kfree_skb”
    net: ena: don't wake up tx queue when down
    drop_monitor: Better sanitize notified packets
    ...

    Linus Torvalds
     
  • Pull driver core updates from Greg Kroah-Hartman:
    "Here is the big driver core update for 5.4-rc1.

    There was a bit of a churn in here, with a number of core and OF
    platform patches being added to the tree, and then after much
    discussion and review and a day-long in-person meeting, they were
    decided to be reverted and a new set of patches is currently being
    reviewed on the mailing list.

    Other than that churn, there are two "persistent" branches in here
    that other trees will be pulling in as well during the merge window.
    One branch to add support for drivers to have the driver core
    automatically add sysfs attribute files when a driver is bound to a
    device so that the driver doesn't have to manually do it (and then
    clean it up, as it always gets it wrong).

    There's another branch in here for generic lookup helpers for the
    driver core that lots of busses are starting to use. That's the
    majority of the non-driver-core changes in this patch series.

    There's also some on-going debugfs file creation cleanup that has been
    slowly happening over the past few releases, with the goal to
    hopefully get that done sometime next year.

    All of these have been in linux-next for a while now with no reported
    issues"

    [ Note that the above-mentioned generic lookup helpers branch was
    already brought in by the LED merge (commit 4feaab05dc1e) that had
    shared it.

    Also note that that common branch introduced an i2c bug due to a bad
    conversion, which got fixed here. - Linus ]

    * tag 'driver-core-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (49 commits)
    coccinelle: platform_get_irq: Fix parse error
    driver-core: add include guard to linux/container.h
    sysfs: add BIN_ATTR_WO() macro
    driver core: platform: Export platform_get_irq_optional()
    hwmon: pwm-fan: Use platform_get_irq_optional()
    driver core: platform: Introduce platform_get_irq_optional()
    Revert "driver core: Add support for linking devices during device addition"
    Revert "driver core: Add edit_links() callback for drivers"
    Revert "of/platform: Add functional dependency link from DT bindings"
    Revert "driver core: Add sync_state driver/bus callback"
    Revert "of/platform: Pause/resume sync state during init and of_platform_populate()"
    Revert "of/platform: Create device links for all child-supplier depencencies"
    Revert "of/platform: Don't create device links for default busses"
    Revert "of/platform: Fix fn definitons for of_link_is_valid() and of_link_property()"
    Revert "of/platform: Fix device_links_supplier_sync_state_resume() warning"
    Revert "of/platform: Disable generic device linking code for PowerPC"
    devcoredump: fix typo in comment
    devcoredump: use memory_read_from_buffer
    of/platform: Disable generic device linking code for PowerPC
    device.h: Fix warnings for mismatched parameter names in comments
    ...

    Linus Torvalds
     

18 Sep, 2019

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "It's a somewhat calmer cycle for docs this time, as the churn of the
    mass RST conversion is happily mostly behind us.

    - A new document on reproducible builds.

    - We finally got around to zapping the documentation for hardware
    support that was removed in 2004; one doesn't want to rush these
    things.

    - The usual assortment of fixes, typo corrections, etc"

    * tag 'docs-5.4' of git://git.lwn.net/linux: (67 commits)
    Documentation: kbuild: Add document about reproducible builds
    docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]
    Documentation: Add "earlycon=sbi" to the admin guide
    doc:lock: remove reference to clever use of read-write lock
    devices.txt: improve entry for comedi (char major 98)
    docs: mtd: Update spi nor reference driver
    doc: arm64: fix grammar dtb placed in no attributes region
    Documentation: sysrq: don't recommend 'S' 'U' before 'B'
    mailmap: Update email address for Quentin Perret
    docs: ftrace: clarify when tracing is disabled by the trace file
    docs: process: fix broken link
    Documentation/arm/samsung-s3c24xx: Remove stray U+FEFF character to fix title
    Documentation/arm/sa1100/assabet: Fix 'make assabet_defconfig' command
    Documentation/arm/sa1100: Remove some obsolete documentation
    docs/zh_CN: update Chinese howto.rst for latexdocs making
    Documentation: virt: Fix broken reference to virt tree's index
    docs: Fix typo on pull requests guide
    kernel-doc: Allow anonymous enum
    Documentation: sphinx: Don't parse socket() as identifier reference
    Documentation: sphinx: Add missing comma to list of strings
    ...

    Linus Torvalds
     

17 Sep, 2019

1 commit

  • Pull arm64 updates from Will Deacon:
    "Although there isn't tonnes of code in terms of line count, there are
    a fair few headline features which I've noted both in the tag and also
    in the merge commits when I pulled everything together.

    The part I'm most pleased with is that we had 35 contributors this
    time around, which feels like a big jump from the usual small group of
    core arm64 arch developers. Hopefully they all enjoyed it so much that
    they'll continue to contribute, but we'll see.

    It's probably worth highlighting that we've pulled in a branch from
    the risc-v folks which moves our CPU topology code out to where it can
    be shared with others.

    Summary:

    - 52-bit virtual addressing in the kernel

    - New ABI to allow tagged user pointers to be dereferenced by
    syscalls

    - Early RNG seeding by the bootloader

    - Improve robustness of SMP boot

    - Fix TLB invalidation in light of recent architectural
    clarifications

    - Support for i.MX8 DDR PMU

    - Remove direct LSE instruction patching in favour of static keys

    - Function error injection using kprobes

    - Support for the PPTT "thread" flag introduced by ACPI 6.3

    - Move PSCI idle code into proper cpuidle driver

    - Relaxation of implicit I/O memory barriers

    - Build with RELR relocations when toolchain supports them

    - Numerous cleanups and non-critical fixes"

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (114 commits)
    arm64: remove __iounmap
    arm64: atomics: Use K constraint when toolchain appears to support it
    arm64: atomics: Undefine internal macros after use
    arm64: lse: Make ARM64_LSE_ATOMICS depend on JUMP_LABEL
    arm64: asm: Kill 'asm/atomic_arch.h'
    arm64: lse: Remove unused 'alt_lse' assembly macro
    arm64: atomics: Remove atomic_ll_sc compilation unit
    arm64: avoid using hard-coded registers for LSE atomics
    arm64: atomics: avoid out-of-line ll/sc atomics
    arm64: Use correct ll/sc atomic constraints
    jump_label: Don't warn on __exit jump entries
    docs/perf: Add documentation for the i.MX8 DDR PMU
    perf/imx_ddr: Add support for AXI ID filtering
    arm64: kpti: ensure patched kernel text is fetched from PoU
    arm64: fix fixmap copy for 16K pages and 48-bit VA
    perf/smmuv3: Validate groups for global filtering
    perf/smmuv3: Validate group size
    arm64: Relax Documentation/arm64/tagged-pointers.rst
    arm64: kvm: Replace hardcoded '1' with SYS_PAR_EL1_F
    arm64: mm: Ignore spurious translation faults taken from the kernel
    ...

    Linus Torvalds
     

14 Sep, 2019

4 commits

  • I used the C comment style (/* ... */) for the flex and bison files
    as in Kconfig (scripts/kconfig/{lexer.l,parser.y})

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Use the __section() shorthand. This avoids escaping double-quotes,
    and improves the readability.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • This makes *.mod.c much more readable. I confirmed depmod still
    produced the same modules.dep file.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Arnd Bergmann reported false-positive modpost warnings detected by his
    randconfig testing of linux-next.

    Actually, this happens under the combination of CONFIG_MODVERSIONS
    and CONFIG_TRIM_UNUSED_KSYMS since commit 15bfc2348d54 ("modpost:
    check for static EXPORT_SYMBOL* functions").

    For example, arch/arm/config/multi_v7_defconfig + CONFIG_MODVERSIONS
    + CONFIG_TRIM_UNUSED_KSYMS produces the following false-positives:

    WARNING: "__lshrdi3" [vmlinux] is a static (unknown)
    WARNING: "__ashrdi3" [vmlinux] is a static (unknown)
    WARNING: "__aeabi_lasr" [vmlinux] is a static (unknown)
    WARNING: "__aeabi_llsr" [vmlinux] is a static (unknown)
    WARNING: "ftrace_set_clr_event" [vmlinux] is a static (unknown)
    WARNING: "__muldi3" [vmlinux] is a static (unknown)
    WARNING: "__aeabi_ulcmp" [vmlinux] is a static (unknown)
    WARNING: "__ucmpdi2" [vmlinux] is a static (unknown)
    WARNING: "__aeabi_lmul" [vmlinux] is a static (unknown)
    WARNING: "__bswapsi2" [vmlinux] is a static (unknown)
    WARNING: "__bswapdi2" [vmlinux] is a static (unknown)
    WARNING: "__ashldi3" [vmlinux] is a static (unknown)
    WARNING: "__aeabi_llsl" [vmlinux] is a static (unknown)

    The root cause of the problem is not in the modpost, but in the
    implementation of CONFIG_TRIM_UNUSED_KSYMS.

    If there is at least one untrimmed symbol in the file, genksyms is
    invoked to calculate CRC of *all* the exported symbols in that file
    even if some of them have been trimmed due to no caller existing.

    As a result, .tmp_*.ver files contain CRC of trimmed symbols, thus
    unneeded, orphan __crc* symbols are added to objects. It had been
    harmless until recently.

    With commit 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL*
    functions"), it is now harmful because the bogus __crc* symbols make
    modpost call sym_update_crc() to add the symbols to the hash table,
    but there is no one that clears the ->is_static member.

    I gave Fixes to the first commit that uncovered the issue, but the
    potential problem has long existed since commit f235541699bc
    ("export.h: allow for per-symbol configurable EXPORT_SYMBOL()").

    Fixes: 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions")
    Reported-by: Arnd Bergmann
    Signed-off-by: Masahiro Yamada
    Tested-by: Arnd Bergmann

    Masahiro Yamada
     

10 Sep, 2019

3 commits

  • A script that uses the '.ns_deps' files generated by modpost to
    automatically add the required symbol namespace dependencies to each
    module.

    Usage:
    1) Move some symbols to a namespace with EXPORT_SYMBOL_NS() or define
    DEFAULT_SYMBOL_NAMESPACE
    2) Run 'make' (or 'make modules') and get warnings about modules not
    importing that namespace.
    3) Run 'make nsdeps' to automatically add required import statements
    to said modules.

    This makes it easer for subsystem maintainers to introduce and maintain
    symbol namespaces into their codebase.

    Co-developed-by: Martijn Coenen
    Signed-off-by: Martijn Coenen
    Acked-by: Julia Lawall
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Matthias Maennich
    Signed-off-by: Jessica Yu

    Matthias Maennich
     
  • This patch adds an option to modpost to generate a .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: Martijn Coenen
    Signed-off-by: Martijn Coenen
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Matthias Maennich
    Signed-off-by: Jessica Yu

    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: Martijn Coenen
    Signed-off-by: Martijn Coenen
    Reviewed-by: Joel Fernandes (Google)
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Matthias Maennich
    Signed-off-by: Jessica Yu

    Matthias Maennich
     

09 Sep, 2019

1 commit

  • GCC and Clang have different policy for -Wunused-function; GCC does not
    warn unused static inline functions at all whereas Clang does if they
    are defined in source files instead of included headers although it has
    been suppressed since commit abb2ea7dfd82 ("compiler, clang: suppress
    warning for unused static inline functions").

    We often miss to delete unused functions where 'static inline' is used
    in *.c files since there is no tool to detect them. Unused code remains
    until somebody notices. For example, commit 075ddd75680f ("regulator:
    core: remove unused rdev_get_supply()").

    Let's remove __maybe_unused from the inline macro to allow Clang to
    start finding unused static inline functions. For now, we do this only
    for W=1 build since it is not a good idea to sprinkle warnings for the
    normal build (e.g. 35 warnings for arch/x86/configs/x86_64_defconfig).

    My initial attempt was to add -Wno-unused-function for no W= build
    (https://lore.kernel.org/patchwork/patch/1120594/)

    Nathan Chancellor pointed out that would weaken Clang's checks since
    we would no longer get -Wunused-function without W=1. It is true GCC
    would catch unused static non-inline functions, but it would weaken
    Clang as a standalone compiler, at least.

    Hence, here is a counter implementation. The current problem is, W=...
    only controls compiler flags, which are globally effective. There is
    no way to address only 'static inline' functions.

    This commit defines KBUILD_EXTRA_WARN[123] corresponding to W=[123].
    When KBUILD_EXTRA_WARN1 is defined, __maybe_unused is omitted from
    the 'inline' macro.

    The new macro __inline_maybe_unused makes the code a bit uglier, so I
    hope we can remove it entirely after fixing most of the warnings.

    If you contribute to code clean-up, please run "make CC=clang W=1"
    and check -Wunused-function warnings. You will find lots of unused
    functions.

    Some of them are false-positives because the call-sites are disabled
    by #ifdef. I do not like to abuse the inline keyword for suppressing
    unused-function warnings because it is intended to be a hint for the
    compiler optimization. I prefer #ifdef around the definition, or
    __maybe_unused if #ifdef would make the code too ugly.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nathan Chancellor
    Tested-by: Nathan Chancellor

    Masahiro Yamada
     

07 Sep, 2019

1 commit

  • ${@:2} is BASH-specific extension, which makes link-vmlinux.sh rely on
    BASH. Use shift and ${@} instead to fix this issue.

    Reported-by: Stephen Rothwell
    Fixes: 341dfcf8d78e ("btf: expose BTF info through sysfs")
    Cc: Stephen Rothwell
    Cc: Masahiro Yamada
    Signed-off-by: Andrii Nakryiko
    Acked-by: Yonghong Song
    Reviewed-by: Masahiro Yamada
    Signed-off-by: Alexei Starovoitov

    Andrii Nakryiko
     

06 Sep, 2019

4 commits

  • Daniel Borkmann says:

    ====================
    The following pull-request contains BPF updates for your *net-next* tree.

    The main changes are:

    1) Add the ability to use unaligned chunks in the AF_XDP umem. By
    relaxing where the chunks can be placed, it allows to use an
    arbitrary buffer size and place whenever there is a free
    address in the umem. Helps more seamless DPDK AF_XDP driver
    integration. Support for i40e, ixgbe and mlx5e, from Kevin and
    Maxim.

    2) Addition of a wakeup flag for AF_XDP tx and fill rings so the
    application can wake up the kernel for rx/tx processing which
    avoids busy-spinning of the latter, useful when app and driver
    is located on the same core. Support for i40e, ixgbe and mlx5e,
    from Magnus and Maxim.

    3) bpftool fixes for printf()-like functions so compiler can actually
    enforce checks, bpftool build system improvements for custom output
    directories, and addition of 'bpftool map freeze' command, from Quentin.

    4) Support attaching/detaching XDP programs from 'bpftool net' command,
    from Daniel.

    5) Automatic xskmap cleanup when AF_XDP socket is released, and several
    barrier/{read,write}_once fixes in AF_XDP code, from Björn.

    6) Relicense of bpf_helpers.h/bpf_endian.h for future libbpf
    inclusion as well as libbpf versioning improvements, from Andrii.

    7) Several new BPF kselftests for verifier precision tracking, from Alexei.

    8) Several BPF kselftest fixes wrt endianess to run on s390x, from Ilya.

    9) And more BPF kselftest improvements all over the place, from Stanislav.

    10) Add simple BPF map op cache for nfp driver to batch dumps, from Jakub.

    11) AF_XDP socket umem mapping improvements for 32bit archs, from Ivan.

    12) Add BPF-to-BPF call and BTF line info support for s390x JIT, from Yauheni.

    13) Small optimization in arm64 JIT to spare 1 insns for BPF_MOD, from Jerin.

    14) Fix an error check in bpf_tcp_gen_syncookie() helper, from Petar.

    15) Various minor fixes and cleanups, from Nathan, Masahiro, Masanari,
    Peter, Wei, Yue.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • KBUILD_ENABLE_EXTRA_GCC_CHECKS started as a switch to add extra warning
    options for GCC, but now it is a historical misnomer since we use it
    also for Clang, DTC, and even kernel-doc.

    Rename it to more sensible, shorter KBUILD_EXTRA_WARN.

    For the backward compatibility, KBUILD_ENABLE_EXTRA_GCC_CHECKS is still
    supported (but not advertised in the documentation).

    I also fixed up 'make help', and updated the documentation.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nathan Chancellor
    Reviewed-by: Nick Desaulniers
    Reviewed-by: Sedat Dilek

    Masahiro Yamada
     
  • Instead of the warning-[123] magic, let's accumulate compiler options
    to KBUILD_CFLAGS directly as the top Makefile does. I think this makes
    it easier to understand what is going on in this file.

    This commit slightly changes the behavior, I think all of which are OK.

    [1] Currently, cc-option calls are needlessly evaluated. For example,
    warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
    needs evaluating only when W=3, but it is actually evaluated for
    W=1, W=2 as well. With this commit, only relevant cc-option calls
    will be evaluated. This is a slight optimization.

    [2] Currently, unsupported level like W=4 is checked by:
    $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
    This will no longer be checked, but I do not think it is a big
    deal.

    [3] Currently, 4 Clang warnings (Winitializer-overrides, Wformat,
    Wsign-compare, Wformat-zero-length) are shown by any of W=1, W=2,
    and W=3. With this commit, they will be warned only by W=1. I
    think this is a more correct behavior since each warning belongs
    to only one group.

    For understanding this commit correctly:

    We have 3 warning groups, W=1, W=2, and W=3. You may think W=3 has a
    higher level than W=1, but they are actually independent. If you like,
    you can combine them like W=13. To enable all the warnings, you can
    pass W=123. It is shown by 'make help', but not noticed much. Since we
    support W= combination, there should not exist intersection among the
    three groups. If we enable Winitializer-overrides for W=1, we do not
    need to for W=2 or W=3. This is the reason why I think the change [3]
    makes sense.

    The documentation says -Winitializer-overrides is enabled by default.
    (https://clang.llvm.org/docs/DiagnosticsReference.html#winitializer-overrides)
    We negate it by passing -Wno-initializer-overrides for the normal
    build, but we do not do that for W=1. This means, W=1 effectively
    enables -Winitializer-overrides by the clang's default. The same for
    the other three.

    Add comments in case people are confused with the code.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nathan Chancellor
    Tested-by: Sedat Dilek
    Acked-by: Nick Desaulniers
    Acked-by: Miguel Ojeda

    Masahiro Yamada
     
  • When do coccicheck, I get this error:

    spatch -D report --no-show-diff --very-quiet --cocci-file
    ./scripts/coccinelle/api/platform_get_irq.cocci --include-headers
    --dir . -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include
    -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi
    -I ./include/uapi -I ./include/generated/uapi
    --include ./include/linux/kconfig.h --jobs 192 --chunksize 1
    minus: parse error:
    File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
    around = '\(',
    whole content = if ( ret \( < \|
    Reviewed-by: Stephen Boyd
    Acked-by: Julia Lawall
    Link: https://lore.kernel.org/r/20190906033006.17616-1-yuehaibing@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    YueHaibing
     

04 Sep, 2019

5 commits

  • The merge_config.sh script verifies that all the config options have
    their expected value in the resulting file and prints any issues as
    warnings. These checks aren't intended to be treated as errors given
    the current implementation. However, since "set -e" was added, if the
    grep command to look for a config option does not find it the script
    will then abort prematurely.

    Handle the case where the grep exit status is non-zero by setting
    ACTUAL_VAL to an empty string to restore previous functionality.

    Fixes: cdfca821571d ("merge_config.sh: Check error codes from make")
    Signed-off-by: Guillaume Tucker
    Acked-by: Jon Hunter
    Tested-by: Jon Hunter
    Signed-off-by: Masahiro Yamada

    Guillaume Tucker
     
  • Kbuild provides per-file compiler flag addition/removal:

    CFLAGS_.o
    CFLAGS_REMOVE_.o
    AFLAGS_.o
    AFLAGS_REMOVE_.o
    CPPFLAGS_.lds
    HOSTCFLAGS_.o
    HOSTCXXFLAGS_.o

    The is the filename of the target with its directory and
    suffix stripped.

    This syntax comes into a trouble when two files with the same basename
    appear in one Makefile, for example:

    obj-y += foo.o
    obj-y += dir/foo.o
    CFLAGS_foo.o :=

    Here, the applies to both foo.o and dir/foo.o

    The real world problem is:

    scripts/kconfig/util.c
    scripts/kconfig/lxdialog/util.c

    Both files are compiled into scripts/kconfig/mconf, but only the
    latter should be given with the ncurses flags.

    It is more sensible to use the relative path to the Makefile, like this:

    obj-y += foo.o
    CFLAGS_foo.o :=
    obj-y += dir/foo.o
    CFLAGS_dir/foo.o :=

    At first, I attempted to replace $(basetarget) with $*. The $* variable
    is replaced with the stem ('%') part in a pattern rule. This works with
    most of cases, but does not for explicit rules.

    For example, arch/ia64/lib/Makefile reuses rule_as_o_S in its own
    explicit rules, so $* will be empty, resulting in ignoring the per-file
    AFLAGS.

    I introduced a new variable, target-stem, which can be used also from
    explicit rules.

    Signed-off-by: Masahiro Yamada
    Acked-by: Marc Zyngier

    Masahiro Yamada
     
  • Add NOFAIL check for the strndup call, because the function
    allocates memory and can return NULL. All calls to strdup in
    modpost are checked with NOFAIL.

    Signed-off-by: Denis Efremov
    Signed-off-by: Masahiro Yamada

    Denis Efremov
     
  • Since guid_t is the recommended data type for UUIDs in
    kernel (and I guess uuid_le is meant to be ultimately
    replaced with it), it should be made available here as
    well.

    Signed-off-by: Heikki Krogerus
    Signed-off-by: Masahiro Yamada

    Heikki Krogerus
     
  • CONFIG_SHELL falls back to sh when bash is not installed on the system,
    but nobody is testing such a case since bash is usually installed.
    So, shell scripts invoked by CONFIG_SHELL are only tested with bash.

    It makes it difficult to test whether the hashbang #!/bin/sh is real.
    For example, #!/bin/sh in arch/powerpc/kernel/prom_init_check.sh is
    false. (I fixed it up)

    Besides, some shell scripts invoked by CONFIG_SHELL use bash-extension
    and #!/bin/bash is specified as the hashbang, while CONFIG_SHELL may
    not always be set to bash.

    Probably, the right thing to do is to introduce BASH, which is bash by
    default, and always set CONFIG_SHELL to sh. Replace $(CONFIG_SHELL)
    with $(BASH) for bash scripts.

    If somebody tries to add bash-extension to a #!/bin/sh script, it will
    be caught in testing because /bin/sh is a symlink to dash on some major
    distributions.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

01 Sep, 2019

3 commits

  • cleanup() mostly frees/unmaps the malloc'd/privately-mapped
    copy of the ELF file recordmcount is working on, which is
    set up in mmap_file(). It also deals with positioning within
    the pseduo prive-mapping of the file and appending to the ELF
    file.

    Split into two steps:
    mmap_cleanup() for the mapping itself
    file_append_cleanup() for allocations storing the
    appended ELF data.

    Also, move the global variable initializations out of the main,
    per-object-file loop and nearer to the alloc/init (mmap_file())
    and two cleanup functions so we can more clearly see how they're
    related.

    Link: http://lkml.kernel.org/r/2a387ac86d133d22c68f57b9933c32bab1d09a2d.1564596289.git.mhelsley@vmware.com

    Signed-off-by: Matt Helsley
    Signed-off-by: Steven Rostedt (VMware)

    Matt Helsley
     
  • Redundant cleanup calls were introduced when transitioning from
    the old error/success handling via setjmp/longjmp -- the longjmp
    ensured the cleanup() call only happened once but replacing
    the success_file()/fail_file() calls with cleanup() meant that
    multiple cleanup() calls can happen as we return from function
    calls.

    In do_file(), looking just before and after the "goto out" jumps we
    can see that multiple cleanups() are being performed. We remove
    cleanup() calls from the nested functions because it makes the code
    easier to review -- the resources being cleaned up are generally
    allocated and initialized in the callers so freeing them there
    makes more sense.

    Other redundant cleanup() calls:

    mmap_file() is only called from do_file() and, if mmap_file() fails,
    then we goto out and do cleanup() there too.

    write_file() is only called from do_file() and do_file()
    calls cleanup() unconditionally after returning from write_file()
    therefore the cleanup() calls in write_file() are not necessary.

    find_secsym_ndx(), called from do_func()'s for-loop, when we are
    cleaning up here it's obvious that we break out of the loop and
    do another cleanup().

    __has_rel_mcount() is called from two parts of do_func()
    and calls cleanup(). In theory we move them into do_func(), however
    these in turn prove redundant so another simplification step
    removes them as well.

    Link: http://lkml.kernel.org/r/de197e17fc5426623a847ea7cf3a1560a7402a4b.1564596289.git.mhelsley@vmware.com

    Signed-off-by: Matt Helsley
    Signed-off-by: Steven Rostedt (VMware)

    Matt Helsley
     
  • Fix up the whitespace irregularity in the ELF switch
    blocks.

    Swapping the initial value of gpfx allows us to
    simplify all but one of the one-line switch cases even
    further.

    Link: http://lkml.kernel.org/r/647f21f43723d3e831cedd3238c893db03eea6f0.1564596289.git.mhelsley@vmware.com

    Signed-off-by: Matt Helsley
    Signed-off-by: Steven Rostedt (VMware)

    Matt Helsley