commit ebc59901aad6745e9eade4a13ee616a71e7a5315
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Jun 10 20:22:53 2020 +0200

    Linux 5.6.18

commit 5c940043ffe8a27c2e8af078cdfea79b38e46752
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Tue Jun 9 19:29:42 2020 +0200

    Revert "net/mlx5: Annotate mutex destroy for root ns"
    
    This reverts commit 9b035b08e7e5fe7b2e75636324edf41ee30c5f94 which is
    commit 9ca415399dae133b00273a4283ef31d003a6818d upstream.
    
    It was backported incorrectly, Paul writes at:
            https://lore.kernel.org/r/20200607203425.GD23662@windriver.com
    
            I happened to notice this commit:
    
            9ca415399dae - "net/mlx5: Annotate mutex destroy for root ns"
    
            ...was backported to 4.19 and 5.4 and v5.6 in linux-stable.
    
            It patches del_sw_root_ns() - which only exists after v5.7-rc7 from:
    
            6eb7a268a99b - "net/mlx5: Don't maintain a case of del_sw_func being
            null"
    
            which creates the one line del_sw_root_ns stub function around
            kfree(node) by breaking it out of tree_put_node().
    
            In the absense of del_sw_root_ns - the backport finds an identical one
            line kfree stub fcn - named del_sw_prio from this earlier commit:
    
            139ed6c6c46a - "net/mlx5: Fix steering memory leak"  [in v4.15-rc5]
    
            and then puts the mutex_destroy() into that (wrong) function, instead of
            putting it into tree_put_node where the root ns case used to be hand
    
    Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com>
    Cc: Roi Dayan <roid@mellanox.com>
    Cc: Mark Bloch <markb@mellanox.com>
    Cc: Saeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0fef65e2880f3cf8d979427189ae290da7e1f801
Author: Oleg Nesterov <oleg@redhat.com>
Date:   Mon May 4 18:47:25 2020 +0200

    uprobes: ensure that uprobe->offset and ->ref_ctr_offset are properly aligned
    
    commit 013b2deba9a6b80ca02f4fafd7dedf875e9b4450 upstream.
    
    uprobe_write_opcode() must not cross page boundary; prepare_uprobe()
    relies on arch_uprobe_analyze_insn() which should validate "vaddr" but
    some architectures (csky, s390, and sparc) don't do this.
    
    We can remove the BUG_ON() check in prepare_uprobe() and validate the
    offset early in __uprobe_register(). The new IS_ALIGNED() check matches
    the alignment check in arch_prepare_kprobe() on supported architectures,
    so I think that all insns must be aligned to UPROBE_SWBP_INSN_SIZE.
    
    Another problem is __update_ref_ctr() which was wrong from the very
    beginning, it can read/write outside of kmap'ed page unless "vaddr" is
    aligned to sizeof(short), __uprobe_register() should check this too.
    
    Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
    Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
    Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Tested-by: Sven Schnelle <svens@linux.ibm.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1e6cd20e44d4578c39a6bffbd84638bfb4c4d73b
Author: Josh Poimboeuf <jpoimboe@redhat.com>
Date:   Mon Apr 27 20:46:13 2020 +0200

    x86/speculation: Add Ivy Bridge to affected list
    
    commit 3798cc4d106e91382bfe016caa2edada27c2bb3f upstream
    
    Make the docs match the code.
    
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 897d1639c38691742c36d4c3f3c099396b18d314
Author: Mark Gross <mgross@linux.intel.com>
Date:   Thu Apr 16 18:21:51 2020 +0200

    x86/speculation: Add SRBDS vulnerability and mitigation documentation
    
    commit 7222a1b5b87417f22265c92deea76a6aecd0fb0f upstream
    
    Add documentation for the SRBDS vulnerability and its mitigation.
    
     [ bp: Massage.
       jpoimboe: sysfs table strings. ]
    
    Signed-off-by: Mark Gross <mgross@linux.intel.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Reviewed-by: Tony Luck <tony.luck@intel.com>
    Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 49491339c97686dc697aff1b1ddcb426d62f9eff
Author: Mark Gross <mgross@linux.intel.com>
Date:   Thu Apr 16 17:54:04 2020 +0200

    x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation
    
    commit 7e5b3c267d256822407a22fdce6afdf9cd13f9fb upstream
    
    SRBDS is an MDS-like speculative side channel that can leak bits from the
    random number generator (RNG) across cores and threads. New microcode
    serializes the processor access during the execution of RDRAND and
    RDSEED. This ensures that the shared buffer is overwritten before it is
    released for reuse.
    
    While it is present on all affected CPU models, the microcode mitigation
    is not needed on models that enumerate ARCH_CAPABILITIES[MDS_NO] in the
    cases where TSX is not supported or has been disabled with TSX_CTRL.
    
    The mitigation is activated by default on affected processors and it
    increases latency for RDRAND and RDSEED instructions. Among other
    effects this will reduce throughput from /dev/urandom.
    
    * Enable administrator to configure the mitigation off when desired using
      either mitigations=off or srbds=off.
    
    * Export vulnerability status via sysfs
    
    * Rename file-scoped macros to apply for non-whitelist table initializations.
    
     [ bp: Massage,
       - s/VULNBL_INTEL_STEPPING/VULNBL_INTEL_STEPPINGS/g,
       - do not read arch cap MSR a second time in tsx_fused_off() - just pass it in,
       - flip check in cpu_set_bug_bits() to save an indentation level,
       - reflow comments.
       jpoimboe: s/Mitigated/Mitigation/ in user-visible strings
       tglx: Dropped the fused off magic for now
     ]
    
    Signed-off-by: Mark Gross <mgross@linux.intel.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Tony Luck <tony.luck@intel.com>
    Reviewed-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
    Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Tested-by: Neelima Krishnan <neelima.krishnan@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fed6c76f4965b47c159504496f460857e8c802ec
Author: Mark Gross <mgross@linux.intel.com>
Date:   Thu Apr 16 17:32:42 2020 +0200

    x86/cpu: Add 'table' argument to cpu_matches()
    
    commit 93920f61c2ad7edb01e63323832585796af75fc9 upstream
    
    To make cpu_matches() reusable for other matching tables, have it take a
    pointer to a x86_cpu_id table as an argument.
    
     [ bp: Flip arguments order. ]
    
    Signed-off-by: Mark Gross <mgross@linux.intel.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1b66e95c821de3928b7cc33d5effaa05e1b26310
