1. 13 Mar, 2019 2 commits
  2. 12 Mar, 2019 9 commits
    • Nicolas Le Bayon's avatar
      i2c: i2c-stm32f7: Fix SDADEL minimum formula · c86da50c
      Nicolas Le Bayon authored
      It conforms with Reference Manual I2C timing section.
      
      Fixes: aeb068c5 ("i2c: i2c-stm32f7: add driver")
      Signed-off-by: default avatarNicolas Le Bayon <nicolas.le.bayon@st.com>
      Signed-off-by: default avatarBich Hemon <bich.hemon@st.com>
      Reviewed-by: default avatarPierre-Yves MORDRET <pierre-yves.mordret@st.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      c86da50c
    • Wolfram Sang's avatar
      i2c: rcar: explain the lockless design · 7ce98a55
      Wolfram Sang authored
      To make sure people can understand the lockless design of this driver
      without the need to dive into git history, add a comment giving an
      overview of the situation.
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      7ce98a55
    • Hiromitsu Yamasaki's avatar
      i2c: rcar: fix concurrency issue related to ICDMAER · a35ba2f7
      Hiromitsu Yamasaki authored
      This patch fixes the problem that an interrupt may set up a new I2C
      message and the DMA callback overwrites this setup.
      
      By disabling the DMA Enable Register(ICDMAER), rcar_i2c_dma_unmap()
      enables interrupts for register settings (such as Master Control
      Register(ICMCR)) and advances the I2C transfer sequence.
      
      If an interrupt occurs immediately after ICDMAER is disabled, the
      callback handler later continues and overwrites the previous settings
      from the interrupt. So, disable ICDMAER at the end of the callback to
      ensure other interrupts are masked until then.
      
      Note that this driver needs to work lock-free because there are IP cores
      with a HW race condition which prevent us from using a spinlock in the
      interrupt handler.
      
      Reproduction test:
      1. Add a delay after disabling ICDMAER. (It is expected to generate an
         interrupt of rcar_i2c_irq())
      
          void rcar_i2c_dma_unmap(struct rcar_i2c_priv *priv)
          {
              ...
              rcar_i2c_write(priv, ICDMAER, 0);
              usleep_range(500, 800)
              ...
              priv->dma_direction = DMA_NONE;
          }
      
      2. Execute DMA transfers
      
       $ i2ctransfer -y 4 w9@0x6a 1 1+ r16
      
      3. A log message of BUG_ON() will be displayed.
      
      Fixes: 73e8b052 ("i2c: rcar: add DMA support")
      Signed-off-by: default avatarHiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      [wsa: updated test case to be more reliable, added note to comment]
      Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      a35ba2f7
    • Louis Taylor's avatar
      i2c: sis630: correct format strings · 60f7691c
      Louis Taylor authored
      When compiling with -Wformat, clang warns:
      
      drivers/i2c/busses/i2c-sis630.c:482:4: warning: format specifies type
            'unsigned short' but the argument has type 'int' [-Wformat]
                              smbus_base + SMB_STS,
                              ^~~~~~~~~~~~~~~~~~~~
      
      drivers/i2c/busses/i2c-sis630.c:483:4: warning: format specifies type
            'unsigned short' but the argument has type 'int' [-Wformat]
                              smbus_base + SMB_STS + SIS630_SMB_IOREGION - 1);
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      drivers/i2c/busses/i2c-sis630.c:531:37: warning: format specifies type
            'unsigned short' but the argument has type 'int' [-Wformat]
                       "SMBus SIS630 adapter at %04hx", smbus_base + SMB_STS);
                                                ~~~~~   ^~~~~~~~~~~~~~~~~~~~
      
      This patch fixes the format strings to use the format type for int.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/378Signed-off-by: default avatarLouis Taylor <louis@kragniz.eu>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      60f7691c
    • Hsin-Yi Wang's avatar
      i2c: mediatek: modify threshold passed to i2c_get_dma_safe_msg_buf() · bc1a7f75
      Hsin-Yi Wang authored
      DMA with zero-length transfers doesn't make sense and this HW doesn't
      support them at all, so increase the threshold.
      
      Fixes: fc66b39f ("i2c: mediatek: Use DMA safe buffers for i2c transactions")
      Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
      [wsa: reworded commit message]
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      bc1a7f75
    • Linus Torvalds's avatar
      Merge tag 'xarray-5.1-rc1' of git://git.infradead.org/users/willy/linux-dax · ea295481
      Linus Torvalds authored
      Pull XArray updates from Matthew Wilcox:
       "This pull request changes the xa_alloc() API. I'm only aware of one
        subsystem that has started trying to use it, and we agree on the fixup
        as part of the merge.
      
        The xa_insert() error code also changed to match xa_alloc() (EEXIST to
        EBUSY), and I added xa_alloc_cyclic(). Beyond that, the usual
        bugfixes, optimisations and tweaking.
      
        I now have a git tree with all users of the radix tree and IDR
        converted over to the XArray that I'll be feeding to maintainers over
        the next few weeks"
      
      * tag 'xarray-5.1-rc1' of git://git.infradead.org/users/willy/linux-dax:
        XArray: Fix xa_reserve for 2-byte aligned entries
        XArray: Fix xa_erase of 2-byte aligned entries
        XArray: Use xa_cmpxchg to implement xa_reserve
        XArray: Fix xa_release in allocating arrays
        XArray: Mark xa_insert and xa_reserve as must_check
        XArray: Add cyclic allocation
        XArray: Redesign xa_alloc API
        XArray: Add support for 1s-based allocation
        XArray: Change xa_insert to return -EBUSY
        XArray: Update xa_erase family descriptions
        XArray tests: RCU lock prohibits GFP_KERNEL
      ea295481
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · f3124ccf
      Linus Torvalds authored
      Pull m68knommu update from Greg Ungerer:
       "Only a single change to provide platform side support for the eDMA
        hardware module on the ColdFire MCF5441X SoC"
      
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k: add ColdFire mcf5441x eDMA platform support
      f3124ccf
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.1a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · d14d7f14
      Linus Torvalds authored
      Pull xen updates from Juergen Gross:
       "xen fixes and features:
      
         - remove fallback code for very old Xen hypervisors
      
         - three patches for fixing Xen dom0 boot regressions
      
         - an old patch for Xen PCI passthrough which was never applied for
           unknown reasons
      
         - some more minor fixes and cleanup patches"
      
      * tag 'for-linus-5.1a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen: fix dom0 boot on huge systems
        xen, cpu_hotplug: Prevent an out of bounds access
        xen: remove pre-xen3 fallback handlers
        xen/ACPI: Switch to bitmap_zalloc()
        x86/xen: dont add memory above max allowed allocation
        x86: respect memory size limiting via mem= parameter
        xen/gntdev: Check and release imported dma-bufs on close
        xen/gntdev: Do not destroy context while dma-bufs are in use
        xen/pciback: Don't disable PCI_COMMAND on PCI device reset.
        xen-scsiback: mark expected switch fall-through
        xen: mark expected switch fall-through
      d14d7f14
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 6cdfa54c
      Linus Torvalds authored
      Pull tracing updates from Steven Rostedt:
       "The biggest change for this release is in the histogram code:
      
         - Add "onchange(var)" histogram handler that executes a action when
           $var changes.
      
         - Add new "snapshot()" action for histogram handlers, that causes a
           snapshot of the ring buffer when triggered. ie.
           onchange(var).snapshot() will trigger a snapshot if var changes.
      
         - Add alternative for "trace()" action. Currently, to trigger a
           synthetic event, the name of that event is used as the handler
           name, which is inconsistent with the other actions.
           onchange(var).synthetic(param) where it can now be
           onchange(var).trace(synthetic, param). The older method will still
           be allowed, as long as the synthetic events do not overlap with
           other handler names.
      
         - The histogram documentation at testcases were updated for the new
           changes.
      
        Outside of the histogram code, we have:
      
         - Added a quicker way to enable set_ftrace_filter files, that will
           make it much quicker to bisect tracing a function that shouldn't be
           traced and crashes the kernel. (You can echo in numbers to
           set_ftrace_filter, and it will select the corresponding function
           that is in available_filter_functions).
      
         - Some better displaying of the tracing data (and more information
           was added).
      
        The rest are small fixes and more clean ups to the code"
      
      * tag 'trace-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (37 commits)
        tracing: Use strncpy instead of memcpy when copying comm in trace.c
        tracing: Use strncpy instead of memcpy when copying comm for hist triggers
        tracing: Use strncpy instead of memcpy for string keys in hist triggers
        tracing: Use str_has_prefix() in synth_event_create()
        x86/ftrace: Fix warning and considate ftrace_jmp_replace() and ftrace_call_replace()
        tracing/perf: Use strndup_user() instead of buggy open-coded version
        doc: trace: Fix documentation for uprobe_profile
        tracing: Fix spelling mistake: "analagous" -> "analogous"
        tracing: Comment why cond_snapshot is checked outside of max_lock protection
        tracing: Add hist trigger action 'expected fail' test case
        tracing: Add alternative synthetic event trace action test case
        tracing: Add hist trigger onchange() handler test case
        tracing: Add hist trigger snapshot() action test case
        tracing: Add SPDX license GPL-2.0 license identifier to inter-event testcases
        tracing: Add alternative synthetic event trace action syntax
        tracing: Add hist trigger onchange() handler Documentation
        tracing: Add hist trigger onchange() handler
        tracing: Add hist trigger snapshot() action Documentation
        tracing: Add hist trigger snapshot() action
        tracing: Add conditional snapshot
        ...
      6cdfa54c
  3. 11 Mar, 2019 9 commits
    • Linus Torvalds's avatar
      Merge tag 'linux-watchdog-5.1-rc1' of git://www.linux-watchdog.org/linux-watchdog · a089e4fe
      Linus Torvalds authored
      Pull watchdog updates from Wim Van Sebroeck:
      
       - a new watchdog driver for the Mellanox systems
      
       - renesas-wdt: Document r8a77470 support
      
       - numerous 'Mark expected switch fall-throughs'
      
       - qcom: Add suspend/resume support
      
       - some small fixes and documentation updates
      
      * tag 'linux-watchdog-5.1-rc1' of git://www.linux-watchdog.org/linux-watchdog:
        watchdog: w83877f_wdt: Mark expected switch fall-through
        watchdog: sc520_wdt: Mark expected switch fall-through
        watchdog: sbc60xxwdt: Mark expected switch fall-through
        watchdog: smsc37b787_wdt: Mark expected switch fall-through
        watchdog: sc1200: Mark expected switch fall-through
        watchdog: pc87413: Mark expected switch fall-through
        Documentation/watchdog: Add documentation mlx-wdt driver
        watchdog: mlx-wdt: introduce a watchdog driver for Mellanox systems.
        platform_data/mlxreg: additions for Mellanox watchdog driver.
        watchdog: Update sysfs documentation.
        watchdog: dw: remove useless pr_fmt
        watchdog: pika_wdt: drop pointless static qualifier in pikawdt_init
        watchdog/hpwdt: Update Kconfig documentation
        dt-bindings: watchdog: renesas-wdt: Document r8a77470 support
        watchdog: qcom: Add suspend/resume support
      a089e4fe
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · cf0240a7
      Linus Torvalds authored
      Pull pin control updates from Linus Walleij:
       "This is a calm cycle, not much happened this time around: not even
        much incremental development. Some three new drivers, that is all.
      
        No core changes.
      
        New drivers:
      
         - NXP (ex Freescale) i.MX 8QM driver.
      
         - NXP (ex Freescale) i.MX 8MM driver.
      
         - AT91 SAM9X60 subdriver.
      
        Improvements:
      
         - Support for external interrups (EINT) on Mediatek virtual GPIOs.
      
         - Make BCM2835 pin config fully generic.
      
         - Lots of Renesas SH-PFC incremental improvements"
      
      * tag 'pinctrl-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (70 commits)
        pinctrl: imx: fix scu link errors
        dt-bindings: pinctrl: Document the i.MX50 IOMUXC binding
        pinctrl: qcom: spmi-gpio: Reorder debug print
        pinctrl: nomadik: fix possible object reference leak
        pinctrl: stm32: return error upon hwspinlock failure
        pinctrl: stm32: fix memory leak issue
        pinctrl: sh-pfc: r8a77965: Add DRIF pins, groups and functions
        pinctrl: sh-pfc: r8a77965: Add TMU pins, groups and functions
        pinctrl: sh-pfc: Validate fixed-size field widths at build time
        pinctrl: sh-pfc: sh73a0: Fix fsic_spdif pin groups
        pinctrl: sh-pfc: r8a7792: Fix vin1_data18_b pin group
        pinctrl: sh-pfc: r8a7791: Fix scifb2_data_c pin group
        pinctrl: sh-pfc: emev2: Add missing pinmux functions
        pinctrl: sunxi: Support I/O bias voltage setting on A80
        pinctrl: ingenic: Add LCD pins for the JZ4725B SoC
        pinctrl: samsung: Remove legacy API for handling external wakeup interrupts mask
        pinctrl: bcm2835: Direct GPIO config changes to generic pinctrl
        pinctrl: bcm2835: declare pin config as generic
        pinctrl: qcom: qcs404: Drop unused UFS_RESET macro
        dt-bindings: add documentation for slew rate
        ...
      cf0240a7
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 4f023706
      Linus Torvalds authored
      Pull input updates from Dmitry Torokhov:
      
       - update the ili210x touchscreen driver, refreshing the code and adding
         support for ILI251X line
      
       - add support for st1633 to the st1232 touchscreen driver
      
       - add support for sx8650 to the the sx8654 touchscreen driver
      
       - add support for Evervision FT5726 to the edt-ft5x06 touchscreen
         driver
      
       - add support for gt5688 to the Goodix touchscreen driver
      
       - new vibrator driver for MSM SOCs
      
       - miscellaneous fixes for the rest of input drivers
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (53 commits)
        Input: wacom_serial4 - add support for Wacom ArtPad II tablet
        Input: elan_i2c - add id for touchpad found in Lenovo s21e-20
        Input: raspberrypi-ts - select CONFIG_INPUT_POLLDEV
        Input: msm-vibrator - use correct gpio header
        Input: ti_am335x_tsc - remove set but not used variable 'tscadc_dev'
        Input: i8042 - rework DT node name comparisons
        Input: goodix - print values in case of inconsistencies
        Input: goodix - refer to touchscreen.txt in device tree bindings
        Input: goodix - support Goodix gt5688
        Input: synaptics_i2c - remove redundant spinlock
        Input: db9 - mark expected switch fall-through
        Input: qt2160 - remove redundant spinlock
        Input: st1232 - handle common DT bindings
        Input: ims-pcu - switch to using brightness_set_blocking()
        Input: st1232 - switch to gpiod API
        Input: ili210x - fetch touchscreen geometry from DT
        Input: msm-vibrator - tweak an error message
        Input: tm2-touchkey - acknowledge that setting brightness is a blocking call
        Input: stmfts - acknowledge that setting brightness is a blocking call
        Input: ili210x - switch to using devm_device_add_group()
        ...
      4f023706
    • Linus Torvalds's avatar
      tools: mark 'test_vmalloc.sh' executable · 6bc3fe8e
      Linus Torvalds authored
      Several of these scripts have come in as old-fashioned patches, and in
      the process lost the executable bit.  In most cases it doesn't matter,
      since the test infrastructure will explicitly execute them using the
      proper shell interpreter, but at least in the case of the new vmalloc
      test, the lack of execurable bit caused the test to fail with
      
          ./run_vmtests: line 217: ./test_vmalloc.sh: Permission denied
      
      because of the lacking exectuable permissions bit.
      
      This patch fixes that up.
      
      NOTE! A simple script to look for non-executable scripts in the kernel,
      something like
      
          git ls-files --stage -- '*.sh' |
              grep 100644 |
              cut -f2 |
              xargs grep -l '#!'
      
      will show that there's a lot of other files that _look_ like executable
      shell scripts, but don't have the executable bit set.  I considered just
      scripting them all to be executable, but since it looks like the common
      pattern is to not really require it, I'm just doing the minimal fix as
      pointed out by the kernel test robot.
      
      Fixes: a05ef00c ("selftests/vm: add script helper for CONFIG_TEST_VMALLOC_MODULE")
      Reported-by: default avatarkernel test robot <rong.a.chen@intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Uladzislau Rezki <urezki@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6bc3fe8e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide · bc119dd9
      Linus Torvalds authored
      Pull IDE updates from David Miller:
       "Nothing super exciting as usual:
      
        1) Switch fallthrus from Gustavo A. R. Silva
      
        2) Kconfig formatting cleanup from Enrico Weigelt
      
        3) OF interface adjustment from Rob Herring"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide:
        drivers: ide: Kconfig: pedantic formatting
        ide: mark expected switch fall-through
        ide: hpt366: mark expected switch fall-throughs
        ide: Use of_node_name_eq for node name comparisons
      bc119dd9
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 8f49a658
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "First batch of fixes in the new merge window:
      
         1) Double dst_cache free in act_tunnel_key, from Wenxu.
      
         2) Avoid NULL deref in IN_DEV_MFORWARD() by failing early in the
            ip_route_input_rcu() path, from Paolo Abeni.
      
         3) Fix appletalk compile regression, from Arnd Bergmann.
      
         4) If SLAB objects reach the TCP sendpage method we are in serious
            trouble, so put a debugging check there. From Vasily Averin.
      
         5) Memory leak in hsr layer, from Mao Wenan.
      
         6) Only test GSO type on GSO packets, from Willem de Bruijn.
      
         7) Fix crash in xsk_diag_put_umem(), from Eric Dumazet.
      
         8) Fix VNIC mailbox length in nfp, from Dirk van der Merwe.
      
         9) Fix race in ipv4 route exception handling, from Xin Long.
      
        10) Missing DMA memory barrier in hns3 driver, from Jian Shen.
      
        11) Use after free in __tcf_chain_put(), from Vlad Buslov.
      
        12) Handle inet_csk_reqsk_queue_add() failures, from Guillaume Nault.
      
        13) Return value correction when ip_mc_may_pull() fails, from Eric
            Dumazet.
      
        14) Use after free in x25_device_event(), also from Eric"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (72 commits)
        gro_cells: make sure device is up in gro_cells_receive()
        vxlan: test dev->flags & IFF_UP before calling gro_cells_receive()
        net/x25: fix use-after-free in x25_device_event()
        isdn: mISDNinfineon: fix potential NULL pointer dereference
        net: hns3: fix to stop multiple HNS reset due to the AER changes
        ip: fix ip_mc_may_pull() return value
        net: keep refcount warning in reqsk_free()
        net: stmmac: Avoid one more sometimes uninitialized Clang warning
        net: dsa: mv88e6xxx: Set correct interface mode for CPU/DSA ports
        rxrpc: Fix client call queueing, waiting for channel
        tcp: handle inet_csk_reqsk_queue_add() failures
        net: ethernet: sun: Zero initialize class in default case in niu_add_ethtool_tcam_entry
        8139too : Add support for U.S. Robotics USR997901A 10/100 Cardbus NIC
        fou, fou6: avoid uninit-value in gue_err() and gue6_err()
        net: sched: fix potential use-after-free in __tcf_chain_put()
        vhost: silence an unused-variable warning
        vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
        connector: fix unsafe usage of ->real_parent
        vxlan: do not need BH again in vxlan_cleanup()
        net: hns3: add dma_rmb() for rx description
        ...
      8f49a658
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · ffd602eb
      Linus Torvalds authored
      Pull Kbuild updates from Masahiro Yamada:
      
       - do not generate unneeded top-level built-in.a
      
       - let git ignore O= directory entirely
      
       - optimize scripts/kallsyms slightly
      
       - exclude DWARF info from *.s regardless of config options
      
       - fix GCC toolchain search path for Clang to prepare ld.lld support
      
       - do not generate modules.order when CONFIG_MODULES is disabled
      
       - simplify single target rules and remove VPATH for external module
         build
      
       - allow to add optional flags to dpkg-buildpackage when building
         deb-pkg
      
       - move some compiler option tests from Makefile to Kconfig
      
       - various Makefile cleanups
      
      * tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (40 commits)
        kbuild: remove scripts/basic/% build target
        kbuild: use -Werror=implicit-... instead of -Werror-implicit-...
        kbuild: clean up scripts/gcc-version.sh
        kbuild: remove cc-version macro
        kbuild: update comment block of scripts/clang-version.sh
        kbuild: remove commented-out INITRD_COMPRESS
        kbuild: move -gsplit-dwarf, -gdwarf-4 option tests to Kconfig
        kbuild: [bin]deb-pkg: add DPKG_FLAGS variable
        kbuild: move ".config not found!" message from Kconfig to Makefile
        kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing
        kbuild: simplify single target rules
        kbuild: remove empty rules for makefiles
        kbuild: make -r/-R effective in top Makefile for old Make versions
        kbuild: move tools_silent to a more relevant place
        kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
        kbuild: refactor cc-cross-prefix implementation
        kbuild: hardcode genksyms path and remove GENKSYMS variable
        scripts/gdb: refactor rules for symlink creation
        kbuild: create symlink to vmlinux-gdb.py in scripts_gdb target
        scripts/gdb: do not descend into scripts/gdb from scripts
        ...
      ffd602eb
    • Linus Torvalds's avatar
      Merge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 5af7f115
      Linus Torvalds authored
      Pull tpm updates from James Morris:
      
       - Clean up the transmission flow
      
         Cleaned up the whole transmission flow. Locking of the chip is now
         done in the level of tpm_try_get_ops() and tpm_put_ops() instead
         taking the chip lock inside tpm_transmit(). The nested calls inside
         tpm_transmit(), used with the resource manager, have been refactored
         out.
      
         Should make easier to perform more complex transactions with the TPM
         without making the subsystem a bigger mess (e.g. encrypted channel
         patches by James Bottomley).
      
       - PPI 1.3 support
      
         TPM PPI 1.3 introduces an additional optional command parameter that
         may be needed for some commands. Display the parameter if the command
         requires such a parameter. Only command 23 (SetPCRBanks) needs one.
      
         The PPI request file will show output like this then:
      
            # echo "23 16" > request
            # cat request
            23 16
      
            # echo "5" > request
            # cat request
            5
      
       - Extend all PCR banks in IMA
      
         Instead of static PCR banks array, the array of available PCR banks
         is now allocated dynamically. The digests sizes are determined
         dynamically using a probe PCR read without relying crypto's static
         list of hash algorithms.
      
         This should finally make sealing of measurements in IMA safe and
         secure.
      
       - TPM 2.0 selftests
      
         Added a test suite to tools/testing/selftests/tpm2 previously outside
         of the kernel tree: https://github.com/jsakkine-intel/tpm2-scripts
      
      * 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (37 commits)
        tpm/ppi: Enable submission of optional command parameter for PPI 1.3
        tpm/ppi: Possibly show command parameter if TPM PPI 1.3 is used
        tpm/ppi: Display up to 101 operations as define for version 1.3
        tpm/ppi: rename TPM_PPI_REVISION_ID to TPM_PPI_REVISION_ID_1
        tpm/ppi: pass function revision ID to tpm_eval_dsm()
        tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend()
        KEYS: trusted: explicitly use tpm_chip structure from tpm_default_chip()
        tpm: move tpm_chip definition to include/linux/tpm.h
        tpm: retrieve digest size of unknown algorithms with PCR read
        tpm: rename and export tpm2_digest and tpm2_algorithms
        tpm: dynamically allocate the allocated_banks array
        tpm: remove @flags from tpm_transmit()
        tpm: take TPM chip power gating out of tpm_transmit()
        tpm: introduce tpm_chip_start() and tpm_chip_stop()
        tpm: remove TPM_TRANSMIT_UNLOCKED flag
        tpm: use tpm_try_get_ops() in tpm-sysfs.c.
        tpm: remove @space from tpm_transmit()
        tpm: move TPM space code out of tpm_transmit()
        tpm: move tpm_validate_commmand() to tpm2-space.c
        tpm: clean up tpm_try_transmit() error handling flow
        ...
      5af7f115
    • Linus Torvalds's avatar
      Merge branch 'next-integrity' of... · c3665a6b
      Linus Torvalds authored
      Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
      
      Pull integrity updates from James Morris:
       "Mimi Zohar says:
      
         'Linux 5.0 introduced the platform keyring to allow verifying the IMA
          kexec kernel image signature using the pre-boot keys. This pull
          request similarly makes keys on the platform keyring accessible for
          verifying the PE kernel image signature.
      
          Also included in this pull request is a new IMA hook that tags tmp
          files, in policy, indicating the file hash needs to be calculated.
          The remaining patches are cleanup'"
      
      * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        evm: Use defined constant for UUID representation
        ima: define ima_post_create_tmpfile() hook and add missing call
        evm: remove set but not used variable 'xattr'
        encrypted-keys: fix Opt_err/Opt_error = -1
        kexec, KEYS: Make use of platform keyring for signature verify
        integrity, KEYS: add a reference to platform keyring
      c3665a6b
  4. 10 Mar, 2019 20 commits
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 12ad143e
      Linus Torvalds authored
      Pull perf updates from Thomas Gleixner:
       "Perf updates and fixes:
      
        Kernel:
         - Handle events which have the bpf_event attribute set as side band
           events as they carry information about BPF programs.
         - Add missing switch-case fall-through comments
      
        Libraries:
         - Fix leaks and double frees in error code paths.
         - Prevent buffer overflows in libtraceevent
      
        Tools:
         - Improvements in handling Intel BT/PTS
         - Add BTF ELF markers to perf trace BPF programs to improve output
         - Support --time, --cpu, --pid and --tid filters for perf diff
         - Calculate the column width in perf annotate as the hardcoded 6
           characters for the instruction are not sufficient
         - Small fixes all over the place"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (38 commits)
        perf/core: Mark expected switch fall-through
        perf/x86/intel/uncore: Fix client IMC events return huge result
        perf/ring_buffer: Use high order allocations for AUX buffers optimistically
        perf data: Force perf_data__open|close zero data->file.path
        perf session: Fix double free in perf_data__close
        perf evsel: Probe for precise_ip with simple attr
        perf tools: Read and store caps/max_precise in perf_pmu
        perf hist: Fix memory leak of srcline
        perf hist: Add error path into hist_entry__init
        perf c2c: Fix c2c report for empty numa node
        perf script python: Add Python3 support to intel-pt-events.py
        perf script python: Add Python3 support to event_analyzing_sample.py
        perf script python: add Python3 support to check-perf-trace.py
        perf script python: Add Python3 support to futex-contention.py
        perf script python: Remove mixed indentation
        perf diff: Support --pid/--tid filter options
        perf diff: Support --cpu filter option
        perf diff: Support --time filter option
        perf thread: Generalize function to copy from thread addr space from intel-bts code
        perf annotate: Calculate the max instruction name, align column to that
        ...
      12ad143e
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 262d6a9a
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of fixes for x86:
      
         - Make the unwinder more robust when it encounters a NULL pointer
           call, so the backtrace becomes more useful
      
         - Fix the bogus ORC unwind table alignment
      
         - Prevent kernel panic during kexec on HyperV caused by a cleared but
           not disabled hypercall page.
      
         - Remove the now pointless stacksize increase for KASAN_EXTRA, as
           KASAN_EXTRA is gone.
      
         - Remove unused variables from the x86 memory management code"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/hyperv: Fix kernel panic when kexec on HyperV
        x86/mm: Remove unused variable 'old_pte'
        x86/mm: Remove unused variable 'cpu'
        Revert "x86_64: Increase stack size for KASAN_EXTRA"
        x86/unwind: Add hardcoded ORC entry for NULL
        x86/unwind: Handle NULL pointer calls better in frame unwinder
        x86/unwind/orc: Fix ORC unwind table alignment
      262d6a9a
    • Linus Torvalds's avatar
      Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b6e3cb4e
      Linus Torvalds authored
      Pull x86 boot fix from Thomas Gleixner:
       "A trivial fix for the previous x86/boot pull request which did not
        make it in time"
      
      * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot/KASLR: Always return a value from process_mem_region
      b6e3cb4e
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a15f6b92
      Linus Torvalds authored
      Pull timer fix from Thomas Gleixner:
       "A single fix to prevent a unmet dependencies warning in Kconfig"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        time: Make VIRT_CPU_ACCOUNTING_GEN depend on GENERIC_CLOCKEVENTS
      a15f6b92
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9e55f87c
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "A few fixes for lockdep:
      
         - initialize lockdep internal RCU head after initializing RCU
      
         - prevent use after free in a alloc_workqueue() error handling path
      
         - plug a memory leak in the workqueue core which fails to free a
           dynamically allocated lock name.
      
         - make Clang happy"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        workqueue, lockdep: Fix a memory leak in wq->lock_name
        workqueue, lockdep: Fix an alloc_workqueue() error path
        locking/lockdep: Only call init_rcu_head() after RCU has been initialized
        locking/lockdep: Avoid a Clang warning
      9e55f87c
    • Linus Torvalds's avatar
      Merge branch 'core-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 077d3daf
      Linus Torvalds authored
      Pull watchdog core update from Thomas Gleixner:
       "A single commit adding a command line parameter which allows to set
        the watchdog threshold on the kernel command-line, so kernels with
        massive debug facilities enabled won't trigger the watchdog during
        early boot and before the threshold can be changed via sysctl"
      
      * 'core-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        watchdog/core: Add watchdog_thresh command line parameter
      077d3daf
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86 · dbbdf54c
      Linus Torvalds authored
      Pull x86 platform driver updates from Darren Hart:
      
       - use MODULE_DEVICE_TABLE across several wmi drivers, keeping
         wmi_device_id and MODULE_ALIAS() declarations in sync
      
       - add several Ideapad models to the no_hw_rfkill list
      
       - add support for new Mellanox platforms, including new fan and LED
         functionality
      
       - address Dell keyboard backlight change event and power button release
         issues
      
       - update dell_rbu to use appropriate memory allocation mechanisms
      
       - several small fixes and Ice Lake support for intel_pmc_core
      
       - fix a suspend regression for Cherry Trail based devices in
         intel_int0002_vgpio
      
       - a few other routine fixes
      
      * tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86: (50 commits)
        MAINTAINERS: Include mlxreg.h in Mellanox Platform Driver files
        platform/x86: ideapad-laptop: Add S130-14IGM to no_hw_rfkill list
        platform/x86: mlx-platform: Fix access mode for fan_dir attribute
        platform/x86: mlx-platform: Add UID LED for the next generation systems
        platform/x86: mlx-platform: Add extra CPLD for next generation systems
        platform/x86: wmi-bmof: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
        platform/x86: intel-wmi-thunderbolt: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
        platform/x86: huawei-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
        platform/x86: dell-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
        platform/x86: dell-wmi-descriptor: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
        platform/x86: dell-smbios-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
        platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()
        platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h
        modpost: file2alias: define size of alias
        platform/x86: touchscreen_dmi: Add info for the CHUWI Hi10 Air tablet
        platform/x86: ideapad-laptop: Add Ideapad 530S-14ARR to no_hw_rfkill list
        platform/x86: ideapad-laptop: Add Yoga C930 to no_hw_rfkill_list
        platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown
        platform/x86: intel_pmc_core: Add Package cstates residency info
        platform/x86: intel_pmc_core: Add ICL platform support
        ...
      dbbdf54c
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 45ba8d5d
      Linus Torvalds authored
      Pull virtio updates from Michael Tsirkin:
       "Several fixes, most notably fix for virtio on swiotlb systems"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        vhost: silence an unused-variable warning
        virtio: hint if callbacks surprisingly might sleep
        virtio-ccw: wire up ->bus_name callback
        s390/virtio: handle find on invalid queue gracefully
        virtio-ccw: diag 500 may return a negative cookie
        virtio_balloon: remove the unnecessary 0-initialization
        virtio-balloon: improve update_balloon_size_func
        virtio-blk: Consider virtio_max_dma_size() for maximum segment size
        virtio: Introduce virtio_max_dma_size()
        dma: Introduce dma_max_mapping_size()
        swiotlb: Add is_swiotlb_active() function
        swiotlb: Introduce swiotlb_max_mapping_size()
      45ba8d5d
    • Linus Torvalds's avatar
      Merge tag 'iommu-updates-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · bb97be23
      Linus Torvalds authored
      Pull IOMMU updates from Joerg Roedel:
      
       - A big cleanup and optimization patch-set for the Tegra GART driver
      
       - Documentation updates and fixes for the IOMMU-API
      
       - Support for page request in Intel VT-d scalable mode
      
       - Intel VT-d dma_[un]map_resource() support
      
       - Updates to the ATS enabling code for PCI (acked by Bjorn) and Intel
         VT-d to align with the latest version of the ATS spec
      
       - Relaxed IRQ source checking in the Intel VT-d driver for some aliased
         devices, needed for future devices which send IRQ messages from more
         than on request-ID
      
       - IRQ remapping driver for Hyper-V
      
       - Patches to make generic IOVA and IO-Page-Table code usable outside of
         the IOMMU code
      
       - Various other small fixes and cleanups
      
      * tag 'iommu-updates-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (60 commits)
        iommu/vt-d: Get domain ID before clear pasid entry
        iommu/vt-d: Fix NULL pointer reference in intel_svm_bind_mm()
        iommu/vt-d: Set context field after value initialized
        iommu/vt-d: Disable ATS support on untrusted devices
        iommu/mediatek: Fix semicolon code style issue
        MAINTAINERS: Add Hyper-V IOMMU driver into Hyper-V CORE AND DRIVERS scope
        iommu/hyper-v: Add Hyper-V stub IOMMU driver
        x86/Hyper-V: Set x2apic destination mode to physical when x2apic is available
        PCI/ATS: Add inline to pci_prg_resp_pasid_required()
        iommu/vt-d: Check identity map for hot-added devices
        iommu: Fix IOMMU debugfs fallout
        iommu: Document iommu_ops.is_attach_deferred()
        iommu: Document iommu_ops.iotlb_sync_map()
        iommu/vt-d: Enable ATS only if the device uses page aligned address.
        PCI/ATS: Add pci_ats_page_aligned() interface
        iommu/vt-d: Fix PRI/PASID dependency issue.
        PCI/ATS: Add pci_prg_resp_pasid_required() interface.
        iommu/vt-d: Allow interrupts from the entire bus for aliased devices
        iommu/vt-d: Add helper to set an IRTE to verify only the bus number
        iommu: Fix flush_tlb_all typo
        ...
      bb97be23
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.1' of git://git.infradead.org/users/hch/dma-mapping · b7a7d1c1
      Linus Torvalds authored
      Pull DMA mapping updates from Christoph Hellwig:
      
       - add debugfs support for dumping dma-debug information (Corentin
         Labbe)
      
       - Kconfig cleanups (Andy Shevchenko and me)
      
       - debugfs cleanups (Greg Kroah-Hartman)
      
       - improve dma_map_resource and use it in the media code
      
       - arch_setup_dma_ops / arch_teardown_dma_ops cleanups
      
       - various small cleanups and improvements for the per-device coherent
         allocator
      
       - make the DMA mask an upper bound and don't fail "too large" dma mask
         in the remaning two architectures - this will allow big driver
         cleanups in the following merge windows
      
      * tag 'dma-mapping-5.1' of git://git.infradead.org/users/hch/dma-mapping: (21 commits)
        Documentation/DMA-API-HOWTO: update dma_mask sections
        sparc64/pci_sun4v: allow large DMA masks
        sparc64/iommu: allow large DMA masks
        sparc64: refactor the ali DMA quirk
        ccio: allow large DMA masks
        dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag
        dma-mapping: remove dma_mark_declared_memory_occupied
        dma-mapping: move CONFIG_DMA_CMA to kernel/dma/Kconfig
        dma-mapping: improve selection of dma_declare_coherent availability
        dma-mapping: remove an incorrect __iommem annotation
        of: select OF_RESERVED_MEM automatically
        device.h: dma_mem is only needed for HAVE_GENERIC_DMA_COHERENT
        mfd/sm501: depend on HAS_DMA
        dma-mapping: add a kconfig symbol for arch_teardown_dma_ops availability
        dma-mapping: add a kconfig symbol for arch_setup_dma_ops availability
        dma-mapping: move debug configuration options to kernel/dma
        dma-debug: add dumping facility via debugfs
        dma: debug: no need to check return value of debugfs_create functions
        videobuf2: replace a layering violation with dma_map_resource
        dma-mapping: don't BUG when calling dma_map_resource on RAM
        ...
      b7a7d1c1
    • Enrico Weigelt, metux IT consult's avatar
      drivers: ide: Kconfig: pedantic formatting · dc5c3773
      Enrico Weigelt, metux IT consult authored
      Formatting of Kconfig files doesn't look so pretty, so just
      take a damp cloth and clean it up.
      Signed-off-by: default avatarEnrico Weigelt, metux IT consult <info@metux.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc5c3773
    • Gustavo A. R. Silva's avatar
      ide: mark expected switch fall-through · fbf68b01
      Gustavo A. R. Silva authored
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/ide/ide-floppy.c: In function ‘ide_floppy_get_capacity’:
      drivers/ide/ide-floppy.c:424:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
          if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE))
             ^
      drivers/ide/ide-floppy.c:431:3: note: here
         case CAPACITY_CURRENT:
         ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      Notice that, in this particular case, the code comment is modified
      in accordance with what GCC is expecting to find.
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fbf68b01
    • Gustavo A. R. Silva's avatar
      ide: hpt366: mark expected switch fall-throughs · 498b5894
      Gustavo A. R. Silva authored
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      Notice that, in this particular case, I removed the "else: "
      part from the comment. As we are now using Warning level 3:
      -Wimplicit-fallthrough=3, this is what GCC is expecting to
      find.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      498b5894
    • Eric Dumazet's avatar
      gro_cells: make sure device is up in gro_cells_receive() · 2a5ff07a
      Eric Dumazet authored
      We keep receiving syzbot reports [1] that show that tunnels do not play
      the rcu/IFF_UP rules properly.
      
      At device dismantle phase, gro_cells_destroy() will be called
      only after a full rcu grace period is observed after IFF_UP
      has been cleared.
      
      This means that IFF_UP needs to be tested before queueing packets
      into netif_rx() or gro_cells.
      
      This patch implements the test in gro_cells_receive() because
      too many callers do not seem to bother enough.
      
      [1]
      BUG: unable to handle kernel paging request at fffff4ca0b9ffffe
      PGD 0 P4D 0
      Oops: 0000 [#1] PREEMPT SMP KASAN
      CPU: 0 PID: 21 Comm: kworker/u4:1 Not tainted 5.0.0+ #97
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: netns cleanup_net
      RIP: 0010:__skb_unlink include/linux/skbuff.h:1929 [inline]
      RIP: 0010:__skb_dequeue include/linux/skbuff.h:1945 [inline]
      RIP: 0010:__skb_queue_purge include/linux/skbuff.h:2656 [inline]
      RIP: 0010:gro_cells_destroy net/core/gro_cells.c:89 [inline]
      RIP: 0010:gro_cells_destroy+0x19d/0x360 net/core/gro_cells.c:78
      Code: 03 42 80 3c 20 00 0f 85 53 01 00 00 48 8d 7a 08 49 8b 47 08 49 c7 07 00 00 00 00 48 89 f9 49 c7 47 08 00 00 00 00 48 c1 e9 03 <42> 80 3c 21 00 0f 85 10 01 00 00 48 89 c1 48 89 42 08 48 c1 e9 03
      RSP: 0018:ffff8880aa3f79a8 EFLAGS: 00010a02
      RAX: 00ffffffffffffe8 RBX: ffffe8ffffc64b70 RCX: 1ffff8ca0b9ffffe
      RDX: ffffc6505cffffe8 RSI: ffffffff858410ca RDI: ffffc6505cfffff0
      RBP: ffff8880aa3f7a08 R08: ffff8880aa3e8580 R09: fffffbfff1263645
      R10: fffffbfff1263644 R11: ffffffff8931b223 R12: dffffc0000000000
      R13: 0000000000000000 R14: ffffe8ffffc64b80 R15: ffffe8ffffc64b75
      kobject: 'loop2' (000000004bd7d84a): kobject_uevent_env
      FS:  0000000000000000(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: fffff4ca0b9ffffe CR3: 0000000094941000 CR4: 00000000001406f0
      Call Trace:
      kobject: 'loop2' (000000004bd7d84a): fill_kobj_path: path = '/devices/virtual/block/loop2'
       ip_tunnel_dev_free+0x19/0x60 net/ipv4/ip_tunnel.c:1010
       netdev_run_todo+0x51c/0x7d0 net/core/dev.c:8970
       rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:116
       ip_tunnel_delete_nets+0x423/0x5f0 net/ipv4/ip_tunnel.c:1124
       vti_exit_batch_net+0x23/0x30 net/ipv4/ip_vti.c:495
       ops_exit_list.isra.0+0x105/0x160 net/core/net_namespace.c:156
       cleanup_net+0x3fb/0x960 net/core/net_namespace.c:551
       process_one_work+0x98e/0x1790 kernel/workqueue.c:2173
       worker_thread+0x98/0xe40 kernel/workqueue.c:2319
       kthread+0x357/0x430 kernel/kthread.c:246
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
      Modules linked in:
      CR2: fffff4ca0b9ffffe
         [ end trace 513fc9c1338d1cb3 ]
      RIP: 0010:__skb_unlink include/linux/skbuff.h:1929 [inline]
      RIP: 0010:__skb_dequeue include/linux/skbuff.h:1945 [inline]
      RIP: 0010:__skb_queue_purge include/linux/skbuff.h:2656 [inline]
      RIP: 0010:gro_cells_destroy net/core/gro_cells.c:89 [inline]
      RIP: 0010:gro_cells_destroy+0x19d/0x360 net/core/gro_cells.c:78
      Code: 03 42 80 3c 20 00 0f 85 53 01 00 00 48 8d 7a 08 49 8b 47 08 49 c7 07 00 00 00 00 48 89 f9 49 c7 47 08 00 00 00 00 48 c1 e9 03 <42> 80 3c 21 00 0f 85 10 01 00 00 48 89 c1 48 89 42 08 48 c1 e9 03
      RSP: 0018:ffff8880aa3f79a8 EFLAGS: 00010a02
      RAX: 00ffffffffffffe8 RBX: ffffe8ffffc64b70 RCX: 1ffff8ca0b9ffffe
      RDX: ffffc6505cffffe8 RSI: ffffffff858410ca RDI: ffffc6505cfffff0
      RBP: ffff8880aa3f7a08 R08: ffff8880aa3e8580 R09: fffffbfff1263645
      R10: fffffbfff1263644 R11: ffffffff8931b223 R12: dffffc0000000000
      kobject: 'loop3' (00000000e4ee57a6): kobject_uevent_env
      R13: 0000000000000000 R14: ffffe8ffffc64b80 R15: ffffe8ffffc64b75
      FS:  0000000000000000(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: fffff4ca0b9ffffe CR3: 0000000094941000 CR4: 00000000001406f0
      
      Fixes: c9e6bc64 ("net: add gro_cells infrastructure")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a5ff07a
    • Eric Dumazet's avatar
      vxlan: test dev->flags & IFF_UP before calling gro_cells_receive() · 59cbf56f
      Eric Dumazet authored
      Same reasons than the ones explained in commit 4179cb5a
      ("vxlan: test dev->flags & IFF_UP before calling netif_rx()")
      
      netif_rx() or gro_cells_receive() must be called under a strict contract.
      
      At device dismantle phase, core networking clears IFF_UP
      and flush_all_backlogs() is called after rcu grace period
      to make sure no incoming packet might be in a cpu backlog
      and still referencing the device.
      
      A similar protocol is used for gro_cells infrastructure, as
      gro_cells_destroy() will be called only after a full rcu
      grace period is observed after IFF_UP has been cleared.
      
      Most drivers call netif_rx() from their interrupt handler,
      and since the interrupts are disabled at device dismantle,
      netif_rx() does not have to check dev->flags & IFF_UP
      
      Virtual drivers do not have this guarantee, and must
      therefore make the check themselves.
      
      Otherwise we risk use-after-free and/or crashes.
      
      Fixes: d342894c ("vxlan: virtual extensible lan")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      59cbf56f
    • Eric Dumazet's avatar
      net/x25: fix use-after-free in x25_device_event() · 95d6ebd5
      Eric Dumazet authored
      In case of failure x25_connect() does a x25_neigh_put(x25->neighbour)
      but forgets to clear x25->neighbour pointer, thus triggering use-after-free.
      
      Since the socket is visible in x25_list, we need to hold x25_list_lock
      to protect the operation.
      
      syzbot report :
      
      BUG: KASAN: use-after-free in x25_kill_by_device net/x25/af_x25.c:217 [inline]
      BUG: KASAN: use-after-free in x25_device_event+0x296/0x2b0 net/x25/af_x25.c:252
      Read of size 8 at addr ffff8880a030edd0 by task syz-executor003/7854
      
      CPU: 0 PID: 7854 Comm: syz-executor003 Not tainted 5.0.0+ #97
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x172/0x1f0 lib/dump_stack.c:113
       print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187
       kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
       __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135
       x25_kill_by_device net/x25/af_x25.c:217 [inline]
       x25_device_event+0x296/0x2b0 net/x25/af_x25.c:252
       notifier_call_chain+0xc7/0x240 kernel/notifier.c:93
       __raw_notifier_call_chain kernel/notifier.c:394 [inline]
       raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401
       call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1739
       call_netdevice_notifiers_extack net/core/dev.c:1751 [inline]
       call_netdevice_notifiers net/core/dev.c:1765 [inline]
       __dev_notify_flags+0x1e9/0x2c0 net/core/dev.c:7607
       dev_change_flags+0x10d/0x170 net/core/dev.c:7643
       dev_ifsioc+0x2b0/0x940 net/core/dev_ioctl.c:237
       dev_ioctl+0x1b8/0xc70 net/core/dev_ioctl.c:488
       sock_do_ioctl+0x1bd/0x300 net/socket.c:995
       sock_ioctl+0x32b/0x610 net/socket.c:1096
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:509 [inline]
       do_vfs_ioctl+0xd6e/0x1390 fs/ioctl.c:696
       ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
       __do_sys_ioctl fs/ioctl.c:720 [inline]
       __se_sys_ioctl fs/ioctl.c:718 [inline]
       __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x4467c9
      Code: e8 0c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 5b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
      RSP: 002b:00007fdbea222d98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 00000000006dbc58 RCX: 00000000004467c9
      RDX: 0000000020000340 RSI: 0000000000008914 RDI: 0000000000000003
      RBP: 00000000006dbc50 R08: 00007fdbea223700 R09: 0000000000000000
      R10: 00007fdbea223700 R11: 0000000000000246 R12: 00000000006dbc5c
      R13: 6000030030626669 R14: 0000000000000000 R15: 0000000030626669
      
      Allocated by task 7843:
       save_stack+0x45/0xd0 mm/kasan/common.c:73
       set_track mm/kasan/common.c:85 [inline]
       __kasan_kmalloc mm/kasan/common.c:495 [inline]
       __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:468
       kasan_kmalloc+0x9/0x10 mm/kasan/common.c:509
       kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3615
       kmalloc include/linux/slab.h:545 [inline]
       x25_link_device_up+0x46/0x3f0 net/x25/x25_link.c:249
       x25_device_event+0x116/0x2b0 net/x25/af_x25.c:242
       notifier_call_chain+0xc7/0x240 kernel/notifier.c:93
       __raw_notifier_call_chain kernel/notifier.c:394 [inline]
       raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401
       call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1739
       call_netdevice_notifiers_extack net/core/dev.c:1751 [inline]
       call_netdevice_notifiers net/core/dev.c:1765 [inline]
       __dev_notify_flags+0x121/0x2c0 net/core/dev.c:7605
       dev_change_flags+0x10d/0x170 net/core/dev.c:7643
       dev_ifsioc+0x2b0/0x940 net/core/dev_ioctl.c:237
       dev_ioctl+0x1b8/0xc70 net/core/dev_ioctl.c:488
       sock_do_ioctl+0x1bd/0x300 net/socket.c:995
       sock_ioctl+0x32b/0x610 net/socket.c:1096
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:509 [inline]
       do_vfs_ioctl+0xd6e/0x1390 fs/ioctl.c:696
       ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
       __do_sys_ioctl fs/ioctl.c:720 [inline]
       __se_sys_ioctl fs/ioctl.c:718 [inline]
       __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Freed by task 7865:
       save_stack+0x45/0xd0 mm/kasan/common.c:73
       set_track mm/kasan/common.c:85 [inline]
       __kasan_slab_free+0x102/0x150 mm/kasan/common.c:457
       kasan_slab_free+0xe/0x10 mm/kasan/common.c:465
       __cache_free mm/slab.c:3494 [inline]
       kfree+0xcf/0x230 mm/slab.c:3811
       x25_neigh_put include/net/x25.h:253 [inline]
       x25_connect+0x8d8/0xde0 net/x25/af_x25.c:824
       __sys_connect+0x266/0x330 net/socket.c:1685
       __do_sys_connect net/socket.c:1696 [inline]
       __se_sys_connect net/socket.c:1693 [inline]
       __x64_sys_connect+0x73/0xb0 net/socket.c:1693
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      The buggy address belongs to the object at ffff8880a030edc0
       which belongs to the cache kmalloc-256 of size 256
      The buggy address is located 16 bytes inside of
       256-byte region [ffff8880a030edc0, ffff8880a030eec0)
      The buggy address belongs to the page:
      page:ffffea000280c380 count:1 mapcount:0 mapping:ffff88812c3f07c0 index:0x0
      flags: 0x1fffc0000000200(slab)
      raw: 01fffc0000000200 ffffea0002806788 ffffea00027f0188 ffff88812c3f07c0
      raw: 0000000000000000 ffff8880a030e000 000000010000000c 0000000000000000
      page dumped because: kasan: bad access detected
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: syzbot+04babcefcd396fabec37@syzkaller.appspotmail.com
      Cc: andrew hendry <andrew.hendry@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      95d6ebd5
    • Linus Torvalds's avatar
      Merge tag 'devicetree-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 065b6c4c
      Linus Torvalds authored
      Pull Devicetree updates from Rob Herring:
      
       - Fix a unittest failure on UML. Preparation for converting to kunit
         test framework.
      
       - Add annotations to dtx_diff output
      
       - Fix unittest reporting of expected error
      
       - Move DMA configuration for virtual devices into the driver that needs
         it (s5p-mfc)
      
       - Vendor prefixes for feiyang and techstar
      
       - Convert ARM GIC, GICv3, and L2x0 to DT schema
      
       - Add r8a7778/9 HSCIF serial bindings
      
      * tag 'devicetree-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        of: unittest: unflatten device tree on UML when testing
        dt-bindings: Add vendor prefix for feiyang
        dt-bindings: Add vendor prefix for techstar
        dt-bindings: display: add missing semicolon in example
        of: mark early_init_dt_alloc_reserved_memory_arch static
        of: add dtc annotations functionality to dtx_diff
        of: unittest: add caution to function header comment
        of: unittest: remove report of expected error
        dt-bindings: interrupt-controller: Convert ARM GICv3 to json-schema
        dt-bindings: interrupt-controller: Convert ARM GIC to json-schema
        dt-bindings: arm: l2x0: Convert L2 cache to json-schema
        media: s5p-mfc: Fix memdev DMA configuration
        dt-bindings: serial: sh-sci: Document r8a7778/9 HSCIF bindings
      065b6c4c
    • Kangjie Lu's avatar
      isdn: mISDNinfineon: fix potential NULL pointer dereference · d721fe99
      Kangjie Lu authored
      In case ioremap fails, the fix returns -ENOMEM to avoid NULL
      pointer dereference.
      Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d721fe99
    • Linus Torvalds's avatar
      Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 3d8dfe75
      Linus Torvalds authored
      Pull arm64 updates from Catalin Marinas:
      
       - Pseudo NMI support for arm64 using GICv3 interrupt priorities
      
       - uaccess macros clean-up (unsafe user accessors also merged but
         reverted, waiting for objtool support on arm64)
      
       - ptrace regsets for Pointer Authentication (ARMv8.3) key management
      
       - inX() ordering w.r.t. delay() on arm64 and riscv (acks in place by
         the riscv maintainers)
      
       - arm64/perf updates: PMU bindings converted to json-schema, unused
         variable and misleading comment removed
      
       - arm64/debug fixes to ensure checking of the triggering exception
         level and to avoid the propagation of the UNKNOWN FAR value into the
         si_code for debug signals
      
       - Workaround for Fujitsu A64FX erratum 010001
      
       - lib/raid6 ARM NEON optimisations
      
       - NR_CPUS now defaults to 256 on arm64
      
       - Minor clean-ups (documentation/comments, Kconfig warning, unused
         asm-offsets, clang warnings)
      
       - MAINTAINERS update for list information to the ARM64 ACPI entry
      
      * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (54 commits)
        arm64: mmu: drop paging_init comments
        arm64: debug: Ensure debug handlers check triggering exception level
        arm64: debug: Don't propagate UNKNOWN FAR into si_code for debug signals
        Revert "arm64: uaccess: Implement unsafe accessors"
        arm64: avoid clang warning about self-assignment
        arm64: Kconfig.platforms: fix warning unmet direct dependencies
        lib/raid6: arm: optimize away a mask operation in NEON recovery routine
        lib/raid6: use vdupq_n_u8 to avoid endianness warnings
        arm64: io: Hook up __io_par() for inX() ordering
        riscv: io: Update __io_[p]ar() macros to take an argument
        asm-generic/io: Pass result of I/O accessor to __io_[p]ar()
        arm64: Add workaround for Fujitsu A64FX erratum 010001
        arm64: Rename get_thread_info()
        arm64: Remove documentation about TIF_USEDFPU
        arm64: irqflags: Fix clang build warnings
        arm64: Enable the support of pseudo-NMIs
        arm64: Skip irqflags tracing for NMI in IRQs disabled context
        arm64: Skip preemption when exiting an NMI
        arm64: Handle serror in NMI context
        irqchip/gic-v3: Allow interrupts to be set as pseudo-NMI
        ...
      3d8dfe75
    • Linus Torvalds's avatar
      Merge tag 'nios2-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 · d6075262
      Linus Torvalds authored
      Pull nios2 updates from Ley Foon Tan:
       "Most of updates are MMU related"
      
      * tag 'nios2-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
        nios2: Fix update_mmu_cache preload the TLB with the new PTE
        nios2: update_mmu_cache preload the TLB with the new PTE
        nios2: User address TLB flush break after finding the matching entry
        nios2: flush_tlb_all use TLBMISC way auto-increment feature
        nios2: improve readability of tlb functions
        nios2: flush_tlb_mm flush only the pid
        nios2: flush_tlb_pid can just restore TLBMISC once
        nios2: TLBMISC writes do not require PID bits to be set
        nios2: Use an invalid TLB entry address helper function
        nios2: pte_clear does not need to flush TLB
        nios2: flush_tlb_page use PID based flush
        nios2: update_mmu_cache clear the old entry from the TLB
        nios2: remove redundant 'default n' from Kconfig-s
        nios2: ksyms: Add missing symbol exports
      d6075262