26 Sep, 2019

5 commits

  • When building with W=1, a number of warnings are issued:

    CC lib/extable.o
    lib/extable.c:63:6: warning: no previous prototype for 'sort_extable' [-Wmissing-prototypes]
    63 | void sort_extable(struct exception_table_entry *start,
    | ^~~~~~~~~~~~
    lib/extable.c:75:6: warning: no previous prototype for 'trim_init_extable' [-Wmissing-prototypes]
    75 | void trim_init_extable(struct module *m)
    | ^~~~~~~~~~~~~~~~~
    lib/extable.c:115:1: warning: no previous prototype for 'search_extable' [-Wmissing-prototypes]
    115 | search_extable(const struct exception_table_entry *base,
    | ^~~~~~~~~~~~~~

    Add the missing #include for the prototypes.

    Link: http://lkml.kernel.org/r/45574.1565235784@turing-police
    Signed-off-by: Valdis Kletnieks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Valdis Kletnieks
     
  • When building with W=1, we get some warnings:

    l CC lib/generic-radix-tree.o
    lib/generic-radix-tree.c:39:10: warning: no previous prototype for 'genradix_root_to_depth' [-Wmissing-prototypes]
    39 | unsigned genradix_root_to_depth(struct genradix_root *r)
    | ^~~~~~~~~~~~~~~~~~~~~~
    lib/generic-radix-tree.c:44:23: warning: no previous prototype for 'genradix_root_to_node' [-Wmissing-prototypes]
    44 | struct genradix_node *genradix_root_to_node(struct genradix_root *r)
    | ^~~~~~~~~~~~~~~~~~~~~

    They're not used anywhere else, so make them static inline.

    Link: http://lkml.kernel.org/r/46923.1565236485@turing-police
    Signed-off-by: Valdis Kletnieks
    Cc: Kent Overstreet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Valdis Kletnieks
     
  • As already done for snprintf(), add a check in strscpy() for giant (i.e.
    likely negative and/or miscalculated) copy sizes, WARN, and error out.

    Link: http://lkml.kernel.org/r/201907260928.23DE35406@keescook
    Signed-off-by: Kees Cook
    Cc: Joe Perches
    Cc: Rasmus Villemoes
    Cc: Yann Droneaud
    Cc: David Laight
    Cc: Jonathan Corbet
    Cc: Stephen Kitt
    Cc: Jann Horn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     
  • core-api should show all the various string functions including the newly
    added stracpy and stracpy_pad.

    Miscellanea:

    o Update the Returns: value for strscpy
    o fix a defect with %NUL)

    [joe@perches.com: correct return of -E2BIG descriptions]
    Link: http://lkml.kernel.org/r/29f998b4c1a9d69fbeae70500ba0daa4b340c546.1563889130.git.joe@perches.com
    Link: http://lkml.kernel.org/r/224a6ebf39955f4107c0c376d66155d970e46733.1563841972.git.joe@perches.com
    Signed-off-by: Joe Perches
    Reviewed-by: Kees Cook
    Cc: Jonathan Corbet
    Cc: Stephen Kitt
    Cc: Nitin Gote
    Cc: Rasmus Villemoes
    Cc: Jann Horn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add RB_DECLARE_CALLBACKS_MAX, which generates augmented rbtree callbacks
    for the case where the augmented value is a scalar whose definition
    follows a max(f(node)) pattern. This actually covers all present uses of
    RB_DECLARE_CALLBACKS, and saves some (source) code duplication in the
    various RBCOMPUTE function definitions.

    [walken@google.com: fix mm/vmalloc.c]
    Link: http://lkml.kernel.org/r/CANN689FXgK13wDYNh1zKxdipeTuALG4eKvKpsdZqKFJ-rvtGiQ@mail.gmail.com
    [walken@google.com: re-add check to check_augmented()]
    Link: http://lkml.kernel.org/r/20190727022027.GA86863@google.com
    Link: http://lkml.kernel.org/r/20190703040156.56953-3-walken@google.com
    Signed-off-by: Michel Lespinasse
    Acked-by: Peter Zijlstra (Intel)
    Cc: David Howells
    Cc: Davidlohr Bueso
    Cc: Uladzislau Rezki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     

25 Sep, 2019

7 commits

  • Patch series "mm: remove quicklist page table caches".

    A while ago Nicholas proposed to remove quicklist page table caches [1].

    I've rebased his patch on the curren upstream and switched ia64 and sh to
    use generic versions of PTE allocation.

    [1] https://lore.kernel.org/linux-mm/20190711030339.20892-1-npiggin@gmail.com

    This patch (of 3):

    Remove page table allocator "quicklists". These have been around for a
    long time, but have not got much traction in the last decade and are only
    used on ia64 and sh architectures.

    The numbers in the initial commit look interesting but probably don't
    apply anymore. If anybody wants to resurrect this it's in the git
    history, but it's unhelpful to have this code and divergent allocator
    behaviour for minor archs.

    Also it might be better to instead make more general improvements to page
    allocator if this is still so slow.

    Link: http://lkml.kernel.org/r/1565250728-21721-2-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Mike Rapoport
    Cc: Tony Luck
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicholas Piggin
     
  • Patch series "Make working with compound pages easier", v2.

    These three patches add three helpers and convert the appropriate
    places to use them.

    This patch (of 3):

    It's unnecessarily hard to find out the size of a potentially huge page.
    Replace 'PAGE_SIZE << compound_order(page)' with page_size(page).

    Link: http://lkml.kernel.org/r/20190721104612.19120-2-willy@infradead.org
    Signed-off-by: Matthew Wilcox (Oracle)
    Acked-by: Michal Hocko
    Reviewed-by: Andrew Morton
    Reviewed-by: Ira Weiny
    Acked-by: Kirill A. Shutemov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox (Oracle)
     
  • In several places we need to be able to operate on pointers which have
    gone via a roundtrip:

    virt -> {phys,page} -> virt

    With KASAN_SW_TAGS, we can't preserve the tag for SLUB objects, and the
    {phys,page} -> virt conversion will use KASAN_TAG_KERNEL.

    This patch adds tests to ensure that this works as expected, without
    false positives which have recently been spotted [1,2] in testing.

    [1] https://lore.kernel.org/linux-arm-kernel/20190819114420.2535-1-walter-zh.wu@mediatek.com/
    [2] https://lore.kernel.org/linux-arm-kernel/20190819132347.GB9927@lakrids.cambridge.arm.com/

    [akpm@linux-foundation.org: coding-style fixes]
    Link: http://lkml.kernel.org/r/20190821153927.28630-1-mark.rutland@arm.com
    Signed-off-by: Mark Rutland
    Reviewed-by: Andrey Konovalov
    Tested-by: Andrey Konovalov
    Acked-by: Andrey Ryabinin
    Cc: Alexander Potapenko
    Cc: Dmitry Vyukov
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Rutland
     
  • Add memory corruption identification at bug report for software tag-based
    mode. The report shows whether it is "use-after-free" or "out-of-bound"
    error instead of "invalid-access" error. This will make it easier for
    programmers to see the memory corruption problem.

    We extend the slab to store five old free pointer tag and free backtrace,
    we can check if the tagged address is in the slab record and make a good
    guess if the object is more like "use-after-free" or "out-of-bound".
    therefore every slab memory corruption can be identified whether it's
    "use-after-free" or "out-of-bound".

    [aryabinin@virtuozzo.com: simplify & clenup code]
    Link: https://lkml.kernel.org/r/3318f9d7-a760-3cc8-b700-f06108ae745f@virtuozzo.com]
    Link: http://lkml.kernel.org/r/20190821180332.11450-1-aryabinin@virtuozzo.com
    Signed-off-by: Walter Wu
    Signed-off-by: Andrey Ryabinin
    Acked-by: Andrey Konovalov
    Cc: Dmitry Vyukov
    Cc: Alexander Potapenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Walter Wu
     
  • There are some machines with slow disk and fast CPUs. When they are under
    memory pressure, it could take a long time to swap before the OOM kicks in
    to free up some memory. As the results, it needs a large mem pool for
    kmemleak or suffering from higher chance of a kmemleak metadata allocation
    failure. 524288 proves to be the good number for all architectures here.
    Increase the upper bound to 1M to leave some room for the future.

    Link: http://lkml.kernel.org/r/1565807572-26041-1-git-send-email-cai@lca.pw
    Signed-off-by: Qian Cai
    Acked-by: Catalin Marinas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qian Cai
     
  • Currently kmemleak uses a static early_log buffer to trace all memory
    allocation/freeing before the slab allocator is initialised. Such early
    log is replayed during kmemleak_init() to properly initialise the kmemleak
    metadata for objects allocated up that point. With a memory pool that
    does not rely on the slab allocator, it is possible to skip this early log
    entirely.

    In order to remove the early logging, consider kmemleak_enabled == 1 by
    default while the kmem_cache availability is checked directly on the
    object_cache and scan_area_cache variables. The RCU callback is only
    invoked after object_cache has been initialised as we wouldn't have any
    concurrent list traversal before this.

    In order to reduce the number of callbacks before kmemleak is fully
    initialised, move the kmemleak_init() call to mm_init().

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: remove WARN_ON(), per Catalin]
    Link: http://lkml.kernel.org/r/20190812160642.52134-4-catalin.marinas@arm.com
    Signed-off-by: Catalin Marinas
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Qian Cai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Catalin Marinas
     
  • The current default value (400) is too low on many systems (e.g. some
    ARM64 platform takes up 1000+ entries).

    syzbot uses 16000 as default value, and has proved to be enough on beefy
    configurations, so let's pick that value.

    This consumes more RAM on boot (each entry is 160 bytes, so in total
    ~2.5MB of RAM), but the memory would later be freed (early_log is
    __initdata).

    Link: http://lkml.kernel.org/r/20190730154027.101525-1-drinkcat@chromium.org
    Signed-off-by: Nicolas Boichat
    Suggested-by: Dmitry Vyukov
    Acked-by: Catalin Marinas
    Acked-by: Dmitry Vyukov
    Cc: Masahiro Yamada
    Cc: Kees Cook
    Cc: Petr Mladek
    Cc: Thomas Gleixner
    Cc: Tetsuo Handa
    Cc: Joe Lawrence
    Cc: Uladzislau Rezki
    Cc: Andy Shevchenko
    Cc: Stephen Rothwell
    Cc: Andrey Ryabinin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Boichat
     

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