Author: Mark Gross <mgross@linux.intel.com>
Date:   Thu Apr 16 17:23:10 2020 +0200

    x86/cpu: Add a steppings field to struct x86_cpu_id
    
    commit e9d7144597b10ff13ff2264c059f7d4a7fbc89ac upstream
    
    Intel uses the same family/model for several CPUs. Sometimes the
    stepping must be checked to tell them apart.
    
    On x86 there can be at most 16 steppings. Add a steppings bitmask to
    x86_cpu_id and a X86_MATCH_VENDOR_FAMILY_MODEL_STEPPING_FEATURE macro
    and support for matching against family/model/stepping.
    
     [ bp: Massage.
       tglx: Lightweight variant for backporting ]
    
    Signed-off-by: Mark Gross <mgross@linux.intel.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Tony Luck <tony.luck@intel.com>
    Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 31fe8f408e1aa4fe058e159d17caeba5fcb824bd
Author: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date:   Fri May 22 12:33:41 2020 +0100

    nvmem: qfprom: remove incorrect write support
    
    commit 8d9eb0d6d59a5d7028c80a30831143d3e75515a7 upstream.
    
    qfprom has different address spaces for read and write. Reads are
    always done from corrected address space, where as writes are done
    on raw address space.
    Writing to corrected address space is invalid and ignored, so it
    does not make sense to have this support in the driver which only
    supports corrected address space regions at the moment.
    
    Fixes: 4ab11996b489 ("nvmem: qfprom: Add Qualcomm QFPROM support.")
    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
    Reviewed-by: Douglas Anderson <dianders@chromium.org>
    Cc: stable <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20200522113341.7728-1-srinivas.kandagatla@linaro.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5af17d5d5d57e7c63b79cf44b207668d180eb185
Author: Oliver Neukum <oneukum@suse.com>
Date:   Tue May 26 14:44:20 2020 +0200

    CDC-ACM: heed quirk also in error handling
    
    commit 97fe809934dd2b0b37dfef3a2fc70417f485d7af upstream.
    
    If buffers are iterated over in the error case, the lower limits
    for quirky devices must be heeded.
    
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Reported-by: Jean Rene Dawin <jdawin@math.uni-bielefeld.de>
    Fixes: a4e7279cd1d19 ("cdc-acm: introduce a cool down")
    Cc: stable <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20200526124420.22160-1-oneukum@suse.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4a36a695b9d996784d31d3c63970160351c1e563
Author: Pascal Terjan <pterjan@google.com>
Date:   Sat May 23 22:12:47 2020 +0100

    staging: rtl8712: Fix IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK
    
    commit 15ea976a1f12b5fd76b1bd6ff3eb5132fd28047f upstream.
    
    The value in shared headers was fixed 9 years ago in commit 8d661f1e462d
    ("ieee80211: correct IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK macro") and
    while looking at using shared headers for other duplicated constants
    I noticed this driver uses the old value.
    
    The macros are also defined twice in this file so I am deleting the
    second definition.
    
    Signed-off-by: Pascal Terjan <pterjan@google.com>
    Cc: stable <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20200523211247.23262-1-pterjan@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bdb6d7d8da28c97512b9130932c233eca1f92a8a
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Tue May 26 16:56:32 2020 +0200

    tty: hvc_console, fix crashes on parallel open/close
    
    commit 24eb2377f977fe06d84fca558f891f95bc28a449 upstream.
    
    hvc_open sets tty->driver_data to NULL when open fails at some point.
    Typically, the failure happens in hp->ops->notifier_add(). If there is
    a racing process which tries to open such mangled tty, which was not
    closed yet, the process will crash in hvc_open as tty->driver_data is
    NULL.
    
    All this happens because close wants to know whether open failed or not.
    But ->open should not NULL this and other tty fields for ->close to be
    happy. ->open should call tty_port_set_initialized(true) and close
    should check by tty_port_initialized() instead. So do this properly in
    this driver.
    
    So this patch removes these from ->open:
    * tty_port_tty_set(&hp->port, NULL). This happens on last close.
    * tty->driver_data = NULL. Dtto.
    * tty_port_put(&hp->port). This happens in shutdown and until now, this
      must have been causing a reference underflow, if I am not missing
      something.
    
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Cc: stable <stable@vger.kernel.org>
    Reported-and-tested-by: Raghavendra <rananta@codeaurora.org>
    Link: https://lore.kernel.org/r/20200526145632.13879-1-jslaby@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9a17273f1efe47b0d773fef0a987ea28dafb92f2
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Mon May 25 16:27:40 2020 -0700

    vt: keyboard: avoid signed integer overflow in k_ascii
    
    commit b86dab054059b970111b5516ae548efaae5b3aae upstream.
    
    When k_ascii is invoked several times in a row there is a potential for
    signed integer overflow:
    
    UBSAN: Undefined behaviour in drivers/tty/vt/keyboard.c:888:19 signed integer overflow:
    10 * 1111111111 cannot be represented in type 'int'
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.11 #1
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    Call Trace:
     <IRQ>
     __dump_stack lib/dump_stack.c:77 [inline]
     dump_stack+0xce/0x128 lib/dump_stack.c:118
     ubsan_epilogue+0xe/0x30 lib/ubsan.c:154
     handle_overflow+0xdc/0xf0 lib/ubsan.c:184
     __ubsan_handle_mul_overflow+0x2a/0x40 lib/ubsan.c:205
     k_ascii+0xbf/0xd0 drivers/tty/vt/keyboard.c:888
     kbd_keycode drivers/tty/vt/keyboard.c:1477 [inline]
     kbd_event+0x888/0x3be0 drivers/tty/vt/keyboard.c:1495
    
    While it can be worked around by using check_mul_overflow()/
    check_add_overflow(), it is better to introduce a separate flag to
    signal that number pad is being used to compose a symbol, and
    change type of the accumulator from signed to unsigned, thus
    avoiding undefined behavior when it overflows.
    
    Reported-by: Kyungtae Kim <kt0755@gmail.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Cc: stable <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20200525232740.GA262061@dtor-ws
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit be43f8dba56d8a85617bcf14ebad77563cde1bc2
Author: Josh Triplett <josh@joshtriplett.org>
Date:   Tue May 26 09:13:57 2020 -0700

    serial: 8250: Enable 16550A variants by default on non-x86
    
    commit 15a3f03d5ec0118f1e5db3fc1018686e72744e37 upstream.
    
    Some embedded devices still use these serial ports; make sure they're
    still enabled by default on architectures more likely to have them, to
    avoid rendering someone's console unavailable.
    
    Reported-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reported-by: Maxim Kochetkov <fido_max@inbox.ru>
    Fixes: dc56ecb81a0a ("serial: 8250: Support disabling mdelay-filled probes of 16550A variants")
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    Link: https://lore.kernel.org/r/a20b5fb7dd295cfb48160eecf4bdebd76332d67d.1590509426.git.josh@joshtriplett.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 99771a0d991e38eb9ea7e2618c7a90af5da2e703
Author: Dinghao Liu <dinghao.liu@zju.edu.cn>
Date:   Sun May 24 21:50:49 2020 -0500

    usb: musb: Fix runtime PM imbalance on error
    
    commit e4befc121df03dc8ed2ac1031c98f9538e244bae upstream.
    
    When copy_from_user() returns an error code, there
    is a runtime PM usage counter imbalance.
    
    Fix this by moving copy_from_user() to the beginning
    of this function.
    
    Fixes: 7b6c1b4c0e1e ("usb: musb: fix runtime PM in debugfs")
    
    Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
    Cc: stable@vger.kernel.org
    Signed-off-by: Bin Liu <b-liu@ti.com>
    Link: https://lore.kernel.org/r/20200525025049.3400-7-b-liu@ti.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 683831f90e544819d862c9dcea48a03ce12070a9
