commit f0feeec9c246f6518e168daec66d92a4a6bf0965
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sat Feb 3 17:04:31 2018 +0100

    Linux 4.4.115

commit f84a8d446a16379df5844bc2bd50f0b7431a4718
Author: Stefan Agner <stefan@agner.ch>
Date:   Sun Jan 7 15:05:49 2018 +0100

    spi: imx: do not access registers while clocks disabled
    
    commit d593574aff0ab846136190b1729c151c736727ec upstream.
    
    Since clocks are disabled except during message transfer clocks
    are also disabled when spi_imx_remove gets called. Accessing
    registers leads to a freeeze at least on a i.MX 6ULL. Enable
    clocks before disabling accessing the MXC_CSPICTRL register.
    
    Fixes: 9e556dcc55774 ("spi: spi-imx: only enable the clocks when we start to transfer a message")
    Signed-off-by: Stefan Agner <stefan@agner.ch>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ec73ade66474b645f2322d78e80746310e657399
Author: Fabio Estevam <fabio.estevam@nxp.com>
Date:   Thu Jan 4 15:58:34 2018 -0200

    serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS
    
    commit 38b1f0fb42f772b8c9aac53593883a18ff5eb9d7 upstream.
    
    The wakeup mechanism via RTSDEN bit relies on the system using the RTS/CTS
    lines, so only allow such wakeup method when the system actually has
    RTS/CTS support.
    
    Fixes: bc85734b126f ("serial: imx: allow waking up on RTSD")
    Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
    Reviewed-by: Martin Kaiser <martin@kaiser.cx>
    Acked-by: Fugang Duan <fugang.duan@nxp.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d489d1e03ca2a1dc39028726974658714cbb6aca
