08 Feb, 2018

7 commits

  • commit caf7501a1b4ec964190f31f9c3f163de252273b8

    There's a risk that a kernel which has full retpoline mitigations becomes
    vulnerable when a module gets loaded that hasn't been compiled with the
    right compiler or the right option.

    To enable detection of that mismatch at module load time, add a module info
    string "retpoline" at build time when the module was compiled with
    retpoline support. This only covers compiled C source, but assembler source
    or prebuilt object files are not checked.

    If a retpoline enabled kernel detects a non retpoline protected module at
    load time, print a warning and report it in the sysfs vulnerability file.

    [ tglx: Massaged changelog ]

    Signed-off-by: Andi Kleen
    Signed-off-by: Thomas Gleixner
    Cc: David Woodhouse
    Cc: gregkh@linuxfoundation.org
    Cc: torvalds@linux-foundation.org
    Cc: jeyu@kernel.org
    Cc: arjan@linux.intel.com
    Link: https://lkml.kernel.org/r/20180125235028.31211-1-andi@firstfloor.org
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • commit c940a3fb1e2e9b7d03228ab28f375fb5a47ff699

    Replace indirect call with CALL_NOSPEC.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Reviewed-by: David Woodhouse
    Cc: Andrea Arcangeli
    Cc: Andi Kleen
    Cc: Ashok Raj
    Cc: Greg KH
    Cc: Jun Nakajima
    Cc: David Woodhouse
    Cc: Linus Torvalds
    Cc: rga@amazon.de
    Cc: Dave Hansen
    Cc: Asit Mallick
    Cc: Andy Lutomirski
    Cc: Josh Poimboeuf
    Cc: Jason Baron
    Cc: Paolo Bonzini
    Cc: Dan Williams
    Cc: Arjan Van De Ven
    Cc: Tim Chen
    Link: https://lkml.kernel.org/r/20180125095843.645776917@infradead.org
    Signed-off-by: Greg Kroah-Hartman

    Peter Zijlstra
     
  • commit 1a29b5b7f347a1a9230c1e0af5b37e3e571588ab

    Replace the indirect calls with CALL_NOSPEC.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Reviewed-by: David Woodhouse
    Cc: Andrea Arcangeli
    Cc: Andi Kleen
    Cc: Ashok Raj
    Cc: Greg KH
    Cc: Jun Nakajima
    Cc: David Woodhouse
    Cc: Linus Torvalds
    Cc: rga@amazon.de
    Cc: Dave Hansen
    Cc: Asit Mallick
    Cc: Andy Lutomirski
    Cc: Josh Poimboeuf
    Cc: Jason Baron
    Cc: Paolo Bonzini
    Cc: Dan Williams
    Cc: Arjan Van De Ven
    Cc: Tim Chen
    Link: https://lkml.kernel.org/r/20180125095843.595615683@infradead.org
    Signed-off-by: Greg Kroah-Hartman

    Peter Zijlstra
     
  • commit 1df37383a8aeabb9b418698f0bcdffea01f4b1b2

    It doesn't make sense to have an indirect call thunk with esp/rsp as
    retpoline code won't work correctly with the stack pointer register.
    Removing it will help compiler writers to catch error in case such
    a thunk call is emitted incorrectly.

    Fixes: 76b043848fd2 ("x86/retpoline: Add initial retpoline support")
    Suggested-by: Jeff Law
    Signed-off-by: Waiman Long
    Signed-off-by: Thomas Gleixner
    Acked-by: David Woodhouse
    Cc: Tom Lendacky
    Cc: Kees Cook
    Cc: Andi Kleen
    Cc: Tim Chen
    Cc: Peter Zijlstra
    Cc: Linus Torvalds
    Cc: Jiri Kosina
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Josh Poimboeuf
    Cc: Arjan van de Ven
    Cc: Greg Kroah-Hartman
    Cc: Paul Turner
    Link: https://lkml.kernel.org/r/1516658974-27852-1-git-send-email-longman@redhat.com
    Signed-off-by: Greg Kroah-Hartman

    Waiman Long
     
  • commit 236003e6b5443c45c18e613d2b0d776a9f87540e upstream.

    Expose the state of the RFI flush (enabled/disabled) via debugfs, and
    allow it to be enabled/disabled at runtime.

    eg: $ cat /sys/kernel/debug/powerpc/rfi_flush
    1
    $ echo 0 > /sys/kernel/debug/powerpc/rfi_flush
    $ cat /sys/kernel/debug/powerpc/rfi_flush
    0

    Signed-off-by: Michael Ellerman
    Reviewed-by: Nicholas Piggin
    Signed-off-by: Greg Kroah-Hartman

    Michael Ellerman
     
  • commit fd6e440f20b1a4304553775fc55938848ff617c9 upstream.

    The recent commit 87590ce6e373 ("sysfs/cpu: Add vulnerability folder")
    added a generic folder and set of files for reporting information on
    CPU vulnerabilities. One of those was for meltdown:

    /sys/devices/system/cpu/vulnerabilities/meltdown

    This commit wires up that file for 64-bit Book3S powerpc.

    For now we default to "Vulnerable" unless the RFI flush is enabled.
    That may not actually be true on all hardware, further patches will
    refine the reporting based on the CPU/platform etc. But for now we
    default to being pessimists.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Michael Ellerman
     
  • commit 4cc90b4cc3d4955f79eae4f7f9d64e67e17b468e upstream.

    faddr2line hit var unbound error when CROSS_COMPILE isn't set since
    nounset option is set in bash script.

    Link: http://lkml.kernel.org/r/20171206013022.GA83929@sofia
    Fixes: 95a879825419 ("scripts/faddr2line: extend usage on generic arch")
    Signed-off-by: Liu Changcheng
    Reported-by: Richard Weinberger
    Reviewed-by: Richard Weinberger
    Cc: Thomas Gleixner
    Cc: Greg Kroah-Hartman
    Cc: Philippe Ombredanne
    Cc: NeilBrown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Liu, Changcheng
     