Author: Bin Liu <b-liu@ti.com>
Date:   Sun May 24 21:50:45 2020 -0500

    usb: musb: start session in resume for host port
    
    commit 7f88a5ac393f39319f69b8b20cc8d5759878d1a1 upstream.
    
    Commit 17539f2f4f0b ("usb: musb: fix enumeration after resume") replaced
    musb_start() in musb_resume() to not override softconnect bit, but it
    doesn't restart the session for host port which was done in musb_start().
    The session could be disabled in musb_suspend(), which leads the host
    port doesn't stay in host mode.
    
    So let's start the session specifically for host port in musb_resume().
    
    Fixes: 17539f2f4f0b ("usb: musb: fix enumeration after resume")
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Bin Liu <b-liu@ti.com>
    Link: https://lore.kernel.org/r/20200525025049.3400-3-b-liu@ti.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 49ed0aa2894f7c6b00e25633ec996214f0e9247c
Author: Fabrice Gasnier <fabrice.gasnier@st.com>
Date:   Tue May 12 15:27:05 2020 +0200

    iio: adc: stm32-adc: fix a wrong error message when probing interrupts
    
    commit 10134ec3f8cefa6a40fe84987f1795e9e0da9715 upstream.
    
    A wrong error message is printed out currently, like on STM32MP15:
    - stm32-adc-core 48003000.adc: IRQ index 2 not found.
    
    This is seen since commit 7723f4c5ecdb ("driver core: platform: Add an
    error message to platform_get_irq*()").
    The STM32 ADC core driver wrongly requests up to 3 interrupt lines. It
    should request only the necessary IRQs, based on the compatible:
    - stm32f4/h7 ADCs share a common interrupt
    - stm32mp1, has one interrupt line per ADC.
    So add the number of required interrupts to the compatible data.
    
    Fixes: d58c67d1d851 ("iio: adc: stm32-adc: add support for STM32MP1")
    Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f3a5c36c3264e16523d47948c3018c20a666c32a
Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Date:   Sun May 17 18:30:00 2020 +0100

    iio:chemical:pms7003: Fix timestamp alignment and prevent data leak.
    
    commit 13e945631c2ffb946c0af342812a3cd39227de6e upstream.
    
    One of a class of bugs pointed out by Lars in a recent review.
    iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
    to the size of the timestamp (8 bytes).  This is not guaranteed in
    this driver which uses an array of smaller elements on the stack.
    As Lars also noted this anti pattern can involve a leak of data to
    userspace and that indeed can happen here.  We close both issues by
    moving to a suitable structure in the iio_priv() data with alignment
    explicitly requested.  This data is allocated with kzalloc so no
    data can leak appart from previous readings.
    
    Fixes: a1d642266c14 ("iio: chemical: add support for Plantower PMS7003 sensor")
    Reported-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Cc: <Stable@vger.kernel.org>
    Acked-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c9ad09b03f81e90bbf599972d1833d70175ddc29
Author: Mathieu Othacehe <m.othacehe@gmail.com>
Date:   Sun May 3 11:29:55 2020 +0200

    iio: vcnl4000: Fix i2c swapped word reading.
    
    commit 18dfb5326370991c81a6d1ed6d1aeee055cb8c05 upstream.
    
    The bytes returned by the i2c reading need to be swapped
    unconditionally. Otherwise, on be16 platforms, an incorrect value will be
    returned.
    
    Taking the slow path via next merge window as its been around a while
    and we have a patch set dependent on this which would be held up.
    
    Fixes: 62a1efb9f868 ("iio: add vcnl4000 combined ALS and proximity sensor")
    Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7081ef3b1840569e7c20c94581de12d456808145
Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Date:   Sun May 17 18:29:59 2020 +0100

    iio:chemical:sps30: Fix timestamp alignment
    
    commit a5bf6fdd19c327bcfd9073a8740fa19ca4525fd4 upstream.
    
    One of a class of bugs pointed out by Lars in a recent review.
    iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
    to the size of the timestamp (8 bytes).  This is not guaranteed in
    this driver which uses an array of smaller elements on the stack.
    
    Fixes: 232e0f6ddeae ("iio: chemical: add support for Sensirion SPS30 sensor")
    Reported-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Cc: <Stable@vger.kernel.org>
    Acked-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9978af35e163809f30f3b5c5dcdd7989a524c91e
Author: Johan Hovold <johan@kernel.org>
Date:   Thu May 14 11:36:45 2020 +0200

    USB: serial: ch341: fix lockup of devices with limited prescaler
    
    commit c432df155919582a3cefa35a8f86256c830fa9a4 upstream.
    
    Michael Hanselmann reports that
    
            [a] subset of all CH341 devices stop responding to bulk
            transfers, usually after the third byte, when the highest
            prescaler bit (0b100) is set. There is one exception, namely a
            prescaler of exactly 0b111 (fact=1, ps=3).
    
    Fix this by forcing a lower base clock (fact = 0) whenever needed.
    
    This specifically makes the standard rates 110, 134 and 200 bps work
    again with these devices.
    
    Fixes: 35714565089e ("USB: serial: ch341: reimplement line-speed handling")
    Cc: stable <stable@vger.kernel.org>     # 5.5
    Reported-by: Michael Hanselmann <public@hansmi.ch>
    Link: https://lore.kernel.org/r/20200514141743.GE25962@localhost
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d69c586f269ce218439d5eec2babec21ab337763
Author: Michael Hanselmann <public@hansmi.ch>
Date:   Tue Mar 31 23:37:18 2020 +0000

    USB: serial: ch341: add basis for quirk detection
    
    commit c404bf4aa9236cb4d1068e499ae42acf48a6ff97 upstream.
    
    A subset of CH341 devices does not support all features, namely the
    prescaler is limited to a reduced precision and there is no support for
    sending a RS232 break condition. This patch adds a detection function
    which will be extended to set quirk flags as they're implemented.
    
    The author's affected device has an imprint of "340" on the
    turquoise-colored plug, but not all such devices appear to be affected.
    
    Signed-off-by: Michael Hanselmann <public@hansmi.ch>
    Link: https://lore.kernel.org/r/1e1ae0da6082bb528a44ef323d4e1d3733d38858.1585697281.git.public@hansmi.ch
    [ johan: use long type for quirks; rephrase and use port device for
             messages; handle short reads; set quirk flags directly in
             helper function ]
    Cc: stable <stable@vger.kernel.org>     # 5.5
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9c655c47faba239939ff85847cc13c14230241bb
Author: Daniele Palmas <dnlplm@gmail.com>
Date:   Mon May 25 23:11:06 2020 +0200

    USB: serial: option: add Telit LE910C1-EUX compositions
    
    commit 399ad9477c523f721f8e51d4f824bdf7267f120c upstream.
    
    Add Telit LE910C1-EUX compositions:
    
            0x1031: tty, tty, tty, rmnet
            0x1033: tty, tty, tty, ecm
    
    Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
    Link: https://lore.kernel.org/r/20200525211106.27338-1-dnlplm@gmail.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4ab57fadb5bb5dd13ba5f10d5ed09a4e1099ed32
Author: Bin Liu <b-liu@ti.com>
Date:   Wed May 13 16:36:46 2020 -0500

    USB: serial: usb_wwan: do not resubmit rx urb on fatal errors
    
    commit 986c1748c84d7727defeaeca74a73b37f7d5cce1 upstream.
    
    usb_wwan_indat_callback() shouldn't resubmit rx urb if the previous urb
    status is a fatal error. Or the usb controller would keep processing the
    new urbs then run into interrupt storm, and has no chance to recover.
    
    Fixes: 6c1ee66a0b2b ("USB-Serial: Fix error handling of usb_wwan")
    Cc: stable@vger.kernel.org
    Signed-off-by: Bin Liu <b-liu@ti.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 101d0160b5d9ff5205b85566c3dc5ef3dbf15710
Author: Matt Jolly <Kangie@footclan.ninja>
Date:   Thu May 21 10:43:58 2020 +1000

    USB: serial: qcserial: add DW5816e QDL support
    
    commit 3429444abdd9dbd5faebd9bee552ec6162b17ad6 upstream.
    
    Add support for Dell Wireless 5816e Download Mode (AKA boot & hold mode /
    QDL download mode) to drivers/usb/serial/qcserial.c
    
    This is required to update device firmware.
    
    Signed-off-by: Matt Jolly <Kangie@footclan.ninja>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c98adbfd1625a5fa6b26d443cad6c07390e5d439
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Sun Apr 19 14:12:35 2020 +0200

    net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta()
    
    [ Upstream commit a683012a8e77675a1947cc8f11f97cdc1d5bb769 ]
    
    The drivers reports EINVAL to userspace through netlink on invalid meta
    match. This is confusing since EINVAL is usually reserved for malformed
    netlink messages. Replace it by more meaningful codes.
    
    Fixes: 6d65bc64e232 ("net/mlx5e: Add mlx5e_flower_parse_meta support")
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 79fa84ae94d06e29cb98f21ccd8a3e2706b7d349
Author: Davide Caratti <dcaratti@redhat.com>
Date:   Wed May 27 02:04:26 2020 +0200

    net/sched: fix infinite loop in sch_fq_pie
    
    [ Upstream commit bb2f930d6dd708469a587dc9ed1efe1ef969c0bf ]
    
    this command hangs forever:
    
     # tc qdisc add dev eth0 root fq_pie flows 65536
    
     watchdog: BUG: soft lockup - CPU#1 stuck for 23s! [tc:1028]
     [...]
     CPU: 1 PID: 1028 Comm: tc Not tainted 5.7.0-rc6+ #167
     RIP: 0010:fq_pie_init+0x60e/0x8b7 [sch_fq_pie]
     Code: 4c 89 65 50 48 89 f8 48 c1 e8 03 42 80 3c 30 00 0f 85 2a 02 00 00 48 8d 7d 10 4c 89 65 58 48 89 f8 48 c1 e8 03 42 80 3c 30 00 <0f> 85 a7 01 00 00 48 8d 7d 18 48 c7 45 10 46 c3 23 00 48 89 f8 48
     RSP: 0018:ffff888138d67468 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
     RAX: 1ffff9200018d2b2 RBX: ffff888139c1c400 RCX: ffffffffffffffff
     RDX: 000000000000c5e8 RSI: ffffc900000e5000 RDI: ffffc90000c69590
     RBP: ffffc90000c69580 R08: fffffbfff79a9699 R09: fffffbfff79a9699
     R10: 0000000000000700 R11: fffffbfff79a9698 R12: ffffc90000c695d0
     R13: 0000000000000000 R14: dffffc0000000000 R15: 000000002347c5e8
     FS:  00007f01e1850e40(0000) GS:ffff88814c880000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 000000000067c340 CR3: 000000013864c000 CR4: 0000000000340ee0
     Call Trace:
      qdisc_create+0x3fd/0xeb0
      tc_modify_qdisc+0x3be/0x14a0
      rtnetlink_rcv_msg+0x5f3/0x920
      netlink_rcv_skb+0x121/0x350
      netlink_unicast+0x439/0x630
      netlink_sendmsg+0x714/0xbf0
      sock_sendmsg+0xe2/0x110
      ____sys_sendmsg+0x5b4/0x890
      ___sys_sendmsg+0xe9/0x160
      __sys_sendmsg+0xd3/0x170
      do_syscall_64+0x9a/0x370
      entry_SYSCALL_64_after_hwframe+0x44/0xa9
    
    we can't accept 65536 as a valid number for 'nflows', because the loop on
    'idx' in fq_pie_init() will never end. The extack message is correct, but
    it doesn't say that 0 is not a valid number for 'flows': while at it, fix
    this also. Add a tdc selftest to check correct validation of 'flows'.
    
    CC: Ivan Vecera <ivecera@redhat.com>
    Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler")
    Signed-off-by: Davide Caratti <dcaratti@redhat.com>
    Reviewed-by: Ivan Vecera <ivecera@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 63f44aba259208f4939e3798de75cd99dd657462
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Fri May 29 17:43:29 2020 +0200

    mptcp: fix unblocking connect()
    
    [ Upstream commit 41be81a8d3d09acb9033799938306349328861f9 ]
    
    Currently unblocking connect() on MPTCP sockets fails frequently.
    If mptcp_stream_connect() is invoked to complete a previously
    attempted unblocking connection, it will still try to create
    the first subflow via __mptcp_socket_create(). If the 3whs is
    completed and the 'can_ack' flag is already set, the latter
    will fail with -EINVAL.
    
    This change addresses the issue checking for pending connect and
    delegating the completion to the first subflow. Additionally
    do msk addresses and sk_state changes only when needed.
    
    Fixes: 2303f994b3e1 ("mptcp: Associate MPTCP context with TCP socket")
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 691f6c833612df03ecfee7d0f579979bfc6f78e4
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Wed May 27 19:48:03 2020 +0300

    net: dsa: felix: send VLANs on CPU port as egress-tagged
    
    [ Upstream commit 183be6f967fe37c3154bfac39e913c3bafe89d1b ]
    
    As explained in other commits before (b9cd75e66895 and 87b0f983f66f),
    ocelot switches have a single egress-untagged VLAN per port, and the
    driver would deny adding a second one while an egress-untagged VLAN
    already exists.
    
    But on the CPU port (where the VLAN configuration is implicit, because
    there is no net device for the bridge to control), the DSA core attempts
    to add a VLAN using the same flags as were used for the front-panel
    port. This would make adding any untagged VLAN fail due to the CPU port
    rejecting the configuration:
    
    bridge vlan add dev swp0 vid 100 pvid untagged
    [ 1865.854253] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1
    [ 1865.860824] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 5: -16
    
    (note that port 5 is the CPU port and not the front-panel swp0).
    
    So this hardware will send all VLANs as tagged towards the CPU.
    
    Fixes: 56051948773e ("net: dsa: ocelot: add driver for Felix switch family")
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b96fb681ca789629b8ba3da99ca3b2e6fa807f0a
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu May 28 14:57:47 2020 -0700

    net: be more gentle about silly gso requests coming from user
    
    [ Upstream commit 7c6d2ecbda83150b2036a2b36b21381ad4667762 ]
    
    Recent change in virtio_net_hdr_to_skb() broke some packetdrill tests.
    
    When --mss=XXX option is set, packetdrill always provide gso_type & gso_size
    for its inbound packets, regardless of packet size.
    
            if (packet->tcp && packet->mss) {
                    if (packet->ipv4)
                            gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
                    else
                            gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
                    gso.gso_size = packet->mss;
            }
    
    Since many other programs could do the same, relax virtio_net_hdr_to_skb()
    to no longer return an error, but instead ignore gso settings.
    
    This keeps Willem intent to make sure no malicious packet could
    reach gso stack.
    
    Note that TCP stack has a special logic in tcp_set_skb_tso_segs()
    to clear gso_size for small packets.
    
    Fixes: 6dd912f82680 ("net: check untrusted gso_size at kernel entry")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Willem de Bruijn <willemb@google.com>
    Acked-by: Willem de Bruijn <willemb@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d618b184faa41591f20b00a4365bd552ef71255f
Author: Stefano Garzarella <sgarzare@redhat.com>
Date:   Wed May 27 09:56:55 2020 +0200

    vsock: fix timeout in vsock_accept()
    
    [ Upstream commit 7e0afbdfd13d1e708fe96e31c46c4897101a6a43 ]
    
    The accept(2) is an "input" socket interface, so we should use
    SO_RCVTIMEO instead of SO_SNDTIMEO to set the timeout.
    
    So this patch replace sock_sndtimeo() with sock_rcvtimeo() to
    use the right timeout in the vsock_accept().
    
    Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
    Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
    Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 671bd7fc37d329515637bcf08b807ecaaecc7df9
Author: Jia He <justin.he@arm.com>
Date:   Sat May 30 09:38:28 2020 +0800

    virtio_vsock: Fix race condition in virtio_transport_recv_pkt
    
    [ Upstream commit 8692cefc433f282228fd44938dd4d26ed38254a2 ]
    
    When client on the host tries to connect(SOCK_STREAM, O_NONBLOCK) to the
    server on the guest, there will be a panic on a ThunderX2 (armv8a server):
    
    [  463.718844] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
    [  463.718848] Mem abort info:
    [  463.718849]   ESR = 0x96000044
    [  463.718852]   EC = 0x25: DABT (current EL), IL = 32 bits
    [  463.718853]   SET = 0, FnV = 0
    [  463.718854]   EA = 0, S1PTW = 0
    [  463.718855] Data abort info:
    [  463.718856]   ISV = 0, ISS = 0x00000044
    [  463.718857]   CM = 0, WnR = 1
    [  463.718859] user pgtable: 4k pages, 48-bit VAs, pgdp=0000008f6f6e9000
    [  463.718861] [0000000000000000] pgd=0000000000000000
    [  463.718866] Internal error: Oops: 96000044 [#1] SMP
    [...]
    [  463.718977] CPU: 213 PID: 5040 Comm: vhost-5032 Tainted: G           O      5.7.0-rc7+ #139
    [  463.718980] Hardware name: GIGABYTE R281-T91-00/MT91-FS1-00, BIOS F06 09/25/2018
    [  463.718982] pstate: 60400009 (nZCv daif +PAN -UAO)
    [  463.718995] pc : virtio_transport_recv_pkt+0x4c8/0xd40 [vmw_vsock_virtio_transport_common]
    [  463.718999] lr : virtio_transport_recv_pkt+0x1fc/0xd40 [vmw_vsock_virtio_transport_common]
    [  463.719000] sp : ffff80002dbe3c40
    [...]
    [  463.719025] Call trace:
    [  463.719030]  virtio_transport_recv_pkt+0x4c8/0xd40 [vmw_vsock_virtio_transport_common]
    [  463.719034]  vhost_vsock_handle_tx_kick+0x360/0x408 [vhost_vsock]
    [  463.719041]  vhost_worker+0x100/0x1a0 [vhost]
    [  463.719048]  kthread+0x128/0x130
    [  463.719052]  ret_from_fork+0x10/0x18
    
    The race condition is as follows:
    Task1                                Task2
    =====                                =====
    __sock_release                       virtio_transport_recv_pkt
      __vsock_release                      vsock_find_bound_socket (found sk)
        lock_sock_nested
        vsock_remove_sock
        sock_orphan
          sk_set_socket(sk, NULL)
        sk->sk_shutdown = SHUTDOWN_MASK
        ...
        release_sock
                                        lock_sock
                                           virtio_transport_recv_connecting
                                             sk->sk_socket->state (panic!)
    
    The root cause is that vsock_find_bound_socket can't hold the lock_sock,
    so there is a small race window between vsock_find_bound_socket() and
    lock_sock(). If __vsock_release() is running in another task,
    sk->sk_socket will be set to NULL inadvertently.
    
    This fixes it by checking sk->sk_shutdown(suggested by Stefano) after
    lock_sock since sk->sk_shutdown is set to SHUTDOWN_MASK under the
    protection of lock_sock_nested.
    
    Signed-off-by: Jia He <justin.he@arm.com>
    Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7264f7053779c632e74d2845145a7c3201a2253c
Author: Jonas Falkevik <jonas.falkevik@gmail.com>
Date:   Wed May 27 11:56:40 2020 +0200

    sctp: check assoc before SCTP_ADDR_{MADE_PRIM, ADDED} event
    
    [ Upstream commit 45ebf73ebcec88a34a778f5feaa0b82b1c76069e ]
    
    Make sure SCTP_ADDR_{MADE_PRIM,ADDED} are sent only for associations
    that have been established.
    
    These events are described in rfc6458#section-6.1
    SCTP_PEER_ADDR_CHANGE:
    This tag indicates that an address that is
    part of an existing association has experienced a change of
    state (e.g., a failure or return to service of the reachability
    of an endpoint via a specific transport address).
    
    Signed-off-by: Jonas Falkevik <jonas.falkevik@gmail.com>
    Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
    Reviewed-by: Xin Long <lucien.xin@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 96238d3d706140a31995a36d8a32e6c6183b12cc
Author: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Date:   Wed May 27 09:44:20 2020 +0200

    nfp: flower: fix used time of merge flow statistics
    
    [ Upstream commit 5b186cd60f033110960a3db424ffbd6de4cee528 ]
    
    Prior to this change the correct value for the used counter is calculated
    but not stored nor, therefore, propagated to user-space. In use-cases such
    as OVS use-case at least this results in active flows being removed from
    the hardware datapath. Which results in both unnecessary flow tear-down
    and setup, and packet processing on the host.
    
    This patch addresses the problem by saving the calculated used value
    which allows the value to propagate to user-space.
    
    Found by inspection.
    
    Fixes: aa6ce2ea0c93 ("nfp: flower: support stats update for merge flows")
    Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
    Signed-off-by: Simon Horman <simon.horman@netronome.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bbb1c1a6c491e71516fdfc831642f084311e4133
Author: Chuhong Yuan <hslester96@gmail.com>
Date:   Thu May 28 18:20:37 2020 +0800

    NFC: st21nfca: add missed kfree_skb() in an error path
    
    [ Upstream commit 3decabdc714ca56c944f4669b4cdec5c2c1cea23 ]
    
    st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path.
    Add the missed function call to fix it.
    
    Fixes: 1892bf844ea0 ("NFC: st21nfca: Adding P2P support to st21nfca in Initiator & Target mode")
    Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 64b28160be9c3f70d722454e4a54c945862a1a7a
Author: Daniele Palmas <dnlplm@gmail.com>
Date:   Mon May 25 23:25:37 2020 +0200

    net: usb: qmi_wwan: add Telit LE910C1-EUX composition
    
    [ Upstream commit 591612aa578cd7148b7b9d74869ef40118978389 ]
    
    Add support for Telit LE910C1-EUX composition
    
    0x1031: tty, tty, tty, rmnet
    Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
    Acked-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a0722dbaaf06942ee80ce469e11472baf28154bc
Author: Fugang Duan <fugang.duan@nxp.com>
Date:   Mon May 25 16:18:14 2020 +0800

    net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a
    
    [ Upstream commit f2fb6b6275eba9d312957ca44c487bd780da6169 ]
    
    For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
    PTP v2/802.AS1, any layer, any kind of event packet, but HW only
    take timestamp snapshot for below PTP message: sync, Pdelay_req,
    Pdelay_resp.
    
    Then it causes below issue when test E2E case:
    ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
    ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
    ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
    ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
    ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
    ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
    ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
    ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
    ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp
    
    Timestamp snapshot dependency on register bits in received path:
    SNAPTYPSEL TSMSTRENA TSEVNTENA  PTP_Messages
    01         x         0          SYNC, Follow_Up, Delay_Req,
                                    Delay_Resp, Pdelay_Req, Pdelay_Resp,
                                    Pdelay_Resp_Follow_Up
    01         0         1          SYNC, Pdelay_Req, Pdelay_Resp
    
    For dwmac v5.10a, enabling all events by setting register
    DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
    to 0’b0, which can support all required events.
    
    Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 01212948daab4616e409d2e70fc961340cc9378e
Author: Mark Bloch <markb@mellanox.com>
Date:   Wed May 20 17:32:08 2020 +0000

    net/mlx5: Fix crash upon suspend/resume
    
    [ Upstream commit 8fc3e29be9248048f449793502c15af329f35c6e ]
    
    Currently a Linux system with the mlx5 NIC always crashes upon
    hibernation - suspend/resume.
    
    Add basic callbacks so the NIC could be suspended and resumed.
    
    Fixes: 9603b61de1ee ("mlx5: Move pci device handling from mlx5_ib to mlx5_core")
    Tested-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Mark Bloch <markb@mellanox.com>
    Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 17e1f3e32239025a3ace1eb4f163796cf5708f7d
Author: Willem de Bruijn <willemb@google.com>
Date:   Mon May 25 15:07:40 2020 -0400

    net: check untrusted gso_size at kernel entry
    
    [ Upstream commit 6dd912f82680761d8fb6b1bb274a69d4c7010988 ]
    
    Syzkaller again found a path to a kernel crash through bad gso input:
    a packet with gso size exceeding len.
    
    These packets are dropped in tcp_gso_segment and udp[46]_ufo_fragment.
    But they may affect gso size calculations earlier in the path.
    
    Now that we have thlen as of commit 9274124f023b ("net: stricter
    validation of untrusted gso packets"), check gso_size at entry too.
    
    Fixes: bfd5f4a3d605 ("packet: Add GSO/csum offload support.")
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Signed-off-by: Willem de Bruijn <willemb@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 40af2e037fe11fec2a60b754a1b1c44cc27c904c
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri May 29 11:20:53 2020 -0700

    l2tp: do not use inet_hash()/inet_unhash()
    
    [ Upstream commit 02c71b144c811bcdd865e0a1226d0407d11357e8 ]
    
    syzbot recently found a way to crash the kernel [1]
    
    Issue here is that inet_hash() & inet_unhash() are currently
    only meant to be used by TCP & DCCP, since only these protocols
    provide the needed hashinfo pointer.
    
    L2TP uses a single list (instead of a hash table)
    
    This old bug became an issue after commit 610236587600
    ("bpf: Add new cgroup attach type to enable sock modifications")
    since after this commit, sk_common_release() can be called
    while the L2TP socket is still considered 'hashed'.
    
    general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
    KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
    CPU: 0 PID: 7063 Comm: syz-executor654 Not tainted 5.7.0-rc6-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    RIP: 0010:inet_unhash+0x11f/0x770 net/ipv4/inet_hashtables.c:600
    Code: 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e dd 04 00 00 48 8d 7d 08 44 8b 73 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 55 05 00 00 48 8d 7d 14 4c 8b 6d 08 48 b8 00 00
    RSP: 0018:ffffc90001777d30 EFLAGS: 00010202
    RAX: dffffc0000000000 RBX: ffff88809a6df940 RCX: ffffffff8697c242
    RDX: 0000000000000001 RSI: ffffffff8697c251 RDI: 0000000000000008
    RBP: 0000000000000000 R08: ffff88809f3ae1c0 R09: fffffbfff1514cc1
    R10: ffffffff8a8a6607 R11: fffffbfff1514cc0 R12: ffff88809a6df9b0
    R13: 0000000000000007 R14: 0000000000000000 R15: ffffffff873a4d00
    FS:  0000000001d2b880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00000000006cd090 CR3: 000000009403a000 CR4: 00000000001406f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     sk_common_release+0xba/0x370 net/core/sock.c:3210
     inet_create net/ipv4/af_inet.c:390 [inline]
     inet_create+0x966/0xe00 net/ipv4/af_inet.c:248
     __sock_create+0x3cb/0x730 net/socket.c:1428
     sock_create net/socket.c:1479 [inline]
     __sys_socket+0xef/0x200 net/socket.c:1521
     __do_sys_socket net/socket.c:1530 [inline]
     __se_sys_socket net/socket.c:1528 [inline]
     __x64_sys_socket+0x6f/0xb0 net/socket.c:1528
     do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
     entry_SYSCALL_64_after_hwframe+0x49/0xb3
    RIP: 0033:0x441e29
    Code: e8 fc b3 02 00 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 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
    RSP: 002b:00007ffdce184148 EFLAGS: 00000246 ORIG_RAX: 0000000000000029
    RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441e29
    RDX: 0000000000000073 RSI: 0000000000000002 RDI: 0000000000000002
    RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
    R13: 0000000000402c30 R14: 0000000000000000 R15: 0000000000000000
    Modules linked in:
    ---[ end trace 23b6578228ce553e ]---
    RIP: 0010:inet_unhash+0x11f/0x770 net/ipv4/inet_hashtables.c:600
    Code: 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e dd 04 00 00 48 8d 7d 08 44 8b 73 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 55 05 00 00 48 8d 7d 14 4c 8b 6d 08 48 b8 00 00
    RSP: 0018:ffffc90001777d30 EFLAGS: 00010202
    RAX: dffffc0000000000 RBX: ffff88809a6df940 RCX: ffffffff8697c242
    RDX: 0000000000000001 RSI: ffffffff8697c251 RDI: 0000000000000008
    RBP: 0000000000000000 R08: ffff88809f3ae1c0 R09: fffffbfff1514cc1
    R10: ffffffff8a8a6607 R11: fffffbfff1514cc0 R12: ffff88809a6df9b0
    R13: 0000000000000007 R14: 0000000000000000 R15: ffffffff873a4d00
    FS:  0000000001d2b880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00000000006cd090 CR3: 000000009403a000 CR4: 00000000001406f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    
    Fixes: 0d76751fad77 ("l2tp: Add L2TPv3 IP encapsulation (no UDP) support")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: James Chapman <jchapman@katalix.com>
    Cc: Andrii Nakryiko <andriin@fb.com>
    Reported-by: syzbot+3610d489778b57cc8031@syzkaller.appspotmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 66ded1664dd13d8bf44f205994decafd6515f9a5
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri May 29 11:32:25 2020 -0700

    l2tp: add sk_family checks to l2tp_validate_socket
    
    [ Upstream commit d9a81a225277686eb629938986d97629ea102633 ]
    
    syzbot was able to trigger a crash after using an ISDN socket
    and fool l2tp.
    
    Fix this by making sure the UDP socket is of the proper family.
    
    BUG: KASAN: slab-out-of-bounds in setup_udp_tunnel_sock+0x465/0x540 net/ipv4/udp_tunnel.c:78
    Write of size 1 at addr ffff88808ed0c590 by task syz-executor.5/3018
    
    CPU: 0 PID: 3018 Comm: syz-executor.5 Not tainted 5.7.0-rc6-syzkaller #0
    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+0x188/0x20d lib/dump_stack.c:118
     print_address_description.constprop.0.cold+0xd3/0x413 mm/kasan/report.c:382
     __kasan_report.cold+0x20/0x38 mm/kasan/report.c:511
     kasan_report+0x33/0x50 mm/kasan/common.c:625
     setup_udp_tunnel_sock+0x465/0x540 net/ipv4/udp_tunnel.c:78
     l2tp_tunnel_register+0xb15/0xdd0 net/l2tp/l2tp_core.c:1523
     l2tp_nl_cmd_tunnel_create+0x4b2/0xa60 net/l2tp/l2tp_netlink.c:249
     genl_family_rcv_msg_doit net/netlink/genetlink.c:673 [inline]
     genl_family_rcv_msg net/netlink/genetlink.c:718 [inline]
     genl_rcv_msg+0x627/0xdf0 net/netlink/genetlink.c:735
     netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2469
     genl_rcv+0x24/0x40 net/netlink/genetlink.c:746
     netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
     netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
     netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
     sock_sendmsg_nosec net/socket.c:652 [inline]
     sock_sendmsg+0xcf/0x120 net/socket.c:672
     ____sys_sendmsg+0x6e6/0x810 net/socket.c:2352
     ___sys_sendmsg+0x100/0x170 net/socket.c:2406
     __sys_sendmsg+0xe5/0x1b0 net/socket.c:2439
     do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
     entry_SYSCALL_64_after_hwframe+0x49/0xb3
    RIP: 0033:0x45ca29
    Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
    RSP: 002b:00007effe76edc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
    RAX: ffffffffffffffda RBX: 00000000004fe1c0 RCX: 000000000045ca29
    RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000005
    RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
    R13: 000000000000094e R14: 00000000004d5d00 R15: 00007effe76ee6d4
    
    Allocated by task 3018:
     save_stack+0x1b/0x40 mm/kasan/common.c:49
     set_track mm/kasan/common.c:57 [inline]
     __kasan_kmalloc mm/kasan/common.c:495 [inline]
     __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:468
     __do_kmalloc mm/slab.c:3656 [inline]
     __kmalloc+0x161/0x7a0 mm/slab.c:3665
     kmalloc include/linux/slab.h:560 [inline]
     sk_prot_alloc+0x223/0x2f0 net/core/sock.c:1612
     sk_alloc+0x36/0x1100 net/core/sock.c:1666
     data_sock_create drivers/isdn/mISDN/socket.c:600 [inline]
     mISDN_sock_create+0x272/0x400 drivers/isdn/mISDN/socket.c:796
     __sock_create+0x3cb/0x730 net/socket.c:1428
     sock_create net/socket.c:1479 [inline]
     __sys_socket+0xef/0x200 net/socket.c:1521
     __do_sys_socket net/socket.c:1530 [inline]
     __se_sys_socket net/socket.c:1528 [inline]
     __x64_sys_socket+0x6f/0xb0 net/socket.c:1528
     do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
     entry_SYSCALL_64_after_hwframe+0x49/0xb3
    
    Freed by task 2484:
     save_stack+0x1b/0x40 mm/kasan/common.c:49
     set_track mm/kasan/common.c:57 [inline]
     kasan_set_free_info mm/kasan/common.c:317 [inline]
     __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:456
     __cache_free mm/slab.c:3426 [inline]
     kfree+0x109/0x2b0 mm/slab.c:3757
     kvfree+0x42/0x50 mm/util.c:603
     __free_fdtable+0x2d/0x70 fs/file.c:31
     put_files_struct fs/file.c:420 [inline]
     put_files_struct+0x248/0x2e0 fs/file.c:413
     exit_files+0x7e/0xa0 fs/file.c:445
     do_exit+0xb04/0x2dd0 kernel/exit.c:791
     do_group_exit+0x125/0x340 kernel/exit.c:894
     get_signal+0x47b/0x24e0 kernel/signal.c:2739
     do_signal+0x81/0x2240 arch/x86/kernel/signal.c:784
     exit_to_usermode_loop+0x26c/0x360 arch/x86/entry/common.c:161
     prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
     syscall_return_slowpath arch/x86/entry/common.c:279 [inline]
     do_syscall_64+0x6b1/0x7d0 arch/x86/entry/common.c:305
     entry_SYSCALL_64_after_hwframe+0x49/0xb3
    
    The buggy address belongs to the object at ffff88808ed0c000
     which belongs to the cache kmalloc-2k of size 2048
    The buggy address is located 1424 bytes inside of
     2048-byte region [ffff88808ed0c000, ffff88808ed0c800)
    The buggy address belongs to the page:
    page:ffffea00023b4300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
    flags: 0xfffe0000000200(slab)
    raw: 00fffe0000000200 ffffea0002838208 ffffea00015ba288 ffff8880aa000e00
    raw: 0000000000000000 ffff88808ed0c000 0000000100000001 0000000000000000
    page dumped because: kasan: bad access detected
    
    Memory state around the buggy address:
     ffff88808ed0c480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     ffff88808ed0c500: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
    >ffff88808ed0c580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                             ^
     ffff88808ed0c600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
     ffff88808ed0c680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    
    Fixes: 6b9f34239b00 ("l2tp: fix races in tunnel creation")
    Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: James Chapman <jchapman@katalix.com>
    Cc: Guillaume Nault <gnault@redhat.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Acked-by: Guillaume Nault <gnault@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7c4f41c330a890ee70828f843d7275518055a3fa
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Sat May 30 11:34:33 2020 +0800

    devinet: fix memleak in inetdev_init()
    
    [ Upstream commit 1b49cd71b52403822731dc9f283185d1da355f97 ]
    
    When devinet_sysctl_register() failed, the memory allocated
    in neigh_parms_alloc() should be freed.
    
    Fixes: 20e61da7ffcf ("ipv4: fail early when creating netdev named all or default")
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>