Author: Mark Salyzyn <salyzyn@android.com>
Date:   Thu Feb 1 07:37:04 2018 -0800

    selinux: general protection fault in sock_has_perm
    
    In the absence of commit a4298e4522d6 ("net: add SOCK_RCU_FREE socket
    flag") and all the associated infrastructure changes to take advantage
    of a RCU grace period before freeing, there is a heightened
    possibility that a security check is performed while an ill-timed
    setsockopt call races in from user space.  It then is prudent to null
    check sk_security, and if the case, reject the permissions.
    
    Because of the nature of this problem, hard to duplicate, no clear
    path, this patch is a simplified band-aid for stable trees lacking the
    infrastructure for the series of commits leading up to providing a
    suitable RCU grace period.  This adjustment is orthogonal to
    infrastructure improvements that may nullify the needed check, but
    could be added as good code hygiene in all trees.
    
    general protection fault: 0000 [#1] PREEMPT SMP KASAN
    CPU: 1 PID: 14233 Comm: syz-executor2 Not tainted 4.4.112-g5f6325b #28
    task: ffff8801d1095f00 task.stack: ffff8800b5950000
    RIP: 0010:[<ffffffff81b69b7e>]  [<ffffffff81b69b7e>] sock_has_perm+0x1fe/0x3e0 security/selinux/hooks.c:4069
    RSP: 0018:ffff8800b5957ce0  EFLAGS: 00010202
    RAX: dffffc0000000000 RBX: 1ffff10016b2af9f RCX: ffffffff81b69b51
    RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000010
    RBP: ffff8800b5957de0 R08: 0000000000000001 R09: 0000000000000001
    R10: 0000000000000000 R11: 1ffff10016b2af68 R12: ffff8800b5957db8
    R13: 0000000000000000 R14: ffff8800b7259f40 R15: 00000000000000d7
    FS:  00007f72f5ae2700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000a2fa38 CR3: 00000001d7980000 CR4: 0000000000160670
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Stack:
     ffffffff81b69a1f ffff8800b5957d58 00008000b5957d30 0000000041b58ab3
     ffffffff83fc82f2 ffffffff81b69980 0000000000000246 ffff8801d1096770
     ffff8801d3165668 ffffffff8157844b ffff8801d1095f00
     ffff880000000001
    Call Trace:
    [<ffffffff81b6a19d>] selinux_socket_setsockopt+0x4d/0x80 security/selinux/hooks.c:4338
    [<ffffffff81b4873d>] security_socket_setsockopt+0x7d/0xb0 security/security.c:1257
    [<ffffffff82df1ac8>] SYSC_setsockopt net/socket.c:1757 [inline]
    [<ffffffff82df1ac8>] SyS_setsockopt+0xe8/0x250 net/socket.c:1746
    [<ffffffff83776499>] entry_SYSCALL_64_fastpath+0x16/0x92
    Code: c2 42 9b b6 81 be 01 00 00 00 48 c7 c7 a0 cb 2b 84 e8
    f7 2f 6d ff 49 8d 7d 10 48 b8 00 00 00 00 00 fc ff df 48 89
    fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 83 01 00
    00 41 8b 75 10 31
    RIP  [<ffffffff81b69b7e>] sock_has_perm+0x1fe/0x3e0 security/selinux/hooks.c:4069
    RSP <ffff8800b5957ce0>
    ---[ end trace 7b5aaf788fef6174 ]---
    
    Signed-off-by: Mark Salyzyn <salyzyn@android.com>
    Acked-by: Paul Moore <paul@paul-moore.com>
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: Stephen Smalley <sds@tycho.nsa.gov>
    Cc: selinux@tycho.nsa.gov
    Cc: linux-security-module@vger.kernel.org
    Cc: Eric Paris <eparis@parisplace.org>
    Cc: Serge E. Hallyn <serge@hallyn.com>
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1bbdf7649ffef49ba5cd1d08cf488d1b2e9ffd40
Author: Oliver Neukum <oneukum@suse.com>
Date:   Thu Jan 11 13:10:16 2018 +0100

    usb: uas: unconditionally bring back host after reset
    
    commit cbeef22fd611c4f47c494b821b2b105b8af970bb upstream.
    
    Quoting Hans:
    
    If we return 1 from our post_reset handler, then our disconnect handler
    will be called immediately afterwards. Since pre_reset blocks all scsi
    requests our disconnect handler will then hang in the scsi_remove_host
    call.
    
    This is esp. bad because our disconnect handler hanging for ever also
    stops the USB subsys from enumerating any new USB devices, causes commands
    like lsusb to hang, etc.
    
    In practice this happens when unplugging some uas devices because the hub
    code may see the device as needing a warm-reset and calls usb_reset_device
    before seeing the disconnect. In this case uas_configure_endpoints fails
    with -ENODEV. We do not want to print an error for this, so this commit
    also silences the shost_printk for -ENODEV.
    
    ENDQUOTE
    
    However, if we do that we better drop any unconditional execution
    and report to the SCSI subsystem that we have undergone a reset
    but we are not operational now.
    
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Reported-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 68b43caf4a4b98256bdb67dba025f858bdf21725
Author: Hemant Kumar <hemantk@codeaurora.org>
Date:   Tue Jan 9 12:30:53 2018 +0530

    usb: f_fs: Prevent gadget unbind if it is already unbound
    
    commit ce5bf9a50daf2d9078b505aca1cea22e88ecb94a upstream.
    
    Upon usb composition switch there is possibility of ep0 file
    release happening after gadget driver bind. In case of composition
    switch from adb to a non-adb composition gadget will never gets
    bound again resulting into failure of usb device enumeration. Fix
    this issue by checking FFS_FL_BOUND flag and avoid extra
    gadget driver unbind if it is already done as part of composition
    switch.
    
    This fixes adb reconnection error reported on Android running
    v4.4 and above kernel versions. Verified on Hikey running vanilla
    v4.15-rc7 + few out of tree Mali patches.
    
    Reviewed-at: https://android-review.googlesource.com/#/c/582632/
    
    Cc: Felipe Balbi <balbi@kernel.org>
    Cc: Greg KH <gregkh@linux-foundation.org>
    Cc: Michal Nazarewicz <mina86@mina86.com>
    Cc: John Stultz <john.stultz@linaro.org>
    Cc: Dmitry Shmidt <dimitrysh@google.com>
    Cc: Badhri <badhri@google.com>
    Cc: Android Kernel Team <kernel-team@android.com>
    Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
    [AmitP: Cherry-picked it from android-4.14 and updated the commit log]
    Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bab3a0dac8966ee9dd5f442098957ff15c7f7216
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jan 18 14:46:41 2018 +1100

    USB: serial: simple: add Motorola Tetra driver
    
    commit 46fe895e22ab3845515ec06b01eaf1282b342e29 upstream.
    
    Add new Motorola Tetra (simple) driver for Motorola Solutions TETRA PEI
    devices.
    
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=0cad ProdID=9011 Rev=24.16
    S:  Manufacturer=Motorola Solutions Inc.
    S:  Product=Motorola Solutions TETRA PEI interface
    C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
    
    Note that these devices do not support the CDC SET_CONTROL_LINE_STATE
    request (for any interface).
    
    Reported-by: Max Schulze <max.schulze@posteo.de>
    Tested-by: Max Schulze <max.schulze@posteo.de>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 46c651aea6afd5c517fa759d91d730ff5408136c
Author: Shuah Khan <shuahkh@osg.samsung.com>
Date:   Wed Jan 17 12:08:03 2018 -0700

    usbip: list: don't list devices attached to vhci_hcd
    
    commit ef824501f50846589f02173d73ce3fe6021a9d2a upstream.
    
    usbip host lists devices attached to vhci_hcd on the same server
    when user does attach over localhost or specifies the server as the
    remote.
    
    usbip attach -r localhost -b busid
    or
    usbip attach -r servername (or server IP)
    
    Fix it to check and not list devices that are attached to vhci_hcd.
    
    Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a7d225692e2adc3c50ba41c8225301b1a67cb7d3
Author: Shuah Khan <shuahkh@osg.samsung.com>
Date:   Wed Jan 17 12:07:30 2018 -0700

    usbip: prevent bind loops on devices attached to vhci_hcd
    
    commit ef54cf0c600fb8f5737fb001a9e357edda1a1de8 upstream.
    
    usbip host binds to devices attached to vhci_hcd on the same server
    when user does attach over localhost or specifies the server as the
    remote.
    
    usbip attach -r localhost -b busid
    or
    usbip attach -r servername (or server IP)
    
    Unbind followed by bind works, however device is left in a bad state with
    accesses via the attached busid result in errors and system hangs during
    shutdown.
    
    Fix it to check and bail out if the device is already attached to vhci_hcd.
    
    Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 95bb041eefc4fb4fd613cd2857ec76ea7e47fda9
Author: Jia-Ju Bai <baijiaju1990@gmail.com>
Date:   Wed Dec 13 20:34:36 2017 +0800

    USB: serial: io_edgeport: fix possible sleep-in-atomic
    
    commit c7b8f77872c73f69a16528a9eb87afefcccdc18b upstream.
    
    According to drivers/usb/serial/io_edgeport.c, the driver may sleep
    under a spinlock.
    The function call path is:
    edge_bulk_in_callback (acquire the spinlock)
       process_rcvd_data
         process_rcvd_status
           change_port_settings
             send_iosp_ext_cmd
               write_cmd_usb
                 usb_kill_urb --> may sleep
    
    To fix it, the redundant usb_kill_urb() is removed from the error path
    after usb_submit_urb() fails.
    
    This possible bug is found by my static analysis tool (DSAC) and checked
    by my code review.
    
    Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit aaea9d3f6c0b28ce8a1a9ce306089471bb1264a8
Author: Oliver Neukum <oneukum@suse.com>
Date:   Thu Jan 18 12:13:45 2018 +0100

    CDC-ACM: apply quirk for card reader
    
    commit df1cc78a52491f71d8170d513d0f6f114faa1bda upstream.
    
    This devices drops random bytes from messages if you talk to it
    too fast.
    
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9d851e1525852493158f496ee5efc0a79f45da74
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sun Jan 14 16:09:00 2018 +0100

    USB: cdc-acm: Do not log urb submission errors on disconnect
    
    commit f0386c083c2ce85284dc0b419d7b89c8e567c09f upstream.
    
    When disconnected sometimes the cdc-acm driver logs errors like these:
    
    [20278.039417] cdc_acm 2-2:2.1: urb 9 failed submission with -19
    [20278.042924] cdc_acm 2-2:2.1: urb 10 failed submission with -19
    [20278.046449] cdc_acm 2-2:2.1: urb 11 failed submission with -19
    [20278.049920] cdc_acm 2-2:2.1: urb 12 failed submission with -19
    [20278.053442] cdc_acm 2-2:2.1: urb 13 failed submission with -19
    [20278.056915] cdc_acm 2-2:2.1: urb 14 failed submission with -19
    [20278.060418] cdc_acm 2-2:2.1: urb 15 failed submission with -19
    
    Silence these by not logging errors when the result is -ENODEV.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Acked-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 80a2a5dbdc2622040f6c14b709293757b4fe51de
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu Jan 25 09:48:55 2018 +0100

    USB: serial: pl2303: new device id for Chilitag
    
    commit d08dd3f3dd2ae351b793fc5b76abdbf0fd317b12 upstream.
    
    This adds a new device id for Chilitag devices to the pl2303 driver.
    
    Reported-by: "Chu.Mike [朱堅宜]" <Mike-Chu@prolific.com.tw>
    Acked-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1821d49ab7f313b3eb5fdbb3166ef18d79aa5134
Author: OKAMOTO Yoshiaki <yokamoto@allied-telesis.co.jp>
Date:   Tue Jan 16 09:51:17 2018 +0000

    usb: option: Add support for FS040U modem
    
    commit 69341bd15018da0a662847e210f9b2380c71e623 upstream.
    
    FS040U modem is manufactured by omega, and sold by Fujisoft. This patch
    adds ID of the modem to use option1 driver. Interface 3 is used as
    qmi_wwan, so the interface is ignored.
    
    Signed-off-by: Yoshiaki Okamoto <yokamoto@allied-telesis.co.jp>
    Signed-off-by: Hiroyuki Yamamoto <hyamamo@allied-telesis.co.jp>
    Acked-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 46a7fd70437702432ab642cc3455e8cd6b72f43f
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Sat Nov 25 13:32:38 2017 -0600

    staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID
    
    
    [ Upstream commit b77992d2df9e47144354d1b25328b180afa33442 ]
    
    When not associated with an AP, wifi device drivers should respond to the
    SIOCGIWESSID ioctl with a zero-length string for the SSID, which is the
    behavior expected by dhcpcd.
    
    Currently, this driver returns an error code (-1) from the ioctl call,
    which causes dhcpcd to assume that the device is not a wireless interface
    and therefore it fails to work correctly with it thereafter.
    
    This problem was reported and tested at
    https://github.com/lwfinger/rtl8188eu/issues/234.
    
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 380d05ee26dcf075a87bfbf97fdfe33035a8beeb
Author: Colin Ian King <colin.king@canonical.com>
Date:   Tue Nov 14 16:18:28 2017 +0000

    usb: gadget: don't dereference g until after it has been null checked
    
    
    [ Upstream commit b2fc059fa549fe6881d4c1f8d698b0f50bcd16ec ]
    
    Avoid dereferencing pointer g until after g has been sanity null checked;
    move the assignment of cdev much later when it is required into a more
    local scope.
    
    Detected by CoverityScan, CID#1222135 ("Dereference before null check")
    
    Fixes: b785ea7ce662 ("usb: gadget: composite: fix ep->maxburst initialization")
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8d594f95698a098516c7e94fb92a4764e4dec4d0
Author: Icenowy Zheng <icenowy@aosc.io>
Date:   Sun Apr 16 02:51:16 2017 -0400

    media: usbtv: add a new usbid
    
    
    [ Upstream commit 04226916d2360f56d57ad00bc48d2d1854d1e0b0 ]
    
    A new usbid of UTV007 is found in a newly bought device.
    
    The usbid is 1f71:3301.
    
    The ID on the chip is:
    UTV007
    A89029.1
    1520L18K1
    
    Both video and audio is tested with the modified usbtv driver.
    
    Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
    Acked-by: Lubomir Rintel <lkundrak@v3.sk>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d8933268bd5d84b2996ce70e1d8061702395675f
Author: Gustavo A. R. Silva <garsilva@embeddedor.com>
Date:   Mon Nov 20 08:12:29 2017 -0600

    scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg
    
    
    [ Upstream commit 727535903bea924c4f73abb202c4b3e85fff0ca4 ]
    
    _vreg_ is being dereferenced before it is null checked, hence there is a
    potential null pointer dereference.
    
    Fix this by moving the pointer dereference after _vreg_ has been null
    checked.
    
    This issue was detected with the help of Coccinelle.
    
    Fixes: aa4976130934 ("ufs: Add regulator enable support")
    Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
    Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 03c2854d14bc4f55b145a9dc94ecdb03b9a231b3
Author: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Date:   Fri Nov 17 19:14:55 2017 -0200

    scsi: aacraid: Prevent crash in case of free interrupt during scsi EH path
    
    
    [ Upstream commit e4717292ddebcfe231651b5aff9fa19ca158d178 ]
    
    As part of the scsi EH path, aacraid performs a reinitialization of the
    adapter, which encompass freeing resources and IRQs, NULLifying lots of
    pointers, and then initialize it all over again.  We've identified a
    problem during the free IRQ portion of this path if CONFIG_DEBUG_SHIRQ
    is enabled on kernel config file.
    
    Happens that, in case this flag was set, right after free_irq()
    effectively clears the interrupt, it checks if it was requested as
    IRQF_SHARED. In positive case, it performs another call to the IRQ
    handler on driver. Problem is: since aacraid currently free some
    resources *before* freeing the IRQ, once free_irq() path calls the
    handler again (due to CONFIG_DEBUG_SHIRQ), aacraid crashes due to NULL
    pointer dereference with the following trace:
    
      aac_src_intr_message+0xf8/0x740 [aacraid]
      __free_irq+0x33c/0x4a0
      free_irq+0x78/0xb0
      aac_free_irq+0x13c/0x150 [aacraid]
      aac_reset_adapter+0x2e8/0x970 [aacraid]
      aac_eh_reset+0x3a8/0x5d0 [aacraid]
      scsi_try_host_reset+0x74/0x180
      scsi_eh_ready_devs+0xc70/0x1510
      scsi_error_handler+0x624/0xa20
    
    This patch prevents the crash by changing the order of the
    deinitialization in this path of aacraid: first we clear the IRQ, then
    we free other resources. No functional change intended.
    
    Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
    Reviewed-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dfd0feb42fc522a934e8b77fd8c2353f2c25f5af
Author: Darrick J. Wong <darrick.wong@oracle.com>
Date:   Mon Nov 27 09:50:17 2017 -0800

    xfs: ubsan fixes
    
    
    [ Upstream commit 22a6c83777ac7c17d6c63891beeeac24cf5da450 ]
    
    Fix some complaints from the UBSAN about signed integer addition overflows.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: Brian Foster <bfoster@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 15e1f5cf9bff882d6948c38a6e61780e55d39c16
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date:   Sun Sep 24 08:01:03 2017 +0200

    drm/omap: Fix error handling path in 'omap_dmm_probe()'
    
    
    [ Upstream commit 8677b1ac2db021ab30bb1fa34f1e56ebe0051ec3 ]
    
    If we don't find a matching device node, we must free the memory allocated
    in 'omap_dmm' a few lines above.
    
    Fixes: 7cb0d6c17b96 ("drm/omap: fix TILER on OMAP5")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 51d2967fe5d518cbc17dcbe1db159a6e92eaa615
Author: Yisheng Xie <xieyisheng1@huawei.com>
Date:   Wed Nov 29 16:11:08 2017 -0800

    kmemleak: add scheduling point to kmemleak_scan()
    
    
    [ Upstream commit bde5f6bc68db51128f875a756e9082a6c6ff7b4c ]
    
    kmemleak_scan() will scan struct page for each node and it can be really
    large and resulting in a soft lockup.  We have seen a soft lockup when
    do scan while compile kernel:
    
      watchdog: BUG: soft lockup - CPU#53 stuck for 22s! [bash:10287]
     [...]
      Call Trace:
       kmemleak_scan+0x21a/0x4c0
       kmemleak_write+0x312/0x350
       full_proxy_write+0x5a/0xa0
       __vfs_write+0x33/0x150
       vfs_write+0xad/0x1a0
       SyS_write+0x52/0xc0
       do_syscall_64+0x61/0x1a0
       entry_SYSCALL64_slow_path+0x25/0x25
    
    Fix this by adding cond_resched every MAX_SCAN_SIZE.
    
    Link: http://lkml.kernel.org/r/1511439788-20099-1-git-send-email-xieyisheng1@huawei.com
    Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
    Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
    Acked-by: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Michal Hocko <mhocko@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ff8417176a69482e40f30036b4e9eb07360ec759
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Fri Nov 24 12:00:24 2017 -0500

    SUNRPC: Allow connect to return EHOSTUNREACH
    
    
    [ Upstream commit 4ba161a793d5f43757c35feff258d9f20a082940 ]
    
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Tested-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit cbfe0c04cef3c379e71d6c1f3fe30aacef1a1ba2
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Wed Nov 29 22:34:50 2017 +0900

    quota: Check for register_shrinker() failure.
    
    
    [ Upstream commit 88bc0ede8d35edc969350852894dc864a2dc1859 ]
    
    register_shrinker() might return -ENOMEM error since Linux 3.12.
    Call panic() as with other failure checks in this function if
    register_shrinker() failed.
    
    Fixes: 1d3d4437eae1 ("vmscan: per-node deferred work")
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Cc: Jan Kara <jack@suse.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Reviewed-by: Michal Hocko <mhocko@suse.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5e7bd57ace5029df81267976bd83015dd88df1f1
Author: Geert Uytterhoeven <geert+renesas@glider.be>
Date:   Wed Nov 29 11:01:09 2017 +0100

    net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit
    
    
    [ Upstream commit 15bfe05c8d6386f1a90e9340d15336e85e32aad6 ]
    
    On 64-bit (e.g. powerpc64/allmodconfig):
    
        drivers/net/ethernet/xilinx/ll_temac_main.c: In function 'temac_start_xmit_done':
        drivers/net/ethernet/xilinx/ll_temac_main.c:633:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
            dev_kfree_skb_irq((struct sk_buff *)cur_p->app4);
                              ^
    
    cdmac_bd.app4 is u32, so it is too small to hold a kernel pointer.
    
    Note that several other fields in struct cdmac_bd are also too small to
    hold physical addresses on 64-bit platforms.
    
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8de0ae8c8bc37e51e2e46ec13145bc8b3f1efe8f
Author: Robert Lippert <roblip@gmail.com>
Date:   Mon Nov 27 15:51:55 2017 -0800

    hwmon: (pmbus) Use 64bit math for DIRECT format values
    
    
    [ Upstream commit bd467e4eababe4c04272c1e646f066db02734c79 ]
    
    Power values in the 100s of watt range can easily blow past
    32bit math limits when processing everything in microwatts.
    
    Use 64bit math instead to avoid these issues on common 32bit ARM
    BMC platforms.
    
    Fixes: 442aba78728e ("hwmon: PMBus device driver")
    Signed-off-by: Robert Lippert <rlippert@google.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 17375b2735010a400620ca378e4ccd7faafc74e3
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Mon Nov 13 07:25:40 2017 +0300

    lockd: fix "list_add double add" caused by legacy signal interface
    
    
    [ Upstream commit 81833de1a46edce9ca20cfe079872ac1c20ef359 ]
    
    restart_grace() uses hardcoded init_net.
    It can cause to "list_add double add" in following scenario:
    
    1) nfsd and lockd was started in several net namespaces
    2) nfsd in init_net was stopped (lockd was not stopped because
     it have users from another net namespaces)
    3) lockd got signal, called restart_grace() -> set_grace_period()
     and enabled lock_manager in hardcoded init_net.
    4) nfsd in init_net is started again,
     its lockd_up() calls set_grace_period() and tries to add
     lock_manager into init_net 2nd time.
    
    Jeff Layton suggest:
    "Make it safe to call locks_start_grace multiple times on the same
    lock_manager. If it's already on the global grace_list, then don't try
    to add it again.  (But we don't intentionally add twice, so for now we
    WARN about that case.)
    
    With this change, we also need to ensure that the nfsd4 lock manager
    initializes the list before we call locks_start_grace. While we're at
    it, move the rest of the nfsd_net initialization into
    nfs4_state_create_net. I see no reason to have it spread over two
    functions like it is today."
    
    Suggested patch was updated to generate warning in described situation.
    
    Suggested-by: Jeff Layton <jlayton@redhat.com>
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ebd331bed2c9cff8c9874bce07a9397c5d74df24
Author: Andrew Elble <aweits@rit.edu>
Date:   Thu Nov 9 13:41:10 2017 -0500

    nfsd: check for use of the closed special stateid
    
    
    [ Upstream commit ae254dac721d44c0bfebe2795df87459e2e88219 ]
    
    Prevent the use of the closed (invalid) special stateid by clients.
    
    Signed-off-by: Andrew Elble <aweits@rit.edu>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 21db5da6ba10006722a64be9dc679c460b44b87a
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Mon Nov 6 16:22:48 2017 +0300

    grace: replace BUG_ON by WARN_ONCE in exit_net hook
    
    
    [ Upstream commit b872285751c1af010e12d02bce7069e2061a58ca ]
    
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 19e1d83bbb79586178f2cde6f5ab3f788433a703
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Fri Nov 3 08:00:15 2017 -0400

    nfsd: Ensure we check stateid validity in the seqid operation checks
    
    
    [ Upstream commit 9271d7e509c1bfc0b9a418caec29ec8d1ac38270 ]
    
    After taking the stateid st_mutex, we want to know that the stateid
    still represents valid state before performing any non-idempotent
    actions.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 12a48b3605b80a3f4c143a83b88e4e922eb4a2e0
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Fri Nov 3 08:00:12 2017 -0400

    nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0)
    
    
    [ Upstream commit fb500a7cfee7f2f447d2bbf30cb59629feab6ac1 ]
    
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 49f1a164d4310a9586f4dbc142a9fdc001b44434
Author: Eduardo Otubo <otubo@redhat.com>
Date:   Thu Nov 23 15:18:35 2017 +0100

    xen-netfront: remove warning when unloading module
    
    
    [ Upstream commit 5b5971df3bc2775107ddad164018a8a8db633b81 ]
    
    v2:
     * Replace busy wait with wait_event()/wake_up_all()
     * Cannot garantee that at the time xennet_remove is called, the
       xen_netback state will not be XenbusStateClosed, so added a
       condition for that
     * There's a small chance for the xen_netback state is
       XenbusStateUnknown by the time the xen_netfront switches to Closed,
       so added a condition for that.
    
    When unloading module xen_netfront from guest, dmesg would output
    warning messages like below:
    
      [  105.236836] xen:grant_table: WARNING: g.e. 0x903 still in use!
      [  105.236839] deferring g.e. 0x903 (pfn 0x35805)
    
    This problem relies on netfront and netback being out of sync. By the time
    netfront revokes the g.e.'s netback didn't have enough time to free all of
    them, hence displaying the warnings on dmesg.
    
    The trick here is to make netfront to wait until netback frees all the g.e.'s
    and only then continue to cleanup for the module removal, and this is done by
    manipulating both device states.
    
    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fe7832ffea9ab8c579b4bd94f3529380dbb3f6e6
