commit ad13e142e024aa194016a32de8b9ba058fe9a6af
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu Apr 2 15:11:03 2020 +0200

    Linux 5.4.30

commit 9e62b6673d14512790735639cc0f3a28079e9a67
Author: Madalin Bucur <madalin.bucur@oss.nxp.com>
Date:   Mon Mar 16 14:05:58 2020 +0200

    arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode
    
    commit d79e9d7c1e4ba5f95f2ff3541880c40ea9722212 upstream.
    
    The correct setting for the RGMII ports on LS1046ARDB is to
    enable delay on both Rx and Tx so the interface mode used must
    be PHY_INTERFACE_MODE_RGMII_ID.
    
    Since commit 1b3047b5208a80 ("net: phy: realtek: add support for
    configuring the RX delay on RTL8211F") the Realtek 8211F PHY driver
    has control over the RGMII RX delay and it is disabling it for
    RGMII_TXID. The LS1046ARDB uses two such PHYs in RGMII_ID mode but
    in the device tree the mode was described as "rgmii".
    
    Changing the phy-connection-type to "rgmii-id" to address the issue.
    
    Fixes: 3fa395d2c48a ("arm64: dts: add LS1046A DPAA FMan nodes")
    Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c399a50ae87815c61b0c70a8038c66cbd026e97a
Author: Madalin Bucur <madalin.bucur@oss.nxp.com>
Date:   Mon Mar 16 14:05:57 2020 +0200

    arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id
    
    commit 4022d808c45277693ea86478fab1f081ebf997e8 upstream.
    
    The correct setting for the RGMII ports on LS1043ARDB is to
    enable delay on both Rx and Tx so the interface mode used must
    be PHY_INTERFACE_MODE_RGMII_ID.
    
    Since commit 1b3047b5208a80 ("net: phy: realtek: add support for
    configuring the RX delay on RTL8211F") the Realtek 8211F PHY driver
    has control over the RGMII RX delay and it is disabling it for
    RGMII_TXID. The LS1043ARDB uses two such PHYs in RGMII_ID mode but
    in the device tree the mode was described as "rgmii_txid".
    This issue was not apparent at the time as the PHY driver took the
    same action for RGMII_TXID and RGMII_ID back then but it became
    visible (RX no longer working) after the above patch.
    
    Changing the phy-connection-type to "rgmii-id" to address the issue.
    
    Fixes: bf02f2ffe59c ("arm64: dts: add LS1043A DPAA FMan support")
    Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5aa29219206ad5f6e6d3e3f2729c32caab8b6cad
Author: Chen-Yu Tsai <wens@csie.org>
Date:   Wed Mar 11 01:47:07 2020 +0800

    ARM: dts: sun8i: r40: Move AHCI device node based on address order
    
    commit fe3a04824f75786e39ed74e82fb6cb2534c95fe4 upstream.
    
    When the AHCI device node was added, it was added in the wrong location
    in the device tree file. The device nodes should be sorted by register
    address.
    
    Move the device node to before EHCI1, where it belongs.
    
    Fixes: 41c64d3318aa ("ARM: dts: sun8i: r40: add sata node")
    Acked-by: Maxime Ripard <mripard@kernel.org>
    Reviewed-by: Andre Przywara <andre.przywara@arm.com>
    Signed-off-by: Chen-Yu Tsai <wens@csie.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8f1199341837acfcee4f2155c73ea6990bf68820
Author: Arthur Demchenkov <spinal.by@gmail.com>
Date:   Sun Mar 8 22:19:33 2020 +0300

    ARM: dts: N900: fix onenand timings
    
    commit 0c5220a3c1242c7a2451570ed5f5af69620aac75 upstream.
    
    Commit a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
    started using DT specified timings for GPMC, and as a result the
    OneNAND stopped working on N900 as we had wrong values in the DT.
    Fix by updating the values to bootloader timings that have been tested
    to be working on Nokia N900 with OneNAND manufacturers: Samsung,
    Numonyx.
    
    Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
    Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com>
    Tested-by: Merlijn Wajer <merlijn@wizzup.org>
    Reviewed-by: Roger Quadros <rogerq@ti.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 89ecba47b39158d0d7548adeb8358386460bdc9a
Author: Marco Felsch <m.felsch@pengutronix.de>
Date:   Thu Feb 27 12:02:46 2020 +0100

    ARM: dts: imx6: phycore-som: fix arm and soc minimum voltage
    
    commit 636b45b8efa91db05553840b6c0120d6fa6b94fa upstream.
    
    The current set minimum voltage of 730000µV seems to be wrong. I don't
    know the document which specifies that but the imx6qdl datasheets says
    that the minimum voltage should be 0.925V for VDD_ARM (LDO bypassed,
    lowest opp) and 1.15V for VDD_SOC (LDO bypassed, lowest opp).
    
    Fixes: ddec5d1c0047 ("ARM: dts: imx6: Add initial support for phyCORE-i.MX 6 SOM")
    Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bb4ec20d16874cc8ec1b4979d710671dadc5a132
Author: Nick Hudson <skrll@netbsd.org>
Date:   Thu Mar 12 09:03:45 2020 +0000

    ARM: bcm2835-rpi-zero-w: Add missing pinctrl name
    
    commit 6687c201fdc3139315c2ea7ef96c157672805cdc upstream.
    
    Define the sdhci pinctrl state as "default" so it gets applied
    correctly and to match all other RPis.
    
    Fixes: 2c7c040c73e9 ("ARM: dts: bcm2835: Add Raspberry Pi Zero W")
    Signed-off-by: Nick Hudson <skrll@netbsd.org>
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e58eb564e1fc651611be5862b313e38d0b5d5fd1
Author: Sungbo Eo <mans0n@gorani.run>
Date:   Sat Mar 21 23:36:53 2020 +0900

    ARM: dts: oxnas: Fix clear-mask property
    
    commit deeabb4c1341a12bf8b599e6a2f4cfa4fd74738c upstream.
    
    Disable all rps-irq interrupts during driver initialization to prevent
    an accidental interrupt on GIC.
    
    Fixes: 84316f4ef141 ("ARM: boot: dts: Add Oxford Semiconductor OX810SE dtsi")
    Fixes: 38d4a53733f5 ("ARM: dts: Add support for OX820 and Pogoplug V3")
    Signed-off-by: Sungbo Eo <mans0n@gorani.run>
    Acked-by: Neil Armstrong <narmstrong@baylibre.com>
    Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a1081413e834508938949d2896eae97c2105e4f4
Author: disconnect3d <dominik.b.czarnota@gmail.com>
Date:   Mon Mar 9 11:48:53 2020 +0100

    perf map: Fix off by one in strncpy() size argument
    
    commit db2c549407d4a76563c579e4768f7d6d32afefba upstream.
    
    This patch fixes an off-by-one error in strncpy size argument in
    tools/perf/util/map.c. The issue is that in:
    
            strncmp(filename, "/system/lib/", 11)
    
    the passed string literal: "/system/lib/" has 12 bytes (without the NULL
    byte) and the passed size argument is 11. As a result, the logic won't
    match the ending "/" byte and will pass filepaths that are stored in
    other directories e.g. "/system/libmalicious/bin" or just
    "/system/libmalicious".
    
    This functionality seems to be present only on Android. I assume the
    /system/ directory is only writable by the root user, so I don't think
    this bug has much (or any) security impact.
    
    Fixes: eca818369996 ("perf tools: Add automatic remapping of Android libraries")
    Signed-off-by: disconnect3d <dominik.b.czarnota@gmail.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Changbin Du <changbin.du@intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: John Keeping <john@metanate.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Michael Lentine <mlentine@google.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Song Liu <songliubraving@fb.com>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lore.kernel.org/lkml/20200309104855.3775-1-dominik.b.czarnota@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 451bf4d9592aca43e6cd025577399fa712c937d6
Author: Ilie Halip <ilie.halip@gmail.com>
Date:   Thu Mar 19 23:45:28 2020 +0200

    arm64: alternative: fix build with clang integrated assembler
    
    commit 6f5459da2b8736720afdbd67c4bd2d1edba7d0e3 upstream.
    
    Building an arm64 defconfig with clang's integrated assembler, this error
    occurs:
        <instantiation>:2:2: error: unrecognized instruction mnemonic
         _ASM_EXTABLE 9999b, 9f
         ^
        arch/arm64/mm/cache.S:50:1: note: while in macro instantiation
        user_alt 9f, "dc cvau, x4", "dc civac, x4", 0
        ^
    
    While GNU as seems fine with case-sensitive macro instantiations, clang
    doesn't, so use the actual macro name (_asm_extable) as in the rest of
    the file.
    
    Also checked that the generated assembly matches the GCC output.
    
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
    Tested-by: Nick Desaulniers <ndesaulniers@google.com>
    Fixes: 290622efc76e ("arm64: fix "dc cvau" cache operation on errata-affected core")
    Link: https://github.com/ClangBuiltLinux/linux/issues/924
    Signed-off-by: Ilie Halip <ilie.halip@gmail.com>
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 693860e79552bbb157cb0b374aa3071e23a62ff4
Author: Ilya Dryomov <idryomov@gmail.com>
Date:   Tue Mar 10 16:19:01 2020 +0100

    libceph: fix alloc_msg_with_page_vector() memory leaks
    
    commit e886274031200bb60965c1b9c49b7acda56a93bd upstream.
    
    Make it so that CEPH_MSG_DATA_PAGES data item can own pages,
    fixing a bunch of memory leaks for a page vector allocated in
    alloc_msg_with_page_vector().  Currently, only watch-notify
    messages trigger this allocation, and normally the page vector
    is freed either in handle_watch_notify() or by the caller of
    ceph_osdc_notify().  But if the message is freed before that
    (e.g. if the session faults while reading in the message or
    if the notify is stale), we leak the page vector.
    
    This was supposed to be fixed by switching to a message-owned
    pagelist, but that never happened.
    
    Fixes: 1907920324f1 ("libceph: support for sending notifies")
    Reported-by: Roman Penyaev <rpenyaev@suse.de>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Reviewed-by: Roman Penyaev <rpenyaev@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 61bbc823a17abb3798568cfb11ff38fc22317442
Author: Tony Lindgren <tony@atomide.com>
Date:   Fri Feb 21 09:10:30 2020 -0800

    clk: ti: am43xx: Fix clock parent for RTC clock
    
    commit 5f3d9b07b9bb4679922f0b2e2baa770e74a6bbd3 upstream.
    
    Currently enabling clkctrl clock on am4 can fail for RTC as the clock
    parent is wrong for RTC.
    
    Fixes: 76a1049b84dd ("clk: ti: am43xx: add new clkctrl data for am43xx")
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Link: https://lkml.kernel.org/r/20200221171030.39326-1-tony@atomide.com
    Acked-by: Tero Kristo <t-kristo@ti.com>
    Signed-off-by: Stephen Boyd <sboyd@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b2efabe3f88cf568537f98c315474ad61e74a3cc
Author: Leonard Crestez <leonard.crestez@nxp.com>
Date:   Thu Feb 20 18:29:33 2020 +0200

    clk: imx: Align imx sc clock parent msg structs to 4
    
    commit 8400ab8896324641243b57fc49b448023c07409a upstream.
    
    The imx SC api strongly assumes that messages are composed out of
    4-bytes words but some of our message structs have odd sizeofs.
    
    This produces many oopses with CONFIG_KASAN=y.
    
    Fix by marking with __aligned(4).
    
    Fixes: 666aed2d13ee ("clk: imx: scu: add set parent support")
    Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
    Link: https://lkml.kernel.org/r/aad021e432b3062c142973d09b766656eec18fde.1582216144.git.leonard.crestez@nxp.com
    Signed-off-by: Stephen Boyd <sboyd@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4a3c7e1c807f77bd865f584635aeeed36415e04f
Author: Leonard Crestez <leonard.crestez@nxp.com>
Date:   Thu Feb 20 18:29:32 2020 +0200

    clk: imx: Align imx sc clock msg structs to 4
    
    commit a0ae04a25650fd51b7106e742d27333e502173c6 upstream.
    
    The imx SC api strongly assumes that messages are composed out of
    4-bytes words but some of our message structs have odd sizeofs.
    
    This produces many oopses with CONFIG_KASAN=y.
    
    Fix by marking with __aligned(4).
    
    Fixes: fe37b4820417 ("clk: imx: add scu clock common part")
    Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
    Link: https://lkml.kernel.org/r/10e97a04980d933b2cfecb6b124bf9046b6e4f16.1582216144.git.leonard.crestez@nxp.com
    Signed-off-by: Stephen Boyd <sboyd@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 08479b1391cb6a30b64d63d3aad2f7c85af6b605
Author: Marek Vasut <marex@denx.de>
Date:   Wed Mar 25 15:25:47 2020 +0100

    net: ks8851-ml: Fix IO operations, again
    
    commit 8262e6f9b1034ede34548a04dec4c302d92c9497 upstream.
    
    This patch reverts 58292104832f ("net: ks8851-ml: Fix 16-bit IO operation")
    and edacb098ea9c ("net: ks8851-ml: Fix 16-bit data access"), because it
    turns out these were only necessary due to buggy hardware. This patch adds
    a check for such a buggy hardware to prevent any such mistakes again.
    
    While working further on the KS8851 driver, it came to light that the
    KS8851-16MLL is capable of switching bus endianness by a hardware strap,
    EESK pin. If this strap is incorrect, the IO accesses require such endian
    swapping as is being reverted by this patch. Such swapping also impacts
    the performance significantly.
    
    Hence, in addition to removing it, detect that the hardware is broken,
    report to user, and fail to bind with such hardware.
    
    Fixes: 58292104832f ("net: ks8851-ml: Fix 16-bit IO operation")
    Fixes: edacb098ea9c ("net: ks8851-ml: Fix 16-bit data access")
    Signed-off-by: Marek Vasut <marex@denx.de>
    Cc: David S. Miller <davem@davemloft.net>
    Cc: Lukas Wunner <lukas@wunner.de>
    Cc: Petr Stetiar <ynezz@true.cz>
    Cc: YueHaibing <yuehaibing@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 62465fd66323465ca6d928185f2fef3c0ba52705
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Mon Mar 2 12:12:25 2020 +0100

    gpiolib: acpi: Add quirk to ignore EC wakeups on HP x2 10 CHT + AXP288 model
    
    commit 0c625ccfe6f754d0896b8881f5c85bcb81699f1f upstream.
    
    There are at least 3 models of the HP x2 10 models:
    
    Bay Trail SoC + AXP288 PMIC
    Cherry Trail SoC + AXP288 PMIC
    Cherry Trail SoC + TI PMIC
    
    Like on the other HP x2 10 models we need to ignore wakeup for ACPI GPIO
    events on the external embedded-controller pin to avoid spurious wakeups
    on the HP x2 10 CHT + AXP288 model too.
    
    This commit adds an extra DMI based quirk for the HP x2 10 CHT + AXP288
    model, ignoring wakeups for ACPI GPIO events on the EC interrupt pin
    on this model. This fixes spurious wakeups from suspend on this model.
    
    Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")
    Reported-and-tested-by: Marc Lehmann <schmorp@schmorp.de>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Link: https://lore.kernel.org/r/20200302111225.6641-4-hdegoede@redhat.com
    Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 877f28596da26273227897605966b8e631d2a420
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Fri Mar 20 17:22:58 2020 +0100

    bpf: Explicitly memset some bpf info structures declared on the stack
    
    commit 5c6f25887963f15492b604dd25cb149c501bbabf upstream.
    
    Trying to initialize a structure with "= {};" will not always clean out
    all padding locations in a structure. So be explicit and call memset to
    initialize everything for a number of bpf information structures that
    are then copied from userspace, sometimes from smaller memory locations
    than the size of the structure.
    
    Reported-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Yonghong Song <yhs@fb.com>
    Link: https://lore.kernel.org/bpf/20200320162258.GA794295@kroah.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e92528a8984e613afead703947282f069bd8b240
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Fri Mar 20 10:48:13 2020 +0100

    bpf: Explicitly memset the bpf_attr structure
    
    commit 8096f229421f7b22433775e928d506f0342e5907 upstream.
    
    For the bpf syscall, we are relying on the compiler to properly zero out
    the bpf_attr union that we copy userspace data into. Unfortunately that
    doesn't always work properly, padding and other oddities might not be
    correctly zeroed, and in some tests odd things have been found when the
    stack is pre-initialized to other values.
    
    Fix this by explicitly memsetting the structure to 0 before using it.
    
    Reported-by: Maciej Żenczykowski <maze@google.com>
    Reported-by: John Stultz <john.stultz@linaro.org>
    Reported-by: Alexander Potapenko <glider@google.com>
    Reported-by: Alistair Delva <adelva@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Yonghong Song <yhs@fb.com>
    Link: https://android-review.googlesource.com/c/kernel/common/+/1235490
    Link: https://lore.kernel.org/bpf/20200320094813.GA421650@kroah.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d3e215554a6c4bd9007db38ba9ea2216b0e8f78d
Author: Georg Müller <georgmueller@gmx.net>
Date:   Mon Feb 3 21:11:06 2020 +0100

    platform/x86: pmc_atom: Add Lex 2I385SW to critclk_systems DMI table
    
    commit 95b31e35239e5e1689e3d965d692a313c71bd8ab upstream.
    
    The Lex 2I385SW board has two Intel I211 ethernet controllers. Without
    this patch, only the first port is usable. The second port fails to
    start with the following message:
    
        igb: probe of 0000:02:00.0 failed with error -2
    
    Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
    Tested-by: Georg Müller <georgmueller@gmx.net>
    Signed-off-by: Georg Müller <georgmueller@gmx.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3f4ba176c6237e291417d0c8f9c1386556dc080d
Author: Eric Biggers <ebiggers@google.com>
Date:   Sat Mar 21 20:43:05 2020 -0700

    vt: vt_ioctl: fix use-after-free in vt_in_use()
    
    commit 7cf64b18b0b96e751178b8d0505d8466ff5a448f upstream.
    
    vt_in_use() dereferences console_driver->ttys[i] without proper locking.
    This is broken because the tty can be closed and freed concurrently.
    
    We could fix this by using 'READ_ONCE(console_driver->ttys[i]) != NULL'
    and skipping the check of tty_struct::count.  But, looking at
    console_driver->ttys[i] isn't really appropriate anyway because even if
    it is NULL the tty can still be in the process of being closed.
    
    Instead, fix it by making vt_in_use() require console_lock() and check
    whether the vt is allocated and has port refcount > 1.  This works since
    following the patch "vt: vt_ioctl: fix VT_DISALLOCATE freeing in-use
    virtual console" the port refcount is incremented while the vt is open.
    
    Reproducer (very unreliable, but it worked for me after a few minutes):
    
            #include <fcntl.h>
            #include <linux/vt.h>
    
            int main()
            {
                    int fd, nproc;
                    struct vt_stat state;
                    char ttyname[16];
    
                    fd = open("/dev/tty10", O_RDONLY);
                    for (nproc = 1; nproc < 8; nproc *= 2)
                            fork();
                    for (;;) {
                            sprintf(ttyname, "/dev/tty%d", rand() % 8);
                            close(open(ttyname, O_RDONLY));
                            ioctl(fd, VT_GETSTATE, &state);
                    }
            }
    
    KASAN report:
    
            BUG: KASAN: use-after-free in vt_in_use drivers/tty/vt/vt_ioctl.c:48 [inline]
            BUG: KASAN: use-after-free in vt_ioctl+0x1ad3/0x1d70 drivers/tty/vt/vt_ioctl.c:657
            Read of size 4 at addr ffff888065722468 by task syz-vt2/132
    
            CPU: 0 PID: 132 Comm: syz-vt2 Not tainted 5.6.0-rc5-00130-g089b6d3654916 #13
            Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20191223_100556-anatol 04/01/2014
            Call Trace:
             [...]
             vt_in_use drivers/tty/vt/vt_ioctl.c:48 [inline]
             vt_ioctl+0x1ad3/0x1d70 drivers/tty/vt/vt_ioctl.c:657
             tty_ioctl+0x9db/0x11b0 drivers/tty/tty_io.c:2660
             [...]
    
            Allocated by task 136:
             [...]
             kzalloc include/linux/slab.h:669 [inline]
             alloc_tty_struct+0x96/0x8a0 drivers/tty/tty_io.c:2982
             tty_init_dev+0x23/0x350 drivers/tty/tty_io.c:1334
             tty_open_by_driver drivers/tty/tty_io.c:1987 [inline]
             tty_open+0x3ca/0xb30 drivers/tty/tty_io.c:2035
             [...]
    
            Freed by task 41:
             [...]
             kfree+0xbf/0x200 mm/slab.c:3757
             free_tty_struct+0x8d/0xb0 drivers/tty/tty_io.c:177
             release_one_tty+0x22d/0x2f0 drivers/tty/tty_io.c:1468
             process_one_work+0x7f1/0x14b0 kernel/workqueue.c:2264
             worker_thread+0x8b/0xc80 kernel/workqueue.c:2410
             [...]
    
    Fixes: 4001d7b7fc27 ("vt: push down the tty lock so we can see what is left to tackle")
    Cc: <stable@vger.kernel.org> # v3.4+
    Acked-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Eric Biggers <ebiggers@google.com>
    Link: https://lore.kernel.org/r/20200322034305.210082-3-ebiggers@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit acf0e94019310a9e1c4b6807c208f49a25f74573
Author: Eric Biggers <ebiggers@google.com>
Date:   Sat Mar 21 20:43:04 2020 -0700

    vt: vt_ioctl: fix VT_DISALLOCATE freeing in-use virtual console
    
    commit ca4463bf8438b403596edd0ec961ca0d4fbe0220 upstream.
    
    The VT_DISALLOCATE ioctl can free a virtual console while tty_release()
    is still running, causing a use-after-free in con_shutdown().  This
    occurs because VT_DISALLOCATE considers a virtual console's
    'struct vc_data' to be unused as soon as the corresponding tty's
    refcount hits 0.  But actually it may be still being closed.
    
    Fix this by making vc_data be reference-counted via the embedded
    'struct tty_port'.  A newly allocated virtual console has refcount 1.
    Opening it for the first time increments the refcount to 2.  Closing it
    for the last time decrements the refcount (in tty_operations::cleanup()
    so that it happens late enough), as does VT_DISALLOCATE.
    
    Reproducer:
            #include <fcntl.h>
            #include <linux/vt.h>
            #include <sys/ioctl.h>
            #include <unistd.h>
    
            int main()
            {
                    if (fork()) {
                            for (;;)
                                    close(open("/dev/tty5", O_RDWR));
                    } else {
                            int fd = open("/dev/tty10", O_RDWR);
    
                            for (;;)
                                    ioctl(fd, VT_DISALLOCATE, 5);
                    }
            }
    
    KASAN report:
            BUG: KASAN: use-after-free in con_shutdown+0x76/0x80 drivers/tty/vt/vt.c:3278
            Write of size 8 at addr ffff88806a4ec108 by task syz_vt/129
    
            CPU: 0 PID: 129 Comm: syz_vt Not tainted 5.6.0-rc2 #11
            Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20191223_100556-anatol 04/01/2014
            Call Trace:
             [...]
             con_shutdown+0x76/0x80 drivers/tty/vt/vt.c:3278
             release_tty+0xa8/0x410 drivers/tty/tty_io.c:1514
             tty_release_struct+0x34/0x50 drivers/tty/tty_io.c:1629
             tty_release+0x984/0xed0 drivers/tty/tty_io.c:1789
             [...]
    
            Allocated by task 129:
             [...]
             kzalloc include/linux/slab.h:669 [inline]
             vc_allocate drivers/tty/vt/vt.c:1085 [inline]
             vc_allocate+0x1ac/0x680 drivers/tty/vt/vt.c:1066
             con_install+0x4d/0x3f0 drivers/tty/vt/vt.c:3229
             tty_driver_install_tty drivers/tty/tty_io.c:1228 [inline]
             tty_init_dev+0x94/0x350 drivers/tty/tty_io.c:1341
             tty_open_by_driver drivers/tty/tty_io.c:1987 [inline]
             tty_open+0x3ca/0xb30 drivers/tty/tty_io.c:2035
             [...]
    
            Freed by task 130:
             [...]
             kfree+0xbf/0x1e0 mm/slab.c:3757
             vt_disallocate drivers/tty/vt/vt_ioctl.c:300 [inline]
             vt_ioctl+0x16dc/0x1e30 drivers/tty/vt/vt_ioctl.c:818
             tty_ioctl+0x9db/0x11b0 drivers/tty/tty_io.c:2660
             [...]
    
    Fixes: 4001d7b7fc27 ("vt: push down the tty lock so we can see what is left to tackle")
    Cc: <stable@vger.kernel.org> # v3.4+
    Reported-by: syzbot+522643ab5729b0421998@syzkaller.appspotmail.com
    Acked-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Eric Biggers <ebiggers@google.com>
    Link: https://lore.kernel.org/r/20200322034305.210082-2-ebiggers@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d1b6ab26c850ff1e02e895b10e74564a4df12483
Author: Eric Biggers <ebiggers@google.com>
Date:   Mon Feb 24 00:03:26 2020 -0800

    vt: vt_ioctl: remove unnecessary console allocation checks
    
    commit 1aa6e058dd6cd04471b1f21298270014daf48ac9 upstream.
    
    The vc_cons_allocated() checks in vt_ioctl() and vt_compat_ioctl() are
    unnecessary because they can only be reached by calling ioctl() on an
    open tty, which implies the corresponding virtual console is allocated.
    
    And even if the virtual console *could* be freed concurrently, then
    these checks would be broken since they aren't done under console_lock,
    and the vc_data is dereferenced before them anyway.
    
    So, remove these unneeded checks to avoid confusion.
    
    Signed-off-by: Eric Biggers <ebiggers@google.com>
    Link: https://lore.kernel.org/r/20200224080326.295046-1-ebiggers@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c897e625f94b3dad181362c98f6eef61ef8471a9
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Wed Feb 19 08:39:48 2020 +0100

    vt: switch vt_dont_switch to bool
    
    commit f400991bf872debffb01c46da882dc97d7e3248e upstream.
    
    vt_dont_switch is pure boolean, no need for whole char.
    
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Link: https://lore.kernel.org/r/20200219073951.16151-6-jslaby@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e7244ce86ceb3436f28b8cec8aa0e30fd9c93a01
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Wed Feb 19 08:39:44 2020 +0100

    vt: ioctl, switch VT_IS_IN_USE and VT_BUSY to inlines
    
    commit e587e8f17433ddb26954f0edf5b2f95c42155ae9 upstream.
    
    These two were macros. Switch them to static inlines, so that it's more
    understandable what they are doing.
    
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Link: https://lore.kernel.org/r/20200219073951.16151-2-jslaby@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 383c71b7314f407815e71d6aa09d594ebe46e14c
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Wed Feb 19 08:39:43 2020 +0100

    vt: selection, introduce vc_is_sel
    
    commit dce05aa6eec977f1472abed95ccd71276b9a3864 upstream.
    
    Avoid global variables (namely sel_cons) by introducing vc_is_sel. It
    checks whether the parameter is the current selection console. This will
    help putting sel_cons to a struct later.
    
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Link: https://lore.kernel.org/r/20200219073951.16151-1-jslaby@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 125dd8c48b1970360884140886b2a6d5b6b47a3f
Author: Lanqing Liu <liuhhome@gmail.com>
Date:   Mon Mar 16 11:13:33 2020 +0800

    serial: sprd: Fix a dereference warning
    
    commit efc176929a3505a30c3993ddd393b40893649bd2 upstream.
    
    We should validate if the 'sup' is NULL or not before freeing DMA
    memory, to fix below warning.
    
    "drivers/tty/serial/sprd_serial.c:1141 sprd_remove()
     error: we previously assumed 'sup' could be null (see line 1132)"
    
    Fixes: f4487db58eb7 ("serial: sprd: Add DMA mode support")
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Lanqing Liu <liuhhome@gmail.com>
    Cc: stable <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/e2bd92691538e95b04a2c2a728f3292e1617018f.1584325957.git.liuhhome@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5b1bd4900fedb6c755febe84dd165a53692b243b
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun Mar 29 22:50:06 2020 +0200

    mac80211: fix authentication with iwlwifi/mvm
    
    commit be8c827f50a0bcd56361b31ada11dc0a3c2fd240 upstream.
    
    The original patch didn't copy the ieee80211_is_data() condition
    because on most drivers the management frames don't go through
    this path. However, they do on iwlwifi/mvm, so we do need to keep
    the condition here.
    
    Cc: stable@vger.kernel.org
    Fixes: ce2e1ca70307 ("mac80211: Check port authorization in the ieee80211_tx_dequeue() case")
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Cc: Woody Suwalski <terraluna977@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5863d2b27fb2df268dd4d31e5b4bd992e3ee1011
Author: Jouni Malinen <jouni@codeaurora.org>
Date:   Thu Mar 26 15:51:34 2020 +0100

    mac80211: Check port authorization in the ieee80211_tx_dequeue() case
    
    commit ce2e1ca703071723ca2dd94d492a5ab6d15050da upstream.
    
    mac80211 used to check port authorization in the Data frame enqueue case
    when going through start_xmit(). However, that authorization status may
    change while the frame is waiting in a queue. Add a similar check in the
    dequeue case to avoid sending previously accepted frames after
    authorization change. This provides additional protection against
    potential leaking of frames after a station has been disconnected and
    the keys for it are being removed.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Link: https://lore.kernel.org/r/20200326155133.ced84317ea29.I34d4c47cd8cc8a4042b38a76f16a601fbcbfd9b3@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>