2 commits

  • Pull asm inline support from Miguel Ojeda:
    "Make use of gcc 9's "asm inline()" (Rasmus Villemoes):

    gcc 9+ (and gcc 8.3, 7.5) provides a way to override the otherwise
    crude heuristic that gcc uses to estimate the size of the code
    represented by an asm() statement. From the gcc docs

    If you use 'asm inline' instead of just 'asm', then for inlining
    purposes the size of the asm is taken as the minimum size, ignoring
    how many instructions GCC thinks it is.

    For compatibility with older compilers, we obviously want a

    #if [understands asm inline]
    #define asm_inline asm inline
    #else
    #define asm_inline asm
    #endif

    But since we #define the identifier inline to attach some attributes,
    we have to use an alternate spelling of that keyword. gcc provides
    both __inline__ and __inline, and we currently #define both to inline,
    so they all have the same semantics.

    We have to free up one of __inline__ and __inline, and the latter is
    by far the easiest.

    The two x86 changes cause smaller code gen differences than I'd
    expect, but I think we do want the asm_inline thing available sooner
    or later, so this is just to get the ball rolling"

    * tag 'compiler-attributes-for-linus-v5.4' of git://github.com/ojeda/linux:
    x86: bug.h: use asm_inline in _BUG_FLAGS definitions
    x86: alternative.h: use asm_inline for all alternative variants
    compiler-types.h: add asm_inline definition
    compiler_types.h: don't #define __inline
    lib/zstd/mem.h: replace __inline by inline
    staging: rtl8723bs: replace __inline by inline

    Linus Torvalds
     
  • Pull printk updates from Petr Mladek:

    - Fix off-by-one error when calculating messages that might fit into
    kmsg buffer. It causes occasional omitting of the last message.

    - Add missing pointer check in %pD format modifier handling.

    - Some clean up

    * tag 'printk-for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk:
    ABI: Update dev-kmsg documentation to match current kernel behaviour
    printk: Replace strncmp() with str_has_prefix()
    lib/test_printf: Remove obvious comments from %pd and %pD tests
    lib/test_printf: Add test of null/invalid pointer dereference for dentry
    vsprintf: Prevent crash when dereferencing invalid pointers for %pD
    printk: Do not lose last line in kmsg buffer dump

    Linus Torvalds
     