Author: Wanpeng Li <wanpeng.li@hotmail.com>
Date:   Mon Nov 20 14:52:21 2017 -0800

    KVM: VMX: Fix rflags cache during vCPU reset
    
    
    [ Upstream commit c37c28730bb031cc8a44a130c2555c0f3efbe2d0 ]
    
    Reported by syzkaller:
    
       *** Guest State ***
       CR0: actual=0x0000000080010031, shadow=0x0000000060000010, gh_mask=fffffffffffffff7
       CR4: actual=0x0000000000002061, shadow=0x0000000000000000, gh_mask=ffffffffffffe8f1
       CR3 = 0x000000002081e000
       RSP = 0x000000000000fffa  RIP = 0x0000000000000000
       RFLAGS=0x00023000         DR7 = 0x00000000000000
              ^^^^^^^^^^
       ------------[ cut here ]------------
       WARNING: CPU: 6 PID: 24431 at /home/kernel/linux/arch/x86/kvm//x86.c:7302 kvm_arch_vcpu_ioctl_run+0x651/0x2ea0 [kvm]
       CPU: 6 PID: 24431 Comm: reprotest Tainted: G        W  OE   4.14.0+ #26
       RIP: 0010:kvm_arch_vcpu_ioctl_run+0x651/0x2ea0 [kvm]
       RSP: 0018:ffff880291d179e0 EFLAGS: 00010202
       Call Trace:
        kvm_vcpu_ioctl+0x479/0x880 [kvm]
        do_vfs_ioctl+0x142/0x9a0
        SyS_ioctl+0x74/0x80
        entry_SYSCALL_64_fastpath+0x23/0x9a
    
    The failed vmentry is triggered by the following beautified testcase:
    
        #include <unistd.h>
        #include <sys/syscall.h>
        #include <string.h>
        #include <stdint.h>
        #include <linux/kvm.h>
        #include <fcntl.h>
        #include <sys/ioctl.h>
    
        long r[5];
        int main()
        {
            struct kvm_debugregs dr = { 0 };
    
            r[2] = open("/dev/kvm", O_RDONLY);
            r[3] = ioctl(r[2], KVM_CREATE_VM, 0);
            r[4] = ioctl(r[3], KVM_CREATE_VCPU, 7);
            struct kvm_guest_debug debug = {
                    .control = 0xf0403,
                    .arch = {
                            .debugreg[6] = 0x2,
                            .debugreg[7] = 0x2
                    }
            };
            ioctl(r[4], KVM_SET_GUEST_DEBUG, &debug);
            ioctl(r[4], KVM_RUN, 0);
        }
    
    which testcase tries to setup the processor specific debug
    registers and configure vCPU for handling guest debug events through
    KVM_SET_GUEST_DEBUG.  The KVM_SET_GUEST_DEBUG ioctl will get and set
    rflags in order to set TF bit if single step is needed. All regs' caches
    are reset to avail and GUEST_RFLAGS vmcs field is reset to 0x2 during vCPU
    reset. However, the cache of rflags is not reset during vCPU reset. The
    function vmx_get_rflags() returns an unreset rflags cache value since
    the cache is marked avail, it is 0 after boot. Vmentry fails if the
    rflags reserved bit 1 is 0.
    
    This patch fixes it by resetting both the GUEST_RFLAGS vmcs field and
    its cache to 0x2 during vCPU reset.
    
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Tested-by: Dmitry Vyukov <dvyukov@google.com>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    Cc: Nadav Amit <nadav.amit@gmail.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit de3d7e13461c5727128ffaa725d254d2c704ba03
Author: Josef Bacik <jbacik@fb.com>
Date:   Wed Nov 15 16:20:52 2017 -0500

    btrfs: fix deadlock when writing out space cache
    
    
    [ Upstream commit b77000ed558daa3bef0899d29bf171b8c9b5e6a8 ]
    
    If we fail to prepare our pages for whatever reason (out of memory in
    our case) we need to make sure to drop the block_group->data_rwsem,
    otherwise hilarity ensues.
    
    Signed-off-by: Josef Bacik <jbacik@fb.com>
    Reviewed-by: Omar Sandoval <osandov@fb.com>
    Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
    Reviewed-by: David Sterba <dsterba@suse.com>
    [ add label and use existing unlocking code ]
    Signed-off-by: David Sterba <dsterba@suse.com>
    
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4870fb97221d3fd8d8868e26aa4e61f78ebb32b2
Author: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Date:   Tue Nov 14 23:20:05 2017 +0800

    mac80211: fix the update of path metric for RANN frame
    
    
    [ Upstream commit fbbdad5edf0bb59786a51b94a9d006bc8c2da9a2 ]
    
    The previous path metric update from RANN frame has not considered
    the own link metric toward the transmitting mesh STA. Fix this.
    
    Reported-by: Michael65535
    Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5acc065c6b3e389fa5520e1d171c79c7c5c701b8
