commit 968722f5371ad5deee23fc20269fdc44c23014b1
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Sep 16 08:20:46 2019 +0200

    Linux 4.14.144

commit 7e9480b480a57fb4ef2e4d2c2cddbb1a31d56b33
Author: yongduan <yongduan@tencent.com>
Date:   Wed Sep 11 17:44:24 2019 +0800

    vhost: make sure log_num < in_num
    
    commit 060423bfdee3f8bc6e2c1bac97de24d5415e2bc4 upstream.
    
    The code assumes log_num < in_num everywhere, and that is true as long as
    in_num is incremented by descriptor iov count, and log_num by 1. However
    this breaks if there's a zero sized descriptor.
    
    As a result, if a malicious guest creates a vring desc with desc.len = 0,
    it may cause the host kernel to crash by overflowing the log array. This
    bug can be triggered during the VM migration.
    
    There's no need to log when desc.len = 0, so just don't increment log_num
    in this case.
    
    Fixes: 3a4d5c94e959 ("vhost_net: a kernel-level virtio server")
    Cc: stable@vger.kernel.org
    Reviewed-by: Lidong Chen <lidongchen@tencent.com>
    Signed-off-by: ruippan <ruippan@tencent.com>
    Signed-off-by: yongduan <yongduan@tencent.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5b53e102b9757b2f079d42f38e2c6a355ef380a7
Author: YueHaibing <yuehaibing@huawei.com>
Date:   Tue Jun 11 23:00:07 2019 +0800

    kernel/module: Fix mem leak in module_add_modinfo_attrs
    
    [ Upstream commit bc6f2a757d525e001268c3658bd88822e768f8db ]
    
    In module_add_modinfo_attrs if sysfs_create_file
    fails, we forget to free allocated modinfo_attrs
    and roll back the sysfs files.
    
    Fixes: 03e88ae1b13d ("[PATCH] fix module sysfs files reference counting")
    Reviewed-by: Miroslav Benes <mbenes@suse.cz>
    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    Signed-off-by: Jessica Yu <jeyu@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 2eff0ac931699b8d6b5eff7779da6ccad83812eb