21 Sep, 2019

1 commit


19 Sep, 2019

3 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 crypto updates from Herbert Xu:
    "API:
    - Add the ability to abort a skcipher walk.

    Algorithms:
    - Fix XTS to actually do the stealing.
    - Add library helpers for AES and DES for single-block users.
    - Add library helpers for SHA256.
    - Add new DES key verification helper.
    - Add surrounding bits for ESSIV generator.
    - Add accelerations for aegis128.
    - Add test vectors for lzo-rle.

    Drivers:
    - Add i.MX8MQ support to caam.
    - Add gcm/ccm/cfb/ofb aes support in inside-secure.
    - Add ofb/cfb aes support in media-tek.
    - Add HiSilicon ZIP accelerator support.

    Others:
    - Fix potential race condition in padata.
    - Use unbound workqueues in padata"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (311 commits)
    crypto: caam - Cast to long first before pointer conversion
    crypto: ccree - enable CTS support in AES-XTS
    crypto: inside-secure - Probe transform record cache RAM sizes
    crypto: inside-secure - Base RD fetchcount on actual RD FIFO size
    crypto: inside-secure - Base CD fetchcount on actual CD FIFO size
    crypto: inside-secure - Enable extended algorithms on newer HW
    crypto: inside-secure: Corrected configuration of EIP96_TOKEN_CTRL
    crypto: inside-secure - Add EIP97/EIP197 and endianness detection
    padata: remove cpu_index from the parallel_queue
    padata: unbind parallel jobs from specific CPUs
    padata: use separate workqueues for parallel and serial work
    padata, pcrypt: take CPU hotplug lock internally in padata_alloc_possible
    crypto: pcrypt - remove padata cpumask notifier
    padata: make padata_do_parallel find alternate callback CPU
    workqueue: require CPU hotplug read exclusion for apply_workqueue_attrs
    workqueue: unconfine alloc/apply/free_workqueue_attrs()
    padata: allocate workqueue internally
    arm64: dts: imx8mq: Add CAAM node
    random: Use wait_event_freezable() in add_hwgenerator_randomness()
    crypto: ux500 - Fix COMPILE_TEST warnings
    ...

    Linus Torvalds
     
  • Pull char/misc driver updates from Greg KH:
    "Here is the big char/misc driver pull request for 5.4-rc1.

    As has been happening in previous releases, more and more individual
    driver subsystem trees are ending up in here. Now if that is good or
    bad I can't tell, but hopefully it makes your life easier as it's more
    of an aggregation of trees together to one merge point for you.

    Anyway, lots of stuff in here:
    - habanalabs driver updates
    - thunderbolt driver updates
    - misc driver updates
    - coresight and intel_th hwtracing driver updates
    - fpga driver updates
    - extcon driver updates
    - some dma driver updates
    - char driver updates
    - android binder driver updates
    - nvmem driver updates
    - phy driver updates
    - parport driver fixes
    - pcmcia driver fix
    - uio driver updates
    - w1 driver updates
    - configfs fixes
    - other assorted driver updates

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

    * tag 'char-misc-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (200 commits)
    misc: mic: Use PTR_ERR_OR_ZERO rather than its implementation
    habanalabs: correctly cast variable to __le32
    habanalabs: show correct id in error print
    habanalabs: stop using the acronym KMD
    habanalabs: display card name as sensors header
    habanalabs: add uapi to retrieve aggregate H/W events
    habanalabs: add uapi to retrieve device utilization
    habanalabs: Make the Coresight timestamp perpetual
    habanalabs: explicitly set the queue-id enumerated numbers
    habanalabs: print to kernel log when reset is finished
    habanalabs: replace __le32_to_cpu with le32_to_cpu
    habanalabs: replace __cpu_to_le32/64 with cpu_to_le32/64
    habanalabs: Handle HW_IP_INFO if device disabled or in reset
    habanalabs: Expose devices after initialization is done
    habanalabs: improve security in Debug IOCTL
    habanalabs: use default structure for user input in Debug IOCTL
    habanalabs: Add descriptive name to PSOC app status register
    habanalabs: Add descriptive names to PSOC scratch-pad registers
    habanalabs: create two char devices per ASIC
    habanalabs: change device_setup_cdev() to be more generic
    ...

    Linus Torvalds
     