Author: zhangliping <zhangliping02@baidu.com>
Date:   Sat Nov 25 22:02:12 2017 +0800

    openvswitch: fix the incorrect flow action alloc size
    
    
    [ Upstream commit 67c8d22a73128ff910e2287567132530abcf5b71 ]
    
    If we want to add a datapath flow, which has more than 500 vxlan outputs'
    action, we will get the following error reports:
      openvswitch: netlink: Flow action size 32832 bytes exceeds max
      openvswitch: netlink: Flow action size 32832 bytes exceeds max
      openvswitch: netlink: Actions may not be safe on all matching packets
      ... ...
    
    It seems that we can simply enlarge the MAX_ACTIONS_BUFSIZE to fix it, but
    this is not the root cause. For example, for a vxlan output action, we need
    about 60 bytes for the nlattr, but after it is converted to the flow
    action, it only occupies 24 bytes. This means that we can still support
    more than 1000 vxlan output actions for a single datapath flow under the
    the current 32k max limitation.
    
    So even if the nla_len(attr) is larger than MAX_ACTIONS_BUFSIZE, we
    shouldn't report EINVAL and keep it move on, as the judgement can be
    done by the reserve_sfa_size.
    
    Signed-off-by: zhangliping <zhangliping02@baidu.com>
    Acked-by: Pravin B Shelar <pshelar@ovn.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 44ef4f4033dc9eac4a9697ea7e0f1577dfd9ad06
Author: Felix Kuehling <Felix.Kuehling@amd.com>
Date:   Wed Nov 1 19:21:57 2017 -0400

    drm/amdkfd: Fix SDMA oversubsription handling
    
    
    [ Upstream commit 8c946b8988acec785bcf67088b6bd0747f36d2d3 ]
    
    SDMA only supports a fixed number of queues. HWS cannot handle
    oversubscription.
    
    Signed-off-by: shaoyun liu <shaoyun.liu@amd.com>
    Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a50f2e242887ad0b0feb62df79cd05f7943c709e
Author: shaoyunl <Shaoyun.Liu@amd.com>
Date:   Wed Nov 1 19:21:56 2017 -0400

    drm/amdkfd: Fix SDMA ring buffer size calculation
    
    
    [ Upstream commit d12fb13f23199faa7e536acec1db49068e5a067d ]
    
    ffs function return the position of the first bit set on 1 based.
    (bit zero returns 1).
    
    Signed-off-by: shaoyun liu <shaoyun.liu@amd.com>
    Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 206fa7b19cb266575bb7c100723d7c060c1bd886
Author: Felix Kuehling <Felix.Kuehling@amd.com>
Date:   Wed Nov 1 19:21:55 2017 -0400

    drm/amdgpu: Fix SDMA load/unload sequence on HWS disabled mode
    
    
    [ Upstream commit cf21654b40968609779751b34e7923180968fe5b ]
    
    Fix the SDMA load and unload sequence as suggested by HW document.
    
    Signed-off-by: shaoyun liu <shaoyun.liu@amd.com>
    Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Acked-by: Oded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1f9bfbe7016b4a772bb6b47f8209ec76f6fad57d
Author: Michael Lyle <mlyle@lyle.org>
Date:   Fri Nov 24 15:14:27 2017 -0800

    bcache: check return value of register_shrinker
    
    
    [ Upstream commit 6c4ca1e36cdc1a0a7a84797804b87920ccbebf51 ]
    
    register_shrinker is now __must_check, so check it to kill a warning.
    Caller of bch_btree_cache_alloc in super.c appropriately checks return
    value so this is fully plumbed through.
    
    This V2 fixes checkpatch warnings and improves the commit description,
    as I was too hasty getting the previous version out.
    
    Signed-off-by: Michael Lyle <mlyle@lyle.org>
    Reviewed-by: Vojtech Pavlik <vojtech@suse.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5fb21a653095dfc913eb82868143a95b5366f0c1