Author: Nathan Chancellor <natechancellor@gmail.com>
Date:   Thu Oct 18 12:13:40 2018 -0700

    clk: s2mps11: Add used attribute to s2mps11_dt_match
    
    [ Upstream commit 9c940bbe2bb47e03ca5e937d30b6a50bf9c0e671 ]
    
    Clang warns after commit 8985167ecf57 ("clk: s2mps11: Fix matching when
    built as module and DT node contains compatible"):
    
    drivers/clk/clk-s2mps11.c:242:34: warning: variable 's2mps11_dt_match'
    is not needed and will not be emitted [-Wunneeded-internal-declaration]
    static const struct of_device_id s2mps11_dt_match[] = {
                                     ^
    1 warning generated.
    
    This warning happens when a variable is used in some construct that
    doesn't require a reference to that variable to be emitted in the symbol
    table; in this case, it's MODULE_DEVICE_TABLE, which only needs to hold
    the data of the variable, not the variable itself.
    
    $ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_dt_match
    00000078 000003d4 R __mod_of__s2mps11_dt_match_device_table
    
    Normally, with device ID table variables, it means that the variable
    just needs to be tied to the device declaration at the bottom of the
    file, like s2mps11_clk_id:
    
    $ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_clk_id
    00000000 00000078 R __mod_platform__s2mps11_clk_id_device_table
    00000000 00000078 r s2mps11_clk_id
    
    However, because the comment above this deliberately doesn't want this
    variable added to .of_match_table, we need to mark s2mps11_dt_match as
    __used to silence this warning. This makes it clear to Clang that the
    variable is used for something, even if a reference to it isn't being
    emitted.
    
    Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
    Fixes: 8985167ecf57 ("clk: s2mps11: Fix matching when built as module and DT node contains compatible")
    Signed-off-by: Stephen Boyd <sboyd@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit b53ba116d607b037fc1f8e26dec3bd9fc0090cb4
Author: Nicolas Boichat <drinkcat@chromium.org>
Date:   Thu Jul 11 20:52:27 2019 -0700

    scripts/decode_stacktrace: match basepath using shell prefix operator, not regex
    
    [ Upstream commit 31013836a71e07751a6827f9d2ad41ef502ddaff ]
    
    The basepath may contain special characters, which would confuse the regex
    matcher.  ${var#prefix} does the right thing.
    
    Link: http://lkml.kernel.org/r/20190518055946.181563-1-drinkcat@chromium.org
    Fixes: 67a28de47faa8358 ("scripts/decode_stacktrace: only strip base path when a prefix of the path")
    Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
    Reviewed-by: Stephen Boyd <swboyd@chromium.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit dc28d6a0db194f4cebb4ecef987fa0bf71f8a161
Author: Dmitry Voytik <voytikd@gmail.com>
Date:   Tue Jan 22 23:38:48 2019 +0100

    arm64: dts: rockchip: enable usb-host regulators at boot on rk3328-rock64
    
    [ Upstream commit 26e2d7b03ea7ff254bf78305aa44dda62e70b78e ]
    
    After commit ef05bcb60c1a, boot from USB drives is broken.
    Fix this problem by enabling usb-host regulators during boot time.
    
    Fixes: ef05bcb60c1a ("arm64: dts: rockchip: fix vcc_host1_5v pin assign on rk3328-rock64")
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Voytik <voytikd@gmail.com>
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit feb93a6160b173528bd8f66d957218e7e4a30e82
Author: Christophe Leroy <christophe.leroy@c-s.fr>
Date:   Fri May 10 06:31:28 2019 +0000

    powerpc/64: mark start_here_multiplatform as __ref
    
    [ Upstream commit 9c4e4c90ec24652921e31e9551fcaedc26eec86d ]
    
    Otherwise, the following warning is encountered:
    
    WARNING: vmlinux.o(.text+0x3dc6): Section mismatch in reference from the variable start_here_multiplatform to the function .init.text:.early_setup()
    The function start_here_multiplatform() references
    the function __init .early_setup().
    This is often because start_here_multiplatform lacks a __init
    annotation or the annotation of .early_setup is wrong.
    
    Fixes: 56c46bba9bbf ("powerpc/64: Fix booting large kernels with STRICT_KERNEL_RWX")
    Cc: Russell Currey <ruscur@russell.cc>
    Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit dd17277c2483db588c470df406f63059f3975432
Author: Dexuan Cui <decui@microsoft.com>
Date:   Wed Jul 31 01:25:45 2019 +0000

    hv_sock: Fix hang when a connection is closed
    
    [ Upstream commit 685703b497bacea8765bb409d6b73455b73c540e ]
    
    There is a race condition for an established connection that is being closed
    by the guest: the refcnt is 4 at the end of hvs_release() (Note: here the
    'remove_sock' is false):
    
    1 for the initial value;
    1 for the sk being in the bound list;
    1 for the sk being in the connected list;
    1 for the delayed close_work.
    
    After hvs_release() finishes, __vsock_release() -> sock_put(sk) *may*
    decrease the refcnt to 3.
    
    Concurrently, hvs_close_connection() runs in another thread:
      calls vsock_remove_sock() to decrease the refcnt by 2;
      call sock_put() to decrease the refcnt to 0, and free the sk;
      next, the "release_sock(sk)" may hang due to use-after-free.
    
    In the above, after hvs_release() finishes, if hvs_close_connection() runs
    faster than "__vsock_release() -> sock_put(sk)", then there is not any issue,
    because at the beginning of hvs_close_connection(), the refcnt is still 4.
    
    The issue can be resolved if an extra reference is taken when the
    connection is established.
    
    Fixes: a9eeb998c28d ("hv_sock: Add support for delayed close")
    Signed-off-by: Dexuan Cui <decui@microsoft.com>
    Reviewed-by: Sunil Muthuswamy <sunilmut@microsoft.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 28400323ea2e541b22666dfd62b6836bc97d629b
Author: Sven Eckelmann <sven@narfation.org>
Date:   Thu Aug 22 08:55:36 2019 +0200

    batman-adv: Only read OGM tvlv_len after buffer len check
    
    commit a15d56a60760aa9dbe26343b9a0ac5228f35d445 upstream.
    
    Multiple batadv_ogm_packet can be stored in an skbuff. The functions
    batadv_iv_ogm_send_to_if()/batadv_iv_ogm_receive() use
    batadv_iv_ogm_aggr_packet() to check if there is another additional
    batadv_ogm_packet in the skb or not before they continue processing the
    packet.
    
    The length for such an OGM is BATADV_OGM_HLEN +
    batadv_ogm_packet->tvlv_len. The check must first check that at least
    BATADV_OGM_HLEN bytes are available before it accesses tvlv_len (which is
    part of the header. Otherwise it might try read outside of the currently
    available skbuff to get the content of tvlv_len.
    
    Fixes: ef26157747d4 ("batman-adv: tvlv - basic infrastructure")
    Reported-by: syzbot+355cab184197dbbfa384@syzkaller.appspotmail.com
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Acked-by: Antonio Quartulli <a@unstable.cc>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 89ea639a2ce5023ccfefc9a85dfd436523efe78f
Author: Eric Dumazet <edumazet@google.com>
Date:   Mon Aug 12 04:57:27 2019 -0700

    batman-adv: fix uninit-value in batadv_netlink_get_ifindex()
    
    commit 3ee1bb7aae97324ec9078da1f00cb2176919563f upstream.
    
    batadv_netlink_get_ifindex() needs to make sure user passed
    a correct u32 attribute.
    
    syzbot reported :
    BUG: KMSAN: uninit-value in batadv_netlink_dump_hardif+0x70d/0x880 net/batman-adv/netlink.c:968
    CPU: 1 PID: 11705 Comm: syz-executor888 Not tainted 5.1.0+ #1
    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+0x191/0x1f0 lib/dump_stack.c:113
     kmsan_report+0x130/0x2a0 mm/kmsan/kmsan.c:622
     __msan_warning+0x75/0xe0 mm/kmsan/kmsan_instr.c:310
     batadv_netlink_dump_hardif+0x70d/0x880 net/batman-adv/netlink.c:968
     genl_lock_dumpit+0xc6/0x130 net/netlink/genetlink.c:482
     netlink_dump+0xa84/0x1ab0 net/netlink/af_netlink.c:2253
     __netlink_dump_start+0xa3a/0xb30 net/netlink/af_netlink.c:2361
     genl_family_rcv_msg net/netlink/genetlink.c:550 [inline]
     genl_rcv_msg+0xfc1/0x1a40 net/netlink/genetlink.c:627
     netlink_rcv_skb+0x431/0x620 net/netlink/af_netlink.c:2486
     genl_rcv+0x63/0x80 net/netlink/genetlink.c:638
     netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
     netlink_unicast+0xf3e/0x1020 net/netlink/af_netlink.c:1337
     netlink_sendmsg+0x127e/0x12f0 net/netlink/af_netlink.c:1926
     sock_sendmsg_nosec net/socket.c:651 [inline]
     sock_sendmsg net/socket.c:661 [inline]
     ___sys_sendmsg+0xcc6/0x1200 net/socket.c:2260
     __sys_sendmsg net/socket.c:2298 [inline]
     __do_sys_sendmsg net/socket.c:2307 [inline]
     __se_sys_sendmsg+0x305/0x460 net/socket.c:2305
     __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2305
     do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291
     entry_SYSCALL_64_after_hwframe+0x63/0xe7
    RIP: 0033:0x440209
    
    Fixes: b60620cf567b ("batman-adv: netlink: hardif query")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e93482df922b2811bea65c8bbcbd1725c298ec5a
Author: Tiwei Bie <tiwei.bie@intel.com>
Date:   Wed Aug 28 13:37:00 2019 +0800

    vhost/test: fix build for vhost test
    
    commit 264b563b8675771834419057cbe076c1a41fb666 upstream.
    
    Since vhost_exceeds_weight() was introduced, callers need to specify
    the packet weight and byte weight in vhost_dev_init(). Note that, the
    packet weight isn't counted in this patch to keep the original behavior
    unchanged.
    
    Fixes: e82b9b0727ff ("vhost: introduce vhost_exceeds_weight()")
    Cc: stable@vger.kernel.org
    Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b36199bc9dada09c082b0c47516bd59b8bc38c9b
Author: Vignesh R <vigneshr@ti.com>
Date:   Fri Dec 29 17:11:30 2017 +0530

    PCI: dra7xx: Fix legacy INTD IRQ handling
    
    commit 524d59f6e30aab5b618da55e604c802ccd83e708 upstream.
    
    Legacy INTD IRQ handling is broken on dra7xx due to fact that driver
    uses hwirq in range of 1-4 for INTA, INTD whereas IRQ domain is of size
    4 which is numbered 0-3. Therefore when INTD IRQ line is used with
    pci-dra7xx driver following warning is seen:
    
           WARNING: CPU: 0 PID: 1 at kernel/irq/irqdomain.c:342 irq_domain_associate+0x12c/0x1c4
           error: hwirq 0x4 is too large for dummy
    
    Fix this by using pci_irqd_intx_xlate() helper to translate the INTx 1-4
    range into the 0-3 as done in other PCIe drivers.
    
    Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
    Reported-by: Chris Welch <Chris.Welch@viavisolutions.com>
    Signed-off-by: Vignesh R <vigneshr@ti.com>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ae85d34dd87144a4ab67d63e0ec7df35230f7f7c
Author: Niklas Cassel <niklas.cassel@axis.com>
Date:   Thu Dec 14 14:01:44 2017 +0100

    PCI: designware-ep: Fix find_first_zero_bit() usage
    
    commit ad4a5becc689c3f32bbbc2b37eff89efe19dc2f9 upstream.
    
    find_first_zero_bit()'s parameter 'size' is defined in bits,
    not in bytes.
    
    find_first_zero_bit() is called with size in bytes rather than bits,
    which thus defines a too low upper limit, causing
    dw_pcie_ep_inbound_atu() to assign iatu index #4 to both bar 4
    and bar 5, which makes bar 5 overwrite the settings set by bar 4.
    
    Since the sizes of the bitmaps are known, dynamically allocate the
    bitmaps, and use the correct size when calling find_first_zero_bit().
    
    Additionally, make sure that ep->num_ob_windows and ep->num_ib_windows,
    which are obtained from device tree, are smaller than the maximum number
    of iATUs (MAX_IATU_IN/MAX_IATU_OUT).
    
    Fixes: f8aed6ec624f ("PCI: dwc: designware: Add EP mode support")
    Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 720a6817e131b1208263f1a951d0c8ee1982950a
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri May 3 08:24:44 2019 -0700

    ip6: fix skb leak in ip6frag_expire_frag_queue()
    
    commit 47d3d7fdb10a21c223036b58bd70ffdc24a472c4 upstream.
    
    Since ip6frag_expire_frag_queue() now pulls the head skb
    from frag queue, we should no longer use skb_get(), since
    this leads to an skb leak.
    
    Stefan Bader initially reported a problem in 4.4.stable [1] caused
    by the skb_get(), so this patch should also fix this issue.
    
    296583.091021] kernel BUG at /build/linux-6VmqmP/linux-4.4.0/net/core/skbuff.c:1207!
    [296583.091734] Call Trace:
    [296583.091749]  [<ffffffff81740e50>] __pskb_pull_tail+0x50/0x350
    [296583.091764]  [<ffffffff8183939a>] _decode_session6+0x26a/0x400
    [296583.091779]  [<ffffffff817ec719>] __xfrm_decode_session+0x39/0x50
    [296583.091795]  [<ffffffff818239d0>] icmpv6_route_lookup+0xf0/0x1c0
    [296583.091809]  [<ffffffff81824421>] icmp6_send+0x5e1/0x940
    [296583.091823]  [<ffffffff81753238>] ? __netif_receive_skb+0x18/0x60
    [296583.091838]  [<ffffffff817532b2>] ? netif_receive_skb_internal+0x32/0xa0
    [296583.091858]  [<ffffffffc0199f74>] ? ixgbe_clean_rx_irq+0x594/0xac0 [ixgbe]
    [296583.091876]  [<ffffffffc04eb260>] ? nf_ct_net_exit+0x50/0x50 [nf_defrag_ipv6]
    [296583.091893]  [<ffffffff8183d431>] icmpv6_send+0x21/0x30
    [296583.091906]  [<ffffffff8182b500>] ip6_expire_frag_queue+0xe0/0x120
    [296583.091921]  [<ffffffffc04eb27f>] nf_ct_frag6_expire+0x1f/0x30 [nf_defrag_ipv6]
    [296583.091938]  [<ffffffff810f3b57>] call_timer_fn+0x37/0x140
    [296583.091951]  [<ffffffffc04eb260>] ? nf_ct_net_exit+0x50/0x50 [nf_defrag_ipv6]
    [296583.091968]  [<ffffffff810f5464>] run_timer_softirq+0x234/0x330
    [296583.091982]  [<ffffffff8108a339>] __do_softirq+0x109/0x2b0
    
    Fixes: d4289fcc9b16 ("net: IP6 defrag: use rbtrees for IPv6 defrag")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: Stefan Bader <stefan.bader@canonical.com>
    Cc: Peter Oskolkov <posk@google.com>
    Cc: Florian Westphal <fw@strlen.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit cd393b38514dc3caa916db3b4405d592bfd3c9ea
Author: Cong Wang <xiyou.wangcong@gmail.com>
Date:   Fri Mar 22 16:26:19 2019 -0700

    xfrm: clean up xfrm protocol checks
    
    commit dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 upstream.
    
    In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
    I introduced a check for xfrm protocol, but according to Herbert
    IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
    it should be removed from validate_tmpl().
    
    And, IPSEC_PROTO_ANY is expected to only match 3 IPSec-specific
    protocols, this is why xfrm_state_flush() could still miss
    IPPROTO_ROUTING, which leads that those entries are left in
    net->xfrm.state_all before exit net. Fix this by replacing
    IPSEC_PROTO_ANY with zero.
    
    This patch also extracts the check from validate_tmpl() to
    xfrm_id_proto_valid() and uses it in parse_ipsecrequest().
    With this, no other protocols should be added into xfrm.
    
    Fixes: 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
    Reported-by: syzbot+0bf0519d6e0de15914fe@syzkaller.appspotmail.com
    Cc: Steffen Klassert <steffen.klassert@secunet.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
    Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Zubin Mithra <zsm@chromium.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 32b803e81ce17eec816f09d5388ef0a1cc9e4c2f
Author: Gustavo Romero <gromero@linux.ibm.com>
Date:   Wed Sep 4 00:55:27 2019 -0400

    powerpc/tm: Fix FP/VMX unavailable exceptions inside a transaction
    
    commit 8205d5d98ef7f155de211f5e2eb6ca03d95a5a60 upstream.
    
    When we take an FP unavailable exception in a transaction we have to
    account for the hardware FP TM checkpointed registers being
    incorrect. In this case for this process we know the current and
    checkpointed FP registers must be the same (since FP wasn't used
    inside the transaction) hence in the thread_struct we copy the current
    FP registers to the checkpointed ones.
    
    This copy is done in tm_reclaim_thread(). We use thread->ckpt_regs.msr
    to determine if FP was on when in userspace. thread->ckpt_regs.msr
    represents the state of the MSR when exiting userspace. This is setup
    by check_if_tm_restore_required().
    
    Unfortunatley there is an optimisation in giveup_all() which returns
    early if tsk->thread.regs->msr (via local variable `usermsr`) has
    FP=VEC=VSX=SPE=0. This optimisation means that
    check_if_tm_restore_required() is not called and hence
    thread->ckpt_regs.msr is not updated and will contain an old value.
    
    This can happen if due to load_fp=255 we start a userspace process
    with MSR FP=1 and then we are context switched out. In this case
    thread->ckpt_regs.msr will contain FP=1. If that same process is then
    context switched in and load_fp overflows, MSR will have FP=0. If that
    process now enters a transaction and does an FP instruction, the FP
    unavailable will not update thread->ckpt_regs.msr (the bug) and MSR
    FP=1 will be retained in thread->ckpt_regs.msr.  tm_reclaim_thread()
    will then not perform the required memcpy and the checkpointed FP regs
    in the thread struct will contain the wrong values.
    
    The code path for this happening is:
    
           Userspace:                      Kernel
                       Start userspace
                        with MSR FP/VEC/VSX/SPE=0 TM=1
                          < -----
           ...
           tbegin
           bne
           fp instruction
                       FP unavailable
                           ---- >
                                            fp_unavailable_tm()
                                              tm_reclaim_current()
                                                tm_reclaim_thread()
                                                  giveup_all()
                                                    return early since FP/VMX/VSX=0
                                                    /* ckpt MSR not updated (Incorrect) */
                                                  tm_reclaim()
                                                    /* thread_struct ckpt FP regs contain junk (OK) */
                                                  /* Sees ckpt MSR FP=1 (Incorrect) */
                                                  no memcpy() performed
                                                    /* thread_struct ckpt FP regs not fixed (Incorrect) */
                                              tm_recheckpoint()
                                                 /* Put junk in hardware checkpoint FP regs */
                                             ....
                          < -----
                       Return to userspace
                         with MSR TM=1 FP=1
                         with junk in the FP TM checkpoint
           TM rollback
           reads FP junk
    
    This is a data integrity problem for the current process as the FP
    registers are corrupted. It's also a security problem as the FP
    registers from one process may be leaked to another.
    
    This patch moves up check_if_tm_restore_required() in giveup_all() to
    ensure thread->ckpt_regs.msr is updated correctly.
    
    A simple testcase to replicate this will be posted to
    tools/testing/selftests/powerpc/tm/tm-poison.c
    
    Similarly for VMX.
    
    This fixes CVE-2019-15030.
    
    Fixes: f48e91e87e67 ("powerpc/tm: Fix FP and VMX register corruption")
    Cc: stable@vger.kernel.org # 4.12+
    Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com>
    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20190904045529.23002-1-gromero@linux.vnet.ibm.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1fab51be84fdcae2287f34caad1a3828e056c9c1
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Thu Aug 15 11:30:50 2019 +0300

    drm/vmwgfx: Fix double free in vmw_recv_msg()
    
    commit 08b0c891605acf727e43e3e03a25857d3e789b61 upstream.
    
    We recently added a kfree() after the end of the loop:
    
            if (retries == RETRIES) {
                    kfree(reply);
                    return -EINVAL;
            }
    
    There are two problems.  First the test is wrong and because retries
    equals RETRIES if we succeed on the last iteration through the loop.
    Second if we fail on the last iteration through the loop then the kfree
    is a double free.
    
    When you're reading this code, please note the break statement at the
    end of the while loop.  This patch changes the loop so that if it's not
    successful then "reply" is NULL and we can test for that afterward.
    
    Cc: <stable@vger.kernel.org>
    Fixes: 6b7c3b86f0b6 ("drm/vmwgfx: fix memory leak when too many retries have occurred")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d33576c260b4075930ac29a4105626658fe2b650
Author: Liangyan <liangyan.peng@linux.alibaba.com>
Date:   Mon Aug 26 20:16:33 2019 +0800

    sched/fair: Don't assign runtime for throttled cfs_rq
    
    commit 5e2d2cc2588bd3307ce3937acbc2ed03c830a861 upstream.
    
    do_sched_cfs_period_timer() will refill cfs_b runtime and call
    distribute_cfs_runtime to unthrottle cfs_rq, sometimes cfs_b->runtime
    will allocate all quota to one cfs_rq incorrectly, then other cfs_rqs
    attached to this cfs_b can't get runtime and will be throttled.
    
    We find that one throttled cfs_rq has non-negative
    cfs_rq->runtime_remaining and cause an unexpetced cast from s64 to u64
    in snippet:
    
      distribute_cfs_runtime() {
        runtime = -cfs_rq->runtime_remaining + 1;
      }
    
    The runtime here will change to a large number and consume all
    cfs_b->runtime in this cfs_b period.
    
    According to Ben Segall, the throttled cfs_rq can have
    account_cfs_rq_runtime called on it because it is throttled before
    idle_balance, and the idle_balance calls update_rq_clock to add time
    that is accounted to the task.
    
    This commit prevents cfs_rq to be assgined new runtime if it has been
    throttled until that distribute_cfs_runtime is called.
    
    Signed-off-by: Liangyan <liangyan.peng@linux.alibaba.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
    Reviewed-by: Ben Segall <bsegall@google.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: shanpeic@linux.alibaba.com
    Cc: stable@vger.kernel.org
    Cc: xlpang@linux.alibaba.com
    Fixes: d3d9dc330236 ("sched: Throttle entities exceeding their allowed bandwidth")
    Link: https://lkml.kernel.org/r/20190826121633.6538-1-liangyan.peng@linux.alibaba.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fe4d826a6e6acd5425b761fdbc5407d7629077d6
Author: Hui Wang <hui.wang@canonical.com>
Date:   Wed Sep 4 13:53:27 2019 +0800

    ALSA: hda/realtek - Fix the problem of two front mics on a ThinkCentre
    
    commit 2a36c16efab254dd6017efeb35ad88ecc96f2328 upstream.
    
    This ThinkCentre machine has a new realtek codec alc222, it is not
    in the support list, we add it in the realtek.c then this machine
    can apply FIXUPs for the realtek codec.
    
    And this machine has two front mics which can't be handled
    by PA so far, it uses the pin 0x18 and 0x19 as the front mics, as
    a result the existing FIXUP ALC294_FIXUP_LENOVO_MIC_LOCATION doesn't
    work on this machine. Fortunately another FIXUP
    ALC283_FIXUP_HEADSET_MIC also can change the location for one of the
    two mics on this machine.
    
    Link: https://lore.kernel.org/r/20190904055327.9883-1-hui.wang@canonical.com
    Signed-off-by: Hui Wang <hui.wang@canonical.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 29fa79cefe6faaf148bc936ed338c02f0bd582ec
Author: Takashi Iwai <tiwai@suse.de>
Date:   Fri Aug 30 12:03:38 2019 +0200

    ALSA: hda/realtek - Fix overridden device-specific initialization
    
    commit 89781d0806c2c4f29072d3f00cb2dd4274aabc3d upstream.
    
    The recent change to shuffle the codec initialization procedure for
    Realtek via commit 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on
    later") caused the silent output on some machines.  This change was
    supposed to be safe, but it isn't actually; some devices have quirk
    setups to override the EAPD via COEF or BTL in the additional verb
    table, which is applied at the beginning of snd_hda_gen_init().  And
    this EAPD setup is again overridden in alc_auto_init_amp().
    
    For recovering from the regression, tell snd_hda_gen_init() not to
    apply the verbs there by a new flag, then apply the verbs in
    alc_init().
    
    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204727
    Fixes: 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on later")
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3dd3ca376c0868a718999978fcf58c3a60853fd8
Author: Takashi Iwai <tiwai@suse.de>
Date:   Thu Aug 29 09:52:02 2019 +0200

    ALSA: hda - Fix potential endless loop at applying quirks
    
    commit 333f31436d3db19f4286f8862a00ea1d8d8420a1 upstream.
    
    Since the chained quirks via chained_before flag is applied before the
    depth check, it may lead to the endless recursive calls, when the
    chain were set up incorrectly.  Fix it by moving the depth check at
    the beginning of the loop.
    
    Fixes: 1f57825077dc ("ALSA: hda - Add chained_before flag to the fixup entry")
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>