18 Sep, 2019

4 commits

  • Pull media updates from Mauro Carvalho Chehab:

    - a new sensor driver for ov5675

    - a new platform driver for Allwinner A10 sensor interface

    - some new remote controller keymaps

    - some cosmetic changes at V4L2 core in order to avoid #ifdefs and to
    merge two core modules into one

    - removal of bcm2048 radio driver from staging

    - removal of davinci_vpfe video driver from staging

    - regression fix since Kernel 5.1 at the legacy VideoBuffer version 1
    core

    - added some documentation for remote controller protocols

    - pixel format documentation was split on two files

    - lots of other driver improvements and cleanups

    * tag 'media/v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (321 commits)
    media: videobuf-core.c: poll_wait needs a non-NULL buf pointer
    media: sun4i: Make sun4i_csi_formats static
    media: imx: remove unused including
    media: stm32-dcmi: Delete an unnecessary of_node_put() call in dcmi_probe()
    media: pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code
    media: em28xx: Fix exception handling in em28xx_alloc_urbs()
    media: don't do a 31 bit shift on a signed int
    media: use the BIT() macro
    media: ov9650: add a sanity check
    media: aspeed-video: address a protential usage of an unitialized var
    media: vicodec: make life easier for static analyzers
    media: remove include stdarg.h from some drivers
    v4l2-core: fix coding style for the two new c files
    media: v4l2-core: Remove BUG() from i2c and spi helpers
    media: v4l2-core: introduce a helper to unregister a i2c subdev
    media: v4l2-core: introduce a helper to unregister a spi subdev
    media: v4l2-core: move i2c helpers out of v4l2-common.c
    media: v4l2-core: move spi helpers out of v4l2-common.c
    media: v4l2-core: Module re-organization
    media: usbvision: Remove dead code
    ...

    Linus Torvalds
     
  • Pull block updates from Jens Axboe:

    - Two NVMe pull requests:
    - ana log parse fix from Anton
    - nvme quirks support for Apple devices from Ben
    - fix missing bio completion tracing for multipath stack devices
    from Hannes and Mikhail
    - IP TOS settings for nvme rdma and tcp transports from Israel
    - rq_dma_dir cleanups from Israel
    - tracing for Get LBA Status command from Minwoo
    - Some nvme-tcp cleanups from Minwoo, Potnuri and Myself
    - Some consolidation between the fabrics transports for handling
    the CAP register
    - reset race with ns scanning fix for fabrics (move fabrics
    commands to a dedicated request queue with a different lifetime
    from the admin request queue)."
    - controller reset and namespace scan races fixes
    - nvme discovery log change uevent support
    - naming improvements from Keith
    - multiple discovery controllers reject fix from James
    - some regular cleanups from various people

    - Series fixing (and re-fixing) null_blk debug printing and nr_devices
    checks (André)

    - A few pull requests from Song, with fixes from Andy, Guoqing,
    Guilherme, Neil, Nigel, and Yufen.

    - REQ_OP_ZONE_RESET_ALL support (Chaitanya)

    - Bio merge handling unification (Christoph)

    - Pick default elevator correctly for devices with special needs
    (Damien)

    - Block stats fixes (Hou)

    - Timeout and support devices nbd fixes (Mike)

    - Series fixing races around elevator switching and device add/remove
    (Ming)

    - sed-opal cleanups (Revanth)

    - Per device weight support for BFQ (Fam)

    - Support for blk-iocost, a new model that can properly account cost of
    IO workloads. (Tejun)

    - blk-cgroup writeback fixes (Tejun)

    - paride queue init fixes (zhengbin)

    - blk_set_runtime_active() cleanup (Stanley)

    - Block segment mapping optimizations (Bart)

    - lightnvm fixes (Hans/Minwoo/YueHaibing)

    - Various little fixes and cleanups

    * tag 'for-5.4/block-2019-09-16' of git://git.kernel.dk/linux-block: (186 commits)
    null_blk: format pr_* logs with pr_fmt
    null_blk: match the type of parameter nr_devices
    null_blk: do not fail the module load with zero devices
    block: also check RQF_STATS in blk_mq_need_time_stamp()
    block: make rq sector size accessible for block stats
    bfq: Fix bfq linkage error
    raid5: use bio_end_sector in r5_next_bio
    raid5: remove STRIPE_OPS_REQ_PENDING
    md: add feature flag MD_FEATURE_RAID0_LAYOUT
    md/raid0: avoid RAID0 data corruption due to layout confusion.
    raid5: don't set STRIPE_HANDLE to stripe which is in batch list
    raid5: don't increment read_errors on EILSEQ return
    nvmet: fix a wrong error status returned in error log page
    nvme: send discovery log page change events to userspace
    nvme: add uevent variables for controller devices
    nvme: enable aen regardless of the presence of I/O queues
    nvme-fabrics: allow discovery subsystems accept a kato
    nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery()
    nvme: Remove redundant assignment of cq vector
    nvme: Assign subsys instance from first ctrl
    ...

    Linus Torvalds
     
  • Pull core timer updates from Thomas Gleixner:
    "Timers and timekeeping updates:

    - A large overhaul of the posix CPU timer code which is a preparation
    for moving the CPU timer expiry out into task work so it can be
    properly accounted on the task/process.

    An update to the bogus permission checks will come later during the
    merge window as feedback was not complete before heading of for
    travel.

    - Switch the timerqueue code to use cached rbtrees and get rid of the
    homebrewn caching of the leftmost node.

    - Consolidate hrtimer_init() + hrtimer_init_sleeper() calls into a
    single function

    - Implement the separation of hrtimers to be forced to expire in hard
    interrupt context even when PREEMPT_RT is enabled and mark the
    affected timers accordingly.

    - Implement a mechanism for hrtimers and the timer wheel to protect
    RT against priority inversion and live lock issues when a (hr)timer
    which should be canceled is currently executing the callback.
    Instead of infinitely spinning, the task which tries to cancel the
    timer blocks on a per cpu base expiry lock which is held and
    released by the (hr)timer expiry code.

    - Enable the Hyper-V TSC page based sched_clock for Hyper-V guests
    resulting in faster access to timekeeping functions.

    - Updates to various clocksource/clockevent drivers and their device
    tree bindings.

    - The usual small improvements all over the place"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (101 commits)
    posix-cpu-timers: Fix permission check regression
    posix-cpu-timers: Always clear head pointer on dequeue
    hrtimer: Add a missing bracket and hide `migration_base' on !SMP
    posix-cpu-timers: Make expiry_active check actually work correctly
    posix-timers: Unbreak CONFIG_POSIX_TIMERS=n build
    tick: Mark sched_timer to expire in hard interrupt context
    hrtimer: Add kernel doc annotation for HRTIMER_MODE_HARD
    x86/hyperv: Hide pv_ops access for CONFIG_PARAVIRT=n
    posix-cpu-timers: Utilize timerqueue for storage
    posix-cpu-timers: Move state tracking to struct posix_cputimers
    posix-cpu-timers: Deduplicate rlimit handling
    posix-cpu-timers: Remove pointless comparisons
    posix-cpu-timers: Get rid of 64bit divisions
    posix-cpu-timers: Consolidate timer expiry further
    posix-cpu-timers: Get rid of zero checks
    rlimit: Rewrite non-sensical RLIMIT_CPU comment
    posix-cpu-timers: Respect INFINITY for hard RTTIME limit
    posix-cpu-timers: Switch thread group sampling to array
    posix-cpu-timers: Restructure expiry array
    posix-cpu-timers: Remove cputime_expires
    ...

    Linus Torvalds
     
  • Pull CPU hotplug updates from Thomas Gleixner:
    "A small update for the SMP hotplug code code:

    - Track "booted once" CPUs in a cpumask so the x86 APIC code has an
    easy way to decide whether broadcast IPIs are safe to use or not.

    - Implement a cpumask_or_equal() helper for the IPI broadcast
    evaluation.

    The above two changes have been also pulled into the x86/apic
    branch for implementing the conditional IPI broadcast feature.

    - Cache the number of online CPUs instead of reevaluating it over and
    over. num_online_cpus() is an unreliable snapshot anyway except
    when it is used outside a cpu hotplug locked region. The cached
    access is not changing this, but it's definitely faster than
    calculating the bitmap wheight especially in hot paths"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    cpu/hotplug: Cache number of online CPUs
    cpumask: Implement cpumask_or_equal()
    smp/hotplug: Track booted once CPUs in a cpumask

    Linus Torvalds
     

17 Sep, 2019

2 commits

  • Pull x86 cpu-feature updates from Ingo Molnar:

    - Rework the Intel model names symbols/macros, which were decades of
    ad-hoc extensions and added random noise. It's now a coherent, easy
    to follow nomenclature.

    - Add new Intel CPU model IDs:
    - "Tiger Lake" desktop and mobile models
    - "Elkhart Lake" model ID
    - and the "Lightning Mountain" variant of Airmont, plus support code

    - Add the new AVX512_VP2INTERSECT instruction to cpufeatures

    - Remove Intel MPX user-visible APIs and the self-tests, because the
    toolchain (gcc) is not supporting it going forward. This is the
    first, lowest-risk phase of MPX removal.

    - Remove X86_FEATURE_MFENCE_RDTSC

    - Various smaller cleanups and fixes

    * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits)
    x86/cpu: Update init data for new Airmont CPU model
    x86/cpu: Add new Airmont variant to Intel family
    x86/cpu: Add Elkhart Lake to Intel family
    x86/cpu: Add Tiger Lake to Intel family
    x86: Correct misc typos
    x86/intel: Add common OPTDIFFs
    x86/intel: Aggregate microserver naming
    x86/intel: Aggregate big core graphics naming
    x86/intel: Aggregate big core mobile naming
    x86/intel: Aggregate big core client naming
    x86/cpufeature: Explain the macro duplication
    x86/ftrace: Remove mcount() declaration
    x86/PCI: Remove superfluous returns from void functions
    x86/msr-index: Move AMD MSRs where they belong
    x86/cpu: Use constant definitions for CPU models
    lib: Remove redundant ftrace flag removal
    x86/crash: Remove unnecessary comparison
    x86/bitops: Use __builtin_constant_p() directly instead of IS_IMMEDIATE()
    x86: Remove X86_FEATURE_MFENCE_RDTSC
    x86/mpx: Remove MPX APIs
    ...

    Linus Torvalds
     
  • Pull stacktrace fixlet from Ingo Molnar:
    "Two comment fixes"

    * 'core-stacktrace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    lib/stackdepot: Fix outdated comments

    Linus Torvalds
     

16 Sep, 2019

1 commit

  • Currently, compiler_types.h #defines __inline as inline (and further
    #defines inline to automatically attach some attributes), so this does
    not change functionality. It serves as preparation for removing the
    #define of __inline.

    While at it, also remove the __attribute__((unused)) - it's already
    included in the definition of the inline macro, and "open-coded"
    __attribute__(()) should be avoided.

    Since commit a95b37e20db9 (kbuild: get out of
    ), compiler_types.h is automatically included by all
    kernel C code - i.e., the definition of inline including the unused
    attribute is guaranteed to be in effect whenever ZSTD_STATIC is
    expanded.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Miguel Ojeda

    Rasmus Villemoes
     

15 Sep, 2019

1 commit


12 Sep, 2019

1 commit

  • When CONFIG_MODULES is disabled, CONFIG_UNUSED_SYMBOLS is pointless,
    thus it should be invisible.

    Instead of adding "depends on MODULES", I moved it to the sub-menu
    "Enable loadable module support", which is a better fit. I put it
    close to TRIM_UNUSED_KSYMS because it depends on !UNUSED_SYMBOLS.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Jessica Yu

    Masahiro Yamada
     

11 Sep, 2019

1 commit

  • Keep the "Library routines" menu intact by moving OBJAGG into it.
    Otherwise OBJAGG is displayed/presented as an orphan in the
    various config menus.

    Fixes: 0a020d416d0a ("lib: introduce initial implementation of object aggregation manager")
    Signed-off-by: Randy Dunlap
    Cc: Jiri Pirko
    Cc: Ido Schimmel
    Cc: David S. Miller
    Tested-by: Ido Schimmel
    Signed-off-by: David S. Miller

    Randy Dunlap
     

06 Sep, 2019

2 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
     
  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     

05 Sep, 2019

2 commits

  • lib/crypto/sha256.c and include/crypto/sha256_base.h define
    99% identical functions to init a sha256_state struct for sha224 or
    sha256 use.

    This commit moves the functions from lib/crypto/sha256.c to
    include/crypto/sha.h (making them static inline) and makes the
    sha224/256_base_init static inline functions from
    include/crypto/sha256_base.h wrappers around the now also
    static inline include/crypto/sha.h functions.

    Signed-off-by: Hans de Goede
    Signed-off-by: Herbert Xu

    Hans de Goede
     
  • The generic sha256 implementation from lib/crypto/sha256.c uses data
    structs defined in crypto/sha.h, so lets move the function prototypes
    there too.

    Signed-off-by: Hans de Goede
    Signed-off-by: Herbert Xu

    Hans de Goede
     

04 Sep, 2019

1 commit

  • Add test config into_buf to allow request_firmware_into_buf to be
    called instead of request_firmware/request_firmware_direct. The number
    of parameters differ calling request_firmware_into_buf and support
    has not been added to test such api in test_firmware until now.

    Signed-off-by: Scott Branden
    Acked-by: Luis Chamberlain
    Acked-by: Shuah Khan
    Link: https://lore.kernel.org/r/20190822184005.901-2-scott.branden@broadcom.com
    Signed-off-by: Greg Kroah-Hartman

    Scott Branden
     

31 Aug, 2019

1 commit

  • Commit dfe2a77fd243 ("kfifo: fix kfifo_alloc() and kfifo_init()") made
    the kfifo code round the number of elements up. That was good for
    __kfifo_alloc(), but it's actually wrong for __kfifo_init().

    The difference? __kfifo_alloc() will allocate the rounded-up number of
    elements, but __kfifo_init() uses an allocation done by the caller. We
    can't just say "use more elements than the caller allocated", and have
    to round down.

    The good news? All the normal cases will be using power-of-two arrays
    anyway, and most users of kfifo's don't use kfifo_init() at all, but one
    of the helper macros to declare a KFIFO that enforce the proper
    power-of-two behavior. But it looks like at least ibmvscsis might be
    affected.

    The bad news? Will Deacon refers to an old thread and points points out
    that the memory ordering in kfifo's is questionable. See

    https://lore.kernel.org/lkml/20181211034032.32338-1-yuleixzhang@tencent.com/

    for more.

    Fixes: dfe2a77fd243 ("kfifo: fix kfifo_alloc() and kfifo_init()")
    Reported-by: laokz
    Cc: Stefani Seibold
    Cc: Andrew Morton
    Cc: Dan Carpenter
    Cc: Greg KH
    Cc: Kees Cook
    Cc: Will Deacon
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

30 Aug, 2019

1 commit


29 Aug, 2019

1 commit

  • Hisilicon fixes for v5.3-rc

    - Fixed RCU usage in logical PIO
    - Added a function to unregister a logical PIO range in logical PIO
    to support the fixes in the hisi-lpc driver
    - Fixed and optimized hisi-lpc driver to avoid potential use-after-free
    and driver unbind crash

    * tag 'hisi-fixes-for-5.3' of git://github.com/hisilicon/linux-hisi:
    bus: hisi_lpc: Add .remove method to avoid driver unbind crash
    bus: hisi_lpc: Unregister logical PIO range to avoid potential use-after-free
    lib: logic_pio: Add logic_pio_unregister_range()
    lib: logic_pio: Avoid possible overlap for unregistering regions
    lib: logic_pio: Fix RCU usage

    Link: https://lore.kernel.org/r/5D562335.7000902@hisilicon.com
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

22 Aug, 2019

3 commits

  • Add sha224 support to the lib/crypto/sha256 library code. This will allow
    us to replace both the sha256 and sha224 parts of crypto/sha256_generic.c
    when we remove the code duplication in further patches in this series.

    Suggested-by: Eric Biggers
    Signed-off-by: Hans de Goede
    Signed-off-by: Herbert Xu

    Hans de Goede
     
  • Before this commit lib/crypto/sha256.c has only been used in the s390 and
    x86 purgatory code, make it suitable for generic use:

    * Export interesting symbols
    * Add -D__DISABLE_EXPORTS to CFLAGS_sha256.o for purgatory builds to
    avoid the exports for the purgatory builds
    * Add to lib/crypto/Makefile and crypto/Kconfig

    Signed-off-by: Hans de Goede
    Signed-off-by: Herbert Xu

    Hans de Goede
     
  • Use get/put_unaligned_be32 in lib/crypto/sha256.c to load / store data
    so that it can be used with unaligned buffers too, making it more generic.

    And use memzero_explicit for better clearing of sensitive data.

    Note unlike other patches in this series this commit actually makes
    functional changes to the sha256 code as used by the purgatory code.

    This fully aligns the lib/crypto/sha256.c sha256 implementation with the
    one from crypto/sha256_generic.c allowing us to remove the latter in
    further patches in this series.

    Signed-off-by: Hans de Goede
    Signed-off-by: Herbert Xu

    Hans de Goede