Author: James Hogan <jhogan@kernel.org>
Date:   Wed Nov 15 21:17:55 2017 +0000

    cpufreq: Add Loongson machine dependencies
    
    
    [ Upstream commit 0d307935fefa6389eb726c6362351c162c949101 ]
    
    The MIPS loongson cpufreq drivers don't build unless configured for the
    correct machine type, due to dependency on machine specific architecture
    headers and symbols in machine specific platform code.
    
    More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU,
    neither of which is defined in asm/mach-loongson32/regs-clk.h unless
    CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references
    loongson2_clockmod_table[], which is only defined in
    arch/mips/loongson64/lemote-2f/clock.c, i.e. when
    CONFIG_LEMOTE_MACH2F=y.
    
    Add these dependencies to Kconfig to avoid randconfig / allyesconfig
    build failures (e.g. when based on BMIPS which also has a cpufreq
    driver).
    
    Signed-off-by: James Hogan <jhogan@kernel.org>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0deb9532cafb37a0775e8e853fca0272eb2bee0f
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sun Oct 15 21:24:49 2017 +0200

    ACPI / bus: Leave modalias empty for devices which are not present
    
    
    [ Upstream commit 10809bb976648ac58194a629e3d7af99e7400297 ]
    
    Most Bay and Cherry Trail devices use a generic DSDT with all possible
    peripheral devices present in the DSDT, with their _STA returning 0x00 or
    0x0f based on AML variables which describe what is actually present on
    the board.
    
    Since ACPI device objects with a 0x00 status (not present) still get an
    entry under /sys/bus/acpi/devices, and those entry had an acpi:PNPID
    modalias, userspace would end up loading modules for non present hardware.
    
    This commit fixes this by leaving the modalias empty for non present
    devices. This results in 10 modules less being loaded with a generic
    distro kernel config on my Cherry Trail test-device (a GPD pocket).
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 77e1eb750f4172f0718a6d770798b0ab9eeeb8d6
Author: Nikita Leshenko <nikita.leshchenko@oracle.com>
Date:   Sun Nov 5 15:52:33 2017 +0200

    KVM: x86: ioapic: Preserve read-only values in the redirection table
    
    
    [ Upstream commit b200dded0a6974a3b69599832b2203483920ab25 ]
    
    According to 82093AA (IOAPIC) manual, Remote IRR and Delivery Status are
    read-only. QEMU implements the bits as RO in commit 479c2a1cb7fb
    ("ioapic: keep RO bits for IOAPIC entry").
    
    Signed-off-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
    Reviewed-by: Liran Alon <liran.alon@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
    Reviewed-by: Steve Rutherford <srutherford@google.com>
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3ee7ae2bb537e54d3f6ce7120c5cc39957bec930
Author: Nikita Leshenko <nikita.leshchenko@oracle.com>
Date:   Sun Nov 5 15:52:32 2017 +0200

    KVM: x86: ioapic: Clear Remote IRR when entry is switched to edge-triggered
    
    
    [ Upstream commit a8bfec2930525808c01f038825d1df3904638631 ]
    
    Some OSes (Linux, Xen) use this behavior to clear the Remote IRR bit for
    IOAPICs without an EOI register. They simulate the EOI message manually
    by changing the trigger mode to edge and then back to level, with the
    entry being masked during this.
    
    QEMU implements this feature in commit ed1263c363c9
    ("ioapic: clear remote irr bit for edge-triggered interrupts")
    
    As a side effect, this commit removes an incorrect behavior where Remote
    IRR was cleared when the redirection table entry was rewritten. This is not
    consistent with the manual and also opens an opportunity for a strange
    behavior when a redirection table entry is modified from an interrupt
    handler that handles the same entry: The modification will clear the
    Remote IRR bit even though the interrupt handler is still running.
    
    Signed-off-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
    Reviewed-by: Liran Alon <liran.alon@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
    Reviewed-by: Steve Rutherford <srutherford@google.com>
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 19a2c007214931808cbeae3ceb673233e57ed4f9
Author: Nikita Leshenko <nikita.leshchenko@oracle.com>
Date:   Sun Nov 5 15:52:29 2017 +0200

    KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race
    
    
    [ Upstream commit 0fc5a36dd6b345eb0d251a65c236e53bead3eef7 ]
    
    KVM uses ioapic_handled_vectors to track vectors that need to notify the
    IOAPIC on EOI. The problem is that IOAPIC can be reconfigured while an
    interrupt with old configuration is pending or running and
    ioapic_handled_vectors only remembers the newest configuration;
    thus EOI from the old interrupt is not delievered to the IOAPIC.
    
    A previous commit db2bdcbbbd32
    ("KVM: x86: fix edge EOI and IOAPIC reconfig race")
    addressed this issue by adding pending edge-triggered interrupts to
    ioapic_handled_vectors, fixing this race for edge-triggered interrupts.
    The commit explicitly ignored level-triggered interrupts,
    but this race applies to them as well:
    
    1) IOAPIC sends a level triggered interrupt vector to VCPU0
    2) VCPU0's handler deasserts the irq line and reconfigures the IOAPIC
       to route the vector to VCPU1. The reconfiguration rewrites only the
       upper 32 bits of the IOREDTBLn register. (Causes KVM to update
       ioapic_handled_vectors for VCPU0 and it no longer includes the vector.)
    3) VCPU0 sends EOI for the vector, but it's not delievered to the
       IOAPIC because the ioapic_handled_vectors doesn't include the vector.
    4) New interrupts are not delievered to VCPU1 because remote_irr bit
       is set forever.
    
    Therefore, the correct behavior is to add all pending and running
    interrupts to ioapic_handled_vectors.
    
    This commit introduces a slight performance hit similar to
    commit db2bdcbbbd32 ("KVM: x86: fix edge EOI and IOAPIC reconfig race")
    for the rare case that the vector is reused by a non-IOAPIC source on
    VCPU0. We prefer to keep solution simple and not handle this case just
    as the original commit does.
    
    Fixes: db2bdcbbbd32 ("KVM: x86: fix edge EOI and IOAPIC reconfig race")
    
    Signed-off-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
    Reviewed-by: Liran Alon <liran.alon@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3bad2ece682151144b014bd18506d44acf6c21e4
Author: Wanpeng Li <wanpeng.li@hotmail.com>
Date:   Sun Nov 5 16:54:47 2017 -0800

    KVM: X86: Fix operand/address-size during instruction decoding
    
    
    [ Upstream commit 3853be2603191829b442b64dac6ae8ba0c027bf9 ]
    
    Pedro reported:
      During tests that we conducted on KVM, we noticed that executing a "PUSH %ES"
      instruction under KVM produces different results on both memory and the SP
      register depending on whether EPT support is enabled. With EPT the SP is
      reduced by 4 bytes (and the written value is 0-padded) but without EPT support
      it is only reduced by 2 bytes. The difference can be observed when the CS.DB
      field is 1 (32-bit) but not when it's 0 (16-bit).
    
    The internal segment descriptor cache exist even in real/vm8096 mode. The CS.D
    also should be respected instead of just default operand/address-size/66H
    prefix/67H prefix during instruction decoding. This patch fixes it by also
    adjusting operand/address-size according to CS.D.
    
    Reported-by: Pedro Fonseca <pfonseca@cs.washington.edu>
    Tested-by: Pedro Fonseca <pfonseca@cs.washington.edu>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    Cc: Nadav Amit <nadav.amit@gmail.com>
    Cc: Pedro Fonseca <pfonseca@cs.washington.edu>
    Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 80d2b5af21d2a29abfd58d378195a446dbc3ae43
Author: Liran Alon <liran.alon@oracle.com>
Date:   Sun Nov 5 16:56:34 2017 +0200

    KVM: x86: Don't re-execute instruction when not passing CR2 value
    
    
    [ Upstream commit 9b8ae63798cb97e785a667ff27e43fa6220cb734 ]
    
    In case of instruction-decode failure or emulation failure,
    x86_emulate_instruction() will call reexecute_instruction() which will
    attempt to use the cr2 value passed to x86_emulate_instruction().
    However, when x86_emulate_instruction() is called from
    emulate_instruction(), cr2 is not passed (passed as 0) and therefore
    it doesn't make sense to execute reexecute_instruction() logic at all.
    
    Fixes: 51d8b66199e9 ("KVM: cleanup emulate_instruction")
    
    Signed-off-by: Liran Alon <liran.alon@oracle.com>
    Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3d4df917d67191bca18aec35b9d1065d718fc39c