04 Feb, 2018

33 commits

  • Greg Kroah-Hartman
     
  • commit a5c03c31af2291f13689d11760c0b59fb70c9a5a upstream.

    Some distributions have turned on the reset attack mitigation feature,
    which is designed to force the platform to clear the contents of RAM if
    the machine is shut down uncleanly. However, in order for the platform
    to be able to determine whether the shutdown was clean or not, userspace
    has to be configured to clear the MemoryOverwriteRequest flag on
    shutdown - otherwise the firmware will end up clearing RAM on every
    reboot, which is unnecessarily time consuming. Add some additional
    clarity to the kconfig text to reduce the risk of systems being
    configured this way.

    Signed-off-by: Matthew Garrett
    Acked-by: Ard Biesheuvel
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Matthew Garrett
     
  • commit a1ab69021a584d952e6548a44b93760547b1b6b5 upstream.

    We want to free memory reserved for interrupt mask handling only after we
    free functions, as function drivers might want to mask interrupts. This is
    needed for the followup patch to the F03 that would implement unmasking and
    masking interrupts from the serio pass-through port open() and close()
    methods.

    Reviewed-by: Lyude Paul
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • commit 6abe534f0776d2437c8302f58d8eb5abd483e926 upstream.

    Currently we register the pass-through serio port when we probe the F03 RMI
    function, and then, in sensor configure phase, we unmask interrupts.
    Unfortunately this is too late, as other drivers are free probe devices
    attached to the serio port as soon as it is probed. Because interrupts are
    masked, the IO times out, which may result in not being able to detect
    trackpoints on the pass-through port.

    To fix the issue we implement open() and close() methods for the
    pass-through serio port and unmask interrupts from there. We also move
    creation of the pass-through port form probe to configure stage, as RMI
    driver does not enable transport interrupt until all functions are probed
    (we should change this, but this is a separate topic).

    We also try to clear the pending data before unmasking interrupts, because
    some devices like to spam the system with multiple 0xaa 0x00 announcements,
    which may interfere with us trying to query ID of the device.

    Fixes: c5e8848fc98e ("Input: synaptics-rmi4 - add support for F03")
    Reviewed-by: Lyude Paul
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • commit a5e1923356505e46476c2fb518559b7a4d9d25b1 upstream.

    Add the missing unlock before return from function
    config_num_requests_store() in the error handling case.

    Fixes: c92316bf8e94 ("test_firmware: add batched firmware tests")
    Signed-off-by: Wei Yongjun
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • commit 8f114acd4e1a9cfa05b70bcc4219bc88197b5c9b upstream.

    in_concentration_raw should report, according to sysfs-bus-iio documentation,
    a "Raw (unscaled no offset etc.) percentage reading of a substance."

    Modify scale to convert from ppm/ppb to percentage:
    1 ppm = 0.0001%
    1 ppb = 0.0000001%

    There is no offset needed to convert the ppm/ppb to percentage,
    so remove offset from IIO_CONCENTRATION (IIO_MOD_CO2) channel.

    Cc'd stable to reduce chance of userspace breakage in the long
    run as we fix this wrong bit of ABI usage.

    Signed-off-by: Narcisa Ana Maria Vasile
    Reviewed-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Narcisa Ana Maria Vasile
     
  • commit 04e491ca9df60ffe8637d00d68e5ab8bc73b30d5 upstream.

    By default, watermark is set to '1'. Watermark is used to fine tune
    cyclic dma buffer period. In case watermark is left untouched (e.g. 1)
    and several channels are being scanned, buffer period is wrongly set
    (e.g. to 1 sample). As a consequence, data is never pushed to upper layer.
    Fix buffer period size, by taking scan channels number into account.

    Fixes: 2763ea0585c9 ("iio: adc: stm32: add optional dma support")

    Signed-off-by: Fabrice Gasnier
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Fabrice Gasnier
     
  • 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
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Stefan Agner
     
  • 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
    Reviewed-by: Martin Kaiser
    Acked-by: Fugang Duan
    Signed-off-by: Greg Kroah-Hartman

    Fabio Estevam
     
  • commit 7defa77d2baca4d6eb85234f10f38ab618332e75 upstream.

    Fix to return a negative error code from the port register error
    handling case instead of 0, as done elsewhere in this function.

    Fixes: 39be40ce066d ("serial: 8250_uniphier: fix serial port index in private data")
    Signed-off-by: Wei Yongjun
    Acked-by: Masahiro Yamada
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • commit b9820a31691b771db37afe2054dd3d3a680c1eed upstream.

    The error pointer from devm_reset_control_get_optional_shared() is
    not propagated.

    One of the most common problem scenarios is it returns -EPROBE_DEFER
    when the reset controller has not probed yet. In this case, the
    probe of the reset consumer should be deferred.

    Fixes: e2860e1f62f2 ("serial: 8250_of: Add reset support")
    Signed-off-by: Masahiro Yamada
    Reviewed-by: Philipp Zabel
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     
  • commit cc365dcf0e56271bedf3de95f88922abe248e951 upstream.

    >From the pci power documentation:
    "The driver itself should not call pm_runtime_allow(), though. Instead,
    it should let user space or some platform-specific code do that (user space
    can do it via sysfs as stated above)..."

    However, the S0ix residency cannot be reached without MEI device getting
    into low power state. Hence, for mei devices that support D0i3, it's better
    to make runtime power management mandatory and not rely on the system
    integration such as udev rules.
    This policy cannot be applied globally as some older platforms
    were found to have broken power management.

    Cc: Rafael J. Wysocki
    Signed-off-by: Tomas Winkler
    Reviewed-by: Alexander Usyskin
    Signed-off-by: Greg Kroah-Hartman

    Tomas Winkler
     
  • commit aac6830ec1cb681544212838911cdc57f2638216 upstream.

    VM_IOREMAP is used to access hardware through a mechanism called
    I/O mapped memory. Android binder is a IPC machanism which will
    not access I/O memory.

    And VM_IOREMAP has alignment requiement which may not needed in
    binder.
    __get_vm_area_node()
    {
    ...
    if (flags & VM_IOREMAP)
    align = 1ul << clamp_t(int, fls_long(size),
    PAGE_SHIFT, IOREMAP_MAX_ORDER);
    ...
    }

    This patch will save some kernel vm area, especially for 32bit os.

    In 32bit OS, kernel vm area is only 240MB. We may got below
    error when launching a app:

    [ 4482.440053] binder_alloc: binder_alloc_mmap_handler: 15728 8ce67000-8cf65000 get_vm_area failed -12
    [ 4483.218817] binder_alloc: binder_alloc_mmap_handler: 15745 8ce67000-8cf65000 get_vm_area failed -12

    Signed-off-by: Ganesh Mahendran
    Acked-by: Martijn Coenen
    Acked-by: Todd Kjos
    Signed-off-by: Greg Kroah-Hartman

    Ganesh Mahendran
     
  • commit f5cb779ba16334b45ba8946d6bfa6d9834d1527f upstream.

    binder_poll() passes the thread->wait waitqueue that
    can be slept on for work. When a thread that uses
    epoll explicitly exits using BINDER_THREAD_EXIT,
    the waitqueue is freed, but it is never removed
    from the corresponding epoll data structure. When
    the process subsequently exits, the epoll cleanup
    code tries to access the waitlist, which results in
    a use-after-free.

    Prevent this by using POLLFREE when the thread exits.

    Signed-off-by: Martijn Coenen
    Reported-by: syzbot
    Signed-off-by: Greg Kroah-Hartman

    Martijn Coenen
     
  • commit 11fb37998759c48e4e4c200c974593cbeab25d3e upstream.

    The current code tries to test for bits that are masked out by
    usb_endpoint_maxp(). Instead, use the proper accessor to access
    the new high bandwidth bits.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Herrenschmidt
     
  • 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
    Reported-by: Hans de Goede
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     
  • 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
    Cc: Greg KH
    Cc: Michal Nazarewicz
    Cc: John Stultz
    Cc: Dmitry Shmidt
    Cc: Badhri
    Cc: Android Kernel Team
    Signed-off-by: Hemant Kumar
    [AmitP: Cherry-picked it from android-4.14 and updated the commit log]
    Signed-off-by: Amit Pundir
    Signed-off-by: Greg Kroah-Hartman

    Hemant Kumar
     
  • 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
    Tested-by: Max Schulze
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan
     
  • 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
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Jia-Ju Bai
     
  • commit df1cc78a52491f71d8170d513d0f6f114faa1bda upstream.

    This devices drops random bytes from messages if you talk to it
    too fast.

    Signed-off-by: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     
  • 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
    Acked-by: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit d08dd3f3dd2ae351b793fc5b76abdbf0fd317b12 upstream.

    This adds a new device id for Chilitag devices to the pl2303 driver.

    Reported-by: "Chu.Mike [朱堅宜]"
    Acked-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • 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
    Signed-off-by: Hiroyuki Yamamoto
    Acked-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    OKAMOTO Yoshiaki
     
  • commit b027e2298bd588d6fa36ed2eda97447fb3eac078 upstream.

    There can be a race, if receive_buf call comes before
    tty initialization completes in n_tty_open and tty->disc_data
    may be NULL.

    CPU0 CPU1
    ---- ----
    000|n_tty_receive_buf_common() n_tty_open()
    -001|n_tty_receive_buf2() tty_ldisc_open.isra.3()
    -002|tty_ldisc_receive_buf(inline) tty_ldisc_setup()

    Using ldisc semaphore lock in tty_init_dev till disc_data
    initializes completely.

    Signed-off-by: Gaurav Kohli
    Reviewed-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Gaurav Kohli
     
  • commit dc5591dc9c03e4cd22d3f0c3659196cc34668452 upstream.

    When moving from internal for kernel FIPS infrastructure the FIPS event irq
    handling code was left with the old ifdef by mistake. Fix it.

    Fixes: b7e607bf33a2 ("staging: ccree: move FIPS support to kernel infrastructure")
    Signed-off-by: Gilad Ben-Yossef
    Signed-off-by: Greg Kroah-Hartman

    Gilad Ben-Yossef
     
  • commit 46df8824982e4fb0198776078d4a8c3e2d531464 upstream.

    backup_info field is only allocated for decrypt code path.
    The field was not nullified when not used causing a kfree
    in an error handling path to attempt to free random
    addresses as uncovered in stress testing.

    Fixes: 737aed947f9b ("staging: ccree: save ciphertext for CTS IV")
    Signed-off-by: Gilad Ben-Yossef
    Signed-off-by: Greg Kroah-Hartman

    Gilad Ben-Yossef
     
  • commit 9b046013e5837f8a58453d1e9f8e01d03adb7fe7 upstream.

    The logic of the original commit 4d99b2581eff ("staging: lustre: avoid
    intensive reconnecting for ko2iblnd") was assumed conditional free of
    struct kib_conn if the second argument free_conn in function
    kiblnd_destroy_conn(struct kib_conn *conn, bool free_conn) is true.
    But this hunk of code was dropped from original commit. As result the logic
    works wrong and current code use struct kib_conn after free.

    > drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
    > 3317 kiblnd_destroy_conn(conn, !peer);
    > ^^^^ Freed always (but should be conditionally)
    > 3318
    > 3319 spin_lock_irqsave(lock, flags);
    > 3320 if (!peer)
    > 3321 continue;
    > 3322
    > 3323 conn->ibc_peer = peer;
    > ^^^^^^^^^^^^^^ Use after free
    > 3324 if (peer->ibp_reconnected < KIB_RECONN_HIGH_RACE)
    > 3325 list_add_tail(&conn->ibc_list,
    > ^^^^^^^^^^^^^^ Use after free
    > 3326 &kiblnd_data.kib_reconn_list);
    > 3327 else
    > 3328 list_add_tail(&conn->ibc_list,
    > ^^^^^^^^^^^^^^ Use after free
    > 3329 &kiblnd_data.kib_reconn_wait);

    To avoid confusion this fix moved the freeing a struct kib_conn outside of
    the function kiblnd_destroy_conn() and free as it was intended in original
    commit.

    Fixes: 4d99b2581eff ("staging: lustre: avoid intensive reconnecting for ko2iblnd")
    Signed-off-by: Dmitry Eremin
    Reviewed-by: Andreas Dilger
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Eremin
     
  • [ Upstream commit bd89525a823ce6edddcedbe9aed79faa1b9cf544 ]

    This reverts commits ae1f57670703656cc9f293722c3b8b6782f8ab3f
    and ac9b305caa0df6f5b75d294e4b86c1027648991e.

    If the hardware doesn't support MOVBE, but L0 sets CPUID.01H:ECX.MOVBE
    in L1's emulated CPUID information, then L1 is likely to pass that
    CPUID bit through to L2. L2 will expect MOVBE to work, but if L1
    doesn't intercept #UD, then any MOVBE instruction executed in L2 will
    raise #UD, and the exception will be delivered in L2.

    Commit ac9b305caa0df6f5b75d294e4b86c1027648991e is a better and more
    complete version of ae1f57670703 ("KVM: nVMX: Do not emulate #UD while
    in guest mode"); however, neither considers the above case.

    Suggested-by: Jim Mattson
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Paolo Bonzini
     
  • [ Upstream commit ce9caf2f79a5aa170a4b6456a03db639eed9c988 ]

    We were calling enable_irq on bind, where it was already enabled previously
    by the IRQ helper. Additionally, dev->irq is not set correctly until after
    postinstall and so was always zero here, triggering a warning in 4.15.
    Fix both by moving the enable to the power management resume path, where we
    know there was a previous disable invocation during suspend.

    Fixes: 253696ccd613 ("drm/vc4: Account for interrupts in flight")
    Signed-off-by: Stefan Schake
    Signed-off-by: Eric Anholt
    Link: https://patchwork.freedesktop.org/patch/msgid/1514563543-32511-1-git-send-email-stschake@gmail.com
    Tested-by: Stefan Wahren
    Reviewed-by: Eric Anholt
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Stefan Schake
     
  • [ 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
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Larry Finger
     
  • [ 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
    Signed-off-by: Felipe Balbi
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King