Author: Liran Alon <liran.alon@oracle.com>
Date:   Sun Nov 5 16:56:33 2017 +0200

    KVM: x86: emulator: Return to user-mode on L1 CPL=0 emulation failure
    
    
    [ Upstream commit 1f4dcb3b213235e642088709a1c54964d23365e9 ]
    
    On this case, handle_emulation_failure() fills kvm_run with
    internal-error information which it expects to be delivered
    to user-mode for further processing.
    However, the code reports a wrong return-value which makes KVM to never
    return to user-mode on this scenario.
    
    Fixes: 6d77dbfc88e3 ("KVM: inject #UD if instruction emulation fails and exit to
    userspace")
    
    Signed-off-by: Liran Alon <liran.alon@oracle.com>
    Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2b84fd62aa402f83fafb1f5bcc014cc135bdcf69
Author: Lyude Paul <lyude@redhat.com>
Date:   Tue Dec 12 14:31:30 2017 -0500

    igb: Free IRQs when device is hotplugged
    
    commit 888f22931478a05bc81ceb7295c626e1292bf0ed upstream.
    
    Recently I got a Caldigit TS3 Thunderbolt 3 dock, and noticed that upon
    hotplugging my kernel would immediately crash due to igb:
    
    [  680.825801] kernel BUG at drivers/pci/msi.c:352!
    [  680.828388] invalid opcode: 0000 [#1] SMP
    [  680.829194] Modules linked in: igb(O) thunderbolt i2c_algo_bit joydev vfat fat btusb btrtl btbcm btintel bluetooth ecdh_generic hp_wmi sparse_keymap rfkill wmi_bmof iTCO_wdt intel_rapl x86_pkg_temp_thermal coretemp crc32_pclmul snd_pcm rtsx_pci_ms mei_me snd_timer memstick snd pcspkr mei soundcore i2c_i801 tpm_tis psmouse shpchp wmi tpm_tis_core tpm video hp_wireless acpi_pad rtsx_pci_sdmmc mmc_core crc32c_intel serio_raw rtsx_pci mfd_core xhci_pci xhci_hcd i2c_hid i2c_core [last unloaded: igb]
    [  680.831085] CPU: 1 PID: 78 Comm: kworker/u16:1 Tainted: G           O     4.15.0-rc3Lyude-Test+ #6
    [  680.831596] Hardware name: HP HP ZBook Studio G4/826B, BIOS P71 Ver. 01.03 06/09/2017
    [  680.832168] Workqueue: kacpi_hotplug acpi_hotplug_work_fn
    [  680.832687] RIP: 0010:free_msi_irqs+0x180/0x1b0
    [  680.833271] RSP: 0018:ffffc9000030fbf0 EFLAGS: 00010286
    [  680.833761] RAX: ffff8803405f9c00 RBX: ffff88033e3d2e40 RCX: 000000000000002c
    [  680.834278] RDX: 0000000000000000 RSI: 00000000000000ac RDI: ffff880340be2178
    [  680.834832] RBP: 0000000000000000 R08: ffff880340be1ff0 R09: ffff8803405f9c00
    [  680.835342] R10: 0000000000000000 R11: 0000000000000040 R12: ffff88033d63a298
    [  680.835822] R13: ffff88033d63a000 R14: 0000000000000060 R15: ffff880341959000
    [  680.836332] FS:  0000000000000000(0000) GS:ffff88034f440000(0000) knlGS:0000000000000000
    [  680.836817] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  680.837360] CR2: 000055e64044afdf CR3: 0000000001c09002 CR4: 00000000003606e0
    [  680.837954] Call Trace:
    [  680.838853]  pci_disable_msix+0xce/0xf0
    [  680.839616]  igb_reset_interrupt_capability+0x5d/0x60 [igb]
    [  680.840278]  igb_remove+0x9d/0x110 [igb]
    [  680.840764]  pci_device_remove+0x36/0xb0
    [  680.841279]  device_release_driver_internal+0x157/0x220
    [  680.841739]  pci_stop_bus_device+0x7d/0xa0
    [  680.842255]  pci_stop_bus_device+0x2b/0xa0
    [  680.842722]  pci_stop_bus_device+0x3d/0xa0
    [  680.843189]  pci_stop_and_remove_bus_device+0xe/0x20
    [  680.843627]  trim_stale_devices+0xf3/0x140
    [  680.844086]  trim_stale_devices+0x94/0x140
    [  680.844532]  trim_stale_devices+0xa6/0x140
    [  680.845031]  ? get_slot_status+0x90/0xc0
    [  680.845536]  acpiphp_check_bridge.part.5+0xfe/0x140
    [  680.846021]  acpiphp_hotplug_notify+0x175/0x200
    [  680.846581]  ? free_bridge+0x100/0x100
    [  680.847113]  acpi_device_hotplug+0x8a/0x490
    [  680.847535]  acpi_hotplug_work_fn+0x1a/0x30
    [  680.848076]  process_one_work+0x182/0x3a0
    [  680.848543]  worker_thread+0x2e/0x380
    [  680.848963]  ? process_one_work+0x3a0/0x3a0
    [  680.849373]  kthread+0x111/0x130
    [  680.849776]  ? kthread_create_worker_on_cpu+0x50/0x50
    [  680.850188]  ret_from_fork+0x1f/0x30
    [  680.850601] Code: 43 14 85 c0 0f 84 d5 fe ff ff 31 ed eb 0f 83 c5 01 39 6b 14 0f 86 c5 fe ff ff 8b 7b 10 01 ef e8 b7 e4 d2 ff 48 83 78 70 00 74 e3 <0f> 0b 49 8d b5 a0 00 00 00 e8 62 6f d3 ff e9 c7 fe ff ff 48 8b
    [  680.851497] RIP: free_msi_irqs+0x180/0x1b0 RSP: ffffc9000030fbf0
    
    As it turns out, normally the freeing of IRQs that would fix this is called
    inside of the scope of __igb_close(). However, since the device is
    already gone by the point we try to unregister the netdevice from the
    driver due to a hotplug we end up seeing that the netif isn't present
    and thus, forget to free any of the device IRQs.
    
    So: make sure that if we're in the process of dismantling the netdev, we
    always allow __igb_close() to be called so that IRQs may be freed
    normally. Additionally, only allow igb_close() to be called from
    __igb_close() if it hasn't already been called for the given adapter.
    
    Signed-off-by: Lyude Paul <lyude@redhat.com>
    Fixes: 9474933caf21 ("igb: close/suspend race in netif_device_detach")
    Cc: Todd Fujinaka <todd.fujinaka@intel.com>
    Cc: Stephen Hemminger <stephen@networkplumber.org>
    Tested-by: Aaron Brown <aaron.f.brown@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f42132c9610fa22b8377c4636b2e39664293fd66
Author: Jesse Chan <jc@linux.com>
Date:   Mon Nov 20 12:57:13 2017 -0800

    mtd: nand: denali_pci: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
    
    commit d822401d1c6898a4a4ee03977b78b8cec402e88a upstream.
    
    This change resolves a new compile-time warning
    when built as a loadable module:
    
    WARNING: modpost: missing MODULE_LICENSE() in drivers/mtd/nand/denali_pci.o
    see include/linux/module.h for more information
    
    This adds the license as "GPL v2", which matches the header of the file.
    
    MODULE_DESCRIPTION and MODULE_AUTHOR are also added.
    
    Signed-off-by: Jesse Chan <jc@linux.com>
    Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 40ac08f609145800e1062b24e712f2e1e673f6e4
Author: Jesse Chan <jc@linux.com>
Date:   Mon Nov 20 12:54:26 2017 -0800

    gpio: ath79: add missing MODULE_DESCRIPTION/LICENSE
    
    commit 539340f37e6d6ed4cd93e8e18c9b2e4eafd4b842 upstream.
    
    This change resolves a new compile-time warning
    when built as a loadable module:
    
    WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
    see include/linux/module.h for more information
    
    This adds the license as "GPL v2", which matches the header of the file.
    
    MODULE_DESCRIPTION is also added.
    
    Signed-off-by: Jesse Chan <jc@linux.com>
    Acked-by: Alban Bedel <albeu@free.fr>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 35831adf13e869d1b6eceb923229621d55053c3d
Author: Jesse Chan <jc@linux.com>
Date:   Mon Nov 20 12:54:52 2017 -0800

    gpio: iop: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
    
    commit 97b03136e1b637d7a9d2274c099e44ecf23f1103 upstream.
    
    This change resolves a new compile-time warning
    when built as a loadable module:
    
    WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
    see include/linux/module.h for more information
    
    This adds the license as "GPL", which matches the header of the file.
    
    MODULE_DESCRIPTION and MODULE_AUTHOR are also added.
    
    Signed-off-by: Jesse Chan <jc@linux.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3f19b9ea13f49aed67192e768f207b7ecbd2cb1f
Author: Jesse Chan <jc@linux.com>
Date:   Mon Nov 20 12:58:27 2017 -0800

    power: reset: zx-reboot: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
    
    commit 348c7cf5fcbcb68838255759d4cb45d039af36d2 upstream.
    
    This change resolves a new compile-time warning
    when built as a loadable module:
    
    WARNING: modpost: missing MODULE_LICENSE() in drivers/power/reset/zx-reboot.o
    see include/linux/module.h for more information
    
    This adds the license as "GPL v2", which matches the header of the file.
    
    MODULE_DESCRIPTION and MODULE_AUTHOR are also added.
    
    Signed-off-by: Jesse Chan <jc@linux.com>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fba245f4c6351b1d25dd4594f0a092bb7a78cf12
Author: Stephan Mueller <smueller@chronox.de>
Date:   Tue Jan 2 08:55:25 2018 +0100

    crypto: af_alg - whitelist mask and type
    
    commit bb30b8848c85e18ca7e371d0a869e94b3e383bdf upstream.
    
    The user space interface allows specifying the type and mask field used
    to allocate the cipher. Only a subset of the possible flags are intended
    for user space. Therefore, white-list the allowed flags.
    
    In case the user space caller uses at least one non-allowed flag, EINVAL
    is returned.
    
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Signed-off-by: Stephan Mueller <smueller@chronox.de>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0b69d7f4b5fc1ac0cf49a21139a1384e6d0c934f
Author: Stephan Mueller <smueller@chronox.de>
Date:   Thu Jan 18 20:41:09 2018 +0100

    crypto: aesni - handle zero length dst buffer
    
    commit 9c674e1e2f9e24fa4392167efe343749008338e0 upstream.
    
    GCM can be invoked with a zero destination buffer. This is possible if
    the AAD and the ciphertext have zero lengths and only the tag exists in
    the source buffer (i.e. a source buffer cannot be zero). In this case,
    the GCM cipher only performs the authentication and no decryption
    operation.
    
    When the destination buffer has zero length, it is possible that no page
    is mapped to the SG pointing to the destination. In this case,
    sg_page(req->dst) is an invalid access. Therefore, page accesses should
    only be allowed if the req->dst->length is non-zero which is the
    indicator that a page must exist.
    
    This fixes a crash that can be triggered by user space via AF_ALG.
    
    Signed-off-by: Stephan Mueller <smueller@chronox.de>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 623e5c8ae32b39cc8baea83478695dc624935318
Author: Takashi Iwai <tiwai@suse.de>
Date:   Tue Jan 9 23:11:03 2018 +0100

    ALSA: seq: Make ioctls race-free
    
    commit b3defb791b26ea0683a93a4f49c77ec45ec96f10 upstream.
    
    The ALSA sequencer ioctls have no protection against racy calls while
    the concurrent operations may lead to interfere with each other.  As
    reported recently, for example, the concurrent calls of setting client
    pool with a combination of write calls may lead to either the
    unkillable dead-lock or UAF.
    
    As a slightly big hammer solution, this patch introduces the mutex to
    make each ioctl exclusive.  Although this may reduce performance via
    parallel ioctl calls, usually it's not demanded for sequencer usages,
    hence it should be negligible.
    
    Reported-by: Luo Quan <a4651386@163.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    [bwh: Backported to 4.4: ioctl dispatch is done from snd_seq_do_ioctl();
     take the mutex and add ret variable there.]
    Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 145ebf95fb346528dd276c3e23324609e5f4d3f6
Author: Hugh Dickins <hughd@google.com>
Date:   Mon Jan 29 18:15:33 2018 -0800

    kaiser: fix intel_bts perf crashes
    
    Vince reported perf_fuzzer quickly locks up on 4.15-rc7 with PTI;
    Robert reported Bad RIP with KPTI and Intel BTS also on 4.15-rc7:
    honggfuzz -f /tmp/somedirectorywithatleastonefile \
              --linux_perf_bts_edge -s -- /bin/true
    (honggfuzz from https://github.com/google/honggfuzz) crashed with
    BUG: unable to handle kernel paging request at ffff9d3215100000
    (then narrowed it down to
    perf record --per-thread -e intel_bts//u -- /bin/ls).
    
    The intel_bts driver does not use the 'normal' BTS buffer which is
    exposed through kaiser_add_mapping(), but instead uses the memory
    allocated for the perf AUX buffer.
    
    This obviously comes apart when using PTI, because then the kernel
    mapping, which includes that AUX buffer memory, disappears while
    switched to user page tables.
    
    Easily fixed in old-Kaiser backports, by applying kaiser_add_mapping()
    to those pages; perhaps not so easy for upstream, where 4.15-rc8 commit
    99a9dc98ba52 ("x86,perf: Disable intel_bts when PTI") disables for now.
    
    Slightly reorganized surrounding code in bts_buffer_setup_aux(),
    so it can better match bts_buffer_free_aux(): free_aux with an #ifdef
    to avoid the loop when PTI is off, but setup_aux needs to loop anyway
    (and kaiser_add_mapping() is cheap when PTI config is off or "pti=off").
    
    Reported-by: Vince Weaver <vincent.weaver@maine.edu>
    Reported-by: Robert Święcki <robert@swiecki.net>
    Analyzed-by: Peter Zijlstra <peterz@infradead.org>
    Analyzed-by: Stephane Eranian <eranian@google.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Vince Weaver <vince@deater.net>
    Cc: stable@vger.kernel.org
    Cc: Jiri Kosina <jkosina@suze.cz>
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5991ee90a270537a8a04751f0097b82274ebc177
Author: Dave Hansen <dave.hansen@linux.intel.com>
Date:   Wed Jan 10 14:49:39 2018 -0800

    x86/pti: Make unpoison of pgd for trusted boot work for real
    
    commit 445b69e3b75e42362a5bdc13c8b8f61599e2228a upstream.
    
    The inital fix for trusted boot and PTI potentially misses the pgd clearing
    if pud_alloc() sets a PGD.  It probably works in *practice* because for two
    adjacent calls to map_tboot_page() that share a PGD entry, the first will
    clear NX, *then* allocate and set the PGD (without NX clear).  The second
    call will *not* allocate but will clear the NX bit.
    
    Defer the NX clearing to a point after it is known that all top-level
    allocations have occurred.  Add a comment to clarify why.
    
    [ tglx: Massaged changelog ]
    
    [hughd notes: I have not tested tboot, but this looks to me as necessary
    and as safe in old-Kaiser backports as it is upstream; I'm not submitting
    the commit-to-be-fixed 262b6b30087, since it was undone by 445b69e3b75e,
    and makes conflict trouble because of 5-level's p4d versus 4-level's pgd.]
    
    Fixes: 262b6b30087 ("x86/tboot: Unbreak tboot with PTI enabled")
    Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Jon Masters <jcm@redhat.com>
    Cc: "Tim Chen" <tim.c.chen@linux.intel.com>
    Cc: gnomes@lxorguk.ukuu.org.uk
    Cc: peterz@infradead.org
    Cc: ning.sun@intel.com
    Cc: tboot-devel@lists.sourceforge.net
    Cc: andi@firstfloor.org
    Cc: luto@kernel.org
    Cc: law@redhat.com
    Cc: pbonzini@redhat.com
    Cc: torvalds@linux-foundation.org
    Cc: gregkh@linux-foundation.org
    Cc: dwmw@amazon.co.uk
    Cc: nickc@redhat.com
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180110224939.2695CD47@viggo.jf.intel.com
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit faa74a862a9442233bff39a496013a74775fb660
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Tue Jan 30 03:37:46 2018 +0100

    bpf: reject stores into ctx via st and xadd
    
    [ upstream commit f37a8cb84cce18762e8f86a70bd6a49a66ab964c ]
    
    Alexei found that verifier does not reject stores into context
    via BPF_ST instead of BPF_STX. And while looking at it, we
    also should not allow XADD variant of BPF_STX.
    
    The context rewriter is only assuming either BPF_LDX_MEM- or
    BPF_STX_MEM-type operations, thus reject anything other than
    that so that assumptions in the rewriter properly hold. Add
    test cases as well for BPF selftests.
    
    Fixes: d691f9e8d440 ("bpf: allow programs to write to certain skb fields")
    Reported-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 02662601a231f8721930168ce71d84bcfb8d9a96
Author: Alexei Starovoitov <ast@kernel.org>
Date:   Tue Jan 30 03:37:45 2018 +0100

    bpf: fix 32-bit divide by zero
    
    [ upstream commit 68fda450a7df51cff9e5a4d4a4d9d0d5f2589153 ]
    
    due to some JITs doing if (src_reg == 0) check in 64-bit mode
    for div/mod operations mask upper 32-bits of src register
    before doing the check
    
    Fixes: 622582786c9e ("net: filter: x86: internal BPF JIT")
    Fixes: 7a12b5031c6b ("sparc64: Add eBPF JIT.")
    Reported-by: syzbot+48340bb518e88849e2e3@syzkaller.appspotmail.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b72ba2a0d82447538c7c977ccb3f2b31b19b7767
Author: Eric Dumazet <edumazet@google.com>
Date:   Tue Jan 30 03:37:44 2018 +0100

    bpf: fix divides by zero
    
    [ upstream commit c366287ebd698ef5e3de300d90cd62ee9ee7373e ]
    
    Divides by zero are not nice, lets avoid them if possible.
    
    Also do_div() seems not needed when dealing with 32bit operands,
    but this seems a minor detail.
    
    Fixes: bd4cf0ed331a ("net: filter: rework/optimize internal BPF interpreter's instruction set")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 96d9b2338bed553c37f759127d8d18c857449ceb
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Tue Jan 30 03:37:43 2018 +0100

    bpf: avoid false sharing of map refcount with max_entries
    
    [ upstream commit be95a845cc4402272994ce290e3ad928aff06cb9 ]
    
    In addition to commit b2157399cc98 ("bpf: prevent out-of-bounds
    speculation") also change the layout of struct bpf_map such that
    false sharing of fast-path members like max_entries is avoided
    when the maps reference counter is altered. Therefore enforce
    them to be placed into separate cachelines.
    
    pahole dump after change:
    
      struct bpf_map {
            const struct bpf_map_ops  * ops;                 /*     0     8 */
            struct bpf_map *           inner_map_meta;       /*     8     8 */
            void *                     security;             /*    16     8 */
            enum bpf_map_type          map_type;             /*    24     4 */
            u32                        key_size;             /*    28     4 */
            u32                        value_size;           /*    32     4 */
            u32                        max_entries;          /*    36     4 */
            u32                        map_flags;            /*    40     4 */
            u32                        pages;                /*    44     4 */
            u32                        id;                   /*    48     4 */
            int                        numa_node;            /*    52     4 */
            bool                       unpriv_array;         /*    56     1 */
    
            /* XXX 7 bytes hole, try to pack */
    
            /* --- cacheline 1 boundary (64 bytes) --- */
            struct user_struct *       user;                 /*    64     8 */
            atomic_t                   refcnt;               /*    72     4 */
            atomic_t                   usercnt;              /*    76     4 */
            struct work_struct         work;                 /*    80    32 */
            char                       name[16];             /*   112    16 */
            /* --- cacheline 2 boundary (128 bytes) --- */
    
            /* size: 128, cachelines: 2, members: 17 */
            /* sum members: 121, holes: 1, sum holes: 7 */
      };
    
    Now all entries in the first cacheline are read only throughout
    the life time of the map, set up once during map creation. Overall
    struct size and number of cachelines doesn't change from the
    reordering. struct bpf_map is usually first member and embedded
    in map structs in specific map implementations, so also avoid those
    members to sit at the end where it could potentially share the
    cacheline with first map values e.g. in the array since remote
    CPUs could trigger map updates just as well for those (easily
    dirtying members like max_entries intentionally as well) while
    having subsequent values in cache.
    
    Quoting from Google's Project Zero blog [1]:
    
      Additionally, at least on the Intel machine on which this was
      tested, bouncing modified cache lines between cores is slow,
      apparently because the MESI protocol is used for cache coherence
      [8]. Changing the reference counter of an eBPF array on one
      physical CPU core causes the cache line containing the reference
      counter to be bounced over to that CPU core, making reads of the
      reference counter on all other CPU cores slow until the changed
      reference counter has been written back to memory. Because the
      length and the reference counter of an eBPF array are stored in
      the same cache line, this also means that changing the reference
      counter on one physical CPU core causes reads of the eBPF array's
      length to be slow on other physical CPU cores (intentional false
      sharing).
    
    While this doesn't 'control' the out-of-bounds speculation through
    masking the index as in commit b2157399cc98, triggering a manipulation
    of the map's reference counter is really trivial, so lets not allow
    to easily affect max_entries from it.
    
    Splitting to separate cachelines also generally makes sense from
    a performance perspective anyway in that fast-path won't have a
    cache miss if the map gets pinned, reused in other progs, etc out
    of control path, thus also avoids unintentional false sharing.
    
      [1] https://googleprojectzero.blogspot.ch/2018/01/reading-privileged-memory-with-side.html
    
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7dcda40e52ff0712a2d7d5353c1722cb1f994330
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Tue Jan 30 03:37:42 2018 +0100

    bpf: arsh is not supported in 32 bit alu thus reject it
    
    [ upstream commit 7891a87efc7116590eaba57acc3c422487802c6f ]
    
    The following snippet was throwing an 'unknown opcode cc' warning
    in BPF interpreter:
    
      0: (18) r0 = 0x0
      2: (7b) *(u64 *)(r10 -16) = r0
      3: (cc) (u32) r0 s>>= (u32) r0
      4: (95) exit
    
    Although a number of JITs do support BPF_ALU | BPF_ARSH | BPF_{K,X}
    generation, not all of them do and interpreter does neither. We can
    leave existing ones and implement it later in bpf-next for the
    remaining ones, but reject this properly in verifier for the time
    being.
    
    Fixes: 17a5267067f3 ("bpf: verifier (add verifier core)")
    Reported-by: syzbot+93c4904c5c70348a6890@syzkaller.appspotmail.com
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 28c486744e6de4d882a1d853aa63d99fcba4b7a6
Author: Alexei Starovoitov <ast@kernel.org>
Date:   Tue Jan 30 03:37:41 2018 +0100

    bpf: introduce BPF_JIT_ALWAYS_ON config
    
    [ upstream commit 290af86629b25ffd1ed6232c4e9107da031705cb ]
    
    The BPF interpreter has been used as part of the spectre 2 attack CVE-2017-5715.
    
    A quote from goolge project zero blog:
    "At this point, it would normally be necessary to locate gadgets in
    the host kernel code that can be used to actually leak data by reading
    from an attacker-controlled location, shifting and masking the result
    appropriately and then using the result of that as offset to an
    attacker-controlled address for a load. But piecing gadgets together
    and figuring out which ones work in a speculation context seems annoying.
    So instead, we decided to use the eBPF interpreter, which is built into
    the host kernel - while there is no legitimate way to invoke it from inside
    a VM, the presence of the code in the host kernel's text section is sufficient
    to make it usable for the attack, just like with ordinary ROP gadgets."
    
    To make attacker job harder introduce BPF_JIT_ALWAYS_ON config
    option that removes interpreter from the kernel in favor of JIT-only mode.
    So far eBPF JIT is supported by:
    x64, arm64, arm32, sparc64, s390, powerpc64, mips64
    
    The start of JITed program is randomized and code page is marked as read-only.
    In addition "constant blinding" can be turned on with net.core.bpf_jit_harden
    
    v2->v3:
    - move __bpf_prog_ret0 under ifdef (Daniel)
    
    v1->v2:
    - fix init order, test_bpf and cBPF (Daniel's feedback)
    - fix offloaded bpf (Jakub's feedback)
    - add 'return 0' dummy in case something can invoke prog->bpf_func
    - retarget bpf tree. For bpf-next the patch would need one extra hunk.
      It will be sent when the trees are merged back to net-next
    
    Considered doing:
      int bpf_jit_enable __read_mostly = BPF_EBPF_JIT_DEFAULT;
    but it seems better to land the patch as-is and in bpf-next remove
    bpf_jit_enable global variable from all JITs, consolidate in one place
    and remove this jit_init() function.
    
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 361fb0481247bea4da3eb122e685c8b72ef7c8a9
Author: Alexei Starovoitov <ast@fb.com>
Date:   Tue Jan 30 03:37:40 2018 +0100

    bpf: fix bpf_tail_call() x64 JIT
    
    [ upstream commit 90caccdd8cc0215705f18b92771b449b01e2474a ]
    
    - bpf prog_array just like all other types of bpf array accepts 32-bit index.
      Clarify that in the comment.
    - fix x64 JIT of bpf_tail_call which was incorrectly loading 8 instead of 4 bytes
    - tighten corresponding check in the interpreter to stay consistent
    
    The JIT bug can be triggered after introduction of BPF_F_NUMA_NODE flag
    in commit 96eabe7a40aa in 4.14. Before that the map_flags would stay zero and
    though JIT code is wrong it will check bounds correctly.
    Hence two fixes tags. All other JITs don't have this problem.
    
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Fixes: 96eabe7a40aa ("bpf: Allow selecting numa node during map creation")
    Fixes: b52f00e6a715 ("x86: bpf_jit: implement bpf_tail_call() helper")
    Acked-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Martin KaFai Lau <kafai@fb.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5a802e670c46ee2027ae43ec03501ecdb85d080a
Author: Eric Dumazet <edumazet@google.com>
Date:   Tue Jan 30 03:37:39 2018 +0100

    x86: bpf_jit: small optimization in emit_bpf_tail_call()
    
    [ upstream commit 84ccac6e7854ebbfb56d2fc6d5bef9be49bb304c ]
    
    Saves 4 bytes replacing following instructions :
    
    lea rax, [rsi + rdx * 8 + offsetof(...)]
    mov rax, qword ptr [rax]
    cmp rax, 0
    
    by :
    
    mov rax, [rsi + rdx * 8 + offsetof(...)]
    test rax, rax
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1367d854b97493bfb1f3d24cf89ba60cb7f059ea
Author: Alexei Starovoitov <ast@fb.com>
Date:   Tue Jan 30 03:37:38 2018 +0100

    bpf: fix branch pruning logic
    
    [ Upstream commit c131187db2d3fa2f8bf32fdf4e9a4ef805168467 ]
    
    when the verifier detects that register contains a runtime constant
    and it's compared with another constant it will prune exploration
    of the branch that is guaranteed not to be taken at runtime.
    This is all correct, but malicious program may be constructed
    in such a way that it always has a constant comparison and
    the other branch is never taken under any conditions.
    In this case such path through the program will not be explored
    by the verifier. It won't be taken at run-time either, but since
    all instructions are JITed the malicious program may cause JITs
    to complain about using reserved fields, etc.
    To fix the issue we have to track the instructions explored by
    the verifier and sanitize instructions that are dead at run time
    with NOPs. We cannot reject such dead code, since llvm generates
    it for valid C code, since it doesn't do as much data flow
    analysis as the verifier does.
    
    Fixes: 17a5267067f3 ("bpf: verifier (add verifier core)")
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Acked-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b392225467b8066538dfa200dc925c844b76880b
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Fri Jan 5 16:26:00 2018 -0800

    loop: fix concurrent lo_open/lo_release
    
    commit ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5 upstream.
    
    范龙飞 reports that KASAN can report a use-after-free in __lock_acquire.
    The reason is due to insufficient serialization in lo_release(), which
    will continue to use the loop device even after it has decremented the
    lo_refcnt to zero.
    
    In the meantime, another process can come in, open the loop device
    again as it is being shut down. Confusion ensues.
    
    Reported-by: 范龙飞 <long7573@126.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>