Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hotplug limitation to certain # of cores #3

Closed
janengelmohr opened this issue Apr 13, 2016 · 5 comments
Closed

Add hotplug limitation to certain # of cores #3

janengelmohr opened this issue Apr 13, 2016 · 5 comments

Comments

@janengelmohr
Copy link
Owner

8 cores are not needed for daily activity such as browsing.

CONFIG_HOTPLUG might help here

gueste added a commit to gueste/android_kernel_elephone_p8000 that referenced this issue Jun 18, 2016
commit ca1199fccf14540e86f6da955333e31d6fec5f3e
Author: Willy Tarreau <w@1wt.eu>
Date:   Sun Jun 12 11:41:54 2016 +0200

    Linux 3.10.102

commit fd1a096205147366e2cc9dc0a816e24f56946a83
Author: Chanwoo Choi <cw00.choi@samsung.com>
Date:   Thu Apr 21 18:58:31 2016 +0900

    serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()

    commit b8995f527aac143e83d3900ff39357651ea4e0f6 upstream.

    This patch fixes the broken serial log when changing the clock source
    of uart device. Before disabling the original clock source, this patch
    enables the new clock source to protect the clock off state for a split second.

    Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
    Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 0fff1b1ff8c9c07caa1762b6c0b76b1dbbe20223
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Tue May 3 17:05:54 2016 +0200

    tty: vt, return error when con_startup fails

    commit 6798df4c5fe0a7e6d2065cf79649a794e5ba7114 upstream.

    When csw->con_startup() fails in do_register_con_driver, we return no
    error (i.e. 0). This was changed back in 2006 by commit 3e795de763.
    Before that we used to return -ENODEV.

    So fix the return value to be -ENODEV in that case again.

    Fixes: 3e795de763 ("VT binding: Add binding/unbinding support for the VT console")
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Reported-by: "Dan Carpenter" <dan.carpenter@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 49849df77f10d800990bb8cb3e4f974745967520
Author: Schemmel Hans-Christoph <Hans-Christoph.Schemmel@gemalto.com>
Date:   Fri Apr 29 08:51:06 2016 +0000

    USB: serial: option: add support for Cinterion PH8 and AHxx

    commit 444f94e9e625f6ec6bbe2cb232a6451c637f35a3 upstream.

    Added support for Gemalto's Cinterion PH8 and AHxx products
    with 2 RmNet Interfaces and products with 1 RmNet + 1 USB Audio interface.

    In addition some minor renaming and formatting.

    Signed-off-by: Hans-Christoph Schemmel <hans-christoph.schemmel@gemalto.com>
    [johan: sort current entries and trim trailing whitespace ]
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 9d08a9916056a23f2c4818222cf90e800d3f77ec
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:07:57 2016 +0200

    USB: serial: io_edgeport: fix memory leaks in probe error path

    commit c8d62957d450cc1a22ce3242908709fe367ddc8e upstream.

    URBs and buffers allocated in attach for Epic devices would never be
    deallocated in case of a later probe error (e.g. failure to allocate
    minor numbers) as disconnect is then never called.

    Fix by moving deallocation to release and making sure that the
    URBs are first unlinked.

    Fixes: f9c99bb8b3a1 ("USB: usb-serial: replace shutdown with disconnect,
    release")
    Cc: stable <stable@vger.kernel.org>	# v2.6.31
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 1f983d0bebe54898bc35779815a23582ac38c9b7
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:08:02 2016 +0200

    USB: serial: quatech2: fix use-after-free in probe error path

    commit 028c49f5e02a257c94129cd815f7c8485f51d4ef upstream.

    The interface read URB is submitted in attach, but was only unlinked by
    the driver at disconnect.

    In case of a late probe error (e.g. due to failed minor allocation),
    disconnect is never called and we would end up with active URBs for an
    unbound interface. This in turn could lead to deallocated memory being
    dereferenced in the completion callback.

    Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 550d9c436e40dd384b22f2beea93e20c2e069600
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:07:58 2016 +0200

    USB: serial: keyspan: fix use-after-free in probe error path

    commit 35be1a71d70775e7bd7e45fa6d2897342ff4c9d2 upstream.

    The interface instat and indat URBs were submitted in attach, but never
    unlinked in release before deallocating the corresponding transfer
    buffers.

    In the case of a late probe error (e.g. due to failed minor allocation),
    disconnect would not have been called before release, causing the
    buffers to be freed while the URBs are still in use. We'd also end up
    with active URBs for an unbound interface.

    Fixes: f9c99bb8b3a1 ("USB: usb-serial: replace shutdown with disconnect,
    release")
    Cc: stable <stable@vger.kernel.org>	# v2.6.31
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit c21f25b36d258d04c0332609aaa68d895cfa8796
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Sat Mar 19 11:49:43 2016 +0100

    Bluetooth: vhci: purge unhandled skbs

    commit 13407376b255325fa817798800117a839f3aa055 upstream.

    The write handler allocates skbs and queues them into data->readq.
    Read side should read them, if there is any. If there is none, skbs
    should be dropped by hdev->flush. But this happens only if the device
    is HCI_UP, i.e. hdev->power_on work was triggered already. When it was
    not, skbs stay allocated in the queue when /dev/vhci is closed. So
    purge the queue in ->release.

    Program to reproduce:
    	#include <err.h>
    	#include <fcntl.h>
    	#include <stdio.h>
    	#include <unistd.h>

    	#include <sys/stat.h>
    	#include <sys/types.h>
    	#include <sys/uio.h>

    	int main()
    	{
    		char buf[] = { 0xff, 0 };
    		struct iovec iov = {
    			.iov_base = buf,
    			.iov_len = sizeof(buf),
    		};
    		int fd;

    		while (1) {
    			fd = open("/dev/vhci", O_RDWR);
    			if (fd < 0)
    				err(1, "open");

    			usleep(50);

    			if (writev(fd, &iov, 1) < 0)
    				err(1, "writev");

    			usleep(50);

    			close(fd);
    		}

    		return 0;
    	}

    Result:
    kmemleak: 4609 new suspected memory leaks
    unreferenced object 0xffff88059f4d5440 (size 232):
      comm "vhci", pid 1084, jiffies 4294912542 (age 37569.296s)
      hex dump (first 32 bytes):
        20 f0 23 87 05 88 ff ff 20 f0 23 87 05 88 ff ff   .#..... .#.....
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace:
    ...
        [<ffffffff81ece010>] __alloc_skb+0x0/0x5a0
        [<ffffffffa021886c>] vhci_create_device+0x5c/0x580 [hci_vhci]
        [<ffffffffa0219436>] vhci_write+0x306/0x4c8 [hci_vhci]

    Fixes: 23424c0d31 (Bluetooth: Add support creating virtual AMP controllers)
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e9e0c8aded7f1c1bc5e6c01ee73ec29ec5942f6d
Author: Matt Gumbel <matthew.k.gumbel@intel.com>
Date:   Fri May 20 10:33:46 2016 +0300

    mmc: longer timeout for long read time quirk

    commit 32ecd320db39bcb007679ed42f283740641b81ea upstream.

    008GE0 Toshiba mmc in some Intel Baytrail tablets responds to
    MMC_SEND_EXT_CSD in 450-600ms.

    This patch will...

    () Increase the long read time quirk timeout from 300ms to 600ms. Original
       author of that quirk says 300ms was only a guess and that the number
       may need to be raised in the future.

    () Add this specific MMC to the quirk

    Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e94c917abb4a6a083eda8831e63907d4c836fd53
Author: Adrian Hunter <adrian.hunter@intel.com>
Date:   Thu May 5 08:12:28 2016 +0300

    mmc: mmc: Fix partition switch timeout for some eMMCs

    commit 1c447116d017a98c90f8f71c8c5a611e0aa42178 upstream.

    Some eMMCs set the partition switch timeout too low.

    Now typically eMMCs are considered a critical component (e.g. because
    they store the root file system) and consequently are expected to be
    reliable.  Thus we can neglect the use case where eMMCs can't switch
    reliably and we might want a lower timeout to facilitate speedy
    recovery.

    Although we could employ a quirk for the cards that are affected (if
    we could identify them all), as described above, there is little
    benefit to having a low timeout, so instead simply set a minimum
    timeout.

    The minimum is set to 300ms somewhat arbitrarily - the examples that
    have been seen had a timeout of 10ms but were sometimes taking 60-70ms.

    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 0cf266167e9f1e39bb411a49f1163f488f5a75e8
Author: Roger Quadros <rogerq@ti.com>
Date:   Mon May 9 11:28:37 2016 +0300

    mfd: omap-usb-tll: Fix scheduling while atomic BUG

    commit b49b927f16acee626c56a1af4ab4cb062f75b5df upstream.

    We shouldn't be calling clk_prepare_enable()/clk_prepare_disable()
    in an atomic context.

    Fixes the following issue:

    [    5.830970] ehci-omap: OMAP-EHCI Host Controller driver
    [    5.830974] driver_register 'ehci-omap'
    [    5.895849] driver_register 'wl1271_sdio'
    [    5.896870] BUG: scheduling while atomic: udevd/994/0x00000002
    [    5.896876] 4 locks held by udevd/994:
    [    5.896904]  #0:  (&dev->mutex){......}, at: [<c049597c>] __driver_attach+0x60/0xac
    [    5.896923]  #1:  (&dev->mutex){......}, at: [<c049598c>] __driver_attach+0x70/0xac
    [    5.896946]  #2:  (tll_lock){+.+...}, at: [<c04c2630>] omap_tll_enable+0x2c/0xd0
    [    5.896966]  #3:  (prepare_lock){+.+...}, at: [<c05ce9c8>] clk_prepare_lock+0x48/0xe0
    [    5.897042] Modules linked in: wlcore_sdio(+) ehci_omap(+) dwc3_omap snd_soc_ts3a225e leds_is31fl319x bq27xxx_battery_i2c tsc2007 bq27xxx_battery bq2429x_charger ina2xx tca8418_keypad as5013 leds_tca6507 twl6040_vibra gpio_twl6040 bmp085_i2c(+) palmas_gpadc usb3503 palmas_pwrbutton bmg160_i2c(+) bmp085 bma150(+) bmg160_core bmp280 input_polldev snd_soc_omap_mcbsp snd_soc_omap_mcpdm snd_soc_omap snd_pcm_dmaengine
    [    5.897048] Preemption disabled at:[<  (null)>]   (null)
    [    5.897051]
    [    5.897059] CPU: 0 PID: 994 Comm: udevd Not tainted 4.6.0-rc5-letux+ #233
    [    5.897062] Hardware name: Generic OMAP5 (Flattened Device Tree)
    [    5.897076] [<c010e714>] (unwind_backtrace) from [<c010af34>] (show_stack+0x10/0x14)
    [    5.897087] [<c010af34>] (show_stack) from [<c040aa7c>] (dump_stack+0x88/0xc0)
    [    5.897099] [<c040aa7c>] (dump_stack) from [<c020c558>] (__schedule_bug+0xac/0xd0)
    [    5.897111] [<c020c558>] (__schedule_bug) from [<c06f3d44>] (__schedule+0x88/0x7e4)
    [    5.897120] [<c06f3d44>] (__schedule) from [<c06f46d8>] (schedule+0x9c/0xc0)
    [    5.897129] [<c06f46d8>] (schedule) from [<c06f4904>] (schedule_preempt_disabled+0x14/0x20)
    [    5.897140] [<c06f4904>] (schedule_preempt_disabled) from [<c06f64e4>] (mutex_lock_nested+0x258/0x43c)
    [    5.897150] [<c06f64e4>] (mutex_lock_nested) from [<c05ce9c8>] (clk_prepare_lock+0x48/0xe0)
    [    5.897160] [<c05ce9c8>] (clk_prepare_lock) from [<c05d0e7c>] (clk_prepare+0x10/0x28)
    [    5.897169] [<c05d0e7c>] (clk_prepare) from [<c04c2668>] (omap_tll_enable+0x64/0xd0)
    [    5.897180] [<c04c2668>] (omap_tll_enable) from [<c04c1728>] (usbhs_runtime_resume+0x18/0x17c)
    [    5.897192] [<c04c1728>] (usbhs_runtime_resume) from [<c049d404>] (pm_generic_runtime_resume+0x2c/0x40)
    [    5.897202] [<c049d404>] (pm_generic_runtime_resume) from [<c049f180>] (__rpm_callback+0x38/0x68)
    [    5.897210] [<c049f180>] (__rpm_callback) from [<c049f220>] (rpm_callback+0x70/0x88)
    [    5.897218] [<c049f220>] (rpm_callback) from [<c04a0a00>] (rpm_resume+0x4ec/0x7ec)
    [    5.897227] [<c04a0a00>] (rpm_resume) from [<c04a0f48>] (__pm_runtime_resume+0x4c/0x64)
    [    5.897236] [<c04a0f48>] (__pm_runtime_resume) from [<c04958dc>] (driver_probe_device+0x30/0x70)
    [    5.897246] [<c04958dc>] (driver_probe_device) from [<c04959a4>] (__driver_attach+0x88/0xac)
    [    5.897256] [<c04959a4>] (__driver_attach) from [<c04940f8>] (bus_for_each_dev+0x50/0x84)
    [    5.897267] [<c04940f8>] (bus_for_each_dev) from [<c0494e40>] (bus_add_driver+0xcc/0x1e4)
    [    5.897276] [<c0494e40>] (bus_add_driver) from [<c0496914>] (driver_register+0xac/0xf4)
    [    5.897286] [<c0496914>] (driver_register) from [<c01018e0>] (do_one_initcall+0x100/0x1b8)
    [    5.897296] [<c01018e0>] (do_one_initcall) from [<c01c7a54>] (do_init_module+0x58/0x1c0)
    [    5.897304] [<c01c7a54>] (do_init_module) from [<c01c8a3c>] (SyS_finit_module+0x88/0x90)
    [    5.897313] [<c01c8a3c>] (SyS_finit_module) from [<c0107120>] (ret_fast_syscall+0x0/0x1c)
    [    5.912697] ------------[ cut here ]------------
    [    5.912711] WARNING: CPU: 0 PID: 994 at kernel/sched/core.c:2996 _raw_spin_unlock+0x28/0x58
    [    5.912717] DEBUG_LOCKS_WARN_ON(val > preempt_count())

    Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
    Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
    Signed-off-by: Roger Quadros <rogerq@ti.com>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit acd291378f60343d146b0157b64fbca97182c4ea
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Fri May 13 09:34:12 2016 -0400

    ring-buffer: Prevent overflow of size in ring_buffer_resize()

    commit 59643d1535eb220668692a5359de22545af579f6 upstream.

    If the size passed to ring_buffer_resize() is greater than MAX_LONG - BUF_PAGE_SIZE
    then the DIV_ROUND_UP() will return zero.

    Here's the details:

      # echo 18014398509481980 > /sys/kernel/debug/tracing/buffer_size_kb

    tracing_entries_write() processes this and converts kb to bytes.

     18014398509481980 << 10 = 18446744073709547520

    and this is passed to ring_buffer_resize() as unsigned long size.

     size = DIV_ROUND_UP(size, BUF_PAGE_SIZE);

    Where DIV_ROUND_UP(a, b) is (a + b - 1)/b

    BUF_PAGE_SIZE is 4080 and here

     18446744073709547520 + 4080 - 1 = 18446744073709551599

    where 18446744073709551599 is still smaller than 2^64

     2^64 - 18446744073709551599 = 17

    But now 18446744073709551599 / 4080 = 4521260802379792

    and size = size * 4080 = 18446744073709551360

    This is checked to make sure its still greater than 2 * 4080,
    which it is.

    Then we convert to the number of buffer pages needed.

     nr_page = DIV_ROUND_UP(size, BUF_PAGE_SIZE)

    but this time size is 18446744073709551360 and

     2^64 - (18446744073709551360 + 4080 - 1) = -3823

    Thus it overflows and the resulting number is less than 4080, which makes

      3823 / 4080 = 0

    an nr_pages is set to this. As we already checked against the minimum that
    nr_pages may be, this causes the logic to fail as well, and we crash the
    kernel.

    There's no reason to have the two DIV_ROUND_UP() (that's just result of
    historical code changes), clean up the code and fix this bug.

    Cc: stable@vger.kernel.org # 3.5+
    Fixes: 83f40318dab00 ("ring-buffer: Make removal of ring buffer pages atomic")
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 1b5493498239d8c7087b6c337285b94eb22e98e4
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Thu May 12 11:01:24 2016 -0400

    ring-buffer: Use long for nr_pages to avoid overflow failures

    commit 9b94a8fba501f38368aef6ac1b30e7335252a220 upstream.

    The size variable to change the ring buffer in ftrace is a long. The
    nr_pages used to update the ring buffer based on the size is int. On 64 bit
    machines this can cause an overflow problem.

    For example, the following will cause the ring buffer to crash:

     # cd /sys/kernel/debug/tracing
     # echo 10 > buffer_size_kb
     # echo 8556384240 > buffer_size_kb

    Then you get the warning of:

     WARNING: CPU: 1 PID: 318 at kernel/trace/ring_buffer.c:1527 rb_update_pages+0x22f/0x260

    Which is:

      RB_WARN_ON(cpu_buffer, nr_removed);

    Note each ring buffer page holds 4080 bytes.

    This is because:

     1) 10 causes the ring buffer to have 3 pages.
        (10kb requires 3 * 4080 pages to hold)

     2) (2^31 / 2^10  + 1) * 4080 = 8556384240
        The value written into buffer_size_kb is shifted by 10 and then passed
        to ring_buffer_resize(). 8556384240 * 2^10 = 8761737461760

     3) The size passed to ring_buffer_resize() is then divided by BUF_PAGE_SIZE
        which is 4080. 8761737461760 / 4080 = 2147484672

     4) nr_pages is subtracted from the current nr_pages (3) and we get:
        2147484669. This value is saved in a signed integer nr_pages_to_update

     5) 2147484669 is greater than 2^31 but smaller than 2^32, a signed int
        turns into the value of -2147482627

     6) As the value is a negative number, in update_pages_handler() it is
        negated and passed to rb_remove_pages() and 2147482627 pages will
        be removed, which is much larger than 3 and it causes the warning
        because not all the pages asked to be removed were removed.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=118001

    Fixes: 7a8e76a3829f1 ("tracing: unified trace buffer")
    Reported-by: Hao Qin <QEver.cn@gmail.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 076765ee6acabf01d19bad64064e920998ca33ba
Author: Stefan Metzmacher <metze@samba.org>
Date:   Tue May 3 10:52:30 2016 +0200

    fs/cifs: correctly to anonymous authentication via NTLMSSP

    commit cfda35d98298131bf38fbad3ce4cd5ecb3cf18db upstream.

    See [MS-NLMP] 3.2.5.1.2 Server Receives an AUTHENTICATE_MESSAGE from the Client:

       ...
       Set NullSession to FALSE
       If (AUTHENTICATE_MESSAGE.UserNameLen == 0 AND
          AUTHENTICATE_MESSAGE.NtChallengeResponse.Length == 0 AND
          (AUTHENTICATE_MESSAGE.LmChallengeResponse == Z(1)
           OR
           AUTHENTICATE_MESSAGE.LmChallengeResponse.Length == 0))
           -- Special case: client requested anonymous authentication
           Set NullSession to TRUE
       ...

    Only server which map unknown users to guest will allow
    access using a non-null NTChallengeResponse.

    For Samba it's the "map to guest = bad user" option.

    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11913

    CC: Stable <stable@vger.kernel.org>
    Signed-off-by: Stefan Metzmacher <metze@samba.org>
    Signed-off-by: Steve French <smfrench@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ee78aa28de7252c93cb35b62517fc71502891b33
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Sun May 8 12:10:14 2016 -0400

    net: fix a kernel infoleak in x25 module

    commit 79e48650320e6fba48369fccf13fd045315b19b8 upstream.

    Stack object "dte_facilities" is allocated in x25_rx_call_request(),
    which is supposed to be initialized in x25_negotiate_facilities.
    However, 5 fields (8 bytes in total) are not initialized. This
    object is then copied to userland via copy_to_user, thus infoleak
    occurs.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 2b3e8cb14e7524f2883326a2221c6728ec5ef96e
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date:   Wed May 4 16:18:45 2016 +0200

    net: bridge: fix old ioctl unlocked net device walk

    commit 31ca0458a61a502adb7ed192bf9716c6d05791a5 upstream.

    get_bridge_ifindices() is used from the old "deviceless" bridge ioctl
    calls which aren't called with rtnl held. The comment above says that it is
    called with rtnl but that is not really the case.
    Here's a sample output from a test ASSERT_RTNL() which I put in
    get_bridge_ifindices and executed "brctl show":
    [  957.422726] RTNL: assertion failed at net/bridge//br_ioctl.c (30)
    [  957.422925] CPU: 0 PID: 1862 Comm: brctl Tainted: G        W  O
    4.6.0-rc4+ #157
    [  957.423009] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
    BIOS 1.8.1-20150318_183358- 04/01/2014
    [  957.423009]  0000000000000000 ffff880058adfdf0 ffffffff8138dec5
    0000000000000400
    [  957.423009]  ffffffff81ce8380 ffff880058adfe58 ffffffffa05ead32
    0000000000000001
    [  957.423009]  00007ffec1a444b0 0000000000000400 ffff880053c19130
    0000000000008940
    [  957.423009] Call Trace:
    [  957.423009]  [<ffffffff8138dec5>] dump_stack+0x85/0xc0
    [  957.423009]  [<ffffffffa05ead32>]
    br_ioctl_deviceless_stub+0x212/0x2e0 [bridge]
    [  957.423009]  [<ffffffff81515beb>] sock_ioctl+0x22b/0x290
    [  957.423009]  [<ffffffff8126ba75>] do_vfs_ioctl+0x95/0x700
    [  957.423009]  [<ffffffff8126c159>] SyS_ioctl+0x79/0x90
    [  957.423009]  [<ffffffff8163a4c0>] entry_SYSCALL_64_fastpath+0x23/0xc1

    Since it only reads bridge ifindices, we can use rcu to safely walk the net
    device list. Also remove the wrong rtnl comment above.

    Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ced4eef10a732bd33ee9289771fada4a07bf508d
Author: Ian Campbell <ian.campbell@docker.com>
Date:   Wed May 4 14:21:53 2016 +0100

    VSOCK: do not disconnect socket when peer has shutdown SEND only

    commit dedc58e067d8c379a15a8a183c5db318201295bb upstream.

    The peer may be expecting a reply having sent a request and then done a
    shutdown(SHUT_WR), so tearing down the whole socket at this point seems
    wrong and breaks for me with a client which does a SHUT_WR.

    Looking at other socket family's stream_recvmsg callbacks doing a shutdown
    here does not seem to be the norm and removing it does not seem to have
    had any adverse effects that I can see.

    I'm using Stefan's RFC virtio transport patches, I'm unsure of the impact
    on the vmci transport.

    Signed-off-by: Ian Campbell <ian.campbell@docker.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
    Cc: Andy King <acking@vmware.com>
    Cc: Dmitry Torokhov <dtor@vmware.com>
    Cc: Jorgen Hansen <jhansen@vmware.com>
    Cc: Adit Ranadive <aditr@vmware.com>
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f9d691421747048d814785136d187595483bab4a
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Tue May 3 16:46:24 2016 -0400

    net: fix infoleak in rtnetlink

    commit 5f8e44741f9f216e33736ea4ec65ca9ac03036e6 upstream.

    The stack object �map� has a total size of 32 bytes. Its last 4
    bytes are padding generated by compiler. These padding bytes are
    not initialized and sent out via �nla_put�.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 44efbfab13ad589048ebe2a914c58cdcfc9d84fb
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Tue May 3 16:35:05 2016 -0400

    net: fix infoleak in llc

    commit b8670c09f37bdf2847cc44f36511a53afc6161fd upstream.

    The stack object �info� has a total size of 12 bytes. Its last byte
    is padding which is not initialized and leaked via �put_cmsg�.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 58da198d99004f57a8f782869f0618d6d8049970
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Wed Apr 20 23:23:08 2016 +0100

    atl2: Disable unimplemented scatter/gather feature

    commit f43bfaeddc79effbf3d0fcb53ca477cca66f3db8 upstream.

    atl2 includes NETIF_F_SG in hw_features even though it has no support
    for non-linear skbs.  This bug was originally harmless since the
    driver does not claim to implement checksum offload and that used to
    be a requirement for SG.

    Now that SG and checksum offload are independent features, if you
    explicitly enable SG *and* use one of the rare protocols that can use
    SG without checkusm offload, this potentially leaks sensitive
    information (before you notice that it just isn't working).  Therefore
    this obscure bug has been designated CVE-2016-2117.

    Reported-by: Justin Yackoski <jyackoski@crypto-nite.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Fixes: ec5f06156423 ("net: Kill link between CSUM and SG features.")
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 13b89711a2ddc389efb2a220e2f34ab8ff47021b
Author: Mathias Krause <minipli@googlemail.com>
Date:   Sun Apr 10 12:52:28 2016 +0200

    packet: fix heap info leak in PACKET_DIAG_MCLIST sock_diag interface

    commit 309cf37fe2a781279b7675d4bb7173198e532867 upstream.

    Because we miss to wipe the remainder of i->addr[] in packet_mc_add(),
    pdiag_put_mclist() leaks uninitialized heap bytes via the
    PACKET_DIAG_MCLIST netlink attribute.

    Fix this by explicitly memset(0)ing the remaining bytes in i->addr[].

    Fixes: eea68e2f1a00 ("packet: Report socket mclist info via diag module")
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Cc: Pavel Emelyanov <xemul@parallels.com>
    Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 3b848d3d6116d5db4a135e94d62f430058c09670
Author: Chris Friesen <chris.friesen@windriver.com>
Date:   Fri Apr 8 15:21:30 2016 -0600

    route: do not cache fib route info on local routes with oif

    commit d6d5e999e5df67f8ec20b6be45e2229455ee3699 upstream.

    For local routes that require a particular output interface we do not want
    to cache the result.  Caching the result causes incorrect behaviour when
    there are multiple source addresses on the interface.  The end result
    being that if the intended recipient is waiting on that interface for the
    packet he won't receive it because it will be delivered on the loopback
    interface and the IP_PKTINFO ipi_ifindex will be set to the loopback
    interface as well.

    This can be tested by running a program such as "dhcp_release" which
    attempts to inject a packet on a particular interface so that it is
    received by another program on the same board.  The receiving process
    should see an IP_PKTINFO ipi_ifndex value of the source interface
    (e.g., eth1) instead of the loopback interface (e.g., lo).  The packet
    will still appear on the loopback interface in tcpdump but the important
    aspect is that the CMSG info is correct.

    Sample dhcp_release command line:

       dhcp_release eth1 192.168.204.222 02:11:33:22:44:66

    Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
    Signed off-by: Chris Friesen <chris.friesen@windriver.com>
    Reviewed-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 49fabfb2ba27a6fd9322b7b89ba147d57dc18ca0
Author: David S. Miller <davem@davemloft.net>
Date:   Sun Apr 10 23:01:30 2016 -0400

    decnet: Do not build routes to devices without decnet private data.

    commit a36a0d4008488fa545c74445d69eaf56377d5d4e upstream.

    In particular, make sure we check for decnet private presence
    for loopback devices.

    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d248f68a930661cf0ba06faa7867d1ab77a9abe3
Author: Tony Lindgren <tony@atomide.com>
Date:   Thu May 28 07:22:08 2015 -0700

    ARM: OMAP3: Fix booting with thumb2 kernel

    commit d8a50941c91a68da202aaa96a3dacd471ea9c693 upstream.

    We get a NULL pointer dereference on omap3 for thumb2 compiled kernels:

    Internal error: Oops: 80000005 [#1] SMP THUMB2
    ...
    [<c046497b>] (_raw_spin_unlock_irqrestore) from [<c0024375>]
    (omap3_enter_idle_bm+0xc5/0x178)
    [<c0024375>] (omap3_enter_idle_bm) from [<c0374e63>]
    (cpuidle_enter_state+0x77/0x27c)
    [<c0374e63>] (cpuidle_enter_state) from [<c00627f1>]
    (cpu_startup_entry+0x155/0x23c)
    [<c00627f1>] (cpu_startup_entry) from [<c06b9a47>]
    (start_kernel+0x32f/0x338)
    [<c06b9a47>] (start_kernel) from [<8000807f>] (0x8000807f)

    The power management related assembly on omaps needs to interact with
    ARM mode bootrom code, so we need to keep most of the related assembly
    in ARM mode.

    Turns out this error is because of missing ENDPROC for assembly code
    as suggested by Stephen Boyd <sboyd@codeaurora.org>. Let's fix the
    problem by adding ENDPROC in two places to sleep34xx.S.

    Let's also remove the now duplicate custom code for mode switching.
    This has been unnecessary since commit 6ebbf2ce437b ("ARM: convert
    all "mov.* pc, reg" to "bx reg" for ARMv6+").

    And let's also remove the comments about local variables, they are
    now just confusing after the ENDPROC.

    The reason why ENDPROC makes a difference is it sets .type and then
    the compiler knows what to do with the thumb bit as explained at:

    https://wiki.ubuntu.com/ARM/Thumb2PortingHowto

    Reported-by: Kevin Hilman <khilman@kernel.org>
    Tested-by: Kevin Hilman <khilman@linaro.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 3f557d256fac2c83ae330c21524ebabb4657a392
Author: Andi Kleen <ak@linux.intel.com>
Date:   Sat Feb 8 08:52:00 2014 +0100

    asmlinkage, pnp: Make variables used from assembler code visible

    commit a99aa42d0253f033cbb85096d3f2bd82201321e6 upstream.

    Mark variables referenced from assembler files visible.

    This fixes compile problems with LTO.

    Cc: Jaroslav Kysela <perex@perex.cz>
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Link: http://lkml.kernel.org/r/1391845930-28580-4-git-send-email-ak@linux.intel.com
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 6985c64f126ff488cbe399e81fb23ee0477bf154
Author: Marek Szyprowski <m.szyprowski@samsung.com>
Date:   Mon May 9 09:31:47 2016 -0700

    Input: max8997-haptic - fix NULL pointer dereference

    commit 6ae645d5fa385f3787bf1723639cd907fe5865e7 upstream.

    NULL pointer derefence happens when booting with DTB because the
    platform data for haptic device is not set in supplied data from parent
    MFD device.

    The MFD device creates only platform data (from Device Tree) for itself,
    not for haptic child.

    Unable to handle kernel NULL pointer dereference at virtual address 0000009c
    pgd = c0004000
    	[0000009c] *pgd=00000000
    	Internal error: Oops: 5 [#1] PREEMPT SMP ARM
    	(max8997_haptic_probe) from [<c03f9cec>] (platform_drv_probe+0x4c/0xb0)
    	(platform_drv_probe) from [<c03f8440>] (driver_probe_device+0x214/0x2c0)
    	(driver_probe_device) from [<c03f8598>] (__driver_attach+0xac/0xb0)
    	(__driver_attach) from [<c03f67ac>] (bus_for_each_dev+0x68/0x9c)
    	(bus_for_each_dev) from [<c03f7a38>] (bus_add_driver+0x1a0/0x218)
    	(bus_add_driver) from [<c03f8db0>] (driver_register+0x78/0xf8)
    	(driver_register) from [<c0101774>] (do_one_initcall+0x90/0x1d8)
    	(do_one_initcall) from [<c0a00dbc>] (kernel_init_freeable+0x15c/0x1fc)
    	(kernel_init_freeable) from [<c06bb5b4>] (kernel_init+0x8/0x114)
    	(kernel_init) from [<c0107938>] (ret_from_fork+0x14/0x3c)

    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Cc: <stable@vger.kernel.org>
    Fixes: 104594b01ce7 ("Input: add driver support for MAX8997-haptic")
    [k.kozlowski: Write commit message, add CC-stable]
    Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8613b37684fbca1f642b6e636b0dd8923fa0bfd9
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Thu May 5 16:25:35 2016 -0400

    get_rock_ridge_filename(): handle malformed NM entries

    commit 99d825822eade8d827a1817357cbf3f889a552d6 upstream.

    Payloads of NM entries are not supposed to contain NUL.  When we run
    into such, only the part prior to the first NUL goes into the
    concatenation (i.e. the directory entry name being encoded by a bunch
    of NM entries).  We do stop when the amount collected so far + the
    claimed amount in the current NM entry exceed 254.  So far, so good,
    but what we return as the total length is the sum of *claimed*
    sizes, not the actual amount collected.  And that can grow pretty
    large - not unlimited, since you'd need to put CE entries in
    between to be able to get more than the maximum that could be
    contained in one isofs directory entry / continuation chunk and
    we are stop once we'd encountered 32 CEs, but you can get about 8Kb
    easily.  And that's what will be passed to readdir callback as the
    name length.  8Kb __copy_to_user() from a buffer allocated by
    __get_free_page()

    Cc: stable@vger.kernel.org # 0.98pl6+ (yes, really)
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f220ec58d1e4f49cb6c761a859241c057844cdf2
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Wed May 4 17:52:56 2016 +0800

    crypto: hash - Fix page length clamping in hash walk

    commit 13f4bb78cf6a312bbdec367ba3da044b09bf0e29 upstream.

    The crypto hash walk code is broken when supplied with an offset
    greater than or equal to PAGE_SIZE.  This patch fixes it by adjusting
    walk->pg and walk->offset when this happens.

    Cc: <stable@vger.kernel.org>
    Reported-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 73dd3ac10bf81213a89538654aa005be6432e52d
Author: Anton Blanchard <anton@samba.org>
Date:   Fri Apr 15 12:06:13 2016 +1000

    powerpc: scan_features() updates incorrect bits for REAL_LE

    commit 6997e57d693b07289694239e52a10d2f02c3a46f upstream.

    The REAL_LE feature entry in the ibm_pa_feature struct is missing an MMU
    feature value, meaning all the remaining elements initialise the wrong
    values.

    This means instead of checking for byte 5, bit 0, we check for byte 0,
    bit 0, and then we incorrectly set the CPU feature bit as well as MMU
    feature bit 1 and CPU user feature bits 0 and 2 (5).

    Checking byte 0 bit 0 (IBM numbering), means we're looking at the
    "Memory Management Unit (MMU)" feature - ie. does the CPU have an MMU.
    In practice that bit is set on all platforms which have the property.

    This means we set CPU_FTR_REAL_LE always. In practice that seems not to
    matter because all the modern cpus which have this property also
    implement REAL_LE, and we've never needed to disable it.

    We're also incorrectly setting MMU feature bit 1, which is:

      #define MMU_FTR_TYPE_8xx		0x00000002

    Luckily the only place that looks for MMU_FTR_TYPE_8xx is in Book3E
    code, which can't run on the same cpus as scan_features(). So this also
    doesn't matter in practice.

    Finally in the CPU user feature mask, we're setting bits 0 and 2. Bit 2
    is not currently used, and bit 0 is:

      #define PPC_FEATURE_PPC_LE		0x00000001

    Which says the CPU supports the old style "PPC Little Endian" mode.
    Again this should be harmless in practice as no 64-bit CPUs implement
    that mode.

    Fix the code by adding the missing initialisation of the MMU feature.

    Also add a comment marking CPU user feature bit 2 (0x4) as reserved. It
    would be unsafe to start using it as old kernels incorrectly set it.

    Fixes: 44ae3ab3358e ("powerpc: Free up some CPU feature bits by moving out MMU-related features")
    Signed-off-by: Anton Blanchard <anton@samba.org>
    [mpe: Flesh out changelog, add comment reserving 0x4]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d7b49e545800e7ccf5b566d22d9f6572eaa0fbb3
Author: Andrey Gelman <andrey.gelman@compulab.co.il>
Date:   Tue Oct 6 15:43:43 2015 -0700

    Input: ads7846 - correct the value got from SPI

    commit 879f2fea8a5a748bcbf98d2cdce9139c045505d3 upstream.

    According to the touch controller spec, SPI return a 16 bit value, only 12
    bits are valid, they are bit[14-3].

    The value of MISO and MOSI can be configured when SPI is in idle mode.
    Currently this touch driver assumes the SPI bus sets the MOSI and MISO in
    low level when SPI bus is in idle mode. So the bit[15] of the value got
    from SPI bus is always 0. But when SPI bus congfigures the MOSI and MISO in
    high level during the SPI idle mode, the bit[15] of the value get from SPI
    is always 1. If bit[15] is not masked, we may get the wrong value.

    Mask the invalid bit to make sure the correct value gets returned.
    Regardless of the SPI bus idle configuration.

    Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
    Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
    Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5e1a1e7fca96f0cd8129bac3dd605cc7cd86fd50
Author: Jasem Mutlaq <mutlaqja@ikarustech.com>
Date:   Tue Apr 19 10:38:27 2016 +0300

    USB: serial: cp210x: add Straizona Focusers device ids

    commit 613ac23a46e10d4d4339febdd534fafadd68e059 upstream.

    Adding VID:PID for Straizona Focusers to cp210x driver.

    Signed-off-by: Jasem Mutlaq <mutlaqja@ikarustech.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 15e27ea97ae7d9833e55e5937a4ecfa4a5dbf81f
Author: Mike Manning <michael@bsch.com.au>
Date:   Mon Apr 18 12:13:23 2016 +0000

    USB: serial: cp210x: add ID for Link ECU

    commit 1d377f4d690637a0121eac8701f84a0aa1e69a69 upstream.

    The Link ECU is an aftermarket ECU computer for vehicles that provides
    full tuning abilities as well as datalogging and displaying capabilities
    via the USB to Serial adapter built into the device.

    Signed-off-by: Mike Manning <michael@bsch.com.au>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 505a7a684b7071972c565488f6d1f9b8835c0dbd
Author: Prarit Bhargava <prarit@redhat.com>
Date:   Wed May 4 13:48:56 2016 +0800

    ACPICA: Dispatcher: Update thread ID for recursive method calls

    commit 93d68841a23a5779cef6fb9aa0ef32e7c5bd00da upstream.

    ACPICA commit 7a3bd2d962f221809f25ddb826c9e551b916eb25

    Set the mutex owner thread ID.
    Original patch from: Prarit Bhargava <prarit@redhat.com>

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=115121
    Link: https://github.com/acpica/acpica/commit/7a3bd2d9
    Signed-off-by: Prarit Bhargava <prarit@redhat.com>
    Tested-by: Andy Lutomirski <luto@kernel.org> # On a Dell XPS 13 9350
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Cc: All applicable <stable@vger.kernel.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit cd275e9ade6b4954c7954f0c4e7ab2a1f4c3522c
Author: Matt Fleming <matt@codeblueprint.co.uk>
Date:   Tue May 3 20:29:39 2016 +0100

    MAINTAINERS: Remove asterisk from EFI directory names

    commit e8dfe6d8f6762d515fcd4f30577f7bfcf7659887 upstream.

    Mark reported that having asterisks on the end of directory names
    confuses get_maintainer.pl when it encounters subdirectories, and that
    my name does not appear when run on drivers/firmware/efi/libstub.

    Reported-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
    Cc: <stable@vger.kernel.org>
    Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1462303781-8686-2-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e712c5d602274d15e8e23da16ba9a9acfc8fc181
Author: Linus Lüssing <linus.luessing@c0d3.blue>
Date:   Fri Mar 11 14:04:49 2016 +0100

    batman-adv: Fix broadcast/ogm queue limit on a removed interface

    commit c4fdb6cff2aa0ae740c5f19b6f745cbbe786d42f upstream.

    When removing a single interface while a broadcast or ogm packet is
    still pending then we will free the forward packet without releasing the
    queue slots again.

    This patch is supposed to fix this issue.

    Fixes: 6d5808d4ae1b ("batman-adv: Add missing hardif_free_ref in forw_packet_free")
    Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
    [sven@narfation.org: fix conflicts with current version]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Antonio Quartulli <a@unstable.cc>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5210e2409a2350a9cdf1871bddc1b3e94879f017
Author: Mathias Krause <minipli@googlemail.com>
Date:   Thu May 5 16:22:26 2016 -0700

    proc: prevent accessing /proc/<PID>/environ until it's ready

    commit 8148a73c9901a8794a50f950083c00ccf97d43b3 upstream.

    If /proc/<PID>/environ gets read before the envp[] array is fully set up
    in create_{aout,elf,elf_fdpic,flat}_tables(), we might end up trying to
    read more bytes than are actually written, as env_start will already be
    set but env_end will still be zero, making the range calculation
    underflow, allowing to read beyond the end of what has been written.

    Fix this as it is done for /proc/<PID>/cmdline by testing env_end for
    zero.  It is, apparently, intentionally set last in create_*_tables().

    This bug was found by the PaX size_overflow plugin that detected the
    arithmetic underflow of 'this_len = env_end - (env_start + src)' when
    env_end is still zero.

    The expected consequence is that userland trying to access
    /proc/<PID>/environ of a not yet fully set up process may get
    inconsistent data as we're in the middle of copying in the environment
    variables.

    Fixes: https://forums.grsecurity.net/viewtopic.php?f=3&t=4363
    Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=116461
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Cc: Emese Revfy <re.emese@gmail.com>
    Cc: Pax Team <pageexec@freemail.hu>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Mateusz Guzik <mguzik@redhat.com>
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Cc: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: Jarod Wilson <jarod@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 7b640feea9d2e050c381d878db14748cb9005635
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date:   Wed Apr 20 13:34:31 2016 +0000

    ARM: SoCFPGA: Fix secondary CPU startup in thumb2 kernel

    commit 5616f36713ea77f57ae908bf2fef641364403c9f upstream.

    The secondary CPU starts up in ARM mode. When the kernel is compiled in
    thumb2 mode we have to explicitly compile the secondary startup
    trampoline in ARM mode, otherwise the CPU will go to Nirvana.

    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
    Reported-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
    Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
    Signed-off-by: Kevin Hilman <khilman@baylibre.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 834f5956da4a7cd908821ffe585fab49a00acaed
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Mar 14 15:29:44 2016 +0100

    lpfc: fix misleading indentation

    commit aeb6641f8ebdd61939f462a8255b316f9bfab707 upstream.

    gcc-6 complains about the indentation of the lpfc_destroy_vport_work_array()
    call in lpfc_online(), which clearly doesn't look right:

    drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_online':
    drivers/scsi/lpfc/lpfc_init.c:2880:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
       lpfc_destroy_vport_work_array(phba, vports);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/scsi/lpfc/lpfc_init.c:2863:2: note: ...this 'if' clause, but it is not
      if (vports != NULL)
      ^~

    Looking at the patch that introduced this code, it's clear that the
    behavior is correct and the indentation is wrong.

    This fixes the indentation and adds curly braces around the previous
    if() block for clarity, as that is most likely what caused the code
    to be misindented in the first place.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Fixes: 549e55cd2a1b ("[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list")
    Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
    Reviewed-by: Hannes Reinecke <hare@suse.com>
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d3605b9c39cffb3cd67176083dc014696c29198c
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Wed Feb 24 09:39:11 2016 +0100

    clk: versatile: sp810: support reentrance

    commit ec7957a6aa0aaf981fb8356dc47a2cdd01cde03c upstream.

    Despite care take to allocate clocks state containers the
    SP810 driver actually just supports creating one instance:
    all clocks registered for every instance will end up with the
    exact same name and __clk_init() will fail.

    Rename the timclken<0> .. timclken<n> to sp810_<instance>_<n>
    so every clock on every instance gets a unique name.

    This is necessary for the RealView PBA8 which has two SP810
    blocks: the second block will not register its clocks unless
    every clock on every instance is unique and results in boot
    logs like this:

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 0 at ../drivers/clk/versatile/clk-sp810.c:137
      clk_sp810_of_setup+0x110/0x154()
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted
    4.5.0-rc2-00030-g352718fc39f6-dirty #225
    Hardware name: ARM RealView Machine (Device Tree Support)
    [<c00167f8>] (unwind_backtrace) from [<c0013204>]
                 (show_stack+0x10/0x14)
    [<c0013204>] (show_stack) from [<c01a049c>]
                 (dump_stack+0x84/0x9c)
    [<c01a049c>] (dump_stack) from [<c0024990>]
                 (warn_slowpath_common+0x74/0xb0)
    [<c0024990>] (warn_slowpath_common) from [<c0024a68>]
                 (warn_slowpath_null+0x1c/0x24)
    [<c0024a68>] (warn_slowpath_null) from [<c051eb44>]
                 (clk_sp810_of_setup+0x110/0x154)
    [<c051eb44>] (clk_sp810_of_setup) from [<c051e3a4>]
                 (of_clk_init+0x12c/0x1c8)
    [<c051e3a4>] (of_clk_init) from [<c0504714>]
                 (time_init+0x20/0x2c)
    [<c0504714>] (time_init) from [<c0501b18>]
                 (start_kernel+0x244/0x3c4)
    [<c0501b18>] (start_kernel) from [<7000807c>] (0x7000807c)
    ---[ end trace cb88537fdc8fa200 ]---

    Cc: Michael Turquette <mturquette@baylibre.com>
    Cc: Pawel Moll <pawel.moll@arm.com>
    Fixes: 6e973d2c4385 "clk: vexpress: Add separate SP810 driver"
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f95bba828ffd675687395eef4e46894a6fd01594
Author: Dan Streetman <dan.streetman@canonical.com>
Date:   Thu Jan 14 13:42:32 2016 -0500

    nbd: ratelimit error msgs after socket close

    commit da6ccaaa79caca4f38b540b651238f87215217a2 upstream.

    Make the "Attempted send on closed socket" error messages generated in
    nbd_request_handler() ratelimited.

    When the nbd socket is shutdown, the nbd_request_handler() function emits
    an error message for every request remaining in its queue.  If the queue
    is large, this will spam a large amount of messages to the log.  There's
    no need for a separate error message for each request, so this patch
    ratelimits it.

    In the specific case this was found, the system was virtual and the error
    messages were logged to the serial port, which overwhelmed it.

    Fixes: 4d48a542b427 ("nbd: fix I/O hang on disconnected nbds")
    Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
    Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 049c18dabc8fa79b5b55cf78d615a93f2ccd97f0
Author: Marco Angaroni <marcoangaroni@gmail.com>
Date:   Sat Mar 5 12:10:02 2016 +0100

    ipvs: correct initial offset of Call-ID header search in SIP persistence engine

    commit 7617a24f83b5d67f4dab1844956be1cebc44aec8 upstream.

    The IPVS SIP persistence engine is not able to parse the SIP header
    "Call-ID" when such header is inserted in the first positions of
    the SIP message.

    When IPVS is configured with "--pe sip" option, like for example:
    ipvsadm -A -u 1.2.3.4:5060 -s rr --pe sip -p 120 -o
    some particular messages (see below for details) do not create entries
    in the connection template table, which can be listed with:
    ipvsadm -Lcn --persistent-conn

    Problematic SIP messages are SIP responses having "Call-ID" header
    positioned just after message first line:
    SIP/2.0 200 OK
    [Call-ID header here]
    [rest of the headers]

    When "Call-ID" header is positioned down (after a few other headers)
    it is correctly recognized.

    This is due to the data offset used in get_callid function call inside
    ip_vs_pe_sip.c file: since dptr already points to the start of the
    SIP message, the value of dataoff should be initially 0.
    Otherwise the header is searched starting from some bytes after the
    first character of the SIP message.

    Fixes: 758ff0338722 ("IPVS: sip persistence engine")
    Signed-off-by: Marco Angaroni <marcoangaroni@gmail.com>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5d814ad8d35e5e23e0c27fb0f0b80c1044ecefad
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Thu Mar 31 09:38:51 2016 +0200

    compiler-gcc: disable -ftracer for __noclone functions

    commit 95272c29378ee7dc15f43fa2758cb28a5913a06d upstream.

    -ftracer can duplicate asm blocks causing compilation to fail in
    noclone functions.  For example, KVM declares a global variable
    in an asm like

        asm("2: ... \n
             .pushsection data \n
             .global vmx_return \n
             vmx_return: .long 2b");

    and -ftracer causes a double declaration.

    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Michal Marek <mmarek@suse.cz>
    Cc: stable@vger.kernel.org
    Cc: kvm@vger.kernel.org
    Reported-by: Linda Walsh <lkml@tlinx.org>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 26898db604e006918cead820ee8f897e09f37ca9
Author: Pali Rohár <pali.rohar@gmail.com>
Date:   Fri Feb 19 10:35:39 2016 -0800

    ARM: OMAP3: Add cpuidle parameters table for omap3430

    commit 98f42221501353067251fbf11e732707dbb68ce3 upstream.

    Based on CPU type choose generic omap3 or omap3430 specific cpuidle
    parameters. Parameters for omap3430 were measured on Nokia N900 device and
    added by commit 5a1b1d3a9efa ("OMAP3: RX-51: Pass cpu idle parameters")
    which were later removed by commit 231900afba52 ("ARM: OMAP3: cpuidle -
    remove rx51 cpuidle parameters table") due to huge code complexity.

    This patch brings cpuidle parameters for omap3430 devices again, but uses
    simple condition based on CPU type.

    Fixes: 231900afba52 ("ARM: OMAP3: cpuidle - remove rx51 cpuidle
    parameters table")
    Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
    Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ab306782a133bc5274a357f7f25488375b04b201
Author: Borislav Petkov <bp@suse.de>
Date:   Mon Mar 7 16:44:44 2016 -0300

    perf stat: Document --detailed option

    commit f594bae08183fb6b57db55387794ece3e1edf6f6 upstream.

    I'm surprised this remained undocumented since at least 2011. And it is
    actually a very useful switch, as Steve and I came to realize recently.

    Add the text from

      2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")

    which added the incrementing aspect to -d.

    Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Davidlohr Bueso <dbueso@suse.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mel Gorman <mgorman@suse.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Fixes: 2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")
    Link: http://lkml.kernel.org/r/1457347294-32546-1-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 70415182b66cc3ca0167d989a7f40d5c437c4c0b
Author: Vitaly Kuznetsov <vkuznets@redhat.com>
Date:   Fri Feb 27 11:25:51 2015 -0800

    Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors

    commit e513229b4c386e6c9f66298c13fde92f73e6e1ac upstream.

    When an SMP Hyper-V guest is running on top of 2012R2 Server and secondary
    cpus are sent offline (with echo 0 > /sys/devices/system/cpu/cpu$cpu/online)
    the system freeze is observed. This happens due to the fact that on newer
    hypervisors (Win8, WS2012R2, ...) vmbus channel handlers are distributed
    across all cpus (see init_vp_index() function in drivers/hv/channel_mgmt.c)
    and on cpu offlining nobody reassigns them to CPU0. Prevent cpu offlining
    when vmbus is loaded until the issue is fixed host-side.

    This patch also disables hibernation but it is OK as it is also broken (MCE
    error is hit on resume). Suspend still works.

    Tested with WS2008R2 and WS2012R2.

    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
    [ 3chas3@gmail.com: rebase to 3.14-stable ]
    Signed-off-by: Chas Williams <3chas3@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit df1da5a5477cc4fb1e8fa330851b0ad78255bfd4
Author: Vasily Kulikov <segoon@openwall.com>
Date:   Wed Sep 9 15:36:00 2015 -0700

    include/linux/poison.h: fix LIST_POISON{1,2} offset

    commit 8a5e5e02fc83aaf67053ab53b359af08c6c49aaf upstream.

    Poison pointer values should be small enough to find a room in
    non-mmap'able/hardly-mmap'able space.  E.g.  on x86 "poison pointer space"
    is located starting from 0x0.  Given unprivileged users cannot mmap
    anything below mmap_min_addr, it should be safe to use poison pointers
    lower than mmap_min_addr.

    The current poison pointer values of LIST_POISON{1,2} might be too big for
    mmap_min_addr values equal or less than 1 MB (common case, e.g.  Ubuntu
    uses only 0x10000).  There is little point to use such a big value given
    the "poison pointer space" below 1 MB is not yet exhausted.  Changing it
    to a smaller value solves the problem for small mmap_min_addr setups.

    The values are suggested by Solar Designer:
    http://www.openwall.com/lists/oss-security/2015/05/02/6

    Signed-off-by: Vasily Kulikov <segoon@openwall.com>
    Cc: Solar Designer <solar@openwall.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 310c45d174f51fd2087aeff2676e01bdbc0e4d34
Author: Michael Hennerich <michael.hennerich@analog.com>
Date:   Mon Feb 22 10:20:24 2016 +0100

    drivers/misc/ad525x_dpot: AD5274 fix RDAC read back errors

    commit f3df53e4d70b5736368a8fe8aa1bb70c1cb1f577 upstream.

    Fix RDAC read back errors caused by a typo. Value must shift by 2.

    Fixes: a4bd394956f2 ("drivers/misc/ad525x_dpot.c: new features")
    Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e35d98315485e10cf3865e0495ec7d1e0d3a3379
Author: Geert Uytterhoeven <geert@linux-m68k.org>
Date:   Tue Mar 1 09:50:01 2016 +0100

    rtc: vr41xx: Wire up alarm_irq_enable

    commit a25f4a95ec3cded34c1250364eba704c5e4fdac4 upstream.

    drivers/rtc/rtc-vr41xx.c:229: warning: �vr41xx_rtc_alarm_irq_enable� defined but not used

    Apparently the conversion to alarm_irq_enable forgot to wire up the
    callback.

    Fixes: 16380c153a69c378 ("RTC: Convert rtc drivers to use the alarm_irq_enable method")
    Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8e806835e276d42158f7e0d1c3405127a24926c2
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Mon Dec 14 14:29:23 2015 +0000

    misc/bmp085: Enable building as a module

    commit 50e6315dba721cbc24ccd6d7b299f1782f210a98 upstream.

    Commit 985087dbcb02 'misc: add support for bmp18x chips to the bmp085
    driver' changed the BMP085 config symbol to a boolean.  I see no
    reason why the shared code cannot be built as a module, so change it
    back to tristate.

    Fixes: 985087dbcb02 ("misc: add support for bmp18x chips to the bmp085 driver")
    Cc: Eric Andersson <eric.andersson@unixphere.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 78d64c695eed7a7266de28f2796b2301bd34d02c
Author: Sushaanth Srirangapathi <sushaanth.s@ti.com>
Date:   Mon Feb 29 18:42:19 2016 +0530

    fbdev: da8xx-fb: fix videomodes of lcd panels

    commit 713fced8d10fa1c759c8fb6bf9aaa681bae68cad upstream.

    Commit 028cd86b794f4a ("video: da8xx-fb: fix the polarities of the
    hsync/vsync pulse") fixes polarities of HSYNC/VSYNC pulse but
    forgot to update known_lcd_panels[] which had sync values
    according to old logic. This breaks LCD at least on DA850 EVM.

    This patch fixes this issue and I have tested this for panel
    "Sharp_LK043T1DG01" using DA850 EVM board.

    Fixes: 028cd86b794f4a ("video: da8xx-fb: fix the polarities of the hsync/vsync pulse")
    Signed-off-by: Sushaanth Srirangapathi <sushaanth.s@ti.com>
    Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 226a8ce3d88baef6a8160edf2d61826e15055d9b
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Mar 15 14:53:29 2016 -0700

    paride: make 'verbose' parameter an 'int' again

    commit dec63a4dec2d6d01346fd5d96062e67c0636852b upstream.

    gcc-6.0 found an ancient bug in the paride driver, which had a
    "module_param(verbose, bool, 0);" since before 2.6.12, but actually uses
    it to accept '0', '1' or '2' as arguments:

      drivers/block/paride/pd.c: In function 'pd_init_dev_parms':
      drivers/block/paride/pd.c:298:29: warning: comparison of constant '1' with boolean expression is always false [-Wbool-compare]
       #define DBMSG(msg) ((verbose>1)?(msg):NULL)

    In 2012, Rusty did a cleanup patch that also changed the type of the
    variable to 'bool', which introduced what is now a gcc warning.

    This changes the type back to 'int' and adapts the module_param() line
    instead, so it should work as documented in case anyone ever cares about
    running the ancient driver with debugging.

    Fixes: 90ab5ee94171 ("module_param: make bool parameters really bool (drivers & misc)")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Rusty Russell <rusty@rustcorp.com.au>
    Cc: Tim Waugh <tim@cyberelk.net>
    Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Cc: Jens Axboe <axboe@fb.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 378175d0ac887f3fb4b8644152f05ccccff7e8d2
Author: Ignat Korchagin <ignat.korchagin@gmail.com>
Date:   Thu Mar 17 18:00:29 2016 +0000

    USB: usbip: fix potential out-of-bounds write

    commit b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb upstream.

    Fix potential out-of-bounds write to urb->transfer_buffer
    usbip handles network communication directly in the kernel. When receiving a
    packet from its peer, usbip code parses headers according to protocol. As
    part of this parsing urb->actual_length is filled. Since the input for
    urb->actual_length comes from the network, it should be treated as untrusted.
    Any entity controlling the network may put any value in the input and the
    preallocated urb->transfer_buffer may not be large enough to hold the data.
    Thus, the malicious entity is able to write arbitrary data to kernel memory.

    Signed-off-by: Ignat Korchagin <ignat.korchagin@gmail.com>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8a872b18df6f08c45ec89d55826ba08cd39756c3
Author: Roman Pen <roman.penyaev@profitbricks.com>
Date:   Tue Apr 26 13:15:35 2016 +0200

    workqueue: fix ghost PENDING flag while doing MQ IO

    commit 346c09f80459a3ad97df1816d6d606169a51001a upstream.

    The bug in a workqueue leads to a stalled IO request in MQ ctx->rq_list
    with the following backtrace:

    [  601.347452] INFO: task kworker/u129:5:1636 blocked for more than 120 seconds.
    [  601.347574]       Tainted: G           O    4.4.5-1-storage+ #6
    [  601.347651] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [  601.348142] kworker/u129:5  D ffff880803077988     0  1636      2 0x00000000
    [  601.348519] Workqueue: ibnbd_server_fileio_wq ibnbd_dev_file_submit_io_worker [ibnbd_server]
    [  601.348999]  ffff880803077988 ffff88080466b900 ffff8808033f9c80 ffff880803078000
    [  601.349662]  ffff880807c95000 7fffffffffffffff ffffffff815b0920 ffff880803077ad0
    [  601.350333]  ffff8808030779a0 ffffffff815b01d5 0000000000000000 ffff880803077a38
    [  601.350965] Call Trace:
    [  601.351203]  [<ffffffff815b0920>] ? bit_wait+0x60/0x60
    [  601.351444]  [<ffffffff815b01d5>] schedule+0x35/0x80
    [  601.351709]  [<ffffffff815b2dd2>] schedule_timeout+0x192/0x230
    [  601.351958]  [<ffffffff812d43f7>] ? blk_flush_plug_list+0xc7/0x220
    [  601.352208]  [<ffffffff810bd737>] ? ktime_get+0x37/0xa0
    [  601.352446]  [<f…
janengelmohr pushed a commit that referenced this issue Jul 12, 2016
commit ca1199fccf14540e86f6da955333e31d6fec5f3e
Author: Willy Tarreau <w@1wt.eu>
Date:   Sun Jun 12 11:41:54 2016 +0200

    Linux 3.10.102

commit fd1a096205147366e2cc9dc0a816e24f56946a83
Author: Chanwoo Choi <cw00.choi@samsung.com>
Date:   Thu Apr 21 18:58:31 2016 +0900

    serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()

    commit b8995f527aac143e83d3900ff39357651ea4e0f6 upstream.

    This patch fixes the broken serial log when changing the clock source
    of uart device. Before disabling the original clock source, this patch
    enables the new clock source to protect the clock off state for a split second.

    Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
    Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 0fff1b1ff8c9c07caa1762b6c0b76b1dbbe20223
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Tue May 3 17:05:54 2016 +0200

    tty: vt, return error when con_startup fails

    commit 6798df4c5fe0a7e6d2065cf79649a794e5ba7114 upstream.

    When csw->con_startup() fails in do_register_con_driver, we return no
    error (i.e. 0). This was changed back in 2006 by commit 3e795de763.
    Before that we used to return -ENODEV.

    So fix the return value to be -ENODEV in that case again.

    Fixes: 3e795de763 ("VT binding: Add binding/unbinding support for the VT console")
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Reported-by: "Dan Carpenter" <dan.carpenter@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 49849df77f10d800990bb8cb3e4f974745967520
Author: Schemmel Hans-Christoph <Hans-Christoph.Schemmel@gemalto.com>
Date:   Fri Apr 29 08:51:06 2016 +0000

    USB: serial: option: add support for Cinterion PH8 and AHxx

    commit 444f94e9e625f6ec6bbe2cb232a6451c637f35a3 upstream.

    Added support for Gemalto's Cinterion PH8 and AHxx products
    with 2 RmNet Interfaces and products with 1 RmNet + 1 USB Audio interface.

    In addition some minor renaming and formatting.

    Signed-off-by: Hans-Christoph Schemmel <hans-christoph.schemmel@gemalto.com>
    [johan: sort current entries and trim trailing whitespace ]
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 9d08a9916056a23f2c4818222cf90e800d3f77ec
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:07:57 2016 +0200

    USB: serial: io_edgeport: fix memory leaks in probe error path

    commit c8d62957d450cc1a22ce3242908709fe367ddc8e upstream.

    URBs and buffers allocated in attach for Epic devices would never be
    deallocated in case of a later probe error (e.g. failure to allocate
    minor numbers) as disconnect is then never called.

    Fix by moving deallocation to release and making sure that the
    URBs are first unlinked.

    Fixes: f9c99bb8b3a1 ("USB: usb-serial: replace shutdown with disconnect,
    release")
    Cc: stable <stable@vger.kernel.org>	# v2.6.31
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 1f983d0bebe54898bc35779815a23582ac38c9b7
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:08:02 2016 +0200

    USB: serial: quatech2: fix use-after-free in probe error path

    commit 028c49f5e02a257c94129cd815f7c8485f51d4ef upstream.

    The interface read URB is submitted in attach, but was only unlinked by
    the driver at disconnect.

    In case of a late probe error (e.g. due to failed minor allocation),
    disconnect is never called and we would end up with active URBs for an
    unbound interface. This in turn could lead to deallocated memory being
    dereferenced in the completion callback.

    Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 550d9c436e40dd384b22f2beea93e20c2e069600
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:07:58 2016 +0200

    USB: serial: keyspan: fix use-after-free in probe error path

    commit 35be1a71d70775e7bd7e45fa6d2897342ff4c9d2 upstream.

    The interface instat and indat URBs were submitted in attach, but never
    unlinked in release before deallocating the corresponding transfer
    buffers.

    In the case of a late probe error (e.g. due to failed minor allocation),
    disconnect would not have been called before release, causing the
    buffers to be freed while the URBs are still in use. We'd also end up
    with active URBs for an unbound interface.

    Fixes: f9c99bb8b3a1 ("USB: usb-serial: replace shutdown with disconnect,
    release")
    Cc: stable <stable@vger.kernel.org>	# v2.6.31
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit c21f25b36d258d04c0332609aaa68d895cfa8796
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Sat Mar 19 11:49:43 2016 +0100

    Bluetooth: vhci: purge unhandled skbs

    commit 13407376b255325fa817798800117a839f3aa055 upstream.

    The write handler allocates skbs and queues them into data->readq.
    Read side should read them, if there is any. If there is none, skbs
    should be dropped by hdev->flush. But this happens only if the device
    is HCI_UP, i.e. hdev->power_on work was triggered already. When it was
    not, skbs stay allocated in the queue when /dev/vhci is closed. So
    purge the queue in ->release.

    Program to reproduce:
    	#include <err.h>
    	#include <fcntl.h>
    	#include <stdio.h>
    	#include <unistd.h>

    	#include <sys/stat.h>
    	#include <sys/types.h>
    	#include <sys/uio.h>

    	int main()
    	{
    		char buf[] = { 0xff, 0 };
    		struct iovec iov = {
    			.iov_base = buf,
    			.iov_len = sizeof(buf),
    		};
    		int fd;

    		while (1) {
    			fd = open("/dev/vhci", O_RDWR);
    			if (fd < 0)
    				err(1, "open");

    			usleep(50);

    			if (writev(fd, &iov, 1) < 0)
    				err(1, "writev");

    			usleep(50);

    			close(fd);
    		}

    		return 0;
    	}

    Result:
    kmemleak: 4609 new suspected memory leaks
    unreferenced object 0xffff88059f4d5440 (size 232):
      comm "vhci", pid 1084, jiffies 4294912542 (age 37569.296s)
      hex dump (first 32 bytes):
        20 f0 23 87 05 88 ff ff 20 f0 23 87 05 88 ff ff   .#..... .#.....
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace:
    ...
        [<ffffffff81ece010>] __alloc_skb+0x0/0x5a0
        [<ffffffffa021886c>] vhci_create_device+0x5c/0x580 [hci_vhci]
        [<ffffffffa0219436>] vhci_write+0x306/0x4c8 [hci_vhci]

    Fixes: 23424c0d31 (Bluetooth: Add support creating virtual AMP controllers)
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e9e0c8aded7f1c1bc5e6c01ee73ec29ec5942f6d
Author: Matt Gumbel <matthew.k.gumbel@intel.com>
Date:   Fri May 20 10:33:46 2016 +0300

    mmc: longer timeout for long read time quirk

    commit 32ecd320db39bcb007679ed42f283740641b81ea upstream.

    008GE0 Toshiba mmc in some Intel Baytrail tablets responds to
    MMC_SEND_EXT_CSD in 450-600ms.

    This patch will...

    () Increase the long read time quirk timeout from 300ms to 600ms. Original
       author of that quirk says 300ms was only a guess and that the number
       may need to be raised in the future.

    () Add this specific MMC to the quirk

    Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e94c917abb4a6a083eda8831e63907d4c836fd53
Author: Adrian Hunter <adrian.hunter@intel.com>
Date:   Thu May 5 08:12:28 2016 +0300

    mmc: mmc: Fix partition switch timeout for some eMMCs

    commit 1c447116d017a98c90f8f71c8c5a611e0aa42178 upstream.

    Some eMMCs set the partition switch timeout too low.

    Now typically eMMCs are considered a critical component (e.g. because
    they store the root file system) and consequently are expected to be
    reliable.  Thus we can neglect the use case where eMMCs can't switch
    reliably and we might want a lower timeout to facilitate speedy
    recovery.

    Although we could employ a quirk for the cards that are affected (if
    we could identify them all), as described above, there is little
    benefit to having a low timeout, so instead simply set a minimum
    timeout.

    The minimum is set to 300ms somewhat arbitrarily - the examples that
    have been seen had a timeout of 10ms but were sometimes taking 60-70ms.

    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 0cf266167e9f1e39bb411a49f1163f488f5a75e8
Author: Roger Quadros <rogerq@ti.com>
Date:   Mon May 9 11:28:37 2016 +0300

    mfd: omap-usb-tll: Fix scheduling while atomic BUG

    commit b49b927f16acee626c56a1af4ab4cb062f75b5df upstream.

    We shouldn't be calling clk_prepare_enable()/clk_prepare_disable()
    in an atomic context.

    Fixes the following issue:

    [    5.830970] ehci-omap: OMAP-EHCI Host Controller driver
    [    5.830974] driver_register 'ehci-omap'
    [    5.895849] driver_register 'wl1271_sdio'
    [    5.896870] BUG: scheduling while atomic: udevd/994/0x00000002
    [    5.896876] 4 locks held by udevd/994:
    [    5.896904]  #0:  (&dev->mutex){......}, at: [<c049597c>] __driver_attach+0x60/0xac
    [    5.896923]  #1:  (&dev->mutex){......}, at: [<c049598c>] __driver_attach+0x70/0xac
    [    5.896946]  #2:  (tll_lock){+.+...}, at: [<c04c2630>] omap_tll_enable+0x2c/0xd0
    [    5.896966]  #3:  (prepare_lock){+.+...}, at: [<c05ce9c8>] clk_prepare_lock+0x48/0xe0
    [    5.897042] Modules linked in: wlcore_sdio(+) ehci_omap(+) dwc3_omap snd_soc_ts3a225e leds_is31fl319x bq27xxx_battery_i2c tsc2007 bq27xxx_battery bq2429x_charger ina2xx tca8418_keypad as5013 leds_tca6507 twl6040_vibra gpio_twl6040 bmp085_i2c(+) palmas_gpadc usb3503 palmas_pwrbutton bmg160_i2c(+) bmp085 bma150(+) bmg160_core bmp280 input_polldev snd_soc_omap_mcbsp snd_soc_omap_mcpdm snd_soc_omap snd_pcm_dmaengine
    [    5.897048] Preemption disabled at:[<  (null)>]   (null)
    [    5.897051]
    [    5.897059] CPU: 0 PID: 994 Comm: udevd Not tainted 4.6.0-rc5-letux+ #233
    [    5.897062] Hardware name: Generic OMAP5 (Flattened Device Tree)
    [    5.897076] [<c010e714>] (unwind_backtrace) from [<c010af34>] (show_stack+0x10/0x14)
    [    5.897087] [<c010af34>] (show_stack) from [<c040aa7c>] (dump_stack+0x88/0xc0)
    [    5.897099] [<c040aa7c>] (dump_stack) from [<c020c558>] (__schedule_bug+0xac/0xd0)
    [    5.897111] [<c020c558>] (__schedule_bug) from [<c06f3d44>] (__schedule+0x88/0x7e4)
    [    5.897120] [<c06f3d44>] (__schedule) from [<c06f46d8>] (schedule+0x9c/0xc0)
    [    5.897129] [<c06f46d8>] (schedule) from [<c06f4904>] (schedule_preempt_disabled+0x14/0x20)
    [    5.897140] [<c06f4904>] (schedule_preempt_disabled) from [<c06f64e4>] (mutex_lock_nested+0x258/0x43c)
    [    5.897150] [<c06f64e4>] (mutex_lock_nested) from [<c05ce9c8>] (clk_prepare_lock+0x48/0xe0)
    [    5.897160] [<c05ce9c8>] (clk_prepare_lock) from [<c05d0e7c>] (clk_prepare+0x10/0x28)
    [    5.897169] [<c05d0e7c>] (clk_prepare) from [<c04c2668>] (omap_tll_enable+0x64/0xd0)
    [    5.897180] [<c04c2668>] (omap_tll_enable) from [<c04c1728>] (usbhs_runtime_resume+0x18/0x17c)
    [    5.897192] [<c04c1728>] (usbhs_runtime_resume) from [<c049d404>] (pm_generic_runtime_resume+0x2c/0x40)
    [    5.897202] [<c049d404>] (pm_generic_runtime_resume) from [<c049f180>] (__rpm_callback+0x38/0x68)
    [    5.897210] [<c049f180>] (__rpm_callback) from [<c049f220>] (rpm_callback+0x70/0x88)
    [    5.897218] [<c049f220>] (rpm_callback) from [<c04a0a00>] (rpm_resume+0x4ec/0x7ec)
    [    5.897227] [<c04a0a00>] (rpm_resume) from [<c04a0f48>] (__pm_runtime_resume+0x4c/0x64)
    [    5.897236] [<c04a0f48>] (__pm_runtime_resume) from [<c04958dc>] (driver_probe_device+0x30/0x70)
    [    5.897246] [<c04958dc>] (driver_probe_device) from [<c04959a4>] (__driver_attach+0x88/0xac)
    [    5.897256] [<c04959a4>] (__driver_attach) from [<c04940f8>] (bus_for_each_dev+0x50/0x84)
    [    5.897267] [<c04940f8>] (bus_for_each_dev) from [<c0494e40>] (bus_add_driver+0xcc/0x1e4)
    [    5.897276] [<c0494e40>] (bus_add_driver) from [<c0496914>] (driver_register+0xac/0xf4)
    [    5.897286] [<c0496914>] (driver_register) from [<c01018e0>] (do_one_initcall+0x100/0x1b8)
    [    5.897296] [<c01018e0>] (do_one_initcall) from [<c01c7a54>] (do_init_module+0x58/0x1c0)
    [    5.897304] [<c01c7a54>] (do_init_module) from [<c01c8a3c>] (SyS_finit_module+0x88/0x90)
    [    5.897313] [<c01c8a3c>] (SyS_finit_module) from [<c0107120>] (ret_fast_syscall+0x0/0x1c)
    [    5.912697] ------------[ cut here ]------------
    [    5.912711] WARNING: CPU: 0 PID: 994 at kernel/sched/core.c:2996 _raw_spin_unlock+0x28/0x58
    [    5.912717] DEBUG_LOCKS_WARN_ON(val > preempt_count())

    Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
    Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
    Signed-off-by: Roger Quadros <rogerq@ti.com>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit acd291378f60343d146b0157b64fbca97182c4ea
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Fri May 13 09:34:12 2016 -0400

    ring-buffer: Prevent overflow of size in ring_buffer_resize()

    commit 59643d1535eb220668692a5359de22545af579f6 upstream.

    If the size passed to ring_buffer_resize() is greater than MAX_LONG - BUF_PAGE_SIZE
    then the DIV_ROUND_UP() will return zero.

    Here's the details:

      # echo 18014398509481980 > /sys/kernel/debug/tracing/buffer_size_kb

    tracing_entries_write() processes this and converts kb to bytes.

     18014398509481980 << 10 = 18446744073709547520

    and this is passed to ring_buffer_resize() as unsigned long size.

     size = DIV_ROUND_UP(size, BUF_PAGE_SIZE);

    Where DIV_ROUND_UP(a, b) is (a + b - 1)/b

    BUF_PAGE_SIZE is 4080 and here

     18446744073709547520 + 4080 - 1 = 18446744073709551599

    where 18446744073709551599 is still smaller than 2^64

     2^64 - 18446744073709551599 = 17

    But now 18446744073709551599 / 4080 = 4521260802379792

    and size = size * 4080 = 18446744073709551360

    This is checked to make sure its still greater than 2 * 4080,
    which it is.

    Then we convert to the number of buffer pages needed.

     nr_page = DIV_ROUND_UP(size, BUF_PAGE_SIZE)

    but this time size is 18446744073709551360 and

     2^64 - (18446744073709551360 + 4080 - 1) = -3823

    Thus it overflows and the resulting number is less than 4080, which makes

      3823 / 4080 = 0

    an nr_pages is set to this. As we already checked against the minimum that
    nr_pages may be, this causes the logic to fail as well, and we crash the
    kernel.

    There's no reason to have the two DIV_ROUND_UP() (that's just result of
    historical code changes), clean up the code and fix this bug.

    Cc: stable@vger.kernel.org # 3.5+
    Fixes: 83f40318dab00 ("ring-buffer: Make removal of ring buffer pages atomic")
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 1b5493498239d8c7087b6c337285b94eb22e98e4
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Thu May 12 11:01:24 2016 -0400

    ring-buffer: Use long for nr_pages to avoid overflow failures

    commit 9b94a8fba501f38368aef6ac1b30e7335252a220 upstream.

    The size variable to change the ring buffer in ftrace is a long. The
    nr_pages used to update the ring buffer based on the size is int. On 64 bit
    machines this can cause an overflow problem.

    For example, the following will cause the ring buffer to crash:

     # cd /sys/kernel/debug/tracing
     # echo 10 > buffer_size_kb
     # echo 8556384240 > buffer_size_kb

    Then you get the warning of:

     WARNING: CPU: 1 PID: 318 at kernel/trace/ring_buffer.c:1527 rb_update_pages+0x22f/0x260

    Which is:

      RB_WARN_ON(cpu_buffer, nr_removed);

    Note each ring buffer page holds 4080 bytes.

    This is because:

     1) 10 causes the ring buffer to have 3 pages.
        (10kb requires 3 * 4080 pages to hold)

     2) (2^31 / 2^10  + 1) * 4080 = 8556384240
        The value written into buffer_size_kb is shifted by 10 and then passed
        to ring_buffer_resize(). 8556384240 * 2^10 = 8761737461760

     3) The size passed to ring_buffer_resize() is then divided by BUF_PAGE_SIZE
        which is 4080. 8761737461760 / 4080 = 2147484672

     4) nr_pages is subtracted from the current nr_pages (3) and we get:
        2147484669. This value is saved in a signed integer nr_pages_to_update

     5) 2147484669 is greater than 2^31 but smaller than 2^32, a signed int
        turns into the value of -2147482627

     6) As the value is a negative number, in update_pages_handler() it is
        negated and passed to rb_remove_pages() and 2147482627 pages will
        be removed, which is much larger than 3 and it causes the warning
        because not all the pages asked to be removed were removed.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=118001

    Fixes: 7a8e76a3829f1 ("tracing: unified trace buffer")
    Reported-by: Hao Qin <QEver.cn@gmail.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 076765ee6acabf01d19bad64064e920998ca33ba
Author: Stefan Metzmacher <metze@samba.org>
Date:   Tue May 3 10:52:30 2016 +0200

    fs/cifs: correctly to anonymous authentication via NTLMSSP

    commit cfda35d98298131bf38fbad3ce4cd5ecb3cf18db upstream.

    See [MS-NLMP] 3.2.5.1.2 Server Receives an AUTHENTICATE_MESSAGE from the Client:

       ...
       Set NullSession to FALSE
       If (AUTHENTICATE_MESSAGE.UserNameLen == 0 AND
          AUTHENTICATE_MESSAGE.NtChallengeResponse.Length == 0 AND
          (AUTHENTICATE_MESSAGE.LmChallengeResponse == Z(1)
           OR
           AUTHENTICATE_MESSAGE.LmChallengeResponse.Length == 0))
           -- Special case: client requested anonymous authentication
           Set NullSession to TRUE
       ...

    Only server which map unknown users to guest will allow
    access using a non-null NTChallengeResponse.

    For Samba it's the "map to guest = bad user" option.

    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11913

    CC: Stable <stable@vger.kernel.org>
    Signed-off-by: Stefan Metzmacher <metze@samba.org>
    Signed-off-by: Steve French <smfrench@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ee78aa28de7252c93cb35b62517fc71502891b33
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Sun May 8 12:10:14 2016 -0400

    net: fix a kernel infoleak in x25 module

    commit 79e48650320e6fba48369fccf13fd045315b19b8 upstream.

    Stack object "dte_facilities" is allocated in x25_rx_call_request(),
    which is supposed to be initialized in x25_negotiate_facilities.
    However, 5 fields (8 bytes in total) are not initialized. This
    object is then copied to userland via copy_to_user, thus infoleak
    occurs.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 2b3e8cb14e7524f2883326a2221c6728ec5ef96e
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date:   Wed May 4 16:18:45 2016 +0200

    net: bridge: fix old ioctl unlocked net device walk

    commit 31ca0458a61a502adb7ed192bf9716c6d05791a5 upstream.

    get_bridge_ifindices() is used from the old "deviceless" bridge ioctl
    calls which aren't called with rtnl held. The comment above says that it is
    called with rtnl but that is not really the case.
    Here's a sample output from a test ASSERT_RTNL() which I put in
    get_bridge_ifindices and executed "brctl show":
    [  957.422726] RTNL: assertion failed at net/bridge//br_ioctl.c (30)
    [  957.422925] CPU: 0 PID: 1862 Comm: brctl Tainted: G        W  O
    4.6.0-rc4+ #157
    [  957.423009] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
    BIOS 1.8.1-20150318_183358- 04/01/2014
    [  957.423009]  0000000000000000 ffff880058adfdf0 ffffffff8138dec5
    0000000000000400
    [  957.423009]  ffffffff81ce8380 ffff880058adfe58 ffffffffa05ead32
    0000000000000001
    [  957.423009]  00007ffec1a444b0 0000000000000400 ffff880053c19130
    0000000000008940
    [  957.423009] Call Trace:
    [  957.423009]  [<ffffffff8138dec5>] dump_stack+0x85/0xc0
    [  957.423009]  [<ffffffffa05ead32>]
    br_ioctl_deviceless_stub+0x212/0x2e0 [bridge]
    [  957.423009]  [<ffffffff81515beb>] sock_ioctl+0x22b/0x290
    [  957.423009]  [<ffffffff8126ba75>] do_vfs_ioctl+0x95/0x700
    [  957.423009]  [<ffffffff8126c159>] SyS_ioctl+0x79/0x90
    [  957.423009]  [<ffffffff8163a4c0>] entry_SYSCALL_64_fastpath+0x23/0xc1

    Since it only reads bridge ifindices, we can use rcu to safely walk the net
    device list. Also remove the wrong rtnl comment above.

    Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ced4eef10a732bd33ee9289771fada4a07bf508d
Author: Ian Campbell <ian.campbell@docker.com>
Date:   Wed May 4 14:21:53 2016 +0100

    VSOCK: do not disconnect socket when peer has shutdown SEND only

    commit dedc58e067d8c379a15a8a183c5db318201295bb upstream.

    The peer may be expecting a reply having sent a request and then done a
    shutdown(SHUT_WR), so tearing down the whole socket at this point seems
    wrong and breaks for me with a client which does a SHUT_WR.

    Looking at other socket family's stream_recvmsg callbacks doing a shutdown
    here does not seem to be the norm and removing it does not seem to have
    had any adverse effects that I can see.

    I'm using Stefan's RFC virtio transport patches, I'm unsure of the impact
    on the vmci transport.

    Signed-off-by: Ian Campbell <ian.campbell@docker.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
    Cc: Andy King <acking@vmware.com>
    Cc: Dmitry Torokhov <dtor@vmware.com>
    Cc: Jorgen Hansen <jhansen@vmware.com>
    Cc: Adit Ranadive <aditr@vmware.com>
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f9d691421747048d814785136d187595483bab4a
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Tue May 3 16:46:24 2016 -0400

    net: fix infoleak in rtnetlink

    commit 5f8e44741f9f216e33736ea4ec65ca9ac03036e6 upstream.

    The stack object �map� has a total size of 32 bytes. Its last 4
    bytes are padding generated by compiler. These padding bytes are
    not initialized and sent out via �nla_put�.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 44efbfab13ad589048ebe2a914c58cdcfc9d84fb
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Tue May 3 16:35:05 2016 -0400

    net: fix infoleak in llc

    commit b8670c09f37bdf2847cc44f36511a53afc6161fd upstream.

    The stack object �info� has a total size of 12 bytes. Its last byte
    is padding which is not initialized and leaked via �put_cmsg�.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 58da198d99004f57a8f782869f0618d6d8049970
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Wed Apr 20 23:23:08 2016 +0100

    atl2: Disable unimplemented scatter/gather feature

    commit f43bfaeddc79effbf3d0fcb53ca477cca66f3db8 upstream.

    atl2 includes NETIF_F_SG in hw_features even though it has no support
    for non-linear skbs.  This bug was originally harmless since the
    driver does not claim to implement checksum offload and that used to
    be a requirement for SG.

    Now that SG and checksum offload are independent features, if you
    explicitly enable SG *and* use one of the rare protocols that can use
    SG without checkusm offload, this potentially leaks sensitive
    information (before you notice that it just isn't working).  Therefore
    this obscure bug has been designated CVE-2016-2117.

    Reported-by: Justin Yackoski <jyackoski@crypto-nite.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Fixes: ec5f06156423 ("net: Kill link between CSUM and SG features.")
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 13b89711a2ddc389efb2a220e2f34ab8ff47021b
Author: Mathias Krause <minipli@googlemail.com>
Date:   Sun Apr 10 12:52:28 2016 +0200

    packet: fix heap info leak in PACKET_DIAG_MCLIST sock_diag interface

    commit 309cf37fe2a781279b7675d4bb7173198e532867 upstream.

    Because we miss to wipe the remainder of i->addr[] in packet_mc_add(),
    pdiag_put_mclist() leaks uninitialized heap bytes via the
    PACKET_DIAG_MCLIST netlink attribute.

    Fix this by explicitly memset(0)ing the remaining bytes in i->addr[].

    Fixes: eea68e2f1a00 ("packet: Report socket mclist info via diag module")
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Cc: Pavel Emelyanov <xemul@parallels.com>
    Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 3b848d3d6116d5db4a135e94d62f430058c09670
Author: Chris Friesen <chris.friesen@windriver.com>
Date:   Fri Apr 8 15:21:30 2016 -0600

    route: do not cache fib route info on local routes with oif

    commit d6d5e999e5df67f8ec20b6be45e2229455ee3699 upstream.

    For local routes that require a particular output interface we do not want
    to cache the result.  Caching the result causes incorrect behaviour when
    there are multiple source addresses on the interface.  The end result
    being that if the intended recipient is waiting on that interface for the
    packet he won't receive it because it will be delivered on the loopback
    interface and the IP_PKTINFO ipi_ifindex will be set to the loopback
    interface as well.

    This can be tested by running a program such as "dhcp_release" which
    attempts to inject a packet on a particular interface so that it is
    received by another program on the same board.  The receiving process
    should see an IP_PKTINFO ipi_ifndex value of the source interface
    (e.g., eth1) instead of the loopback interface (e.g., lo).  The packet
    will still appear on the loopback interface in tcpdump but the important
    aspect is that the CMSG info is correct.

    Sample dhcp_release command line:

       dhcp_release eth1 192.168.204.222 02:11:33:22:44:66

    Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
    Signed off-by: Chris Friesen <chris.friesen@windriver.com>
    Reviewed-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 49fabfb2ba27a6fd9322b7b89ba147d57dc18ca0
Author: David S. Miller <davem@davemloft.net>
Date:   Sun Apr 10 23:01:30 2016 -0400

    decnet: Do not build routes to devices without decnet private data.

    commit a36a0d4008488fa545c74445d69eaf56377d5d4e upstream.

    In particular, make sure we check for decnet private presence
    for loopback devices.

    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d248f68a930661cf0ba06faa7867d1ab77a9abe3
Author: Tony Lindgren <tony@atomide.com>
Date:   Thu May 28 07:22:08 2015 -0700

    ARM: OMAP3: Fix booting with thumb2 kernel

    commit d8a50941c91a68da202aaa96a3dacd471ea9c693 upstream.

    We get a NULL pointer dereference on omap3 for thumb2 compiled kernels:

    Internal error: Oops: 80000005 [#1] SMP THUMB2
    ...
    [<c046497b>] (_raw_spin_unlock_irqrestore) from [<c0024375>]
    (omap3_enter_idle_bm+0xc5/0x178)
    [<c0024375>] (omap3_enter_idle_bm) from [<c0374e63>]
    (cpuidle_enter_state+0x77/0x27c)
    [<c0374e63>] (cpuidle_enter_state) from [<c00627f1>]
    (cpu_startup_entry+0x155/0x23c)
    [<c00627f1>] (cpu_startup_entry) from [<c06b9a47>]
    (start_kernel+0x32f/0x338)
    [<c06b9a47>] (start_kernel) from [<8000807f>] (0x8000807f)

    The power management related assembly on omaps needs to interact with
    ARM mode bootrom code, so we need to keep most of the related assembly
    in ARM mode.

    Turns out this error is because of missing ENDPROC for assembly code
    as suggested by Stephen Boyd <sboyd@codeaurora.org>. Let's fix the
    problem by adding ENDPROC in two places to sleep34xx.S.

    Let's also remove the now duplicate custom code for mode switching.
    This has been unnecessary since commit 6ebbf2ce437b ("ARM: convert
    all "mov.* pc, reg" to "bx reg" for ARMv6+").

    And let's also remove the comments about local variables, they are
    now just confusing after the ENDPROC.

    The reason why ENDPROC makes a difference is it sets .type and then
    the compiler knows what to do with the thumb bit as explained at:

    https://wiki.ubuntu.com/ARM/Thumb2PortingHowto

    Reported-by: Kevin Hilman <khilman@kernel.org>
    Tested-by: Kevin Hilman <khilman@linaro.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 3f557d256fac2c83ae330c21524ebabb4657a392
Author: Andi Kleen <ak@linux.intel.com>
Date:   Sat Feb 8 08:52:00 2014 +0100

    asmlinkage, pnp: Make variables used from assembler code visible

    commit a99aa42d0253f033cbb85096d3f2bd82201321e6 upstream.

    Mark variables referenced from assembler files visible.

    This fixes compile problems with LTO.

    Cc: Jaroslav Kysela <perex@perex.cz>
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Link: http://lkml.kernel.org/r/1391845930-28580-4-git-send-email-ak@linux.intel.com
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 6985c64f126ff488cbe399e81fb23ee0477bf154
Author: Marek Szyprowski <m.szyprowski@samsung.com>
Date:   Mon May 9 09:31:47 2016 -0700

    Input: max8997-haptic - fix NULL pointer dereference

    commit 6ae645d5fa385f3787bf1723639cd907fe5865e7 upstream.

    NULL pointer derefence happens when booting with DTB because the
    platform data for haptic device is not set in supplied data from parent
    MFD device.

    The MFD device creates only platform data (from Device Tree) for itself,
    not for haptic child.

    Unable to handle kernel NULL pointer dereference at virtual address 0000009c
    pgd = c0004000
    	[0000009c] *pgd=00000000
    	Internal error: Oops: 5 [#1] PREEMPT SMP ARM
    	(max8997_haptic_probe) from [<c03f9cec>] (platform_drv_probe+0x4c/0xb0)
    	(platform_drv_probe) from [<c03f8440>] (driver_probe_device+0x214/0x2c0)
    	(driver_probe_device) from [<c03f8598>] (__driver_attach+0xac/0xb0)
    	(__driver_attach) from [<c03f67ac>] (bus_for_each_dev+0x68/0x9c)
    	(bus_for_each_dev) from [<c03f7a38>] (bus_add_driver+0x1a0/0x218)
    	(bus_add_driver) from [<c03f8db0>] (driver_register+0x78/0xf8)
    	(driver_register) from [<c0101774>] (do_one_initcall+0x90/0x1d8)
    	(do_one_initcall) from [<c0a00dbc>] (kernel_init_freeable+0x15c/0x1fc)
    	(kernel_init_freeable) from [<c06bb5b4>] (kernel_init+0x8/0x114)
    	(kernel_init) from [<c0107938>] (ret_from_fork+0x14/0x3c)

    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Cc: <stable@vger.kernel.org>
    Fixes: 104594b01ce7 ("Input: add driver support for MAX8997-haptic")
    [k.kozlowski: Write commit message, add CC-stable]
    Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8613b37684fbca1f642b6e636b0dd8923fa0bfd9
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Thu May 5 16:25:35 2016 -0400

    get_rock_ridge_filename(): handle malformed NM entries

    commit 99d825822eade8d827a1817357cbf3f889a552d6 upstream.

    Payloads of NM entries are not supposed to contain NUL.  When we run
    into such, only the part prior to the first NUL goes into the
    concatenation (i.e. the directory entry name being encoded by a bunch
    of NM entries).  We do stop when the amount collected so far + the
    claimed amount in the current NM entry exceed 254.  So far, so good,
    but what we return as the total length is the sum of *claimed*
    sizes, not the actual amount collected.  And that can grow pretty
    large - not unlimited, since you'd need to put CE entries in
    between to be able to get more than the maximum that could be
    contained in one isofs directory entry / continuation chunk and
    we are stop once we'd encountered 32 CEs, but you can get about 8Kb
    easily.  And that's what will be passed to readdir callback as the
    name length.  8Kb __copy_to_user() from a buffer allocated by
    __get_free_page()

    Cc: stable@vger.kernel.org # 0.98pl6+ (yes, really)
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f220ec58d1e4f49cb6c761a859241c057844cdf2
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Wed May 4 17:52:56 2016 +0800

    crypto: hash - Fix page length clamping in hash walk

    commit 13f4bb78cf6a312bbdec367ba3da044b09bf0e29 upstream.

    The crypto hash walk code is broken when supplied with an offset
    greater than or equal to PAGE_SIZE.  This patch fixes it by adjusting
    walk->pg and walk->offset when this happens.

    Cc: <stable@vger.kernel.org>
    Reported-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 73dd3ac10bf81213a89538654aa005be6432e52d
Author: Anton Blanchard <anton@samba.org>
Date:   Fri Apr 15 12:06:13 2016 +1000

    powerpc: scan_features() updates incorrect bits for REAL_LE

    commit 6997e57d693b07289694239e52a10d2f02c3a46f upstream.

    The REAL_LE feature entry in the ibm_pa_feature struct is missing an MMU
    feature value, meaning all the remaining elements initialise the wrong
    values.

    This means instead of checking for byte 5, bit 0, we check for byte 0,
    bit 0, and then we incorrectly set the CPU feature bit as well as MMU
    feature bit 1 and CPU user feature bits 0 and 2 (5).

    Checking byte 0 bit 0 (IBM numbering), means we're looking at the
    "Memory Management Unit (MMU)" feature - ie. does the CPU have an MMU.
    In practice that bit is set on all platforms which have the property.

    This means we set CPU_FTR_REAL_LE always. In practice that seems not to
    matter because all the modern cpus which have this property also
    implement REAL_LE, and we've never needed to disable it.

    We're also incorrectly setting MMU feature bit 1, which is:

      #define MMU_FTR_TYPE_8xx		0x00000002

    Luckily the only place that looks for MMU_FTR_TYPE_8xx is in Book3E
    code, which can't run on the same cpus as scan_features(). So this also
    doesn't matter in practice.

    Finally in the CPU user feature mask, we're setting bits 0 and 2. Bit 2
    is not currently used, and bit 0 is:

      #define PPC_FEATURE_PPC_LE		0x00000001

    Which says the CPU supports the old style "PPC Little Endian" mode.
    Again this should be harmless in practice as no 64-bit CPUs implement
    that mode.

    Fix the code by adding the missing initialisation of the MMU feature.

    Also add a comment marking CPU user feature bit 2 (0x4) as reserved. It
    would be unsafe to start using it as old kernels incorrectly set it.

    Fixes: 44ae3ab3358e ("powerpc: Free up some CPU feature bits by moving out MMU-related features")
    Signed-off-by: Anton Blanchard <anton@samba.org>
    [mpe: Flesh out changelog, add comment reserving 0x4]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d7b49e545800e7ccf5b566d22d9f6572eaa0fbb3
Author: Andrey Gelman <andrey.gelman@compulab.co.il>
Date:   Tue Oct 6 15:43:43 2015 -0700

    Input: ads7846 - correct the value got from SPI

    commit 879f2fea8a5a748bcbf98d2cdce9139c045505d3 upstream.

    According to the touch controller spec, SPI return a 16 bit value, only 12
    bits are valid, they are bit[14-3].

    The value of MISO and MOSI can be configured when SPI is in idle mode.
    Currently this touch driver assumes the SPI bus sets the MOSI and MISO in
    low level when SPI bus is in idle mode. So the bit[15] of the value got
    from SPI bus is always 0. But when SPI bus congfigures the MOSI and MISO in
    high level during the SPI idle mode, the bit[15] of the value get from SPI
    is always 1. If bit[15] is not masked, we may get the wrong value.

    Mask the invalid bit to make sure the correct value gets returned.
    Regardless of the SPI bus idle configuration.

    Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
    Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
    Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5e1a1e7fca96f0cd8129bac3dd605cc7cd86fd50
Author: Jasem Mutlaq <mutlaqja@ikarustech.com>
Date:   Tue Apr 19 10:38:27 2016 +0300

    USB: serial: cp210x: add Straizona Focusers device ids

    commit 613ac23a46e10d4d4339febdd534fafadd68e059 upstream.

    Adding VID:PID for Straizona Focusers to cp210x driver.

    Signed-off-by: Jasem Mutlaq <mutlaqja@ikarustech.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 15e27ea97ae7d9833e55e5937a4ecfa4a5dbf81f
Author: Mike Manning <michael@bsch.com.au>
Date:   Mon Apr 18 12:13:23 2016 +0000

    USB: serial: cp210x: add ID for Link ECU

    commit 1d377f4d690637a0121eac8701f84a0aa1e69a69 upstream.

    The Link ECU is an aftermarket ECU computer for vehicles that provides
    full tuning abilities as well as datalogging and displaying capabilities
    via the USB to Serial adapter built into the device.

    Signed-off-by: Mike Manning <michael@bsch.com.au>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 505a7a684b7071972c565488f6d1f9b8835c0dbd
Author: Prarit Bhargava <prarit@redhat.com>
Date:   Wed May 4 13:48:56 2016 +0800

    ACPICA: Dispatcher: Update thread ID for recursive method calls

    commit 93d68841a23a5779cef6fb9aa0ef32e7c5bd00da upstream.

    ACPICA commit 7a3bd2d962f221809f25ddb826c9e551b916eb25

    Set the mutex owner thread ID.
    Original patch from: Prarit Bhargava <prarit@redhat.com>

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=115121
    Link: https://github.com/acpica/acpica/commit/7a3bd2d9
    Signed-off-by: Prarit Bhargava <prarit@redhat.com>
    Tested-by: Andy Lutomirski <luto@kernel.org> # On a Dell XPS 13 9350
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Cc: All applicable <stable@vger.kernel.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit cd275e9ade6b4954c7954f0c4e7ab2a1f4c3522c
Author: Matt Fleming <matt@codeblueprint.co.uk>
Date:   Tue May 3 20:29:39 2016 +0100

    MAINTAINERS: Remove asterisk from EFI directory names

    commit e8dfe6d8f6762d515fcd4f30577f7bfcf7659887 upstream.

    Mark reported that having asterisks on the end of directory names
    confuses get_maintainer.pl when it encounters subdirectories, and that
    my name does not appear when run on drivers/firmware/efi/libstub.

    Reported-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
    Cc: <stable@vger.kernel.org>
    Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1462303781-8686-2-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e712c5d602274d15e8e23da16ba9a9acfc8fc181
Author: Linus Lüssing <linus.luessing@c0d3.blue>
Date:   Fri Mar 11 14:04:49 2016 +0100

    batman-adv: Fix broadcast/ogm queue limit on a removed interface

    commit c4fdb6cff2aa0ae740c5f19b6f745cbbe786d42f upstream.

    When removing a single interface while a broadcast or ogm packet is
    still pending then we will free the forward packet without releasing the
    queue slots again.

    This patch is supposed to fix this issue.

    Fixes: 6d5808d4ae1b ("batman-adv: Add missing hardif_free_ref in forw_packet_free")
    Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
    [sven@narfation.org: fix conflicts with current version]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Antonio Quartulli <a@unstable.cc>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5210e2409a2350a9cdf1871bddc1b3e94879f017
Author: Mathias Krause <minipli@googlemail.com>
Date:   Thu May 5 16:22:26 2016 -0700

    proc: prevent accessing /proc/<PID>/environ until it's ready

    commit 8148a73c9901a8794a50f950083c00ccf97d43b3 upstream.

    If /proc/<PID>/environ gets read before the envp[] array is fully set up
    in create_{aout,elf,elf_fdpic,flat}_tables(), we might end up trying to
    read more bytes than are actually written, as env_start will already be
    set but env_end will still be zero, making the range calculation
    underflow, allowing to read beyond the end of what has been written.

    Fix this as it is done for /proc/<PID>/cmdline by testing env_end for
    zero.  It is, apparently, intentionally set last in create_*_tables().

    This bug was found by the PaX size_overflow plugin that detected the
    arithmetic underflow of 'this_len = env_end - (env_start + src)' when
    env_end is still zero.

    The expected consequence is that userland trying to access
    /proc/<PID>/environ of a not yet fully set up process may get
    inconsistent data as we're in the middle of copying in the environment
    variables.

    Fixes: https://forums.grsecurity.net/viewtopic.php?f=3&t=4363
    Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=116461
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Cc: Emese Revfy <re.emese@gmail.com>
    Cc: Pax Team <pageexec@freemail.hu>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Mateusz Guzik <mguzik@redhat.com>
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Cc: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: Jarod Wilson <jarod@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 7b640feea9d2e050c381d878db14748cb9005635
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date:   Wed Apr 20 13:34:31 2016 +0000

    ARM: SoCFPGA: Fix secondary CPU startup in thumb2 kernel

    commit 5616f36713ea77f57ae908bf2fef641364403c9f upstream.

    The secondary CPU starts up in ARM mode. When the kernel is compiled in
    thumb2 mode we have to explicitly compile the secondary startup
    trampoline in ARM mode, otherwise the CPU will go to Nirvana.

    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
    Reported-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
    Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
    Signed-off-by: Kevin Hilman <khilman@baylibre.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 834f5956da4a7cd908821ffe585fab49a00acaed
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Mar 14 15:29:44 2016 +0100

    lpfc: fix misleading indentation

    commit aeb6641f8ebdd61939f462a8255b316f9bfab707 upstream.

    gcc-6 complains about the indentation of the lpfc_destroy_vport_work_array()
    call in lpfc_online(), which clearly doesn't look right:

    drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_online':
    drivers/scsi/lpfc/lpfc_init.c:2880:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
       lpfc_destroy_vport_work_array(phba, vports);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/scsi/lpfc/lpfc_init.c:2863:2: note: ...this 'if' clause, but it is not
      if (vports != NULL)
      ^~

    Looking at the patch that introduced this code, it's clear that the
    behavior is correct and the indentation is wrong.

    This fixes the indentation and adds curly braces around the previous
    if() block for clarity, as that is most likely what caused the code
    to be misindented in the first place.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Fixes: 549e55cd2a1b ("[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list")
    Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
    Reviewed-by: Hannes Reinecke <hare@suse.com>
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d3605b9c39cffb3cd67176083dc014696c29198c
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Wed Feb 24 09:39:11 2016 +0100

    clk: versatile: sp810: support reentrance

    commit ec7957a6aa0aaf981fb8356dc47a2cdd01cde03c upstream.

    Despite care take to allocate clocks state containers the
    SP810 driver actually just supports creating one instance:
    all clocks registered for every instance will end up with the
    exact same name and __clk_init() will fail.

    Rename the timclken<0> .. timclken<n> to sp810_<instance>_<n>
    so every clock on every instance gets a unique name.

    This is necessary for the RealView PBA8 which has two SP810
    blocks: the second block will not register its clocks unless
    every clock on every instance is unique and results in boot
    logs like this:

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 0 at ../drivers/clk/versatile/clk-sp810.c:137
      clk_sp810_of_setup+0x110/0x154()
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted
    4.5.0-rc2-00030-g352718fc39f6-dirty #225
    Hardware name: ARM RealView Machine (Device Tree Support)
    [<c00167f8>] (unwind_backtrace) from [<c0013204>]
                 (show_stack+0x10/0x14)
    [<c0013204>] (show_stack) from [<c01a049c>]
                 (dump_stack+0x84/0x9c)
    [<c01a049c>] (dump_stack) from [<c0024990>]
                 (warn_slowpath_common+0x74/0xb0)
    [<c0024990>] (warn_slowpath_common) from [<c0024a68>]
                 (warn_slowpath_null+0x1c/0x24)
    [<c0024a68>] (warn_slowpath_null) from [<c051eb44>]
                 (clk_sp810_of_setup+0x110/0x154)
    [<c051eb44>] (clk_sp810_of_setup) from [<c051e3a4>]
                 (of_clk_init+0x12c/0x1c8)
    [<c051e3a4>] (of_clk_init) from [<c0504714>]
                 (time_init+0x20/0x2c)
    [<c0504714>] (time_init) from [<c0501b18>]
                 (start_kernel+0x244/0x3c4)
    [<c0501b18>] (start_kernel) from [<7000807c>] (0x7000807c)
    ---[ end trace cb88537fdc8fa200 ]---

    Cc: Michael Turquette <mturquette@baylibre.com>
    Cc: Pawel Moll <pawel.moll@arm.com>
    Fixes: 6e973d2c4385 "clk: vexpress: Add separate SP810 driver"
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f95bba828ffd675687395eef4e46894a6fd01594
Author: Dan Streetman <dan.streetman@canonical.com>
Date:   Thu Jan 14 13:42:32 2016 -0500

    nbd: ratelimit error msgs after socket close

    commit da6ccaaa79caca4f38b540b651238f87215217a2 upstream.

    Make the "Attempted send on closed socket" error messages generated in
    nbd_request_handler() ratelimited.

    When the nbd socket is shutdown, the nbd_request_handler() function emits
    an error message for every request remaining in its queue.  If the queue
    is large, this will spam a large amount of messages to the log.  There's
    no need for a separate error message for each request, so this patch
    ratelimits it.

    In the specific case this was found, the system was virtual and the error
    messages were logged to the serial port, which overwhelmed it.

    Fixes: 4d48a542b427 ("nbd: fix I/O hang on disconnected nbds")
    Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
    Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 049c18dabc8fa79b5b55cf78d615a93f2ccd97f0
Author: Marco Angaroni <marcoangaroni@gmail.com>
Date:   Sat Mar 5 12:10:02 2016 +0100

    ipvs: correct initial offset of Call-ID header search in SIP persistence engine

    commit 7617a24f83b5d67f4dab1844956be1cebc44aec8 upstream.

    The IPVS SIP persistence engine is not able to parse the SIP header
    "Call-ID" when such header is inserted in the first positions of
    the SIP message.

    When IPVS is configured with "--pe sip" option, like for example:
    ipvsadm -A -u 1.2.3.4:5060 -s rr --pe sip -p 120 -o
    some particular messages (see below for details) do not create entries
    in the connection template table, which can be listed with:
    ipvsadm -Lcn --persistent-conn

    Problematic SIP messages are SIP responses having "Call-ID" header
    positioned just after message first line:
    SIP/2.0 200 OK
    [Call-ID header here]
    [rest of the headers]

    When "Call-ID" header is positioned down (after a few other headers)
    it is correctly recognized.

    This is due to the data offset used in get_callid function call inside
    ip_vs_pe_sip.c file: since dptr already points to the start of the
    SIP message, the value of dataoff should be initially 0.
    Otherwise the header is searched starting from some bytes after the
    first character of the SIP message.

    Fixes: 758ff0338722 ("IPVS: sip persistence engine")
    Signed-off-by: Marco Angaroni <marcoangaroni@gmail.com>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5d814ad8d35e5e23e0c27fb0f0b80c1044ecefad
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Thu Mar 31 09:38:51 2016 +0200

    compiler-gcc: disable -ftracer for __noclone functions

    commit 95272c29378ee7dc15f43fa2758cb28a5913a06d upstream.

    -ftracer can duplicate asm blocks causing compilation to fail in
    noclone functions.  For example, KVM declares a global variable
    in an asm like

        asm("2: ... \n
             .pushsection data \n
             .global vmx_return \n
             vmx_return: .long 2b");

    and -ftracer causes a double declaration.

    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Michal Marek <mmarek@suse.cz>
    Cc: stable@vger.kernel.org
    Cc: kvm@vger.kernel.org
    Reported-by: Linda Walsh <lkml@tlinx.org>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 26898db604e006918cead820ee8f897e09f37ca9
Author: Pali Rohár <pali.rohar@gmail.com>
Date:   Fri Feb 19 10:35:39 2016 -0800

    ARM: OMAP3: Add cpuidle parameters table for omap3430

    commit 98f42221501353067251fbf11e732707dbb68ce3 upstream.

    Based on CPU type choose generic omap3 or omap3430 specific cpuidle
    parameters. Parameters for omap3430 were measured on Nokia N900 device and
    added by commit 5a1b1d3a9efa ("OMAP3: RX-51: Pass cpu idle parameters")
    which were later removed by commit 231900afba52 ("ARM: OMAP3: cpuidle -
    remove rx51 cpuidle parameters table") due to huge code complexity.

    This patch brings cpuidle parameters for omap3430 devices again, but uses
    simple condition based on CPU type.

    Fixes: 231900afba52 ("ARM: OMAP3: cpuidle - remove rx51 cpuidle
    parameters table")
    Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
    Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ab306782a133bc5274a357f7f25488375b04b201
Author: Borislav Petkov <bp@suse.de>
Date:   Mon Mar 7 16:44:44 2016 -0300

    perf stat: Document --detailed option

    commit f594bae08183fb6b57db55387794ece3e1edf6f6 upstream.

    I'm surprised this remained undocumented since at least 2011. And it is
    actually a very useful switch, as Steve and I came to realize recently.

    Add the text from

      2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")

    which added the incrementing aspect to -d.

    Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Davidlohr Bueso <dbueso@suse.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mel Gorman <mgorman@suse.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Fixes: 2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")
    Link: http://lkml.kernel.org/r/1457347294-32546-1-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 70415182b66cc3ca0167d989a7f40d5c437c4c0b
Author: Vitaly Kuznetsov <vkuznets@redhat.com>
Date:   Fri Feb 27 11:25:51 2015 -0800

    Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors

    commit e513229b4c386e6c9f66298c13fde92f73e6e1ac upstream.

    When an SMP Hyper-V guest is running on top of 2012R2 Server and secondary
    cpus are sent offline (with echo 0 > /sys/devices/system/cpu/cpu$cpu/online)
    the system freeze is observed. This happens due to the fact that on newer
    hypervisors (Win8, WS2012R2, ...) vmbus channel handlers are distributed
    across all cpus (see init_vp_index() function in drivers/hv/channel_mgmt.c)
    and on cpu offlining nobody reassigns them to CPU0. Prevent cpu offlining
    when vmbus is loaded until the issue is fixed host-side.

    This patch also disables hibernation but it is OK as it is also broken (MCE
    error is hit on resume). Suspend still works.

    Tested with WS2008R2 and WS2012R2.

    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
    [ 3chas3@gmail.com: rebase to 3.14-stable ]
    Signed-off-by: Chas Williams <3chas3@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit df1da5a5477cc4fb1e8fa330851b0ad78255bfd4
Author: Vasily Kulikov <segoon@openwall.com>
Date:   Wed Sep 9 15:36:00 2015 -0700

    include/linux/poison.h: fix LIST_POISON{1,2} offset

    commit 8a5e5e02fc83aaf67053ab53b359af08c6c49aaf upstream.

    Poison pointer values should be small enough to find a room in
    non-mmap'able/hardly-mmap'able space.  E.g.  on x86 "poison pointer space"
    is located starting from 0x0.  Given unprivileged users cannot mmap
    anything below mmap_min_addr, it should be safe to use poison pointers
    lower than mmap_min_addr.

    The current poison pointer values of LIST_POISON{1,2} might be too big for
    mmap_min_addr values equal or less than 1 MB (common case, e.g.  Ubuntu
    uses only 0x10000).  There is little point to use such a big value given
    the "poison pointer space" below 1 MB is not yet exhausted.  Changing it
    to a smaller value solves the problem for small mmap_min_addr setups.

    The values are suggested by Solar Designer:
    http://www.openwall.com/lists/oss-security/2015/05/02/6

    Signed-off-by: Vasily Kulikov <segoon@openwall.com>
    Cc: Solar Designer <solar@openwall.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 310c45d174f51fd2087aeff2676e01bdbc0e4d34
Author: Michael Hennerich <michael.hennerich@analog.com>
Date:   Mon Feb 22 10:20:24 2016 +0100

    drivers/misc/ad525x_dpot: AD5274 fix RDAC read back errors

    commit f3df53e4d70b5736368a8fe8aa1bb70c1cb1f577 upstream.

    Fix RDAC read back errors caused by a typo. Value must shift by 2.

    Fixes: a4bd394956f2 ("drivers/misc/ad525x_dpot.c: new features")
    Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e35d98315485e10cf3865e0495ec7d1e0d3a3379
Author: Geert Uytterhoeven <geert@linux-m68k.org>
Date:   Tue Mar 1 09:50:01 2016 +0100

    rtc: vr41xx: Wire up alarm_irq_enable

    commit a25f4a95ec3cded34c1250364eba704c5e4fdac4 upstream.

    drivers/rtc/rtc-vr41xx.c:229: warning: �vr41xx_rtc_alarm_irq_enable� defined but not used

    Apparently the conversion to alarm_irq_enable forgot to wire up the
    callback.

    Fixes: 16380c153a69c378 ("RTC: Convert rtc drivers to use the alarm_irq_enable method")
    Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8e806835e276d42158f7e0d1c3405127a24926c2
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Mon Dec 14 14:29:23 2015 +0000

    misc/bmp085: Enable building as a module

    commit 50e6315dba721cbc24ccd6d7b299f1782f210a98 upstream.

    Commit 985087dbcb02 'misc: add support for bmp18x chips to the bmp085
    driver' changed the BMP085 config symbol to a boolean.  I see no
    reason why the shared code cannot be built as a module, so change it
    back to tristate.

    Fixes: 985087dbcb02 ("misc: add support for bmp18x chips to the bmp085 driver")
    Cc: Eric Andersson <eric.andersson@unixphere.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 78d64c695eed7a7266de28f2796b2301bd34d02c
Author: Sushaanth Srirangapathi <sushaanth.s@ti.com>
Date:   Mon Feb 29 18:42:19 2016 +0530

    fbdev: da8xx-fb: fix videomodes of lcd panels

    commit 713fced8d10fa1c759c8fb6bf9aaa681bae68cad upstream.

    Commit 028cd86b794f4a ("video: da8xx-fb: fix the polarities of the
    hsync/vsync pulse") fixes polarities of HSYNC/VSYNC pulse but
    forgot to update known_lcd_panels[] which had sync values
    according to old logic. This breaks LCD at least on DA850 EVM.

    This patch fixes this issue and I have tested this for panel
    "Sharp_LK043T1DG01" using DA850 EVM board.

    Fixes: 028cd86b794f4a ("video: da8xx-fb: fix the polarities of the hsync/vsync pulse")
    Signed-off-by: Sushaanth Srirangapathi <sushaanth.s@ti.com>
    Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 226a8ce3d88baef6a8160edf2d61826e15055d9b
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Mar 15 14:53:29 2016 -0700

    paride: make 'verbose' parameter an 'int' again

    commit dec63a4dec2d6d01346fd5d96062e67c0636852b upstream.

    gcc-6.0 found an ancient bug in the paride driver, which had a
    "module_param(verbose, bool, 0);" since before 2.6.12, but actually uses
    it to accept '0', '1' or '2' as arguments:

      drivers/block/paride/pd.c: In function 'pd_init_dev_parms':
      drivers/block/paride/pd.c:298:29: warning: comparison of constant '1' with boolean expression is always false [-Wbool-compare]
       #define DBMSG(msg) ((verbose>1)?(msg):NULL)

    In 2012, Rusty did a cleanup patch that also changed the type of the
    variable to 'bool', which introduced what is now a gcc warning.

    This changes the type back to 'int' and adapts the module_param() line
    instead, so it should work as documented in case anyone ever cares about
    running the ancient driver with debugging.

    Fixes: 90ab5ee94171 ("module_param: make bool parameters really bool (drivers & misc)")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Rusty Russell <rusty@rustcorp.com.au>
    Cc: Tim Waugh <tim@cyberelk.net>
    Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Cc: Jens Axboe <axboe@fb.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 378175d0ac887f3fb4b8644152f05ccccff7e8d2
Author: Ignat Korchagin <ignat.korchagin@gmail.com>
Date:   Thu Mar 17 18:00:29 2016 +0000

    USB: usbip: fix potential out-of-bounds write

    commit b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb upstream.

    Fix potential out-of-bounds write to urb->transfer_buffer
    usbip handles network communication directly in the kernel. When receiving a
    packet from its peer, usbip code parses headers according to protocol. As
    part of this parsing urb->actual_length is filled. Since the input for
    urb->actual_length comes from the network, it should be treated as untrusted.
    Any entity controlling the network may put any value in the input and the
    preallocated urb->transfer_buffer may not be large enough to hold the data.
    Thus, the malicious entity is able to write arbitrary data to kernel memory.

    Signed-off-by: Ignat Korchagin <ignat.korchagin@gmail.com>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8a872b18df6f08c45ec89d55826ba08cd39756c3
Author: Roman Pen <roman.penyaev@profitbricks.com>
Date:   Tue Apr 26 13:15:35 2016 +0200

    workqueue: fix ghost PENDING flag while doing MQ IO

    commit 346c09f80459a3ad97df1816d6d606169a51001a upstream.

    The bug in a workqueue leads to a stalled IO request in MQ ctx->rq_list
    with the following backtrace:

    [  601.347452] INFO: task kworker/u129:5:1636 blocked for more than 120 seconds.
    [  601.347574]       Tainted: G           O    4.4.5-1-storage+ #6
    [  601.347651] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [  601.348142] kworker/u129:5  D ffff880803077988     0  1636      2 0x00000000
    [  601.348519] Workqueue: ibnbd_server_fileio_wq ibnbd_dev_file_submit_io_worker [ibnbd_server]
    [  601.348999]  ffff880803077988 ffff88080466b900 ffff8808033f9c80 ffff880803078000
    [  601.349662]  ffff880807c95000 7fffffffffffffff ffffffff815b0920 ffff880803077ad0
    [  601.350333]  ffff8808030779a0 ffffffff815b01d5 0000000000000000 ffff880803077a38
    [  601.350965] Call Trace:
    [  601.351203]  [<ffffffff815b0920>] ? bit_wait+0x60/0x60
    [  601.351444]  [<ffffffff815b01d5>] schedule+0x35/0x80
    [  601.351709]  [<ffffffff815b2dd2>] schedule_timeout+0x192/0x230
    [  601.351958]  [<ffffffff812d43f7>] ? blk_flush_plug_list+0xc7/0x220
    [  601.352208]  [<ffffffff810bd737>] ? ktime_get+0x37/0xa0
    [  601.352446]  [<f…
@walter79
Copy link
Collaborator

@janengelmohr
Copy link
Owner Author

Nice!

@walter79
Copy link
Collaborator

walter79 commented Sep 4, 2016

[B]Hotplug settings:[/B]

found here: /kernel/elephone/p8000/drivers/misc/mediatek/mach/mt6735/include/mach/mt_hotplug_strategy_internal.h

[CODE]
#define HPS_TASK_PRIORITY (MAX_RT_PRIO - 3)
#define HPS_TIMER_INTERVAL_MS (100)

#define MAX_CPU_UP_TIMES (10)
#define MAX_CPU_DOWN_TIMES (100)
#define MAX_TLP_TIMES (10)
//cpu capability of big / little = 1.7, aka 170, 170 - 100 = 70
#define CPU_DMIPS_BIG_LITTLE_DIFF (70)

/*

  • CONFIG - runtime
  • Execute time interval : 100 ms
    */
    #define DEF_CPU_UP_THRESHOLD (95)
    #define DEF_CPU_UP_TIMES (2)
    #define DEF_CPU_DOWN_THRESHOLD (85)
    #define DEF_CPU_DOWN_TIMES (8)
    #define DEF_TLP_TIMES (1)

#define EN_CPU_INPUT_BOOST (1)
#define DEF_CPU_INPUT_BOOST_CPU_NUM (2)

#define EN_CPU_RUSH_BOOST (1)
#define DEF_CPU_RUSH_BOOST_THRESHOLD (98)
#define DEF_CPU_RUSH_BOOST_TIMES (1)

#define EN_HPS_LOG (1)
#define EN_ISR_LOG (0)

/*

  • EARLY SYSPEND CONFIG - runtime
  • Execute time interval : 400 ms
    */
    #define DEF_ES_CPU_UP_THRESHOLD (95)
    #define DEF_ES_CPU_UP_TIMES (1)
    #define DEF_ES_CPU_DOWN_THRESHOLD (85)
    #define DEF_ES_CPU_DOWN_TIMES (2)
    [/CODE]

Found this: /kernel/elephone/p8000/drivers/misc/mediatek/mach/mt6735/mt_hotplug_strategy_main.c

[CODE]
//In order to fast screen on, power on extra little CPU to serve system resume.
little_cpu_num_resume = 4;
[/CODE]

@walter79
Copy link
Collaborator

walter79 commented Sep 4, 2016

This works well but need some improvement in cpu governor

little_cpu_num_resume = 1

#define EN_CPU_INPUT_BOOST (0)

#define EN_CPU_RUSH_BOOST (0)

@janengelmohr
Copy link
Owner Author

Closed because it limits hotplugging to a reasonable amount

cyclon1978 pushed a commit to cyclon1978/android_kernel_elephone_p8000 that referenced this issue Jul 14, 2017
commit 90915bdf5d75f981251d78f45dce37d39e679ac1
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu Feb 25 11:58:19 2016 -0800

    Linux 3.10.98

commit dd6f1f0d444d8c9fe4307c1527987e474819d5d7
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Wed Feb 3 16:55:26 2016 +1030

    module: wrapper for symbol name.

    commit 2e7bac536106236104e9e339531ff0fcdb7b8147 upstream.

    This trivial wrapper adds clarity and makes the following patch
    smaller.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 40ea6e6f67636529f3ed27d4e2f7589f3ae869c7
Author: WANG Cong <xiyou.wangcong@gmail.com>
Date:   Tue Mar 31 11:01:47 2015 -0700

    ip6mr: call del_timer_sync() in ip6mr_free_table()

    commit 7ba0c47c34a1ea5bc7a24ca67309996cce0569b5 upstream.

    We need to wait for the flying timers, since we
    are going to free the mrtable right after it.

    Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
    Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Cc: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a895706740ceaac0c7f99ddc48e05c40cb21c361
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Sat Dec 19 20:07:38 2015 +0000

    futex: Drop refcount if requeue_pi() acquired the rtmutex

    commit fb75a4282d0d9a3c7c44d940582c2d226cf3acfb upstream.

    If the proxy lock in the requeue loop acquires the rtmutex for a
    waiter then it acquired also refcount on the pi_state related to the
    futex, but the waiter side does not drop the reference count.

    Add the missing free_pi_state() call.

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Darren Hart <darren@dvhart.com>
    Cc: Davidlohr Bueso <dave@stgolabs.net>
    Cc: Bhuvanesh_Surachari@mentor.com
    Cc: Andy Lowe <Andy_Lowe@mentor.com>
    Link: http://lkml.kernel.org/r/20151219200607.178132067@linutronix.de
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4800af91229e06e9d8517a6961f5b5d304b7e9bf
Author: Andy Lutomirski <luto@kernel.org>
Date:   Fri May 22 16:15:47 2015 -0700

    x86/asm/irq: Stop relying on magic JMP behavior for early_idt_handlers

    commit 425be5679fd292a3c36cb1fe423086708a99f11a upstream.

    The early_idt_handlers asm code generates an array of entry
    points spaced nine bytes apart.  It's not really clear from that
    code or from the places that reference it what's going on, and
    the code only works in the first place because GAS never
    generates two-byte JMP instructions when jumping to global
    labels.

    Clean up the code to generate the correct array stride (member size)
    explicitly. This should be considerably more robust against
    screw-ups, as GAS will warn if a .fill directive has a negative
    count.  Using '. =' to advance would have been even more robust
    (it would generate an actual error if it tried to move
    backwards), but it would pad with nulls, confusing anyone who
    tries to disassemble the code.  The new scheme should be much
    clearer to future readers.

    While we're at it, improve the comments and rename the array and
    common code.

    Binutils may start relaxing jumps to non-weak labels.  If so,
    this change will fix our build, and we may need to backport this
    change.

    Before, on x86_64:

      0000000000000000 <early_idt_handlers>:
         0:   6a 00                   pushq  $0x0
         2:   6a 00                   pushq  $0x0
         4:   e9 00 00 00 00          jmpq   9 <early_idt_handlers+0x9>
                              5: R_X86_64_PC32        early_idt_handler-0x4
      ...
        48:   66 90                   xchg   %ax,%ax
        4a:   6a 08                   pushq  $0x8
        4c:   e9 00 00 00 00          jmpq   51 <early_idt_handlers+0x51>
                              4d: R_X86_64_PC32       early_idt_handler-0x4
      ...
       117:   6a 00                   pushq  $0x0
       119:   6a 1f                   pushq  $0x1f
       11b:   e9 00 00 00 00          jmpq   120 <early_idt_handler>
                              11c: R_X86_64_PC32      early_idt_handler-0x4

    After:

      0000000000000000 <early_idt_handler_array>:
         0:   6a 00                   pushq  $0x0
         2:   6a 00                   pushq  $0x0
         4:   e9 14 01 00 00          jmpq   11d <early_idt_handler_common>
      ...
        48:   6a 08                   pushq  $0x8
        4a:   e9 d1 00 00 00          jmpq   120 <early_idt_handler_common>
        4f:   cc                      int3
        50:   cc                      int3
      ...
       117:   6a 00                   pushq  $0x0
       119:   6a 1f                   pushq  $0x1f
       11b:   eb 03                   jmp    120 <early_idt_handler_common>
       11d:   cc                      int3
       11e:   cc                      int3
       11f:   cc                      int3

    Signed-off-by: Andy Lutomirski <luto@kernel.org>
    Acked-by: H. Peter Anvin <hpa@linux.intel.com>
    Cc: Binutils <binutils@sourceware.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: H.J. Lu <hjl.tools@gmail.com>
    Cc: Jan Beulich <JBeulich@suse.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/ac027962af343b0c599cbfcf50b945ad2ef3d7a8.1432336324.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 08fc7d3fdfef75fdf2d44f848cef1f3e1babb8bf
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Tue Jan 26 12:24:25 2016 +0300

    intel_scu_ipcutil: underflow in scu_reg_access()

    commit b1d353ad3d5835b16724653b33c05124e1b5acf1 upstream.

    "count" is controlled by the user and it can be negative.  Let's prevent
    that by making it unsigned.  You have to have CAP_SYS_RAWIO to call this
    function so the bug is not as serious as it could be.

    Fixes: 5369c02d951a ('intel_scu_ipc: Utility driver for intel scu ipc')
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Darren Hart <dvhart@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c750edf63ce45ff34155723b73828527c1d96353
Author: Konstantin Khlebnikov <koct9i@gmail.com>
Date:   Fri Feb 5 15:37:01 2016 -0800

    radix-tree: fix oops after radix_tree_iter_retry

    commit 732042821cfa106b3c20b9780e4c60fee9d68900 upstream.

    Helper radix_tree_iter_retry() resets next_index to the current index.
    In following radix_tree_next_slot current chunk size becomes zero.  This
    isn't checked and it tries to dereference null pointer in slot.

    Tagged iterator is fine because retry happens only at slot 0 where tag
    bitmask in iter->tags is filled with single bit.

    Fixes: 46437f9a554f ("radix-tree: fix race in gang lookup")
    Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
    Cc: Matthew Wilcox <willy@linux.intel.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Ohad Ben-Cohen <ohad@wizery.com>
    Cc: Jeremiah Mahler <jmmahler@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a202017766a111064dc0a99ee38d85886816b27a
Author: Matthew Wilcox <willy@linux.intel.com>
Date:   Tue Feb 2 16:57:52 2016 -0800

    radix-tree: fix race in gang lookup

    commit 46437f9a554fbe3e110580ca08ab703b59f2f95a upstream.

    If the indirect_ptr bit is set on a slot, that indicates we need to redo
    the lookup.  Introduce a new function radix_tree_iter_retry() which
    forces the loop to retry the lookup by setting 'slot' to NULL and
    turning the iterator back to point at the problematic entry.

    This is a pretty rare problem to hit at the moment; the lookup has to
    race with a grow of the radix tree from a height of 0.  The consequences
    of hitting this race are that gang lookup could return a pointer to a
    radix_tree_node instead of a pointer to whatever the user had inserted
    in the tree.

    Fixes: cebbd29e1c2f ("radix-tree: rewrite gang lookup using iterator")
    Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Ohad Ben-Cohen <ohad@wizery.com>
    Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a28c4bb3990dd3f65279ec02c6fa1762044325da
Author: Martijn Coenen <maco@google.com>
Date:   Fri Jan 15 16:57:49 2016 -0800

    memcg: only free spare array when readers are done

    commit 6611d8d76132f86faa501de9451a89bf23fb2371 upstream.

    A spare array holding mem cgroup threshold events is kept around to make
    sure we can always safely deregister an event and have an array to store
    the new set of events in.

    In the scenario where we're going from 1 to 0 registered events, the
    pointer to the primary array containing 1 event is copied to the spare
    slot, and then the spare slot is freed because no events are left.
    However, it is freed before calling synchronize_rcu(), which means
    readers may still be accessing threshold->primary after it is freed.

    Fixed by only freeing after synchronize_rcu().

    Signed-off-by: Martijn Coenen <maco@google.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d5b8e6bb2595ed5ae550e44939016fb9d022fabf
Author: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date:   Thu Jan 14 15:16:53 2016 -0800

    scripts/bloat-o-meter: fix python3 syntax error

    commit 72214a24a7677d4c7501eecc9517ed681b5f2db2 upstream.

    In Python3+ print is a function so the old syntax is not correct
    anymore:

      $ ./scripts/bloat-o-meter vmlinux.o vmlinux.o.old
        File "./scripts/bloat-o-meter", line 61
          print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \
                                                                         ^
      SyntaxError: invalid syntax

    Fix by calling print as a function.

    Tested on python 2.7.11, 3.5.1

    Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2942425f64895dead4dfe46462e00c9871c2bc12
Author: Laura Abbott <labbott@fedoraproject.org>
Date:   Thu Jan 14 15:16:50 2016 -0800

    dma-debug: switch check from _text to _stext

    commit ea535e418c01837d07b6c94e817540f50bfdadb0 upstream.

    In include/asm-generic/sections.h:

      /*
       * Usage guidelines:
       * _text, _data: architecture specific, don't use them in
       * arch-independent code
       * [_stext, _etext]: contains .text.* sections, may also contain
       * .rodata.*
       *                   and/or .init.* sections

    _text is not guaranteed across architectures.  Architectures such as ARM
    may reuse parts which are not actually text and erroneously trigger a bug.
    Switch to using _stext which is guaranteed to contain text sections.

    Came out of https://lkml.kernel.org/g/<567B1176.4000106@redhat.com>

    Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Cc: Russell King <linux@arm.linux.org.uk>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ac6cef6cfa6230d989e24325ea04280a5b1fc5e7
Author: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date:   Thu Jan 14 15:16:47 2016 -0800

    m32r: fix m32104ut_defconfig build fail

    commit 601f1db653217f205ffa5fb33514b4e1711e56d1 upstream.

    The build of m32104ut_defconfig for m32r arch was failing for long long
    time with the error:

      ERROR: "memory_start" [fs/udf/udf.ko] undefined!
      ERROR: "memory_end" [fs/udf/udf.ko] undefined!
      ERROR: "memory_end" [drivers/scsi/sg.ko] undefined!
      ERROR: "memory_start" [drivers/scsi/sg.ko] undefined!
      ERROR: "memory_end" [drivers/i2c/i2c-dev.ko] undefined!
      ERROR: "memory_start" [drivers/i2c/i2c-dev.ko] undefined!

    As done in other architectures export the symbols to fix the error.

    Reported-by: Fengguang Wu <fengguang.wu@intel.com>
    Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e399e769b8f894dac701dc257be093221330cbd2
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Tue Jan 26 17:50:12 2016 +0200

    xhci: Fix list corruption in urb dequeue at host removal

    commit 5c82171167adb8e4ac77b91a42cd49fb211a81a0 upstream.

    xhci driver frees data for all devices, both usb2 and and usb3 the
    first time usb_remove_hcd() is called, including td_list and and xhci_ring
    structures.

    When usb_remove_hcd() is called a second time for the second xhci bus it
    will try to dequeue all pending urbs, and touches td_list which is already
    freed for that endpoint.

    Reported-by: Joe Lawrence <joe.lawrence@stratus.com>
    Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f8f1013f5c6180cf6f812e6d3f823680a6a77cc7
Author: Andrew Banman <abanman@sgi.com>
Date:   Tue Dec 29 14:54:25 2015 -0800

    mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zone()

    commit 5f0f2887f4de9508dcf438deab28f1de8070c271 upstream.

    test_pages_in_a_zone() does not account for the possibility of missing
    sections in the given pfn range.  pfn_valid_within always returns 1 when
    CONFIG_HOLES_IN_ZONE is not set, allowing invalid pfns from missing
    sections to pass the test, leading to a kernel oops.

    Wrap an additional pfn loop with PAGES_PER_SECTION granularity to check
    for missing sections before proceeding into the zone-check code.

    This also prevents a crash from offlining memory devices with missing
    sections.  Despite this, it may be a good idea to keep the related patch
    '[PATCH 3/3] drivers: memory: prohibit offlining of memory blocks with
    missing sections' because missing sections in a memory block may lead to
    other problems not covered by the scope of this fix.

    Signed-off-by: Andrew Banman <abanman@sgi.com>
    Acked-by: Alex Thorlton <athorlton@sgi.com>
    Cc: Russ Anderson <rja@sgi.com>
    Cc: Alex Thorlton <athorlton@sgi.com>
    Cc: Yinghai Lu <yinghai@kernel.org>
    Cc: Greg KH <greg@kroah.com>
    Cc: Seth Jennings <sjennings@variantweb.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1631f17998c51d57182370b84f582729b94bfdf6
Author: CQ Tang <cq.tang@intel.com>
Date:   Wed Jan 13 21:15:03 2016 +0000

    iommu/vt-d: Fix 64-bit accesses to 32-bit DMAR_GSTS_REG

    commit fda3bec12d0979aae3f02ee645913d66fbc8a26e upstream.

    This is a 32-bit register. Apparently harmless on real hardware, but
    causing justified warnings in simulation.

    Signed-off-by: CQ Tang <cq.tang@intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit af5d9b4be5c19097a8e3bbb28eb15fb1b4e1b188
Author: Aurélien Francillon <aurelien@francillon.net>
Date:   Sat Jan 2 20:39:54 2016 -0800

    Input: i8042 - add Fujitsu Lifebook U745 to the nomux list

    commit dd0d0d4de582a6a61c032332c91f4f4cb2bab569 upstream.

    Without i8042.nomux=1 the Elantech touch pad is not working at all on
    a Fujitsu Lifebook U745. This patch does not seem necessary for all
    U745 (maybe because of different BIOS versions?). However, it was
    verified that the patch does not break those (see opensuse bug 883192:
    https://bugzilla.opensuse.org/show_bug.cgi?id=883192).

    Signed-off-by: Aurélien Francillon <aurelien@francillon.net>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 209bde19c95ace3386a66e521dc518e7fd9b26c9
Author: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date:   Mon Jan 11 17:35:38 2016 -0800

    Input: elantech - mark protocols v2 and v3 as semi-mt

    commit 6544a1df11c48c8413071aac3316792e4678fbfb upstream.

    When using a protocol v2 or v3 hardware, elantech uses the function
    elantech_report_semi_mt_data() to report data. This devices are rather
    creepy because if num_finger is 3, (x2,y2) is (0,0). Yes, only one valid
    touch is reported.

    Anyway, userspace (libinput) is now confused by these (0,0) touches,
    and detect them as palm, and rejects them.

    Commit 3c0213d17a09 ("Input: elantech - fix semi-mt protocol for v3 HW")
    was sufficient enough for xf86-input-synaptics and libinput before it has
    palm rejection. Now we need to actually tell libinput that this device is
    a semi-mt one and it should not rely on the actual values of the 2 touches.

    Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 220e1e03fbf0f1e21860ebae237ec39a40732777
Author: Takashi Iwai <tiwai@suse.de>
Date:   Fri Nov 6 11:26:01 2015 -0800

    Input: elantech - add Fujitsu Lifebook U745 to force crc_enabled

    commit 60603950f836ef4e88daddf61a273b91e671db2d upstream.

    Another Lifebook machine that needs the same quirk as other similar
    models to make the driver working.

    Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=883192
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 523ea6a0029ea766f139d58182e459b64b378f4f
Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Date:   Fri Jan 15 16:54:03 2016 -0800

    mm: soft-offline: check return value in second __get_any_page() call

    commit d96b339f453997f2f08c52da3f41423be48c978f upstream.

    I saw the following BUG_ON triggered in a testcase where a process calls
    madvise(MADV_SOFT_OFFLINE) on thps, along with a background process that
    calls migratepages command repeatedly (doing ping-pong among different
    NUMA nodes) for the first process:

       Soft offlining page 0x60000 at 0x700000600000
       __get_any_page: 0x60000 free buddy page
       page:ffffea0001800000 count:0 mapcount:-127 mapping:          (null) index:0x1
       flags: 0x1fffc0000000000()
       page dumped because: VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0)
       ------------[ cut here ]------------
       kernel BUG at /src/linux-dev/include/linux/mm.h:342!
       invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
       Modules linked in: cfg80211 rfkill crc32c_intel serio_raw virtio_balloon i2c_piix4 virtio_blk virtio_net ata_generic pata_acpi
       CPU: 3 PID: 3035 Comm: test_alloc_gene Tainted: G           O    4.4.0-rc8-v4.4-rc8-160107-1501-00000-rc8+ #74
       Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
       task: ffff88007c63d5c0 ti: ffff88007c210000 task.ti: ffff88007c210000
       RIP: 0010:[<ffffffff8118998c>]  [<ffffffff8118998c>] put_page+0x5c/0x60
       RSP: 0018:ffff88007c213e00  EFLAGS: 00010246
       Call Trace:
         put_hwpoison_page+0x4e/0x80
         soft_offline_page+0x501/0x520
         SyS_madvise+0x6bc/0x6f0
         entry_SYSCALL_64_fastpath+0x12/0x6a
       Code: 8b fc ff ff 5b 5d c3 48 89 df e8 b0 fa ff ff 48 89 df 31 f6 e8 c6 7d ff ff 5b 5d c3 48 c7 c6 08 54 a2 81 48 89 df e8 a4 c5 01 00 <0f> 0b 66 90 66 66 66 66 90 55 48 89 e5 41 55 41 54 53 48 8b 47
       RIP  [<ffffffff8118998c>] put_page+0x5c/0x60
        RSP <ffff88007c213e00>

    The root cause resides in get_any_page() which retries to get a refcount
    of the page to be soft-offlined.  This function calls
    put_hwpoison_page(), expecting that the target page is putback to LRU
    list.  But it can be also freed to buddy.  So the second check need to
    care about such case.

    Fixes: af8fae7c0886 ("mm/memory-failure.c: clean up soft_offline_page()")
    Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Jerome Marchand <jmarchan@redhat.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Steve Capper <steve.capper@linaro.org>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Michal Hocko <mhocko@suse.cz>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: David Rientjes <rientjes@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 020ef19153db7b81f94935ec03adecb4a8ab8964
Author: Roman Gushchin <klamm@yandex-team.ru>
Date:   Mon Oct 12 16:33:44 2015 +0300

    fuse: break infinite loop in fuse_fill_write_pages()

    commit 3ca8138f014a913f98e6ef40e939868e1e9ea876 upstream.

    I got a report about unkillable task eating CPU. Further
    investigation shows, that the problem is in the fuse_fill_write_pages()
    function. If iov's first segment has zero length, we get an infinite
    loop, because we never reach iov_iter_advance() call.

    Fix this by calling iov_iter_advance() before repeating an attempt to
    copy data from userspace.

    A similar problem is described in 124d3b7041f ("fix writev regression:
    pan hanging unkillable and un-straceable"). If zero-length segmend
    is followed by segment with invalid address,
    iov_iter_fault_in_readable() checks only first segment (zero-length),
    iov_iter_copy_from_user_atomic() skips it, fails at second and
    returns zero -> goto again without skipping zero-length segment.

    Patch calls iov_iter_advance() before goto again: we'll skip zero-length
    segment at second iteraction and iov_iter_fault_in_readable() will detect
    invalid address.

    Special thanks to Konstantin Khlebnikov, who helped a lot with the commit
    description.

    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Maxim Patlasov <mpatlasov@parallels.com>
    Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
    Signed-off-by: Roman Gushchin <klamm@yandex-team.ru>
    Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
    Fixes: ea9b9907b82a ("fuse: implement perform_write")
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fa4aa48526e852a550613acffc81cacc5233848e
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Mon Feb 8 09:14:37 2016 +0100

    ARM: 8517/1: ICST: avoid arithmetic overflow in icst_hz()

    commit 5070fb14a0154f075c8b418e5bc58a620ae85a45 upstream.

    When trying to set the ICST 307 clock to 25174000 Hz I ran into
    this arithmetic error: the icst_hz_to_vco() correctly figure out
    DIVIDE=2, RDW=100 and VDW=99 yielding a frequency of
    25174000 Hz out of the VCO. (I replicated the icst_hz() function
    in a spreadsheet to verify this.)

    However, when I called icst_hz() on these VCO settings it would
    instead return 4122709 Hz. This causes an error in the common
    clock driver for ICST as the common clock framework will call
    .round_rate() on the clock which will utilize icst_hz_to_vco()
    followed by icst_hz() suggesting the erroneous frequency, and
    then the clock gets set to this.

    The error did not manifest in the old clock framework since
    this high frequency was only used by the CLCD, which calls
    clk_set_rate() without first calling clk_round_rate() and since
    the old clock framework would not call clk_round_rate() before
    setting the frequency, the correct values propagated into
    the VCO.

    After some experimenting I figured out that it was due to a simple
    arithmetic overflow: the divisor for 24Mhz reference frequency
    as reference becomes 24000000*2*(99+8)=0x132212400 and the "1"
    in bit 32 overflows and is lost.

    But introducing an explicit 64-by-32 bit do_div() and casting
    the divisor into (u64) we get the right frequency back, and the
    right frequency gets set.

    Tested on the ARM Versatile.

    Cc: linux-clk@vger.kernel.org
    Cc: Pawel Moll <pawel.moll@arm.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 57cd1f0a2031e82ac1cc13e56f12b7d979ee5403
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Wed Feb 10 09:25:17 2016 +0100

    ARM: 8519/1: ICST: try other dividends than 1

    commit e972c37459c813190461dabfeaac228e00aae259 upstream.

    Since the dawn of time the ICST code has only supported divide
    by one or hang in an eternal loop. Luckily we were always dividing
    by one because the reference frequency for the systems using
    the ICSTs is 24MHz and the [min,max] values for the PLL input
    if [10,320] MHz for ICST307 and [6,200] for ICST525, so the loop
    will always terminate immediately without assigning any divisor
    for the reference frequency.

    But for the code to make sense, let's insert the missing i++

    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e2889463b33d8b7f4bfe4d7d824dd3d621f2e3ef
Author: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Date:   Thu Dec 24 10:25:33 2015 -0600

    udf: Check output buffer length when converting name to CS0

    commit bb00c898ad1ce40c4bb422a8207ae562e9aea7ae upstream.

    If a name contains at least some characters with Unicode values
    exceeding single byte, the CS0 output should have 2 bytes per character.
    And if other input characters have single byte Unicode values, then
    the single input byte is converted to 2 output bytes, and the length
    of output becomes larger than the length of input. And if the input
    name is long enough, the output length may exceed the allocated buffer
    length.

    All this means that conversion from UTF8 or NLS to CS0 requires
    checking of output length in order to stop when it exceeds the given
    output buffer size.

    [JK: Make code return -ENAMETOOLONG instead of silently truncating the
    name]

    Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f548c900b08de916732524992aaccb83cfe65312
Author: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Date:   Thu Dec 24 10:25:32 2015 -0600

    udf: Prevent buffer overrun with multi-byte characters

    commit ad402b265ecf6fa22d04043b41444cdfcdf4f52d upstream.

    udf_CS0toUTF8 function stops the conversion when the output buffer
    length reaches UDF_NAME_LEN-2, which is correct maximum name length,
    but, when checking, it leaves the space for a single byte only,
    while multi-bytes output characters can take more space, causing
    buffer overflow.

    Similar error exists in udf_CS0toNLS function, that restricts
    the output length to UDF_NAME_LEN, while actual maximum allowed
    length is UDF_NAME_LEN-2.

    In these cases the output can override not only the current buffer
    length field, causing corruption of the name buffer itself, but also
    following allocation structures, causing kernel crash.

    Adjust the output length checks in both functions to prevent buffer
    overruns in case of multi-bytes UTF8 or NLS characters.

    Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6b3a508f58f55ce1271c422d71e07f94f6ce7de5
Author: Vegard Nossum <vegard.nossum@oracle.com>
Date:   Fri Dec 11 15:54:16 2015 +0100

    udf: limit the maximum number of indirect extents in a row

    commit b0918d9f476a8434b055e362b83fa4fd1d462c3f upstream.

    udf_next_aext() just follows extent pointers while extents are marked as
    indirect. This can loop forever for corrupted filesystem. Limit number
    the of indirect extents we are willing to follow in a row.

    [JK: Updated changelog, limit, style]

    Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
    Cc: Jan Kara <jack@suse.com>
    Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 45a74b1ce8a11efc82d49100648f7c5dc753cbb8
Author: Andrew Elble <aweits@rit.edu>
Date:   Wed Dec 2 09:20:57 2015 -0500

    nfs: Fix race in __update_open_stateid()

    commit 361cad3c89070aeb37560860ea8bfc092d545adc upstream.

    We've seen this in a packet capture - I've intermixed what I
    think was going on. The fix here is to grab the so_lock sooner.

    1964379 -> #1 open (for write) reply seqid=1
    1964393 -> #2 open (for read) reply seqid=2

      __nfs4_close(), state->n_wronly--
      nfs4_state_set_mode_locked(), changes state->state = [R]
      state->flags is [RW]
      state->state is [R], state->n_wronly == 0, state->n_rdonly == 1

    1964398 -> #3 open (for write) call -> because close is already running
    1964399 -> downgrade (to read) call seqid=2 (close of #1)
    1964402 -> #3 open (for write) reply seqid=3

     __update_open_stateid()
       nfs_set_open_stateid_locked(), changes state->flags
       state->flags is [RW]
       state->state is [R], state->n_wronly == 0, state->n_rdonly == 1
       new sequence number is exposed now via nfs4_stateid_copy()

       next step would be update_open_stateflags(), pending so_lock

    1964403 -> downgrade reply seqid=2, fails with OLD_STATEID (close of #1)

       nfs4_close_prepare() gets so_lock and recalcs flags -> send close

    1964405 -> downgrade (to read) call seqid=3 (close of #1 retry)

       __update_open_stateid() gets so_lock
     * update_open_stateflags() updates state->n_wronly.
       nfs4_state_set_mode_locked() updates state->state

       state->flags is [RW]
       state->state is [RW], state->n_wronly == 1, state->n_rdonly == 1

     * should have suppressed the preceding nfs4_close_prepare() from
       sending open_downgrade

    1964406 -> write call
    1964408 -> downgrade (to read) reply seqid=4 (close of #1 retry)

       nfs_clear_open_stateid_locked()
       state->flags is [R]
       state->state is [RW], state->n_wronly == 1, state->n_rdonly == 1

    1964409 -> write reply (fails, openmode)

    Signed-off-by: Andrew Elble <aweits@rit.edu>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 65b1cbfcc31b63903265bdb6851bfb32ed71c8db
Author: Anton Protopopov <a.s.protopopov@gmail.com>
Date:   Wed Feb 10 12:50:21 2016 -0500

    cifs: fix erroneous return value

    commit 4b550af519854421dfec9f7732cdddeb057134b2 upstream.

    The setup_ntlmv2_rsp() function may return positive value ENOMEM instead
    of -ENOMEM in case of kmalloc failure.

    Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
    Signed-off-by: Steve French <smfrench@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2388eb1b0645f815b193165b17c0ab0f161ec17e
Author: Yong Li <sdliyong@gmail.com>
Date:   Wed Jan 6 09:09:43 2016 +0800

    iio: dac: mcp4725: set iio name property in sysfs

    commit 97a249e98a72d6b79fb7350a8dd56b147e9d5bdb upstream.

    Without this change, the name entity for mcp4725 is missing in
    /sys/bus/iio/devices/iio\:device*/name

    With this change, name is reported correctly

    Signed-off-by: Yong Li <sdliyong@gmail.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9d080ce6c4f118fa425f072e28c0b75ee715a69c
Author: Lars-Peter Clausen <lars@metafoo.de>
Date:   Fri Nov 27 14:55:56 2015 +0100

    iio: adis_buffer: Fix out-of-bounds memory access

    commit d590faf9e8f8509a0a0aa79c38e87fcc6b913248 upstream.

    The SPI tx and rx buffers are both supposed to be scan_bytes amount of
    bytes large and a common allocation is used to allocate both buffers. This
    puts the beginning of the tx buffer scan_bytes bytes after the rx buffer.
    The initialization of the tx buffer pointer is done adding scan_bytes to
    the beginning of the rx buffer, but since the rx buffer is of type __be16
    this will actually add two times as much and the tx buffer ends up pointing
    after the allocated buffer.

    Fix this by using scan_count, which is scan_bytes / 2, instead of
    scan_bytes when initializing the tx buffer pointer.

    Fixes: aacff892cbd5 ("staging:iio:adis: Preallocate transfer message")
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3effd3faeaa18907ba672f4545d0ba4602a2eb8b
Author: Michael Hennerich <michael.hennerich@analog.com>
Date:   Tue Oct 13 18:15:37 2015 +0200

    iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success

    commit 03fe472ef33b7f31fbd11d300dbb3fdab9c00fd4 upstream.

    i2c_master_send() returns the number of bytes transferred on success while
    the ad5064 driver expects that the write() callback returns 0 on success.
    Fix that by translating any non negative return value of i2c_master_send()
    to 0.

    Fixes: commit 6a17a0768f77 ("iio:dac:ad5064: Add support for the ad5629r and ad5669r")
    Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit aac11e32617a7de35937748d1f33aae33be0dff0
Author: Vladimir Zapolskiy <vz@mleia.com>
Date:   Sat Oct 17 21:44:38 2015 +0300

    iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock

    commit 01bb70ae0b98d266fa3e860482c7ce22fa482a6e upstream.

    If common clock framework is configured, the driver generates a warning,
    which is fixed by this change:

        root@devkit3250:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 724 at drivers/clk/clk.c:727 clk_core_enable+0x2c/0xa4()
        Modules linked in: sc16is7xx snd_soc_uda1380
        CPU: 0 PID: 724 Comm: cat Not tainted 4.3.0-rc2+ #198
        Hardware name: LPC32XX SoC (Flattened Device Tree)
        Backtrace:
        [<>] (dump_backtrace) from [<>] (show_stack+0x18/0x1c)
        [<>] (show_stack) from [<>] (dump_stack+0x20/0x28)
        [<>] (dump_stack) from [<>] (warn_slowpath_common+0x90/0xb8)
        [<>] (warn_slowpath_common) from [<>] (warn_slowpath_null+0x24/0x2c)
        [<>] (warn_slowpath_null) from [<>] (clk_core_enable+0x2c/0xa4)
        [<>] (clk_core_enable) from [<>] (clk_enable+0x24/0x38)
        [<>] (clk_enable) from [<>] (lpc32xx_read_raw+0x38/0x80)
        [<>] (lpc32xx_read_raw) from [<>] (iio_read_channel_info+0x70/0x94)
        [<>] (iio_read_channel_info) from [<>] (dev_attr_show+0x28/0x4c)
        [<>] (dev_attr_show) from [<>] (sysfs_kf_seq_show+0x8c/0xf0)
        [<>] (sysfs_kf_seq_show) from [<>] (kernfs_seq_show+0x2c/0x30)
        [<>] (kernfs_seq_show) from [<>] (seq_read+0x1c8/0x440)
        [<>] (seq_read) from [<>] (kernfs_fop_read+0x38/0x170)
        [<>] (kernfs_fop_read) from [<>] (do_readv_writev+0x16c/0x238)
        [<>] (do_readv_writev) from [<>] (vfs_readv+0x50/0x58)
        [<>] (vfs_readv) from [<>] (default_file_splice_read+0x1a4/0x308)
        [<>] (default_file_splice_read) from [<>] (do_splice_to+0x78/0x84)
        [<>] (do_splice_to) from [<>] (splice_direct_to_actor+0xc8/0x1cc)
        [<>] (splice_direct_to_actor) from [<>] (do_splice_direct+0xa0/0xb8)
        [<>] (do_splice_direct) from [<>] (do_sendfile+0x1a8/0x30c)
        [<>] (do_sendfile) from [<>] (SyS_sendfile64+0x104/0x10c)
        [<>] (SyS_sendfile64) from [<>] (ret_fast_syscall+0x0/0x38)

    Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1a640c6b2d1d4fdbf424b2958daa23ffbbbb9e06
Author: Lars-Peter Clausen <lars@metafoo.de>
Date:   Mon Oct 12 14:56:28 2015 +0200

    iio:ad7793: Fix ad7785 product ID

    commit 785171fd6cd7dcd7ada5a733b6a2d44ec566c3a0 upstream.

    While the datasheet for the AD7785 lists 0xXB as the product ID the actual
    product ID is 0xX3.

    Fix the product ID otherwise the driver will reject the device due to non
    matching IDs.

    Fixes: e786cc26dcc5 ("staging:iio:ad7793: Implement stricter id checking")
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8a3f8369fb82b6c2dd8bed82e219b8a49abade2d
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Wed Feb 10 08:03:26 2016 -0800

    scsi: fix soft lockup in scsi_remove_target() on module removal

    commit 90a88d6ef88edcfc4f644dddc7eef4ea41bccf8b upstream.

    This softlockup is currently happening:

    [  444.088002] NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [kworker/1:1:29]
    [  444.088002] Modules linked in: lpfc(-) qla2x00tgt(O) qla2xxx_scst(O) scst_vdisk(O) scsi_transport_fc libcrc32c scst(O) dlm configfs nfsd lockd grace nfs_acl auth_rpcgss sunrpc ed
    d snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device dm_mod iTCO_wdt snd_hda_codec_realtek snd_hda_codec_generic gpio_ich iTCO_vendor_support ppdev snd_hda_intel snd_hda_codec snd_hda
    _core snd_hwdep tg3 snd_pcm snd_timer libphy lpc_ich parport_pc ptp acpi_cpufreq snd pps_core fjes parport i2c_i801 ehci_pci tpm_tis tpm sr_mod cdrom soundcore floppy hwmon sg 8250_
    fintek pcspkr i915 drm_kms_helper uhci_hcd ehci_hcd drm fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit usbcore button video usb_common fan ata_generic ata_piix libata th
    ermal
    [  444.088002] CPU: 1 PID: 29 Comm: kworker/1:1 Tainted: G           O    4.4.0-rc5-2.g1e923a3-default #1
    [  444.088002] Hardware name: FUJITSU SIEMENS ESPRIMO E           /D2164-A1, BIOS 5.00 R1.10.2164.A1               05/08/2006
    [  444.088002] Workqueue: fc_wq_4 fc_rport_final_delete [scsi_transport_fc]
    [  444.088002] task: f6266ec0 ti: f6268000 task.ti: f6268000
    [  444.088002] EIP: 0060:[<c07e7044>] EFLAGS: 00000286 CPU: 1
    [  444.088002] EIP is at _raw_spin_unlock_irqrestore+0x14/0x20
    [  444.088002] EAX: 00000286 EBX: f20d3800 ECX: 00000002 EDX: 00000286
    [  444.088002] ESI: f50ba800 EDI: f2146848 EBP: f6269ec8 ESP: f6269ec8
    [  444.088002]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    [  444.088002] CR0: 8005003b CR2: 08f96600 CR3: 363ae000 CR4: 000006d0
    [  444.088002] Stack:
    [  444.088002]  f6269eec c066b0f7 00000286 f2146848 f50ba808 f50ba800 f50ba800 f2146a90
    [  444.088002]  f2146848 f6269f08 f8f0a4ed f3141000 f2146800 f2146a90 f619fa00 00000040
    [  444.088002]  f6269f40 c026cb25 00000001 166c6392 00000061 f6757140 f6136340 00000004
    [  444.088002] Call Trace:
    [  444.088002]  [<c066b0f7>] scsi_remove_target+0x167/0x1c0
    [  444.088002]  [<f8f0a4ed>] fc_rport_final_delete+0x9d/0x1e0 [scsi_transport_fc]
    [  444.088002]  [<c026cb25>] process_one_work+0x155/0x3e0
    [  444.088002]  [<c026cde7>] worker_thread+0x37/0x490
    [  444.088002]  [<c027214b>] kthread+0x9b/0xb0
    [  444.088002]  [<c07e72c1>] ret_from_kernel_thread+0x21/0x40

    What appears to be happening is that something has pinned the target
    so it can't go into STARGET_DEL via final release and the loop in
    scsi_remove_target spins endlessly until that happens.

    The fix for this soft lockup is to not keep looping over a device that
    we've called remove on but which hasn't gone into DEL state.  This
    patch will retain a simplistic memory of the last target and not keep
    looping over it.

    Reported-by: Sebastian Herbszt <herbszt@gmx.de>
    Tested-by: Sebastian Herbszt <herbszt@gmx.de>
    Fixes: 40998193560dab6c3ce8d25f4fa58a23e252ef38
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 50ec3624a2eadcf6d06fa32a8d89324639066c53
Author: Hannes Reinecke <hare@suse.de>
Date:   Fri Jan 22 15:42:41 2016 +0100

    scsi_dh_rdac: always retry MODE SELECT on command lock violation

    commit d2d06d4fe0f2cc2df9b17fefec96e6e1a1271d91 upstream.

    If MODE SELECT returns with sense '05/91/36' (command lock violation)
    it should always be retried without counting the number of retries.
    During an HBA upgrade or similar circumstances one might see a flood
    of MODE SELECT command from various HBAs, which will easily trigger
    the sense code and exceed the retry count.

    Signed-off-by: Hannes Reinecke <hare@suse.de>
    Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 014212bf4f4bd566c88dd7809882b1be0eb79c51
Author: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Date:   Tue Feb 2 16:57:35 2016 -0800

    drivers/scsi/sg.c: mark VMA as VM_IO to prevent migration

    commit 461c7fa126794157484dca48e88effa4963e3af3 upstream.

    Reduced testcase:

        #include <fcntl.h>
        #include <unistd.h>
        #include <sys/mman.h>
        #include <numaif.h>

        #define SIZE 0x2000

        int main()
        {
            int fd;
            void *p;

            fd = open("/dev/sg0", O_RDWR);
            p = mmap(NULL, SIZE, PROT_EXEC, MAP_PRIVATE | MAP_LOCKED, fd, 0);
            mbind(p, SIZE, 0, NULL, 0, MPOL_MF_MOVE);
            return 0;
        }

    We shouldn't try to migrate pages in sg VMA as we don't have a way to
    update Sg_scatter_hold::pages accordingly from mm core.

    Let's mark the VMA as VM_IO to indicate to mm core that the VMA is not
    migratable.

    Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    Cc: Doug Gilbert <dgilbert@interlog.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Cc: Shiraz Hashim <shashim@codeaurora.org>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Cc: syzkaller <syzkaller@googlegroups.com>
    Cc: Kostya Serebryany <kcc@google.com>
    Cc: Alexander Potapenko <glider@google.com>
    Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3d1df27856ea8b9455e4a59dd22eee9afa40ead9
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Wed Jan 20 11:26:01 2016 -0500

    SCSI: fix crashes in sd and sr runtime PM

    commit 13b4389143413a1f18127c07f72c74cad5b563e8 upstream.

    Runtime suspend during driver probe and removal can cause problems.
    The driver's runtime_suspend or runtime_resume callbacks may invoked
    before the driver has finished binding to the device or after the
    driver has unbound from the device.

    This problem shows up with the sd and sr drivers, and can cause disk
    or CD/DVD drives to become unusable as a result.  The fix is simple.
    The drivers store a pointer to the scsi_disk or scsi_cd structure as
    their private device data when probing is finished, so we simply have
    to be sure to clear the private data during removal and test it during
    runtime suspend/resume.

    This fixes <https://bugs.debian.org/801925>.

    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Reported-by: Paul Menzel <paul.menzel@giantmonkey.de>
    Reported-by: Erich Schubert <erich@debian.org>
    Reported-by: Alexandre Rossi <alexandre.rossi@gmail.com>
    Tested-by: Paul Menzel <paul.menzel@giantmonkey.de>
    Tested-by: Erich Schubert <erich@debian.org>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bac26cabd29db3237c288d054054a1dfbea835f6
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Tue Jan 19 16:15:27 2016 -0800

    iscsi-target: Fix potential dead-lock during node acl delete

    commit 26a99c19f810b2593410899a5b304b21b47428a6 upstream.

    This patch is a iscsi-target specific bug-fix for a dead-lock
    that can occur during explicit struct se_node_acl->acl_group
    se_session deletion via configfs rmdir(2), when iscsi-target
    time2retain timer is still active.

    It changes iscsi-target to obtain se_portal_group->session_lock
    internally using spin_in_locked() to check for the specific
    se_node_acl configfs shutdown rmdir(2) case.

    Note this patch is intended for stable, and the subsequent
    v4.5-rc patch converts target_core_tpg.c to use proper
    se_sess->sess_kref reference counting for both se_node_acl
    deletion + se_node_acl->queue_depth se_session restart.

    Reported-by:: Sagi Grimberg <sagig@mellanox.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Hannes Reinecke <hare@suse.de>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Mike Christie <michaelc@cs.wisc.edu>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2bfa7bba55afcfbd887de08f936c3186ca2fae82
Author: Ken Xue <ken.xue@amd.com>
Date:   Tue Dec 1 14:45:46 2015 +0800

    SCSI: Fix NULL pointer dereference in runtime PM

    commit 4fd41a8552afc01054d9d9fc7f1a63c324867d27 upstream.

    The routines in scsi_pm.c assume that if a runtime-PM callback is
    invoked for a SCSI device, it can only mean that the device's driver
    has asked the block layer to handle the runtime power management (by
    calling blk_pm_runtime_init(), which among other things sets q->dev).

    However, this assumption turns out to be wrong for things like the ses
    driver.  Normally ses devices are not allowed to do runtime PM, but
    userspace can override this setting.  If this happens, the kernel gets
    a NULL pointer dereference when blk_post_runtime_resume() tries to use
    the uninitialized q->dev pointer.

    This patch fixes the problem by checking q->dev in block layer before
    handle runtime PM. Since ses doesn't define any PM callbacks and call
    blk_pm_runtime_init(), the crash won't occur.

    This fixes Bugzilla #101371.
    https://bugzilla.kernel.org/show_bug.cgi?id=101371

    More discussion can be found from below link.
    http://marc.info/?l=linux-scsi&m=144163730531875&w=2

    Signed-off-by: Ken Xue <Ken.Xue@amd.com>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Cc: Xiangliang Yu <Xiangliang.Yu@amd.com>
    Cc: James E.J. Bottomley <JBottomley@odin.com>
    Cc: Jens Axboe <axboe@kernel.dk>
    Cc: Michael Terry <Michael.terry@canonical.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0c808c2962e2cfc9ded0b96a211ed819562e45ba
Author: Bart Van Assche <bart.vanassche@sandisk.com>
Date:   Wed Nov 18 14:56:36 2015 -0800

    Fix a memory leak in scsi_host_dev_release()

    commit b49493f99690c8eaacfbc635bafaad629ea2c036 upstream.

    Avoid that kmemleak reports the following memory leak if a
    SCSI LLD calls scsi_host_alloc() and scsi_host_put() but neither
    scsi_host_add() nor scsi_host_remove(). The following shell
    command triggers that scenario:

    for ((i=0; i<2; i++)); do
      srp_daemon -oac |
      while read line; do
        echo $line >/sys/class/infiniband_srp/srp-mlx4_0-1/add_target
      done
    done

    unreferenced object 0xffff88021b24a220 (size 8):
      comm "srp_daemon", pid 56421, jiffies 4295006762 (age 4240.750s)
      hex dump (first 8 bytes):
        68 6f 73 74 35 38 00 a5                          host58..
      backtrace:
        [<ffffffff8151014a>] kmemleak_alloc+0x7a/0xc0
        [<ffffffff81165c1e>] __kmalloc_track_caller+0xfe/0x160
        [<ffffffff81260d2b>] kvasprintf+0x5b/0x90
        [<ffffffff81260e2d>] kvasprintf_const+0x8d/0xb0
        [<ffffffff81254b0c>] kobject_set_name_vargs+0x3c/0xa0
        [<ffffffff81337e3c>] dev_set_name+0x3c/0x40
        [<ffffffff81355757>] scsi_host_alloc+0x327/0x4b0
        [<ffffffffa03edc8e>] srp_create_target+0x4e/0x8a0 [ib_srp]
        [<ffffffff8133778b>] dev_attr_store+0x1b/0x20
        [<ffffffff811f27fa>] sysfs_kf_write+0x4a/0x60
        [<ffffffff811f1e8e>] kernfs_fop_write+0x14e/0x180
        [<ffffffff81176eef>] __vfs_write+0x2f/0xf0
        [<ffffffff811771e4>] vfs_write+0xa4/0x100
        [<ffffffff81177c64>] SyS_write+0x54/0xc0
        [<ffffffff8151b257>] entry_SYSCALL_64_fastpath+0x12/0x6f

    Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
    Reviewed-by: Lee Duncan <lduncan@suse.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Hannes Reinecke <hare@suse.de>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 481c34209a7e52a9f74ce60e539b9c00036e66b3
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Thu Nov 5 14:11:59 2015 -0800

    iscsi-target: Fix rx_login_comp hang after login failure

    commit ca82c2bded29b38d36140bfa1e76a7bbfcade390 upstream.

    This patch addresses a case where iscsi_target_do_tx_login_io()
    fails sending the last login response PDU, after the RX/TX
    threads have already been started.

    The case centers around iscsi_target_rx_thread() not invoking
    allow_signal(SIGINT) before the send_sig(SIGINT, ...) occurs
    from the failure path, resulting in RX thread hanging
    indefinately on iscsi_conn->rx_login_comp.

    Note this bug is a regression introduced by:

      commit e54198657b65625085834847ab6271087323ffea
      Author: Nicholas Bellinger <nab@linux-iscsi.org>
      Date:   Wed Jul 22 23:14:19 2015 -0700

          iscsi-target: Fix iscsit_start_kthreads failure OOPs

    To address this bug, complete ->rx_login_complete for good
    measure in the failure path, and immediately return from
    RX thread context if connection state did not actually reach
    full feature phase (TARG_CONN_STATE_LOGGED_IN).

    Cc: Sagi Grimberg <sagig@mellanox.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f7d615b9cc7bcfaf064d715770b061b995b44bce
Author: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Date:   Tue Oct 27 10:49:54 2015 +0100

    scsi_sysfs: Fix queue_ramp_up_period return code

    commit 863e02d0e173bb9d8cea6861be22820b25c076cc upstream.

    Writing a number to /sys/bus/scsi/devices/<sdev>/queue_ramp_up_period
    returns the value of that number instead of the number of bytes written.
    This behavior can confuse programs expecting POSIX write() semantics.
    Fix this by returning the number of bytes written instead.

    Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
    Reviewed-by: Hannes Reinecke <hare@suse.de>
    Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2544cce12c7bd18e880b09c21b1a2d944a3423eb
Author: Christoph Hellwig <hch@lst.de>
Date:   Mon Oct 19 16:35:46 2015 +0200

    scsi: restart list search after unlock in scsi_remove_target

    commit 40998193560dab6c3ce8d25f4fa58a23e252ef38 upstream.

    When dropping a lock while iterating a list we must restart the search
    as other threads could have manipulated the list under us.  Without this
    we can get stuck in an endless loop.  This bug was introduced by

    commit bc3f02a795d3b4faa99d37390174be2a75d091bd
    Author: Dan Williams <djbw@fb.com>
    Date:   Tue Aug 28 22:12:10 2012 -0700

        [SCSI] scsi_remove_target: fix softlockup regression on hot remove

    Which was itself trying to fix a reported soft lockup issue

    http://thread.gmane.org/gmane.linux.kernel/1348679

    However, we believe even with this revert of the original patch, the soft
    lockup problem has been fixed by

    commit f2495e228fce9f9cec84367547813cbb0d6db15a
    Author: James Bottomley <JBottomley@Parallels.com>
    Date:   Tue Jan 21 07:01:41 2014 -0800

        [SCSI] dual scan thread bug fix

    Thanks go to Dan Williams <dan.j.williams@intel.com> for tracking all this
    prior history down.

    Reported-by: Johannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Tested-by: Johannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
    Fixes: bc3f02a795d3b4faa99d37390174be2a75d091bd
    Signed-off-by: James Bottomley <JBottomley@Odin.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 00707985578715324f32a0d71dbf6221bc4a2fc7
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Wed Jan 13 08:10:31 2016 -0800

    klist: fix starting point removed bug in klist iterators

    commit 00cd29b799e3449f0c68b1cc77cd4a5f95b42d17 upstream.

    The starting node for a klist iteration is often passed in from
    somewhere way above the klist infrastructure, meaning there's no
    guarantee the node is still on the list.  We've seen this in SCSI where
    we use bus_find_device() to iterate through a list of devices.  In the
    face of heavy hotplug activity, the last device returned by
    bus_find_device() can be removed before the next call.  This leads to

    Dec  3 13:22:02 localhost kernel: WARNING: CPU: 2 PID: 28073 at include/linux/kref.h:47 klist_iter_init_node+0x3d/0x50()
    Dec  3 13:22:02 localhost kernel: Modules linked in: scsi_debug x86_pkg_temp_thermal kvm_intel kvm irqbypass crc32c_intel joydev iTCO_wdt dcdbas ipmi_devintf acpi_power_meter iTCO_vendor_support ipmi_si imsghandler pcspkr wmi acpi_cpufreq tpm_tis tpm shpchp lpc_ich mfd_core nfsd nfs_acl lockd grace sunrpc tg3 ptp pps_core
    Dec  3 13:22:02 localhost kernel: CPU: 2 PID: 28073 Comm: cat Not tainted 4.4.0-rc1+ #2
    Dec  3 13:22:02 localhost kernel: Hardware name: Dell Inc. PowerEdge R320/08VT7V, BIOS 2.0.22 11/19/2013
    Dec  3 13:22:02 localhost kernel: ffffffff81a20e77 ffff880613acfd18 ffffffff81321eef 0000000000000000
    Dec  3 13:22:02 localhost kernel: ffff880613acfd50 ffffffff8107ca52 ffff88061176b198 0000000000000000
    Dec  3 13:22:02 localhost kernel: ffffffff814542b0 ffff880610cfb100 ffff88061176b198 ffff880613acfd60
    Dec  3 13:22:02 localhost kernel: Call Trace:
    Dec  3 13:22:02 localhost kernel: [<ffffffff81321eef>] dump_stack+0x44/0x55
    Dec  3 13:22:02 localhost kernel: [<ffffffff8107ca52>] warn_slowpath_common+0x82/0xc0
    Dec  3 13:22:02 localhost kernel: [<ffffffff814542b0>] ? proc_scsi_show+0x20/0x20
    Dec  3 13:22:02 localhost kernel: [<ffffffff8107cb4a>] warn_slowpath_null+0x1a/0x20
    Dec  3 13:22:02 localhost kernel: [<ffffffff8167225d>] klist_iter_init_node+0x3d/0x50
    Dec  3 13:22:02 localhost kernel: [<ffffffff81421d41>] bus_find_device+0x51/0xb0
    Dec  3 13:22:02 localhost kernel: [<ffffffff814545ad>] scsi_seq_next+0x2d/0x40
    [...]

    And an eventual crash. It can actually occur in any hotplug system
    which has a device finder and a starting device.

    We can fix this globally by making sure the starting node for
    klist_iter_init_node() is actually a member of the list before using it
    (and by starting from the beginning if it isn't).

    Reported-by: Ewan D. Milne <emilne@redhat.com>
    Tested-by: Ewan D. Milne <emilne@redhat.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 710636bc7a255376fe26c768377afa8aee030d86
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Fri Feb 12 22:26:42 2016 +0100

    tracing: Fix freak link error caused by branch tracer

    commit b33c8ff4431a343561e2319f17c14286f2aa52e2 upstream.

    In my randconfig tests, I came across a bug that involves several
    components:

    * gcc-4.9 through at least 5.3
    * CONFIG_GCOV_PROFILE_ALL enabling -fprofile-arcs for all files
    * CONFIG_PROFILE_ALL_BRANCHES overriding every if()
    * The optimized implementation of do_div() that tries to
      replace a library call with an division by multiplication
    * code in drivers/media/dvb-frontends/zl10353.c doing

            u32 adc_clock = 450560; /* 45.056 MHz */
            if (state->config.adc_clock)
                    adc_clock = state->config.adc_clock;
            do_div(value, adc_clock);

    In this case, gcc fails to determine whether the divisor
    in do_div() is __builtin_constant_p(). In particular, it
    concludes that __builtin_constant_p(adc_clock) is false, while
    __builtin_constant_p(!!adc_clock) is true.

    That in turn throws off the logic in do_div() that also uses
    __builtin_constant_p(), and instead of picking either the
    constant- optimized division, and the code in ilog2() that uses
    __builtin_constant_p() to figure out whether it knows the answer at
    compile time. The result is a link error from failing to find
    multiple symbols that should never have been called based on
    the __builtin_constant_p():

    dvb-frontends/zl10353.c:138: undefined reference to `____ilog2_NaN'
    dvb-frontends/zl10353.c:138: undefined reference to `__aeabi_uldivmod'
    ERROR: "____ilog2_NaN" [drivers/media/dvb-frontends/zl10353.ko] undefined!
    ERROR: "__aeabi_uldivmod" [drivers/media/dvb-frontends/zl10353.ko] undefined!

    This patch avoids the problem by changing __trace_if() to check
    whether the condition is known at compile-time to be nonzero, rather
    than checking whether it is actually a constant.

    I see this one link error in roughly one out of 1600 randconfig builds
    on ARM, and the patch fixes all known instances.

    Link: http://lkml.kernel.org/r/1455312410-1058841-1-git-send-email-arnd@arndb.de

    Acked-by: Nicolas Pitre <nico@linaro.org>
    Fixes: ab3c9c686e22 ("branch tracer, intel-iommu: fix build with CONFIG_BRANCH_TRACER=y")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c3b066b6e4d524dd27f23a4417ac2c3633b13327
Author: Steven Rostedt <rostedt@goodmis.org>
Date:   Mon Nov 16 17:25:16 2015 -0500

    tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines

    commit 32abc2ede536aae52978d6c0a8944eb1df14f460 upstream.

    When a long value is read on 32 bit machines for 64 bit output, the
    parsing needs to change "%lu" into "%llu", as the value is read
    natively.

    Unfortunately, if "%llu" is already there, the code will add another "l"
    to it and fail to parse it properly.

    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Acked-by: Namhyung Kim <namhyung@kernel.org>
    Link: http://lkml.kernel.org/r/20151116172516.4b79b109@gandalf.local.home
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 414f6fbc84b58e3f1724f9056efb0c730d040ba6
Author: Jann Horn <jann@thejh.net>
Date:   Wed Jan 20 15:00:04 2016 -0800

    ptrace: use fsuid, fsgid, effective creds for fs access checks

    commit caaee6234d05a58c5b4d05e7bf766131b810a657 upstream.

    By checking the effective credentials instead of the real UID / permitted
    capabilities, ensure that the calling process actually intended to use its
    credentials.

    To ensure that all ptrace checks use the correct caller credentials (e.g.
    in case out-of-tree code or newly added code omits the PTRACE_MODE_*CREDS
    flag), use two new flags and require one of them to be set.

    The problem was that when a privileged task had temporarily dropped its
    privileges, e.g.  by calling setreuid(0, user_uid), with the intent to
    perform following syscalls with the credentials of a user, it still passed
    ptrace access checks that the user would not be able to pass.

    While an attacker should not be able to convince the privileged task to
    perform a ptrace() syscall, this is a problem because the ptrace access
    check is reused for things in procfs.

    In particular, the following somewhat interesting procfs entries only rely
    on ptrace access checks:

     /proc/$pid/stat - uses the check for determining whether pointers
         should be visible, useful for bypassing ASLR
     /proc/$pid/maps - also useful for bypassing ASLR
     /proc/$pid/cwd - useful for gaining access to restricted
         directories that contain files with lax permissions, e.g. in
         this scenario:
         lrwxrwxrwx root root /proc/13020/cwd -> /root/foobar
         drwx------ root root /root
         drwxr-xr-x root root /root/foobar
         -rw-r--r-- root root /root/foobar/secret

    Therefore, on a system where a root-owned mode 6755 binary changes its
    effective credentials as described and then dumps a user-specified file,
    this could be used by an attacker to reveal the memory layout of root's
    processes or reveal the contents of files he is not allowed to access
    (through /proc/$pid/cwd).

    [akpm@linux-foundation.org: fix warning]
    Signed-off-by: Jann Horn <jann@thejh.net>
    Acked-by: Kees Cook <keescook@chromium.org>
    Cc: Casey Schaufler <casey@schaufler-ca.com>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Morris <james.l.morris@oracle.com>
    Cc: "Serge E. Hallyn" <serge.hallyn@ubuntu.com>
    Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    Cc: Willy Tarreau <w@1wt.eu>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 05c5582559ac40ab12a4624681d41f2771239c8e
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Mon Nov 2 10:50:51 2015 +0100

    perf: Fix inherited events vs. tracepoint filters

    commit b71b437eedaed985062492565d9d421d975ae845 upstream.

    Arnaldo reported that tracepoint filters seem to misbehave (ie. not
    apply) on inherited events.

    The fix is obvious; filters are only set on the actual (parent)
    event, use the normal pattern of using this parent event for filters.
    This is safe because each child event has a reference to it.

    Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
    Tested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Frédéric Weisb…
cyclon1978 pushed a commit to cyclon1978/android_kernel_elephone_p8000 that referenced this issue Jul 14, 2017
commit e39c17904aadf3a107b2bc292c03bfd9f850fd08
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu Mar 3 15:07:51 2016 -0800

    Linux 3.10.99

commit d012f71377e1dad1165a0926c2920043e4047438
Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date:   Thu Feb 11 16:10:26 2016 -0500

    xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted.

    commit 4d8c8bd6f2062c9988817183a91fe2e623c8aa5e upstream.

    Occasionaly PV guests would crash with:

    pciback 0000:00:00.1: Xen PCI mapped GSI0 to IRQ16
    BUG: unable to handle kernel paging request at 0000000d1a8c0be0
    .. snip..
      <ffffffff8139ce1b>] find_next_bit+0xb/0x10
      [<ffffffff81387f22>] cpumask_next_and+0x22/0x40
      [<ffffffff813c1ef8>] pci_device_probe+0xb8/0x120
      [<ffffffff81529097>] ? driver_sysfs_add+0x77/0xa0
      [<ffffffff815293e4>] driver_probe_device+0x1a4/0x2d0
      [<ffffffff813c1ddd>] ? pci_match_device+0xdd/0x110
      [<ffffffff81529657>] __device_attach_driver+0xa7/0xb0
      [<ffffffff815295b0>] ? __driver_attach+0xa0/0xa0
      [<ffffffff81527622>] bus_for_each_drv+0x62/0x90
      [<ffffffff8152978d>] __device_attach+0xbd/0x110
      [<ffffffff815297fb>] device_attach+0xb/0x10
      [<ffffffff813b75ac>] pci_bus_add_device+0x3c/0x70
      [<ffffffff813b7618>] pci_bus_add_devices+0x38/0x80
      [<ffffffff813dc34e>] pcifront_scan_root+0x13e/0x1a0
      [<ffffffff817a0692>] pcifront_backend_changed+0x262/0x60b
      [<ffffffff814644c6>] ? xenbus_gather+0xd6/0x160
      [<ffffffff8120900f>] ? put_object+0x2f/0x50
      [<ffffffff81465c1d>] xenbus_otherend_changed+0x9d/0xa0
      [<ffffffff814678ee>] backend_changed+0xe/0x10
      [<ffffffff81463a28>] xenwatch_thread+0xc8/0x190
      [<ffffffff810f22f0>] ? woken_wake_function+0x10/0x10

    which was the result of two things:

    When we call pci_scan_root_bus we would pass in 'sd' (sysdata)
    pointer which was an 'pcifront_sd' structure. However in the
    pci_device_add it expects that the 'sd' is 'struct sysdata' and
    sets the dev->node to what is in sd->node (offset 4):

    set_dev_node(&dev->dev, pcibus_to_node(bus));

     __pcibus_to_node(const struct pci_bus *bus)
    {
            const struct pci_sysdata *sd = bus->sysdata;

            return sd->node;
    }

    However our structure was pcifront_sd which had nothing at that
    offset:

    struct pcifront_sd {
            int                        domain;    /*     0     4 */
            /* XXX 4 bytes hole, try to pack */
            struct pcifront_device *   pdev;      /*     8     8 */
    }

    That is an hole - filled with garbage as we used kmalloc instead of
    kzalloc (the second problem).

    This patch fixes the issue by:
     1) Use kzalloc to initialize to a well known state.
     2) Put 'struct pci_sysdata' at the start of 'pcifront_sd'. That
        way access to the 'node' will access the right offset.

    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1b153db5ac6c1598022b2b11ffb3be1303e3bffb
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Sat Feb 27 19:17:33 2016 -0500

    do_last(): don't let a bogus return value from ->open() et.al. to confuse us

    commit c80567c82ae4814a41287618e315a60ecf513be6 upstream.

    ... into returning a positive to path_openat(), which would interpret that
    as "symlink had been encountered" and proceed to corrupt memory, etc.
    It can only happen due to a bug in some ->open() instance or in some LSM
    hook, etc., so we report any such event *and* make sure it doesn't trick
    us into further unpleasantness.

    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b19e7a870c21104186d5834d469b6e4a60d5cc6a
Author: Simon Guinot <simon.guinot@sequanux.org>
Date:   Thu Sep 10 00:15:18 2015 +0200

    kernel/resource.c: fix muxed resource handling in __request_region()

    commit 59ceeaaf355fa0fb16558ef7c24413c804932ada upstream.

    In __request_region, if a conflict with a BUSY and MUXED resource is
    detected, then the caller goes to sleep and waits for the resource to be
    released.  A pointer on the conflicting resource is kept.  At wake-up
    this pointer is used as a parent to retry to request the region.

    A first problem is that this pointer might well be invalid (if for
    example the conflicting resource have already been freed).  Another
    problem is that the next call to __request_region() fails to detect a
    remaining conflict.  The previously conflicting resource is passed as a
    parameter and __request_region() will look for a conflict among the
    children of this resource and not at the resource itself.  It is likely
    to succeed anyway, even if there is still a conflict.

    Instead, the parent of the conflicting resource should be passed to
    __request_region().

    As a fix, this patch doesn't update the parent resource pointer in the
    case we have to wait for a muxed region right after.

    Reported-and-tested-by: Vincent Pelletier <plr.vincent@gmail.com>
    Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
    Tested-by: Vincent Donnefort <vdonnefort@gmail.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a7d9970fb5419b78310fb827615bd14bf7d94963
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Thu Feb 18 18:55:54 2016 +0000

    sunrpc/cache: fix off-by-one in qword_get()

    commit b7052cd7bcf3c1478796e93e3dff2b44c9e82943 upstream.

    The qword_get() function NUL-terminates its output buffer.  If the input
    string is in hex format \xXXXX... and the same length as the output
    buffer, there is an off-by-one:

      int qword_get(char **bpp, char *dest, int bufsize)
      {
          ...
          while (len < bufsize) {
              ...
              *dest++ = (h << 4) | l;
              len++;
          }
          ...
          *dest = '\0';
          return len;
      }

    This patch ensures the NUL terminator doesn't fall outside the output
    buffer.

    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit eb63a905ff5f0d258693fd9991a94bc49188dcc3
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Wed Feb 24 09:04:24 2016 -0500

    tracing: Fix showing function event in available_events

    commit d045437a169f899dfb0f6f7ede24cc042543ced9 upstream.

    The ftrace:function event is only displayed for parsing the function tracer
    data. It is not used to enable function tracing, and does not include an
    "enable" file in its event directory.

    Originally, this event was kept separate from other events because it did
    not have a ->reg parameter. But perf added a "reg" parameter for its use
    which caused issues, because it made the event available to functions where
    it was not compatible for.

    Commit 9b63776fa3ca9 "tracing: Do not enable function event with enable"
    added a TRACE_EVENT_FL_IGNORE_ENABLE flag that prevented the function event
    from being enabled by normal trace events. But this commit missed keeping
    the function event from being displayed by the "available_events" directory,
    which is used to show what events can be enabled by set_event.

    One documented way to enable all events is to:

     cat available_events > set_event

    But because the function event is displayed in the available_events, this
    now causes an INVALID error:

     cat: write error: Invalid argument

    Reported-by: Chunyu Hu <chuhu@redhat.com>
    Fixes: 9b63776fa3ca9 "tracing: Do not enable function event with enable"
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bd54a801362f13ac756b4de4bb65d1a48c7d5fad
Author: Christian Borntraeger <borntraeger@de.ibm.com>
Date:   Fri Feb 19 13:11:46 2016 +0100

    KVM: async_pf: do not warn on page allocation failures

    commit d7444794a02ff655eda87e3cc54e86b940e7736f upstream.

    In async_pf we try to allocate with NOWAIT to get an element quickly
    or fail. This code also handle failures gracefully. Lets silence
    potential page allocation failures under load.

    qemu-system-s39: page allocation failure: order:0,mode:0x2200000
    [...]
    Call Trace:
    ([<00000000001146b8>] show_trace+0xf8/0x148)
    [<000000000011476a>] show_stack+0x62/0xe8
    [<00000000004a36b8>] dump_stack+0x70/0x98
    [<0000000000272c3a>] warn_alloc_failed+0xd2/0x148
    [<000000000027709e>] __alloc_pages_nodemask+0x94e/0xb38
    [<00000000002cd36a>] new_slab+0x382/0x400
    [<00000000002cf7ac>] ___slab_alloc.constprop.30+0x2dc/0x378
    [<00000000002d03d0>] kmem_cache_alloc+0x160/0x1d0
    [<0000000000133db4>] kvm_setup_async_pf+0x6c/0x198
    [<000000000013dee8>] kvm_arch_vcpu_ioctl_run+0xd48/0xd58
    [<000000000012fcaa>] kvm_vcpu_ioctl+0x372/0x690
    [<00000000002f66f6>] do_vfs_ioctl+0x3be/0x510
    [<00000000002f68ec>] SyS_ioctl+0xa4/0xb8
    [<0000000000781c5e>] system_call+0xd6/0x264
    [<000003ffa24fa06a>] 0x3ffa24fa06a

    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9c8e8b9e50d8e19ae8cbc721cd0a4da8af17fa26
Author: Christoph Hellwig <hch@lst.de>
Date:   Mon Feb 8 21:11:50 2016 +0100

    nfs: fix nfs_size_to_loff_t

    commit 50ab8ec74a153eb30db26529088bc57dd700b24c upstream.

    See http: //www.infradead.org/rpr.html
    X-Evolution-Source: 1451162204.2173.11@leira.trondhjem.org
    Content-Transfer-Encoding: 8bit
    Mime-Version: 1.0

    We support OFFSET_MAX just fine, so don't round down below it.  Also
    switch to using min_t to make the helper more readable.

    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Fixes: 433c92379d9c ("NFS: Clean up nfs_size_to_loff_t()")
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dcc121e02f773b4b8fc88522810214af39ea8313
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Jan 25 10:08:00 2016 -0600

    PCI/AER: Flush workqueue on device remove to avoid use-after-free

    commit 4ae2182b1e3407de369f8c5d799543b7db74221b upstream.

    A Root Port's AER structure (rpc) contains a queue of events.  aer_irq()
    enqueues AER status information and schedules aer_isr() to dequeue and
    process it.  When we remove a device, aer_remove() waits for the queue to
    be empty, then frees the rpc struct.

    But aer_isr() references the rpc struct after dequeueing and possibly
    emptying the queue, which can cause a use-after-free error as in the
    following scenario with two threads, aer_isr() on the left and a
    concurrent aer_remove() on the right:

      Thread A                      Thread B
      --------                      --------
      aer_irq():
        rpc->prod_idx++
                                    aer_remove():
                                      wait_event(rpc->prod_idx == rpc->cons_idx)
                                      # now blocked until queue becomes empty
      aer_isr():                      # ...
        rpc->cons_idx++               # unblocked because queue is now empty
        ...                           kfree(rpc)
        mutex_unlock(&rpc->rpc_mutex)

    To prevent this problem, use flush_work() to wait until the last scheduled
    instance of aer_isr() has completed before freeing the rpc struct in
    aer_remove().

    I reproduced this use-after-free by flashing a device FPGA and
    re-enumerating the bus to find the new device.  With SLUB debug, this
    crashes with 0x6b bytes (POISON_FREE, the use-after-free magic number) in
    GPR25:

      pcieport 0000:00:00.0: AER: Multiple Corrected error received: id=0000
      Unable to handle kernel paging request for data at address 0x27ef9e3e
      Workqueue: events aer_isr
      GPR24: dd6aa000 6b6b6b6b 605f8378 605f8360 d99b12c0 604fc674 606b1704 d99b12c0
      NIP [602f5328] pci_walk_bus+0xd4/0x104

    [bhelgaas: changelog, stable tag]
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 43a349917d77250e1fb7dbcb44e50a80b8cab026
Author: Tejun Heo <tj@kernel.org>
Date:   Mon Feb 1 11:33:21 2016 -0500

    libata: fix sff host state machine locking while polling

    commit 8eee1d3ed5b6fc8e14389567c9a6f53f82bb7224 upstream.

    The bulk of ATA host state machine is implemented by
    ata_sff_hsm_move().  The function is called from either the interrupt
    handler or, if polling, a work item.  Unlike from the interrupt path,
    the polling path calls the function without holding the host lock and
    ata_sff_hsm_move() selectively grabs the lock.

    This is completely broken.  If an IRQ triggers while polling is in
    progress, the two can easily race and end up accessing the hardware
    and updating state machine state at the same time.  This can put the
    state machine in an illegal state and lead to a crash like the
    following.

      kernel BUG at drivers/ata/libata-sff.c:1302!
      invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN
      Modules linked in:
      CPU: 1 PID: 10679 Comm: syz-executor Not tainted 4.5.0-rc1+ #300
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      task: ffff88002bd00000 ti: ffff88002e048000 task.ti: ffff88002e048000
      RIP: 0010:[<ffffffff83a83409>]  [<ffffffff83a83409>] ata_sff_hsm_move+0x619/0x1c60
      ...
      Call Trace:
       <IRQ>
       [<ffffffff83a84c31>] __ata_sff_port_intr+0x1e1/0x3a0 drivers/ata/libata-sff.c:1584
       [<ffffffff83a85611>] ata_bmdma_port_intr+0x71/0x400 drivers/ata/libata-sff.c:2877
       [<     inline     >] __ata_sff_interrupt drivers/ata/libata-sff.c:1629
       [<ffffffff83a85bf3>] ata_bmdma_interrupt+0x253/0x580 drivers/ata/libata-sff.c:2902
       [<ffffffff81479f98>] handle_irq_event_percpu+0x108/0x7e0 kernel/irq/handle.c:157
       [<ffffffff8147a717>] handle_irq_event+0xa7/0x140 kernel/irq/handle.c:205
       [<ffffffff81484573>] handle_edge_irq+0x1e3/0x8d0 kernel/irq/chip.c:623
       [<     inline     >] generic_handle_irq_desc include/linux/irqdesc.h:146
       [<ffffffff811a92bc>] handle_irq+0x10c/0x2a0 arch/x86/kernel/irq_64.c:78
       [<ffffffff811a7e4d>] do_IRQ+0x7d/0x1a0 arch/x86/kernel/irq.c:240
       [<ffffffff86653d4c>] common_interrupt+0x8c/0x8c arch/x86/entry/entry_64.S:520
       <EOI>
       [<     inline     >] rcu_lock_acquire include/linux/rcupdate.h:490
       [<     inline     >] rcu_read_lock include/linux/rcupdate.h:874
       [<ffffffff8164b4a1>] filemap_map_pages+0x131/0xba0 mm/filemap.c:2145
       [<     inline     >] do_fault_around mm/memory.c:2943
       [<     inline     >] do_read_fault mm/memory.c:2962
       [<     inline     >] do_fault mm/memory.c:3133
       [<     inline     >] handle_pte_fault mm/memory.c:3308
       [<     inline     >] __handle_mm_fault mm/memory.c:3418
       [<ffffffff816efb16>] handle_mm_fault+0x2516/0x49a0 mm/memory.c:3447
       [<ffffffff8127dc16>] __do_page_fault+0x376/0x960 arch/x86/mm/fault.c:1238
       [<ffffffff8127e358>] trace_do_page_fault+0xe8/0x420 arch/x86/mm/fault.c:1331
       [<ffffffff8126f514>] do_async_page_fault+0x14/0xd0 arch/x86/kernel/kvm.c:264
       [<ffffffff86655578>] async_page_fault+0x28/0x30 arch/x86/entry/entry_64.S:986

    Fix it by ensuring that the polling path is holding the host lock
    before entering ata_sff_hsm_move() so that all hardware accesses and
    state updates are performed under the host lock.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
    Link: http://lkml.kernel.org/g/CACT4Y+b_JsOxJu2EZyEf+mOXORc_zid5V1-pLZSroJVxyWdSpw@mail.gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 49662cfccb3f4ade7beb77a1f67f2c2db0027edc
Author: Tejun Heo <tj@kernel.org>
Date:   Tue Feb 9 16:11:26 2016 -0500

    Revert "workqueue: make sure delayed work run in local cpu"

    commit 041bd12e272c53a35c54c13875839bcb98c999ce upstream.

    This reverts commit 874bbfe600a660cba9c776b3957b1ce393151b76.

    Workqueue used to implicity guarantee that work items queued without
    explicit CPU specified are put on the local CPU.  Recent changes in
    timer broke the guarantee and led to vmstat breakage which was fixed
    by 176bed1de5bf ("vmstat: explicitly schedule per-cpu work on the CPU
    we need it to run on").

    vmstat is the most likely to expose the issue and it's quite possible
    that there are other similar problems which are a lot more difficult
    to trigger.  As a preventive measure, 874bbfe600a6 ("workqueue: make
    sure delayed work run in local cpu") was applied to restore the local
    CPU guarnatee.  Unfortunately, the change exposed a bug in timer code
    which got fixed by 22b886dd1018 ("timers: Use proper base migration in
    add_timer_on()").  Due to code restructuring, the commit couldn't be
    backported beyond certain point and stable kernels which only had
    874bbfe600a6 started crashing.

    The local CPU guarantee was accidental more than anything else and we
    want to get rid of it anyway.  As, with the vmstat case fixed,
    874bbfe600a6 is causing more problems than it's fixing, it has been
    decided to take the chance and officially break the guarantee by
    reverting the commit.  A debug feature will be added to force foreign
    CPU assignment to expose cases relying on the guarantee and fixes for
    the individual cases will be backported to stable as necessary.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Fixes: 874bbfe600a6 ("workqueue: make sure delayed work run in local cpu")
    Link: http://lkml.kernel.org/g/20160120211926.GJ10810@quack.suse.cz
    Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
    Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
    Cc: Daniel Bilik <daniel.bilik@neosystem.cz>
    Cc: Jan Kara <jack@suse.cz>
    Cc: Shaohua Li <shli@fb.com>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Cc: Ben Hutchings <ben@decadent.org.uk>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Daniel Bilik <daniel.bilik@neosystem.cz>
    Cc: Jiri Slaby <jslaby@suse.cz>
    Cc: Michal Hocko <mhocko@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 01e527fd4c73d05125d04ce3bfd4413eb5af2581
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Jan 26 11:29:03 2016 +0100

    rfkill: fix rfkill_fop_read wait_event usage

    commit 6736fde9672ff6717ac576e9bba2fd5f3dfec822 upstream.

    The code within wait_event_interruptible() is called with
    !TASK_RUNNING, so mustn't call any functions that can sleep,
    like mutex_lock().

    Since we re-check the list_empty() in a loop after the wait,
    it's safe to simply use list_empty() without locking.

    This bug has existed forever, but was only discovered now
    because all userspace implementations, including the default
    'rfkill' tool, use poll() or select() to get a readable fd
    before attempting to read.

    Fixes: c64fb01627e24 ("rfkill: create useful userspace interface")
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit eb80decbf08882c0dc6573d329fd9b5c1aff3c31
Author: Oliver Neukum <oneukum@suse.com>
Date:   Mon Jan 18 15:45:18 2016 +0100

    cdc-acm:exclude Samsung phone 04e8:685d

    commit e912e685f372ab62a2405a1acd923597f524e94a upstream.

    This phone needs to be handled by a specialised firmware tool
    and is reported to crash irrevocably if cdc-acm takes it.

    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 636a9c8a87da5056b4254ff9eaf67cf52c8c2d1d
Author: Ilya Dryomov <idryomov@gmail.com>
Date:   Wed Feb 17 20:04:08 2016 +0100

    libceph: don't bail early from try_read() when skipping a message

    commit e7a88e82fe380459b864e05b372638aeacb0f52d upstream.

    The contract between try_read() and try_write() is that when called
    each processes as much data as possible.  When instructed by osd_client
    to skip a message, try_read() is violating this contract by returning
    after receiving and discarding a single message instead of checking for
    more.  try_write() then gets a chance to write out more requests,
    generating more replies/skips for try_read() to handle, forcing the
    messenger into a starvation loop.

    Reported-by: Varada Kari <Varada.Kari@sandisk.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Tested-by: Varada Kari <Varada.Kari@sandisk.com>
    Reviewed-by: Alex Elder <elder@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b6c92a436f3e930f7d7d8d456cf3ac36602039cf
Author: Mike Marciniszyn <mike.marciniszyn@intel.com>
Date:   Thu Jan 7 16:44:10 2016 -0500

    IB/qib: fix mcast detach when qp not attached

    commit 09dc9cd6528f5b52bcbd3292a6312e762c85260f upstream.

    The code produces the following trace:

    [1750924.419007] general protection fault: 0000 [#3] SMP
    [1750924.420364] Modules linked in: nfnetlink autofs4 rpcsec_gss_krb5 nfsv4
    dcdbas rfcomm bnep bluetooth nfsd auth_rpcgss nfs_acl dm_multipath nfs lockd
    scsi_dh sunrpc fscache radeon ttm drm_kms_helper drm serio_raw parport_pc
    ppdev i2c_algo_bit lpc_ich ipmi_si ib_mthca ib_qib dca lp parport ib_ipoib
    mac_hid ib_cm i3000_edac ib_sa ib_uverbs edac_core ib_umad ib_mad ib_core
    ib_addr tg3 ptp dm_mirror dm_region_hash dm_log psmouse pps_core
    [1750924.420364] CPU: 1 PID: 8401 Comm: python Tainted: G D
    3.13.0-39-generic #66-Ubuntu
    [1750924.420364] Hardware name: Dell Computer Corporation PowerEdge
    860/0XM089, BIOS A04 07/24/2007
    [1750924.420364] task: ffff8800366a9800 ti: ffff88007af1c000 task.ti:
    ffff88007af1c000
    [1750924.420364] RIP: 0010:[<ffffffffa0131d51>] [<ffffffffa0131d51>]
    qib_mcast_qp_free+0x11/0x50 [ib_qib]
    [1750924.420364] RSP: 0018:ffff88007af1dd70  EFLAGS: 00010246
    [1750924.420364] RAX: 0000000000000001 RBX: ffff88007b822688 RCX:
    000000000000000f
    [1750924.420364] RDX: ffff88007b822688 RSI: ffff8800366c15a0 RDI:
    6764697200000000
    [1750924.420364] RBP: ffff88007af1dd78 R08: 0000000000000001 R09:
    0000000000000000
    [1750924.420364] R10: 0000000000000011 R11: 0000000000000246 R12:
    ffff88007baa1d98
    [1750924.420364] R13: ffff88003ecab000 R14: ffff88007b822660 R15:
    0000000000000000
    [1750924.420364] FS:  00007ffff7fd8740(0000) GS:ffff88007fc80000(0000)
    knlGS:0000000000000000
    [1750924.420364] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [1750924.420364] CR2: 00007ffff597c750 CR3: 000000006860b000 CR4:
    00000000000007e0
    [1750924.420364] Stack:
    [1750924.420364]  ffff88007b822688 ffff88007af1ddf0 ffffffffa0132429
    000000007af1de20
    [1750924.420364]  ffff88007baa1dc8 ffff88007baa0000 ffff88007af1de70
    ffffffffa00cb313
    [1750924.420364]  00007fffffffde88 0000000000000000 0000000000000008
    ffff88003ecab000
    [1750924.420364] Call Trace:
    [1750924.420364]  [<ffffffffa0132429>] qib_multicast_detach+0x1e9/0x350
    [ib_qib]
    [1750924.568035]  [<ffffffffa00cb313>] ? ib_uverbs_modify_qp+0x323/0x3d0
    [ib_uverbs]
    [1750924.568035]  [<ffffffffa0092d61>] ib_detach_mcast+0x31/0x50 [ib_core]
    [1750924.568035]  [<ffffffffa00cc213>] ib_uverbs_detach_mcast+0x93/0x170
    [ib_uverbs]
    [1750924.568035]  [<ffffffffa00c61f6>] ib_uverbs_write+0xc6/0x2c0 [ib_uverbs]
    [1750924.568035]  [<ffffffff81312e68>] ? apparmor_file_permission+0x18/0x20
    [1750924.568035]  [<ffffffff812d4cd3>] ? security_file_permission+0x23/0xa0
    [1750924.568035]  [<ffffffff811bd214>] vfs_write+0xb4/0x1f0
    [1750924.568035]  [<ffffffff811bdc49>] SyS_write+0x49/0xa0
    [1750924.568035]  [<ffffffff8172f7ed>] system_call_fastpath+0x1a/0x1f
    [1750924.568035] Code: 66 2e 0f 1f 84 00 00 00 00 00 31 c0 5d c3 66 2e 0f 1f
    84 00 00 00 00 00 66 90 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 8b 7f 10
    <f0> ff 8f 40 01 00 00 74 0e 48 89 df e8 8e f8 06 e1 5b 5d c3 0f
    [1750924.568035] RIP  [<ffffffffa0131d51>] qib_mcast_qp_free+0x11/0x50
    [ib_qib]
    [1750924.568035]  RSP <ffff88007af1dd70>
    [1750924.650439] ---[ end trace 73d5d4b3f8ad4851 ]

    The fix is to note the qib_mcast_qp that was found.   If none is found, then
    return EINVAL indicating the error.

    Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
    Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
    Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
    Signed-off-by: Doug Ledford <dledford@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a81bfc00a3f9eb778bad0d97551d91c332ec2f1b
Author: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date:   Mon Feb 15 19:41:47 2016 +0100

    drm/radeon: use post-decrement in error handling

    commit bc3f5d8c4ca01555820617eb3b6c0857e4df710d upstream.

    We need to use post-decrement to get the pci_map_page undone also for
    i==0, and to avoid some very unpleasant behaviour if pci_map_page
    failed already at i==0.

    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8d5e1e5af0c667545c202e8f4051f77aa3bf31b7
Author: Nicolai Hähnle <nicolai.haehnle@amd.com>
Date:   Fri Feb 5 14:35:53 2016 -0500

    drm/radeon: hold reference to fences in radeon_sa_bo_new

    commit f6ff4f67cdf8455d0a4226eeeaf5af17c37d05eb upstream.

    An arbitrary amount of time can pass between spin_unlock and
    radeon_fence_wait_any, so we need to ensure that nobody frees the
    fences from under us.

    Based on the analogous fix for amdgpu.

    Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit cb071fb6ace47b8422edd02ee91116d4f31c2c92
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Dec 17 12:52:17 2015 -0500

    drm/radeon: clean up fujitsu quirks

    commit 0eb1c3d4084eeb6fb3a703f88d6ce1521f8fcdd1 upstream.

    Combine the two quirks.

    bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=109481

    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a1c393a2a324f2a1210a72fa60e5c9da03b1f1ce
Author: Rob Clark <robdclark@gmail.com>
Date:   Wed Oct 15 15:00:47 2014 -0400

    drm/vmwgfx: respect 'nomodeset'

    commit 96c5d076f0a5e2023ecdb44d8261f87641ee71e0 upstream.

    Signed-off-by: Rob Clark <robdclark@gmail.com>
    Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>.
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 39e88dd4da3ddc4c07150fe75d9590a648d0eb0f
Author: Dmitry V. Levin <ldv@altlinux.org>
Date:   Sun Dec 27 02:13:27 2015 +0300

    sparc64: fix incorrect sign extension in sys_sparc64_personality

    commit 525fd5a94e1be0776fa652df5c687697db508c91 upstream.

    The value returned by sys_personality has type "long int".
    It is saved to a variable of type "int", which is not a problem
    yet because the type of task_struct->pesonality is "unsigned int".
    The problem is the sign extension from "int" to "long int"
    that happens on return from sys_sparc64_personality.

    For example, a userspace call personality((unsigned) -EINVAL) will
    result to any subsequent personality call, including absolutely
    harmless read-only personality(0xffffffff) call, failing with
    errno set to EINVAL.

    Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bf64271c53bfc54deeebf7ffa69d2df03ae58cf5
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Mon Jan 4 02:21:55 2016 +0100

    mmc: mmci: fix an ages old detection error

    commit 0bcb7efdff63564e80fe84dd36a9fbdfbf6697a4 upstream.

    commit 4956e10903fd ("ARM: 6244/1: mmci: add variant data and default
    MCICLOCK support") added variant data for ARM, U300 and Ux500 variants.
    The Nomadik NHK8815/8820 variant was erroneously labeled as a U300
    variant, and when the proper Nomadik variant was later introduced in
    commit 34fd421349ff ("ARM: 7378/1: mmci: add support for the Nomadik MMCI
    variant") this was not fixes. Let's say this fixes the latter commit as
    there was no proper Nomadik support until then.

    Fixes: 34fd421349ff ("ARM: 7378/1: mmci: add support for the Nomadik...")
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 794c33bd215bbd1f7a3513f9c70a8e0afcbfcd7a
Author: Richard Cochran <richardcochran@gmail.com>
Date:   Tue Dec 22 22:19:58 2015 +0100

    posix-clock: Fix return code on the poll method's error path

    commit 1b9f23727abb92c5e58f139e7d180befcaa06fe0 upstream.

    The posix_clock_poll function is supposed to return a bit mask of
    POLLxxx values.  However, in case the hardware has disappeared (due to
    hot plugging for example) this code returns -ENODEV in a futile
    attempt to throw an error at the file descriptor level.  The kernel's
    file_operations interface does not accept such error codes from the
    poll method.  Instead, this function aught to return POLLERR.

    The value -ENODEV does, in fact, contain the POLLERR bit (and almost
    all the other POLLxxx bits as well), but only by chance.  This patch
    fixes code to return a proper bit mask.

    Credit goes to Markus Elfring for pointing out the suspicious
    signed/unsigned mismatch.

    Reported-by: Markus Elfring <elfring@users.sourceforge.net>
    igned-off-by: Richard Cochran <richardcochran@gmail.com>
    Cc: John Stultz <john.stultz@linaro.org>
    Cc: Julia Lawall <julia.lawall@lip6.fr>
    Link: http://lkml.kernel.org/r/1450819198-17420-1-git-send-email-richardcochran@gmail.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit eeb7b0e01658684a743ccfd66a668e8a56d5ebb9
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Fri Jan 8 19:07:55 2016 -0500

    dm snapshot: fix hung bios when copy error occurs

    commit 385277bfb57faac44e92497104ba542cdd82d5fe upstream.

    When there is an error copying a chunk dm-snapshot can incorrectly hold
    associated bios indefinitely, resulting in hung IO.

    The function copy_callback sets pe->error if there was error copying the
    chunk, and then calls complete_exception.  complete_exception calls
    pending_complete on error, otherwise it calls commit_exception with
    commit_callback (and commit_callback calls complete_exception).

    The persistent exception store (dm-snap-persistent.c) assumes that calls
    to prepare_exception and commit_exception are paired.
    persistent_prepare_exception increases ps->pending_count and
    persistent_commit_exception decreases it.

    If there is a copy error, persistent_prepare_exception is called but
    persistent_commit_exception is not.  This results in the variable
    ps->pending_count never returning to zero and that causes some pending
    exceptions (and their associated bios) to be held forever.

    Fix this by unconditionally calling commit_exception regardless of
    whether the copy was successful.  A new "valid" parameter is added to
    commit_exception -- when the copy fails this parameter is set to zero so
    that the chunk that failed to copy (and all following chunks) is not
    recorded in the snapshot store.  Also, remove commit_callback now that
    it is merely a wrapper around pending_complete.

    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2cd529968dd0647bf75e24f4e36fef99fc536b58
Author: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Date:   Wed Feb 3 17:33:48 2016 -0200

    tda1004x: only update the frontend properties if locked

    commit e8beb02343e7582980c6705816cd957cf4f74c7a upstream.

    The tda1004x was updating the properties cache before locking.
    If the device is not locked, the data at the registers are just
    random values with no real meaning.

    This caused the driver to fail with libdvbv5, as such library
    calls GET_PROPERTY from time to time, in order to return the
    DVB stats.

    Tested with a saa7134 card 78:
    	ASUSTeK P7131 Dual, vendor PCI ID: 1043:4862

    Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 590d6fd45445a32e6efecd8158a96e8dd09f8281
Author: Antonio Ospite <ao2@ao2.it>
Date:   Fri Oct 2 17:33:13 2015 -0300

    gspca: ov534/topro: prevent a division by 0

    commit dcc7fdbec53a960588f2c40232db2c6466c09917 upstream.

    v4l2-compliance sends a zeroed struct v4l2_streamparm in
    v4l2-test-formats.cpp::testParmType(), and this results in a division by
    0 in some gspca subdrivers:

      divide error: 0000 [#1] SMP
      Modules linked in: gspca_ov534 gspca_main ...
      CPU: 0 PID: 17201 Comm: v4l2-compliance Not tainted 4.3.0-rc2-ao2 #1
      Hardware name: System manufacturer System Product Name/M2N-E SLI, BIOS
        ASUS M2N-E SLI ACPI BIOS Revision 1301 09/16/2010
      task: ffff8800818306c0 ti: ffff880095c4c000 task.ti: ffff880095c4c000
      RIP: 0010:[<ffffffffa079bd62>]  [<ffffffffa079bd62>] sd_set_streamparm+0x12/0x60 [gspca_ov534]
      RSP: 0018:ffff880095c4fce8  EFLAGS: 00010296
      RAX: 0000000000000000 RBX: ffff8800c9522000 RCX: ffffffffa077a140
      RDX: 0000000000000000 RSI: ffff880095e0c100 RDI: ffff8800c9522000
      RBP: ffff880095e0c100 R08: ffffffffa077a100 R09: 00000000000000cc
      R10: ffff880067ec7740 R11: 0000000000000016 R12: ffffffffa07bb400
      R13: 0000000000000000 R14: ffff880081b6a800 R15: 0000000000000000
      FS:  00007fda0de78740(0000) GS:ffff88012fc00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000014630f8 CR3: 00000000cf349000 CR4: 00000000000006f0
      Stack:
       ffffffffa07a6431 ffff8800c9522000 ffffffffa077656e 00000000c0cc5616
       ffff8800c9522000 ffffffffa07a5e20 ffff880095e0c100 0000000000000000
       ffff880067ec7740 ffffffffa077a140 ffff880067ec7740 0000000000000016
      Call Trace:
       [<ffffffffa07a6431>] ? v4l_s_parm+0x21/0x50 [videodev]
       [<ffffffffa077656e>] ? vidioc_s_parm+0x4e/0x60 [gspca_main]
       [<ffffffffa07a5e20>] ? __video_do_ioctl+0x280/0x2f0 [videodev]
       [<ffffffffa07a5ba0>] ? video_ioctl2+0x20/0x20 [videodev]
       [<ffffffffa07a59b9>] ? video_usercopy+0x319/0x4e0 [videodev]
       [<ffffffff81182dc1>] ? page_add_new_anon_rmap+0x71/0xa0
       [<ffffffff811afb92>] ? mem_cgroup_commit_charge+0x52/0x90
       [<ffffffff81179b18>] ? handle_mm_fault+0xc18/0x1680
       [<ffffffffa07a15cc>] ? v4l2_ioctl+0xac/0xd0 [videodev]
       [<ffffffff811c846f>] ? do_vfs_ioctl+0x28f/0x480
       [<ffffffff811c86d4>] ? SyS_ioctl+0x74/0x80
       [<ffffffff8154a8b6>] ? entry_SYSCALL_64_fastpath+0x16/0x75
      Code: c7 93 d9 79 a0 5b 5d e9 f1 f3 9a e0 0f 1f 00 66 2e 0f 1f 84 00
        00 00 00 00 66 66 66 66 90 53 31 d2 48 89 fb 48 83 ec 08 8b 46 10 <f7>
        76 0c 80 bf ac 0c 00 00 00 88 87 4e 0e 00 00 74 09 80 bf 4f
      RIP  [<ffffffffa079bd62>] sd_set_streamparm+0x12/0x60 [gspca_ov534]
       RSP <ffff880095c4fce8>
      ---[ end trace 279710c2c6c72080 ]---

    Following what the doc says about a zeroed timeperframe (see
    http://www.linuxtv.org/downloads/v4l-dvb-apis/vidioc-g-parm.html):

      ...
      To reset manually applications can just set this field to zero.

    fix the issue by resetting the frame rate to a default value in case of
    an unusable timeperframe.

    The fix is done in the subdrivers instead of gspca.c because only the
    subdrivers have notion of a default frame rate to reset the camera to.

    Signed-off-by: Antonio Ospite <ao2@ao2.it>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1b29bcfbae9971d931fd65f6ae075d394907517b
Author: Malcolm Priestley <tvboxspy@gmail.com>
Date:   Mon Aug 31 06:13:45 2015 -0300

    media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode

    commit c9d57de6103e343f2d4e04ea8d9e417e10a24da7 upstream.

    When in FE_TUNE_MODE_ONESHOT the frontend must report
    the actual capabilities so user can take appropriate
    action.

    With frontends that can't do auto inversion this is done
    by dvb-core automatically so CAN_INVERSION_AUTO is valid.

    However, when in FE_TUNE_MODE_ONESHOT this is not true.

    So only set FE_CAN_INVERSION_AUTO in modes other than
    FE_TUNE_MODE_ONESHOT

    Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4c77a51256e0b05b0948c1f5dd06dfb2b5abe489
Author: Vegard Nossum <vegard.nossum@oracle.com>
Date:   Wed Dec 16 21:59:56 2015 +0100

    uml: fix hostfs mknod()

    commit 9f2dfda2f2f1c6181c3732c16b85c59ab2d195e0 upstream.

    An inverted return value check in hostfs_mknod() caused the function
    to return success after handling it as an error (and cleaning up).

    It resulted in the following segfault when trying to bind() a named
    unix socket:

      Pid: 198, comm: a.out Not tainted 4.4.0-rc4
      RIP: 0033:[<0000000061077df6>]
      RSP: 00000000daae5d60  EFLAGS: 00010202
      RAX: 0000000000000000 RBX: 000000006092a460 RCX: 00000000dfc54208
      RDX: 0000000061073ef1 RSI: 0000000000000070 RDI: 00000000e027d600
      RBP: 00000000daae5de0 R08: 00000000da980ac0 R09: 0000000000000000
      R10: 0000000000000003 R11: 00007fb1ae08f72a R12: 0000000000000000
      R13: 000000006092a460 R14: 00000000daaa97c0 R15: 00000000daaa9a88
      Kernel panic - not syncing: Kernel mode fault at addr 0x40, ip 0x61077df6
      CPU: 0 PID: 198 Comm: a.out Not tainted 4.4.0-rc4 #1
      Stack:
       e027d620 dfc54208 0000006f da981398
       61bee000 0000c1ed daae5de0 0000006e
       e027d620 dfcd4208 00000005 6092a460
      Call Trace:
       [<60dedc67>] SyS_bind+0xf7/0x110
       [<600587be>] handle_syscall+0x7e/0x80
       [<60066ad7>] userspace+0x3e7/0x4e0
       [<6006321f>] ? save_registers+0x1f/0x40
       [<6006c88e>] ? arch_prctl+0x1be/0x1f0
       [<60054985>] fork_handler+0x85/0x90

    Let's also get rid of the "cosmic ray protection" while we're at it.

    Fixes: e9193059b1b3 "hostfs: fix races in dentry_name() and inode_name()"
    Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
    Cc: Jeff Dike <jdike@addtoit.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9cbb43b99bf138e44deef9957678bc464f3bfd82
Author: Vegard Nossum <vegard.nossum@oracle.com>
Date:   Fri Dec 18 21:28:53 2015 +0100

    uml: flush stdout before forking

    commit 0754fb298f2f2719f0393491d010d46cfb25d043 upstream.

    I was seeing some really weird behaviour where piping UML's output
    somewhere would cause output to get duplicated:

      $ ./vmlinux | head -n 40
      Checking that ptrace can change system call numbers...Core dump limits :
              soft - 0
              hard - NONE
      OK
      Checking syscall emulation patch for ptrace...Core dump limits :
              soft - 0
              hard - NONE
      OK
      Checking advanced syscall emulation patch for ptrace...Core dump limits :
              soft - 0
              hard - NONE
      OK
      Core dump limits :
              soft - 0
              hard - NONE

    This is because these tests do a fork() which duplicates the non-empty
    stdout buffer, then glibc flushes the duplicated buffer as each child
    exits.

    A simple workaround is to flush before forking.

    Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 509a4bccfecaaf92af4bc27b9b212fa4a24e756c
Author: Stefan Haberland <stefan.haberland@de.ibm.com>
Date:   Tue Dec 15 10:45:05 2015 +0100

    s390/dasd: fix refcount for PAV reassignment

    commit 9d862ababb609439c5d6987f6d3ddd09e703aa0b upstream.

    Add refcount to the DASD device when a summary unit check worker is
    scheduled. This prevents that the device is set offline with worker
    in place.

    Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9155d3f258f83643bad27297e7539a67bb81122c
Author: Stefan Haberland <stefan.haberland@de.ibm.com>
Date:   Tue Dec 15 10:16:43 2015 +0100

    s390/dasd: prevent incorrect length error under z/VM after PAV changes

    commit 020bf042e5b397479c1174081b935d0ff15d1a64 upstream.

    The channel checks the specified length and the provided amount of
    data for CCWs and provides an incorrect length error if the size does
    not match. Under z/VM with simulation activated the length may get
    changed. Having the suppress length indication bit set is stated as
    good CCW coding practice and avoids errors under z/VM.

    Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 396a61bef1418705af82ab7b5d1e1a193a699dd2
Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Date:   Fri Jan 1 13:39:22 2016 +0100

    s390: fix normalization bug in exception table sorting

    commit bcb7825a77f41c7dd91da6f7ac10b928156a322e upstream.

    The normalization pass in the sorting routine of the relative exception
    table serves two purposes:
    - it ensures that the address fields of the exception table entries are
      fully ordered, so that no ambiguities arise between entries with
      identical instruction offsets (i.e., when two instructions that are
      exactly 8 bytes apart each have an exception table entry associated with
      them)
    - it ensures that the offsets of both the instruction and the fixup fields
      of each entry are relative to their final location after sorting.

    Commit eb608fb366de ("s390/exceptions: switch to relative exception table
    entries") ported the relative exception table format from x86, but modified
    the sorting routine to only normalize the instruction offset field and not
    the fixup offset field. The result is that the fixup offset of each entry
    will be relative to the original location of the entry before sorting,
    likely leading to crashes when those entries are dereferenced.

    Fixes: eb608fb366de ("s390/exceptions: switch to relative exception table entries")
    Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dbf7fab09e9e0612a23ec7fee9570663b21fdfc9
Author: Filipe Manana <fdmanana@suse.com>
Date:   Thu Dec 31 18:16:29 2015 +0000

    Btrfs: fix number of transaction units required to create symlink

    commit 9269d12b2d57d9e3d13036bb750762d1110d425c upstream.

    We weren't accounting for the insertion of an inline extent item for the
    symlink inode nor that we need to update the parent inode item (through
    the call to btrfs_add_nondir()). So fix this by including two more
    transaction units.

    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1f81573daa963299aaf5692de7dfc39185f8a96d
Author: Filipe Manana <fdmanana@suse.com>
Date:   Thu Dec 31 18:07:59 2015 +0000

    Btrfs: send, don't BUG_ON() when an empty symlink is found

    commit a879719b8c90e15c9e7fa7266d5e3c0ca962f9df upstream.

    When a symlink is successfully created it always has an inline extent
    containing the source path. However if an error happens when creating
    the symlink, we can leave in the subvolume's tree a symlink inode without
    any such inline extent item - this happens if after btrfs_symlink() calls
    btrfs_end_transaction() and before it calls the inode eviction handler
    (through the final iput() call), the transaction gets committed and a
    crash happens before the eviction handler gets called, or if a snapshot
    of the subvolume is made before the eviction handler gets called. Sadly
    we can't just avoid this by making btrfs_symlink() call
    btrfs_end_transaction() after it calls the eviction handler, because the
    later can commit the current transaction before it removes any items from
    the subvolume tree (if it encounters ENOSPC errors while reserving space
    for removing all the items).

    So make send fail more gracefully, with an -EIO error, and print a
    message to dmesg/syslog informing that there's an empty symlink inode,
    so that the user can delete the empty symlink or do something else
    about it.

    Reported-by: Stephen R. van den Berg <srb@cuci.nl>
    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d6ecb7ece33b2da65dffa50ce13f28fec392ec54
Author: Josef Bacik <jbacik@fb.com>
Date:   Thu Oct 22 15:05:09 2015 -0400

    Btrfs: igrab inode in writepage

    commit be7bd730841e69fe8f70120098596f648cd1f3ff upstream.

    We hit this panic on a few of our boxes this week where we have an
    ordered_extent with an NULL inode.  We do an igrab() of the inode in writepages,
    but weren't doing it in writepage which can be called directly from the VM on
    dirty pages.  If the inode has been unlinked then we could have I_FREEING set
    which means igrab() would return NULL and we get this panic.  Fix this by trying
    to igrab in btrfs_writepage, and if it returns NULL then just redirty the page
    and return AOP_WRITEPAGE_ACTIVATE; so the VM knows it wasn't successful.  Thanks,

    Signed-off-by: Josef Bacik <jbacik@fb.com>
    Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bf00d124e07fda629e60709c6187437d66848a9d
Author: Anand Jain <anand.jain@oracle.com>
Date:   Wed Oct 7 17:23:23 2015 +0800

    Btrfs: add missing brelse when superblock checksum fails

    commit b2acdddfad13c38a1e8b927d83c3cf321f63601a upstream.

    Looks like oversight, call brelse() when checksum fails. Further down the
    code, in the non error path, we do call brelse() and so we don't see
    brelse() in the goto error paths.

    Signed-off-by: Anand Jain <anand.jain@oracle.com>
    Reviewed-by: David Sterba <dsterba@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 099e9d4f2c57fba73d62db6764e09644636cbbc2
Author: Russell King <rmk+kernel@arm.linux.org.uk>
Date:   Fri Dec 11 12:09:03 2015 +0000

    scripts: recordmcount: break hardlinks

    commit dd39a26538e37f6c6131e829a4a510787e43c783 upstream.

    recordmcount edits the file in-place, which can cause problems when
    using ccache in hardlink mode.  Arrange for recordmcount to break a
    hardlinked object.

    Link: http://lkml.kernel.org/r/E1a7MVT-0000et-62@rmk-PC.arm.linux.org.uk

    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f80e6add955c84db83cc5a230c967635f0a808b9
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Fri Dec 11 09:16:38 2015 -0800

    ses: fix additional element traversal bug

    commit 5e1033561da1152c57b97ee84371dba2b3d64c25 upstream.

    KASAN found that our additional element processing scripts drop off
    the end of the VPD page into unallocated space.  The reason is that
    not every element has additional information but our traversal
    routines think they do, leading to them expecting far more additional
    information than is present.  Fix this by adding a gate to the
    traversal routine so that it only processes elements that are expected
    to have additional information (list is in SES-2 section 6.1.13.1:
    Additional Element Status diagnostic page overview)

    Reported-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Tested-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b8569305e453645f1227a627ec1ced1c68291d63
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Tue Dec 8 09:00:31 2015 -0800

    ses: Fix problems with simple enclosures

    commit 3417c1b5cb1fdc10261dbed42b05cc93166a78fd upstream.

    Simple enclosure implementations (mostly USB) are allowed to return only
    page 8 to every diagnostic query.  That really confuses our
    implementation because we assume the return is the page we asked for and
    end up doing incorrect offsets based on bogus information leading to
    accesses outside of allocated ranges.  Fix that by checking the page
    code of the return and giving an error if it isn't the one we asked for.
    This should fix reported bugs with USB storage by simply refusing to
    attach to enclosures that behave like this.  It's also good defensive
    practise now that we're starting to see more USB enclosures.

    Reported-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Reviewed-by: Tomas Henzl <thenzl@redhat.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ffb785e178acd0d965e4338c561f82bdb2d054b6
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Dec 10 10:37:51 2015 +0100

    rfkill: copy the name into the rfkill struct

    commit b7bb110008607a915298bf0f47d25886ecb94477 upstream.

    Some users of rfkill, like NFC and cfg80211, use a dynamic name when
    allocating rfkill, in those cases dev_name(). Therefore, the pointer
    passed to rfkill_alloc() might not be valid forever, I specifically
    found the case that the rfkill name was quite obviously an invalid
    pointer (or at least garbage) when the wiphy had been renamed.

    Fix this by making a copy of the rfkill name in rfkill_alloc().

    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9cec78832326106ebd03bca2235a461aa6fac804
Author: Kirill A. Shutemov <kirill@shutemov.name>
Date:   Mon Nov 30 04:17:31 2015 +0200

    vgaarb: fix signal handling in vga_get()

    commit 9f5bd30818c42c6c36a51f93b4df75a2ea2bd85e upstream.

    There are few defects in vga_get() related to signal hadning:

      - we shouldn't check for pending signals for TASK_UNINTERRUPTIBLE
        case;

      - if we found pending signal we must remove ourself from wait queue
        and change task state back to running;

      - -ERESTARTSYS is more appropriate, I guess.

    Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
    Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 859ac05006374e785820017deba204859bbdf1ad
Author: Joe Thornber <ejt@redhat.com>
Date:   Thu Dec 10 14:37:53 2015 +0000

    dm btree: fix bufio buffer leaks in dm_btree_del() error path

    commit ed8b45a3679eb49069b094c0711b30833f27c734 upstream.

    If dm_btree_del()'s call to push_frame() fails, e.g. due to
    btree_node_validator finding invalid metadata, the dm_btree_del() error
    path must unlock all frames (which have active dm-bufio buffers) that
    were pushed onto the del_stack.

    Otherwise, dm_bufio_client_destroy() will BUG_ON() because dm-bufio
    buffers have leaked, e.g.:
      device-mapper: bufio: leaked buffer 3, hold count 1, list 0

    Signed-off-by: Joe Thornber <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d6eab6f74f15e0f38d875d523f74e6bc55492ba7
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Thu Nov 26 12:00:59 2015 -0500

    sata_sil: disable trim

    commit d98f1cd0a3b70ea91f1dfda3ac36c3b2e1a4d5e2 upstream.

    When I connect an Intel SSD to SATA SIL controller (PCI ID 1095:3114), any
    TRIM command results in I/O errors being reported in the log. There is
    other similar error reported with TRIM and the SIL controller:
    https://bugs.centos.org/view.php?id=5880

    Apparently the controller doesn't support TRIM commands. This patch
    disables TRIM support on the SATA SIL controller.

    ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
    ata7.00: BMDMA2 stat 0x50001
    ata7.00: failed command: DATA SET MANAGEMENT
    ata7.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 512 out
             res 51/04:01:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)
    ata7.00: status: { DRDY ERR }
    ata7.00: error: { ABRT }
    ata7.00: device reported invalid CHS sector 0
    sd 8:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    sd 8:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] [descriptor]
    sd 8:0:0:0: [sdb] tag#0 Add. Sense: Unaligned write command
    sd 8:0:0:0: [sdb] tag#0 CDB: Write same(16) 93 08 00 00 00 00 00 21 95 88 00 20 00 00 00 00
    blk_update_request: I/O error, dev sdb, sector 2200968

    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6bf97b05008739ad7d644758301a427460479537
Author: Sasha Levin <sasha.levin@oracle.com>
Date:   Mon Nov 30 20:34:20 2015 -0500

    sched/core: Remove false-positive warning from wake_up_process()

    commit 119d6f6a3be8b424b200dcee56e74484d5445f7e upstream.

    Because wakeups can (fundamentally) be late, a task might not be in
    the expected state. Therefore testing against a task's state is racy,
    and can yield false positives.

    Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: oleg@redhat.com
    Fixes: 9067ac85d533 ("wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task")
    Link: http://lkml.kernel.org/r/1448933660-23082-1-git-send-email-sasha.levin@oracle.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4af5f2490fb0cab9e29f8b45b81cd69aa4d9babe
Author: Mirza Krak <mirza.krak@hostmobility.com>
Date:   Tue Nov 10 14:59:34 2015 +0100

    can: sja1000: clear interrupts on start

    commit 7cecd9ab80f43972c056dc068338f7bcc407b71c upstream.

    According to SJA1000 data sheet error-warning (EI) interrupt is not
    cleared by setting the controller in to reset-mode.

    Then if we have the following case:
    - system is suspended (echo mem > /sys/power/state) and SJA1000 is left
      in operating state
    - A bus error condition occurs which activates EI interrupt, system is
      still suspended which means EI interrupt will be not be handled nor
      cleared.

    If the above two events occur, on resume there is no way to return the
    SJA1000 to operating state, except to cycle power to it.

    By simply reading the IR register on start we will clear any previous
    conditions that could be present.

    Signed-off-by: Mirza Krak <mirza.krak@hostmobility.com>
    Reported-by: Christian Magnusson <Christian.Magnusson@semcon.com>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e2f3d50558b8e5deeaacf4990e478fc844444de5
Author: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Date:   Tue Nov 24 17:13:21 2015 -0500

    RDS: fix race condition when sending a message on unbound socket

    commit 8c7188b23474cca017b3ef354c4a58456f68303a upstream.

    Sasha's found a NULL pointer dereference in the RDS connection code when
    sending a message to an apparently unbound socket.  The problem is caused
    by the code checking if the socket is bound in rds_sendmsg(), which checks
    the rs_bound_addr field without taking a lock on the socket.  This opens a
    race where rs_bound_addr is temporarily set but where the transport is not
    in rds_bind(), leading to a NULL pointer dereference when trying to
    dereference 'trans' in __rds_conn_create().

    Vegard wrote a reproducer for this issue, so kindly ask him to share if
    you're interested.

    I cannot reproduce the NULL pointer dereference using Vegard's reproducer
    with this patch, whereas I could without.

    Complete earlier incomplete fix to CVE-2015-6937:

      74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection")

    Reviewed-by: Vegard Nossum <vegard.nossum@oracle.com>
    Reviewed-by: Sasha Levin <sasha.levin@oracle.com>
    Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
    Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1467bec9a74c7369fbf38c9fbd51f1f61a3f14c7
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Nov 17 14:25:21 2015 +0100

    mac80211: mesh: fix call_rcu() usage

    commit c2e703a55245bfff3db53b1f7cbe59f1ee8a4339 upstream.

    When using call_rcu(), the called function may be delayed quite
    significantly, and without a matching rcu_barrier() there's no
    way to be sure it has finished.
    Therefore, global state that could be gone/freed/reused should
    never be touched in the callback.

    Fix this in mesh by moving the atomic_dec() into the caller;
    that's not really a problem since we already unlinked the path
    and it will be destroyed anyway.

    This fixes a crash Jouni observed when running certain tests in
    a certain order, in which the mesh interface was torn down, the
    memory reused for a function pointer (work struct) and running
    that then crashed since the pointer had been decremented by 1,
    resulting in an invalid instruction byte stream.

    Fixes: eb2b9311fd00 ("mac80211: mesh path table implementation")
    Reported-by: Jouni Malinen <j@w1.fi>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 963e16256e30f627f5c105814a8d9658f2107b7e
Author: Suman Anna <s-anna@ti.com>
Date:   Wed Sep 16 19:29:17 2015 -0500

    virtio: fix memory leak of virtio ida cache layers

    commit c13f99b7e945dad5273a8b7ee230f4d1f22d3354 upstream.

    The virtio core uses a static ida named virtio_index_ida for
    assigning index numbers to virtio devices during registration.
    The ida core may allocate some internal idr cache layers and
    an ida bitmap upon any ida allocation, and all these layers are
    truely freed only upon the ida destruction. The virtio_index_ida
    is not destroyed at present, leading to a memory leak when using
    the virtio core as a module and atleast one virtio device is
    registered and unregistered.

    Fix this by invoking ida_destroy() in the virtio core module
    exit.

    Signed-off-by: Suman Anna <s-anna@ti.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6039f028a9bbf7cb34ecfac31d5a9df68453221d
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Mon Nov 23 10:35:36 2015 -0500

    ring-buffer: Update read stamp with first real commit on page

    commit b81f472a208d3e2b4392faa6d17037a89442f4ce upstream.

    Do not update the read stamp after swapping out the reader page from the
    write buffer. If the reader page is swapped out of the buffer before an
    event is written to it, then the read_stamp may get an out of date
    timestamp, as the page timestamp is updated on the first commit to that
    page.

    rb_get_reader_page() only returns a page if it has an event on it, otherwise
    it will return NULL. At that point, check if the page being returned has
    events and has not been read yet. Then at that point update the read_stamp
    to match the time stamp of the reader page.

    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b63a96fada140801597b62a2a6a6818a96ae39e9
Author: Jan Kara <jack@suse.cz>
Date:   Mon Nov 23 13:09:51 2015 +0100

    vfs: Avoid softlockups with sendfile(2)

    commit c2489e07c0a71a56fb2c84bc0ee66cddfca7d068 upstream.

    The following test program from Dmitry can cause softlockups or RCU
    stalls as it copies 1GB from tmpfs into eventfd and we don't have any
    scheduling point at that path in sendfile(2) implementation:

            int r1 = eventfd(0, 0);
            int r2 = memfd_create("", 0);
            unsigned long n = 1<<30;
            fallocate(r2, 0, 0, n);
            sendfile(r1, r2, 0, n);

    Add cond_resched() into __splice_from_pipe() to fix the problem.

    CC: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 677eea664a18f46ec7186d1b0a1595f8ac2cb959
Author: Vineet Gupta <vgupta@synopsys.com>
Date:   Mon Nov 23 19:32:51 2015 +0530

    ARC: dw2 unwind: Remove falllback linear search thru FDE entries

    commit 2e22502c080f27afeab5e6f11e618fb7bc7aea53 upstream.

    Fixes STAR 9000953410: "perf callgraph profiling causing RCU stalls"

    | perf record -g -c 15000 -e cycles /sbin/hackbench
    |
    | INFO: rcu_preempt self-detected stall on CPU
    | 1: (1 GPs behind) idle=609/140000000000002/0 softirq=2914/2915 fqs=603
    | Task dump for CPU 1:

    in-kernel dwarf unwinder has a fast binary lookup and a fallback linear
    search (which iterates thru each of ~11K entries) thus takes 2 orders of
    magnitude longer (~3 million cycles vs. 2000). Routines written in hand
    assembler lack dwarf info (as we don't support assembler CFI pseudo-ops
    yet) fail the unwinder binary lookup, hit linear search, failing
    nevertheless in the end.

    However the linear search is pointless as binary lookup tables are created
    from it in first place. It is impossible to have binary lookup fail while
    succeed the linear search. It is pure waste of cycles thus removed by
    this patch.

    This manifested as RCU stalls / NMI watchdog splat when running
    hackbench under perf with callgraph profiling. The triggering condition
    was perf counter overflowing in routine lacking dwarf info (like memset)
    leading to patheic 3 million cycle unwinder slow path and by the time it
    returned new interrupts were already pending (Timer, IPI) and taken
    rightaway. The original memset didn't make forward progress, system kept
    accruing more interrupts and more unwinder delayes in a vicious feedback
    loop, ultimately triggering the NMI diagnostic.

    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2a27f61bd411e564eb4651c18d225f6e9e1de534
Author: Kees Cook <keescook@chromium.org>
Date:   Thu Nov 19 17:18:54 2015 -0800

    ma…
cyclon1978 pushed a commit to cyclon1978/android_kernel_elephone_p8000 that referenced this issue Jul 14, 2017
commit ca1199fccf14540e86f6da955333e31d6fec5f3e
Author: Willy Tarreau <w@1wt.eu>
Date:   Sun Jun 12 11:41:54 2016 +0200

    Linux 3.10.102

commit fd1a096205147366e2cc9dc0a816e24f56946a83
Author: Chanwoo Choi <cw00.choi@samsung.com>
Date:   Thu Apr 21 18:58:31 2016 +0900

    serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()

    commit b8995f527aac143e83d3900ff39357651ea4e0f6 upstream.

    This patch fixes the broken serial log when changing the clock source
    of uart device. Before disabling the original clock source, this patch
    enables the new clock source to protect the clock off state for a split second.

    Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
    Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 0fff1b1ff8c9c07caa1762b6c0b76b1dbbe20223
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Tue May 3 17:05:54 2016 +0200

    tty: vt, return error when con_startup fails

    commit 6798df4c5fe0a7e6d2065cf79649a794e5ba7114 upstream.

    When csw->con_startup() fails in do_register_con_driver, we return no
    error (i.e. 0). This was changed back in 2006 by commit 3e795de763.
    Before that we used to return -ENODEV.

    So fix the return value to be -ENODEV in that case again.

    Fixes: 3e795de763 ("VT binding: Add binding/unbinding support for the VT console")
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Reported-by: "Dan Carpenter" <dan.carpenter@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 49849df77f10d800990bb8cb3e4f974745967520
Author: Schemmel Hans-Christoph <Hans-Christoph.Schemmel@gemalto.com>
Date:   Fri Apr 29 08:51:06 2016 +0000

    USB: serial: option: add support for Cinterion PH8 and AHxx

    commit 444f94e9e625f6ec6bbe2cb232a6451c637f35a3 upstream.

    Added support for Gemalto's Cinterion PH8 and AHxx products
    with 2 RmNet Interfaces and products with 1 RmNet + 1 USB Audio interface.

    In addition some minor renaming and formatting.

    Signed-off-by: Hans-Christoph Schemmel <hans-christoph.schemmel@gemalto.com>
    [johan: sort current entries and trim trailing whitespace ]
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 9d08a9916056a23f2c4818222cf90e800d3f77ec
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:07:57 2016 +0200

    USB: serial: io_edgeport: fix memory leaks in probe error path

    commit c8d62957d450cc1a22ce3242908709fe367ddc8e upstream.

    URBs and buffers allocated in attach for Epic devices would never be
    deallocated in case of a later probe error (e.g. failure to allocate
    minor numbers) as disconnect is then never called.

    Fix by moving deallocation to release and making sure that the
    URBs are first unlinked.

    Fixes: f9c99bb8b3a1 ("USB: usb-serial: replace shutdown with disconnect,
    release")
    Cc: stable <stable@vger.kernel.org>	# v2.6.31
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 1f983d0bebe54898bc35779815a23582ac38c9b7
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:08:02 2016 +0200

    USB: serial: quatech2: fix use-after-free in probe error path

    commit 028c49f5e02a257c94129cd815f7c8485f51d4ef upstream.

    The interface read URB is submitted in attach, but was only unlinked by
    the driver at disconnect.

    In case of a late probe error (e.g. due to failed minor allocation),
    disconnect is never called and we would end up with active URBs for an
    unbound interface. This in turn could lead to deallocated memory being
    dereferenced in the completion callback.

    Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 550d9c436e40dd384b22f2beea93e20c2e069600
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 8 20:07:58 2016 +0200

    USB: serial: keyspan: fix use-after-free in probe error path

    commit 35be1a71d70775e7bd7e45fa6d2897342ff4c9d2 upstream.

    The interface instat and indat URBs were submitted in attach, but never
    unlinked in release before deallocating the corresponding transfer
    buffers.

    In the case of a late probe error (e.g. due to failed minor allocation),
    disconnect would not have been called before release, causing the
    buffers to be freed while the URBs are still in use. We'd also end up
    with active URBs for an unbound interface.

    Fixes: f9c99bb8b3a1 ("USB: usb-serial: replace shutdown with disconnect,
    release")
    Cc: stable <stable@vger.kernel.org>	# v2.6.31
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit c21f25b36d258d04c0332609aaa68d895cfa8796
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Sat Mar 19 11:49:43 2016 +0100

    Bluetooth: vhci: purge unhandled skbs

    commit 13407376b255325fa817798800117a839f3aa055 upstream.

    The write handler allocates skbs and queues them into data->readq.
    Read side should read them, if there is any. If there is none, skbs
    should be dropped by hdev->flush. But this happens only if the device
    is HCI_UP, i.e. hdev->power_on work was triggered already. When it was
    not, skbs stay allocated in the queue when /dev/vhci is closed. So
    purge the queue in ->release.

    Program to reproduce:
    	#include <err.h>
    	#include <fcntl.h>
    	#include <stdio.h>
    	#include <unistd.h>

    	#include <sys/stat.h>
    	#include <sys/types.h>
    	#include <sys/uio.h>

    	int main()
    	{
    		char buf[] = { 0xff, 0 };
    		struct iovec iov = {
    			.iov_base = buf,
    			.iov_len = sizeof(buf),
    		};
    		int fd;

    		while (1) {
    			fd = open("/dev/vhci", O_RDWR);
    			if (fd < 0)
    				err(1, "open");

    			usleep(50);

    			if (writev(fd, &iov, 1) < 0)
    				err(1, "writev");

    			usleep(50);

    			close(fd);
    		}

    		return 0;
    	}

    Result:
    kmemleak: 4609 new suspected memory leaks
    unreferenced object 0xffff88059f4d5440 (size 232):
      comm "vhci", pid 1084, jiffies 4294912542 (age 37569.296s)
      hex dump (first 32 bytes):
        20 f0 23 87 05 88 ff ff 20 f0 23 87 05 88 ff ff   .#..... .#.....
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace:
    ...
        [<ffffffff81ece010>] __alloc_skb+0x0/0x5a0
        [<ffffffffa021886c>] vhci_create_device+0x5c/0x580 [hci_vhci]
        [<ffffffffa0219436>] vhci_write+0x306/0x4c8 [hci_vhci]

    Fixes: 23424c0d31 (Bluetooth: Add support creating virtual AMP controllers)
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e9e0c8aded7f1c1bc5e6c01ee73ec29ec5942f6d
Author: Matt Gumbel <matthew.k.gumbel@intel.com>
Date:   Fri May 20 10:33:46 2016 +0300

    mmc: longer timeout for long read time quirk

    commit 32ecd320db39bcb007679ed42f283740641b81ea upstream.

    008GE0 Toshiba mmc in some Intel Baytrail tablets responds to
    MMC_SEND_EXT_CSD in 450-600ms.

    This patch will...

    () Increase the long read time quirk timeout from 300ms to 600ms. Original
       author of that quirk says 300ms was only a guess and that the number
       may need to be raised in the future.

    () Add this specific MMC to the quirk

    Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e94c917abb4a6a083eda8831e63907d4c836fd53
Author: Adrian Hunter <adrian.hunter@intel.com>
Date:   Thu May 5 08:12:28 2016 +0300

    mmc: mmc: Fix partition switch timeout for some eMMCs

    commit 1c447116d017a98c90f8f71c8c5a611e0aa42178 upstream.

    Some eMMCs set the partition switch timeout too low.

    Now typically eMMCs are considered a critical component (e.g. because
    they store the root file system) and consequently are expected to be
    reliable.  Thus we can neglect the use case where eMMCs can't switch
    reliably and we might want a lower timeout to facilitate speedy
    recovery.

    Although we could employ a quirk for the cards that are affected (if
    we could identify them all), as described above, there is little
    benefit to having a low timeout, so instead simply set a minimum
    timeout.

    The minimum is set to 300ms somewhat arbitrarily - the examples that
    have been seen had a timeout of 10ms but were sometimes taking 60-70ms.

    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 0cf266167e9f1e39bb411a49f1163f488f5a75e8
Author: Roger Quadros <rogerq@ti.com>
Date:   Mon May 9 11:28:37 2016 +0300

    mfd: omap-usb-tll: Fix scheduling while atomic BUG

    commit b49b927f16acee626c56a1af4ab4cb062f75b5df upstream.

    We shouldn't be calling clk_prepare_enable()/clk_prepare_disable()
    in an atomic context.

    Fixes the following issue:

    [    5.830970] ehci-omap: OMAP-EHCI Host Controller driver
    [    5.830974] driver_register 'ehci-omap'
    [    5.895849] driver_register 'wl1271_sdio'
    [    5.896870] BUG: scheduling while atomic: udevd/994/0x00000002
    [    5.896876] 4 locks held by udevd/994:
    [    5.896904]  #0:  (&dev->mutex){......}, at: [<c049597c>] __driver_attach+0x60/0xac
    [    5.896923]  #1:  (&dev->mutex){......}, at: [<c049598c>] __driver_attach+0x70/0xac
    [    5.896946]  #2:  (tll_lock){+.+...}, at: [<c04c2630>] omap_tll_enable+0x2c/0xd0
    [    5.896966]  #3:  (prepare_lock){+.+...}, at: [<c05ce9c8>] clk_prepare_lock+0x48/0xe0
    [    5.897042] Modules linked in: wlcore_sdio(+) ehci_omap(+) dwc3_omap snd_soc_ts3a225e leds_is31fl319x bq27xxx_battery_i2c tsc2007 bq27xxx_battery bq2429x_charger ina2xx tca8418_keypad as5013 leds_tca6507 twl6040_vibra gpio_twl6040 bmp085_i2c(+) palmas_gpadc usb3503 palmas_pwrbutton bmg160_i2c(+) bmp085 bma150(+) bmg160_core bmp280 input_polldev snd_soc_omap_mcbsp snd_soc_omap_mcpdm snd_soc_omap snd_pcm_dmaengine
    [    5.897048] Preemption disabled at:[<  (null)>]   (null)
    [    5.897051]
    [    5.897059] CPU: 0 PID: 994 Comm: udevd Not tainted 4.6.0-rc5-letux+ #233
    [    5.897062] Hardware name: Generic OMAP5 (Flattened Device Tree)
    [    5.897076] [<c010e714>] (unwind_backtrace) from [<c010af34>] (show_stack+0x10/0x14)
    [    5.897087] [<c010af34>] (show_stack) from [<c040aa7c>] (dump_stack+0x88/0xc0)
    [    5.897099] [<c040aa7c>] (dump_stack) from [<c020c558>] (__schedule_bug+0xac/0xd0)
    [    5.897111] [<c020c558>] (__schedule_bug) from [<c06f3d44>] (__schedule+0x88/0x7e4)
    [    5.897120] [<c06f3d44>] (__schedule) from [<c06f46d8>] (schedule+0x9c/0xc0)
    [    5.897129] [<c06f46d8>] (schedule) from [<c06f4904>] (schedule_preempt_disabled+0x14/0x20)
    [    5.897140] [<c06f4904>] (schedule_preempt_disabled) from [<c06f64e4>] (mutex_lock_nested+0x258/0x43c)
    [    5.897150] [<c06f64e4>] (mutex_lock_nested) from [<c05ce9c8>] (clk_prepare_lock+0x48/0xe0)
    [    5.897160] [<c05ce9c8>] (clk_prepare_lock) from [<c05d0e7c>] (clk_prepare+0x10/0x28)
    [    5.897169] [<c05d0e7c>] (clk_prepare) from [<c04c2668>] (omap_tll_enable+0x64/0xd0)
    [    5.897180] [<c04c2668>] (omap_tll_enable) from [<c04c1728>] (usbhs_runtime_resume+0x18/0x17c)
    [    5.897192] [<c04c1728>] (usbhs_runtime_resume) from [<c049d404>] (pm_generic_runtime_resume+0x2c/0x40)
    [    5.897202] [<c049d404>] (pm_generic_runtime_resume) from [<c049f180>] (__rpm_callback+0x38/0x68)
    [    5.897210] [<c049f180>] (__rpm_callback) from [<c049f220>] (rpm_callback+0x70/0x88)
    [    5.897218] [<c049f220>] (rpm_callback) from [<c04a0a00>] (rpm_resume+0x4ec/0x7ec)
    [    5.897227] [<c04a0a00>] (rpm_resume) from [<c04a0f48>] (__pm_runtime_resume+0x4c/0x64)
    [    5.897236] [<c04a0f48>] (__pm_runtime_resume) from [<c04958dc>] (driver_probe_device+0x30/0x70)
    [    5.897246] [<c04958dc>] (driver_probe_device) from [<c04959a4>] (__driver_attach+0x88/0xac)
    [    5.897256] [<c04959a4>] (__driver_attach) from [<c04940f8>] (bus_for_each_dev+0x50/0x84)
    [    5.897267] [<c04940f8>] (bus_for_each_dev) from [<c0494e40>] (bus_add_driver+0xcc/0x1e4)
    [    5.897276] [<c0494e40>] (bus_add_driver) from [<c0496914>] (driver_register+0xac/0xf4)
    [    5.897286] [<c0496914>] (driver_register) from [<c01018e0>] (do_one_initcall+0x100/0x1b8)
    [    5.897296] [<c01018e0>] (do_one_initcall) from [<c01c7a54>] (do_init_module+0x58/0x1c0)
    [    5.897304] [<c01c7a54>] (do_init_module) from [<c01c8a3c>] (SyS_finit_module+0x88/0x90)
    [    5.897313] [<c01c8a3c>] (SyS_finit_module) from [<c0107120>] (ret_fast_syscall+0x0/0x1c)
    [    5.912697] ------------[ cut here ]------------
    [    5.912711] WARNING: CPU: 0 PID: 994 at kernel/sched/core.c:2996 _raw_spin_unlock+0x28/0x58
    [    5.912717] DEBUG_LOCKS_WARN_ON(val > preempt_count())

    Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
    Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
    Signed-off-by: Roger Quadros <rogerq@ti.com>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit acd291378f60343d146b0157b64fbca97182c4ea
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Fri May 13 09:34:12 2016 -0400

    ring-buffer: Prevent overflow of size in ring_buffer_resize()

    commit 59643d1535eb220668692a5359de22545af579f6 upstream.

    If the size passed to ring_buffer_resize() is greater than MAX_LONG - BUF_PAGE_SIZE
    then the DIV_ROUND_UP() will return zero.

    Here's the details:

      # echo 18014398509481980 > /sys/kernel/debug/tracing/buffer_size_kb

    tracing_entries_write() processes this and converts kb to bytes.

     18014398509481980 << 10 = 18446744073709547520

    and this is passed to ring_buffer_resize() as unsigned long size.

     size = DIV_ROUND_UP(size, BUF_PAGE_SIZE);

    Where DIV_ROUND_UP(a, b) is (a + b - 1)/b

    BUF_PAGE_SIZE is 4080 and here

     18446744073709547520 + 4080 - 1 = 18446744073709551599

    where 18446744073709551599 is still smaller than 2^64

     2^64 - 18446744073709551599 = 17

    But now 18446744073709551599 / 4080 = 4521260802379792

    and size = size * 4080 = 18446744073709551360

    This is checked to make sure its still greater than 2 * 4080,
    which it is.

    Then we convert to the number of buffer pages needed.

     nr_page = DIV_ROUND_UP(size, BUF_PAGE_SIZE)

    but this time size is 18446744073709551360 and

     2^64 - (18446744073709551360 + 4080 - 1) = -3823

    Thus it overflows and the resulting number is less than 4080, which makes

      3823 / 4080 = 0

    an nr_pages is set to this. As we already checked against the minimum that
    nr_pages may be, this causes the logic to fail as well, and we crash the
    kernel.

    There's no reason to have the two DIV_ROUND_UP() (that's just result of
    historical code changes), clean up the code and fix this bug.

    Cc: stable@vger.kernel.org # 3.5+
    Fixes: 83f40318dab00 ("ring-buffer: Make removal of ring buffer pages atomic")
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 1b5493498239d8c7087b6c337285b94eb22e98e4
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Thu May 12 11:01:24 2016 -0400

    ring-buffer: Use long for nr_pages to avoid overflow failures

    commit 9b94a8fba501f38368aef6ac1b30e7335252a220 upstream.

    The size variable to change the ring buffer in ftrace is a long. The
    nr_pages used to update the ring buffer based on the size is int. On 64 bit
    machines this can cause an overflow problem.

    For example, the following will cause the ring buffer to crash:

     # cd /sys/kernel/debug/tracing
     # echo 10 > buffer_size_kb
     # echo 8556384240 > buffer_size_kb

    Then you get the warning of:

     WARNING: CPU: 1 PID: 318 at kernel/trace/ring_buffer.c:1527 rb_update_pages+0x22f/0x260

    Which is:

      RB_WARN_ON(cpu_buffer, nr_removed);

    Note each ring buffer page holds 4080 bytes.

    This is because:

     1) 10 causes the ring buffer to have 3 pages.
        (10kb requires 3 * 4080 pages to hold)

     2) (2^31 / 2^10  + 1) * 4080 = 8556384240
        The value written into buffer_size_kb is shifted by 10 and then passed
        to ring_buffer_resize(). 8556384240 * 2^10 = 8761737461760

     3) The size passed to ring_buffer_resize() is then divided by BUF_PAGE_SIZE
        which is 4080. 8761737461760 / 4080 = 2147484672

     4) nr_pages is subtracted from the current nr_pages (3) and we get:
        2147484669. This value is saved in a signed integer nr_pages_to_update

     5) 2147484669 is greater than 2^31 but smaller than 2^32, a signed int
        turns into the value of -2147482627

     6) As the value is a negative number, in update_pages_handler() it is
        negated and passed to rb_remove_pages() and 2147482627 pages will
        be removed, which is much larger than 3 and it causes the warning
        because not all the pages asked to be removed were removed.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=118001

    Fixes: 7a8e76a3829f1 ("tracing: unified trace buffer")
    Reported-by: Hao Qin <QEver.cn@gmail.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 076765ee6acabf01d19bad64064e920998ca33ba
Author: Stefan Metzmacher <metze@samba.org>
Date:   Tue May 3 10:52:30 2016 +0200

    fs/cifs: correctly to anonymous authentication via NTLMSSP

    commit cfda35d98298131bf38fbad3ce4cd5ecb3cf18db upstream.

    See [MS-NLMP] 3.2.5.1.2 Server Receives an AUTHENTICATE_MESSAGE from the Client:

       ...
       Set NullSession to FALSE
       If (AUTHENTICATE_MESSAGE.UserNameLen == 0 AND
          AUTHENTICATE_MESSAGE.NtChallengeResponse.Length == 0 AND
          (AUTHENTICATE_MESSAGE.LmChallengeResponse == Z(1)
           OR
           AUTHENTICATE_MESSAGE.LmChallengeResponse.Length == 0))
           -- Special case: client requested anonymous authentication
           Set NullSession to TRUE
       ...

    Only server which map unknown users to guest will allow
    access using a non-null NTChallengeResponse.

    For Samba it's the "map to guest = bad user" option.

    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11913

    CC: Stable <stable@vger.kernel.org>
    Signed-off-by: Stefan Metzmacher <metze@samba.org>
    Signed-off-by: Steve French <smfrench@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ee78aa28de7252c93cb35b62517fc71502891b33
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Sun May 8 12:10:14 2016 -0400

    net: fix a kernel infoleak in x25 module

    commit 79e48650320e6fba48369fccf13fd045315b19b8 upstream.

    Stack object "dte_facilities" is allocated in x25_rx_call_request(),
    which is supposed to be initialized in x25_negotiate_facilities.
    However, 5 fields (8 bytes in total) are not initialized. This
    object is then copied to userland via copy_to_user, thus infoleak
    occurs.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 2b3e8cb14e7524f2883326a2221c6728ec5ef96e
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date:   Wed May 4 16:18:45 2016 +0200

    net: bridge: fix old ioctl unlocked net device walk

    commit 31ca0458a61a502adb7ed192bf9716c6d05791a5 upstream.

    get_bridge_ifindices() is used from the old "deviceless" bridge ioctl
    calls which aren't called with rtnl held. The comment above says that it is
    called with rtnl but that is not really the case.
    Here's a sample output from a test ASSERT_RTNL() which I put in
    get_bridge_ifindices and executed "brctl show":
    [  957.422726] RTNL: assertion failed at net/bridge//br_ioctl.c (30)
    [  957.422925] CPU: 0 PID: 1862 Comm: brctl Tainted: G        W  O
    4.6.0-rc4+ #157
    [  957.423009] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
    BIOS 1.8.1-20150318_183358- 04/01/2014
    [  957.423009]  0000000000000000 ffff880058adfdf0 ffffffff8138dec5
    0000000000000400
    [  957.423009]  ffffffff81ce8380 ffff880058adfe58 ffffffffa05ead32
    0000000000000001
    [  957.423009]  00007ffec1a444b0 0000000000000400 ffff880053c19130
    0000000000008940
    [  957.423009] Call Trace:
    [  957.423009]  [<ffffffff8138dec5>] dump_stack+0x85/0xc0
    [  957.423009]  [<ffffffffa05ead32>]
    br_ioctl_deviceless_stub+0x212/0x2e0 [bridge]
    [  957.423009]  [<ffffffff81515beb>] sock_ioctl+0x22b/0x290
    [  957.423009]  [<ffffffff8126ba75>] do_vfs_ioctl+0x95/0x700
    [  957.423009]  [<ffffffff8126c159>] SyS_ioctl+0x79/0x90
    [  957.423009]  [<ffffffff8163a4c0>] entry_SYSCALL_64_fastpath+0x23/0xc1

    Since it only reads bridge ifindices, we can use rcu to safely walk the net
    device list. Also remove the wrong rtnl comment above.

    Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ced4eef10a732bd33ee9289771fada4a07bf508d
Author: Ian Campbell <ian.campbell@docker.com>
Date:   Wed May 4 14:21:53 2016 +0100

    VSOCK: do not disconnect socket when peer has shutdown SEND only

    commit dedc58e067d8c379a15a8a183c5db318201295bb upstream.

    The peer may be expecting a reply having sent a request and then done a
    shutdown(SHUT_WR), so tearing down the whole socket at this point seems
    wrong and breaks for me with a client which does a SHUT_WR.

    Looking at other socket family's stream_recvmsg callbacks doing a shutdown
    here does not seem to be the norm and removing it does not seem to have
    had any adverse effects that I can see.

    I'm using Stefan's RFC virtio transport patches, I'm unsure of the impact
    on the vmci transport.

    Signed-off-by: Ian Campbell <ian.campbell@docker.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
    Cc: Andy King <acking@vmware.com>
    Cc: Dmitry Torokhov <dtor@vmware.com>
    Cc: Jorgen Hansen <jhansen@vmware.com>
    Cc: Adit Ranadive <aditr@vmware.com>
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f9d691421747048d814785136d187595483bab4a
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Tue May 3 16:46:24 2016 -0400

    net: fix infoleak in rtnetlink

    commit 5f8e44741f9f216e33736ea4ec65ca9ac03036e6 upstream.

    The stack object �map� has a total size of 32 bytes. Its last 4
    bytes are padding generated by compiler. These padding bytes are
    not initialized and sent out via �nla_put�.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 44efbfab13ad589048ebe2a914c58cdcfc9d84fb
Author: Kangjie Lu <kangjielu@gmail.com>
Date:   Tue May 3 16:35:05 2016 -0400

    net: fix infoleak in llc

    commit b8670c09f37bdf2847cc44f36511a53afc6161fd upstream.

    The stack object �info� has a total size of 12 bytes. Its last byte
    is padding which is not initialized and leaked via �put_cmsg�.

    Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 58da198d99004f57a8f782869f0618d6d8049970
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Wed Apr 20 23:23:08 2016 +0100

    atl2: Disable unimplemented scatter/gather feature

    commit f43bfaeddc79effbf3d0fcb53ca477cca66f3db8 upstream.

    atl2 includes NETIF_F_SG in hw_features even though it has no support
    for non-linear skbs.  This bug was originally harmless since the
    driver does not claim to implement checksum offload and that used to
    be a requirement for SG.

    Now that SG and checksum offload are independent features, if you
    explicitly enable SG *and* use one of the rare protocols that can use
    SG without checkusm offload, this potentially leaks sensitive
    information (before you notice that it just isn't working).  Therefore
    this obscure bug has been designated CVE-2016-2117.

    Reported-by: Justin Yackoski <jyackoski@crypto-nite.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Fixes: ec5f06156423 ("net: Kill link between CSUM and SG features.")
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 13b89711a2ddc389efb2a220e2f34ab8ff47021b
Author: Mathias Krause <minipli@googlemail.com>
Date:   Sun Apr 10 12:52:28 2016 +0200

    packet: fix heap info leak in PACKET_DIAG_MCLIST sock_diag interface

    commit 309cf37fe2a781279b7675d4bb7173198e532867 upstream.

    Because we miss to wipe the remainder of i->addr[] in packet_mc_add(),
    pdiag_put_mclist() leaks uninitialized heap bytes via the
    PACKET_DIAG_MCLIST netlink attribute.

    Fix this by explicitly memset(0)ing the remaining bytes in i->addr[].

    Fixes: eea68e2f1a00 ("packet: Report socket mclist info via diag module")
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Cc: Pavel Emelyanov <xemul@parallels.com>
    Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 3b848d3d6116d5db4a135e94d62f430058c09670
Author: Chris Friesen <chris.friesen@windriver.com>
Date:   Fri Apr 8 15:21:30 2016 -0600

    route: do not cache fib route info on local routes with oif

    commit d6d5e999e5df67f8ec20b6be45e2229455ee3699 upstream.

    For local routes that require a particular output interface we do not want
    to cache the result.  Caching the result causes incorrect behaviour when
    there are multiple source addresses on the interface.  The end result
    being that if the intended recipient is waiting on that interface for the
    packet he won't receive it because it will be delivered on the loopback
    interface and the IP_PKTINFO ipi_ifindex will be set to the loopback
    interface as well.

    This can be tested by running a program such as "dhcp_release" which
    attempts to inject a packet on a particular interface so that it is
    received by another program on the same board.  The receiving process
    should see an IP_PKTINFO ipi_ifndex value of the source interface
    (e.g., eth1) instead of the loopback interface (e.g., lo).  The packet
    will still appear on the loopback interface in tcpdump but the important
    aspect is that the CMSG info is correct.

    Sample dhcp_release command line:

       dhcp_release eth1 192.168.204.222 02:11:33:22:44:66

    Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
    Signed off-by: Chris Friesen <chris.friesen@windriver.com>
    Reviewed-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 49fabfb2ba27a6fd9322b7b89ba147d57dc18ca0
Author: David S. Miller <davem@davemloft.net>
Date:   Sun Apr 10 23:01:30 2016 -0400

    decnet: Do not build routes to devices without decnet private data.

    commit a36a0d4008488fa545c74445d69eaf56377d5d4e upstream.

    In particular, make sure we check for decnet private presence
    for loopback devices.

    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d248f68a930661cf0ba06faa7867d1ab77a9abe3
Author: Tony Lindgren <tony@atomide.com>
Date:   Thu May 28 07:22:08 2015 -0700

    ARM: OMAP3: Fix booting with thumb2 kernel

    commit d8a50941c91a68da202aaa96a3dacd471ea9c693 upstream.

    We get a NULL pointer dereference on omap3 for thumb2 compiled kernels:

    Internal error: Oops: 80000005 [#1] SMP THUMB2
    ...
    [<c046497b>] (_raw_spin_unlock_irqrestore) from [<c0024375>]
    (omap3_enter_idle_bm+0xc5/0x178)
    [<c0024375>] (omap3_enter_idle_bm) from [<c0374e63>]
    (cpuidle_enter_state+0x77/0x27c)
    [<c0374e63>] (cpuidle_enter_state) from [<c00627f1>]
    (cpu_startup_entry+0x155/0x23c)
    [<c00627f1>] (cpu_startup_entry) from [<c06b9a47>]
    (start_kernel+0x32f/0x338)
    [<c06b9a47>] (start_kernel) from [<8000807f>] (0x8000807f)

    The power management related assembly on omaps needs to interact with
    ARM mode bootrom code, so we need to keep most of the related assembly
    in ARM mode.

    Turns out this error is because of missing ENDPROC for assembly code
    as suggested by Stephen Boyd <sboyd@codeaurora.org>. Let's fix the
    problem by adding ENDPROC in two places to sleep34xx.S.

    Let's also remove the now duplicate custom code for mode switching.
    This has been unnecessary since commit 6ebbf2ce437b ("ARM: convert
    all "mov.* pc, reg" to "bx reg" for ARMv6+").

    And let's also remove the comments about local variables, they are
    now just confusing after the ENDPROC.

    The reason why ENDPROC makes a difference is it sets .type and then
    the compiler knows what to do with the thumb bit as explained at:

    https://wiki.ubuntu.com/ARM/Thumb2PortingHowto

    Reported-by: Kevin Hilman <khilman@kernel.org>
    Tested-by: Kevin Hilman <khilman@linaro.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 3f557d256fac2c83ae330c21524ebabb4657a392
Author: Andi Kleen <ak@linux.intel.com>
Date:   Sat Feb 8 08:52:00 2014 +0100

    asmlinkage, pnp: Make variables used from assembler code visible

    commit a99aa42d0253f033cbb85096d3f2bd82201321e6 upstream.

    Mark variables referenced from assembler files visible.

    This fixes compile problems with LTO.

    Cc: Jaroslav Kysela <perex@perex.cz>
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Link: http://lkml.kernel.org/r/1391845930-28580-4-git-send-email-ak@linux.intel.com
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 6985c64f126ff488cbe399e81fb23ee0477bf154
Author: Marek Szyprowski <m.szyprowski@samsung.com>
Date:   Mon May 9 09:31:47 2016 -0700

    Input: max8997-haptic - fix NULL pointer dereference

    commit 6ae645d5fa385f3787bf1723639cd907fe5865e7 upstream.

    NULL pointer derefence happens when booting with DTB because the
    platform data for haptic device is not set in supplied data from parent
    MFD device.

    The MFD device creates only platform data (from Device Tree) for itself,
    not for haptic child.

    Unable to handle kernel NULL pointer dereference at virtual address 0000009c
    pgd = c0004000
    	[0000009c] *pgd=00000000
    	Internal error: Oops: 5 [#1] PREEMPT SMP ARM
    	(max8997_haptic_probe) from [<c03f9cec>] (platform_drv_probe+0x4c/0xb0)
    	(platform_drv_probe) from [<c03f8440>] (driver_probe_device+0x214/0x2c0)
    	(driver_probe_device) from [<c03f8598>] (__driver_attach+0xac/0xb0)
    	(__driver_attach) from [<c03f67ac>] (bus_for_each_dev+0x68/0x9c)
    	(bus_for_each_dev) from [<c03f7a38>] (bus_add_driver+0x1a0/0x218)
    	(bus_add_driver) from [<c03f8db0>] (driver_register+0x78/0xf8)
    	(driver_register) from [<c0101774>] (do_one_initcall+0x90/0x1d8)
    	(do_one_initcall) from [<c0a00dbc>] (kernel_init_freeable+0x15c/0x1fc)
    	(kernel_init_freeable) from [<c06bb5b4>] (kernel_init+0x8/0x114)
    	(kernel_init) from [<c0107938>] (ret_from_fork+0x14/0x3c)

    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Cc: <stable@vger.kernel.org>
    Fixes: 104594b01ce7 ("Input: add driver support for MAX8997-haptic")
    [k.kozlowski: Write commit message, add CC-stable]
    Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8613b37684fbca1f642b6e636b0dd8923fa0bfd9
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Thu May 5 16:25:35 2016 -0400

    get_rock_ridge_filename(): handle malformed NM entries

    commit 99d825822eade8d827a1817357cbf3f889a552d6 upstream.

    Payloads of NM entries are not supposed to contain NUL.  When we run
    into such, only the part prior to the first NUL goes into the
    concatenation (i.e. the directory entry name being encoded by a bunch
    of NM entries).  We do stop when the amount collected so far + the
    claimed amount in the current NM entry exceed 254.  So far, so good,
    but what we return as the total length is the sum of *claimed*
    sizes, not the actual amount collected.  And that can grow pretty
    large - not unlimited, since you'd need to put CE entries in
    between to be able to get more than the maximum that could be
    contained in one isofs directory entry / continuation chunk and
    we are stop once we'd encountered 32 CEs, but you can get about 8Kb
    easily.  And that's what will be passed to readdir callback as the
    name length.  8Kb __copy_to_user() from a buffer allocated by
    __get_free_page()

    Cc: stable@vger.kernel.org # 0.98pl6+ (yes, really)
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f220ec58d1e4f49cb6c761a859241c057844cdf2
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Wed May 4 17:52:56 2016 +0800

    crypto: hash - Fix page length clamping in hash walk

    commit 13f4bb78cf6a312bbdec367ba3da044b09bf0e29 upstream.

    The crypto hash walk code is broken when supplied with an offset
    greater than or equal to PAGE_SIZE.  This patch fixes it by adjusting
    walk->pg and walk->offset when this happens.

    Cc: <stable@vger.kernel.org>
    Reported-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 73dd3ac10bf81213a89538654aa005be6432e52d
Author: Anton Blanchard <anton@samba.org>
Date:   Fri Apr 15 12:06:13 2016 +1000

    powerpc: scan_features() updates incorrect bits for REAL_LE

    commit 6997e57d693b07289694239e52a10d2f02c3a46f upstream.

    The REAL_LE feature entry in the ibm_pa_feature struct is missing an MMU
    feature value, meaning all the remaining elements initialise the wrong
    values.

    This means instead of checking for byte 5, bit 0, we check for byte 0,
    bit 0, and then we incorrectly set the CPU feature bit as well as MMU
    feature bit 1 and CPU user feature bits 0 and 2 (5).

    Checking byte 0 bit 0 (IBM numbering), means we're looking at the
    "Memory Management Unit (MMU)" feature - ie. does the CPU have an MMU.
    In practice that bit is set on all platforms which have the property.

    This means we set CPU_FTR_REAL_LE always. In practice that seems not to
    matter because all the modern cpus which have this property also
    implement REAL_LE, and we've never needed to disable it.

    We're also incorrectly setting MMU feature bit 1, which is:

      #define MMU_FTR_TYPE_8xx		0x00000002

    Luckily the only place that looks for MMU_FTR_TYPE_8xx is in Book3E
    code, which can't run on the same cpus as scan_features(). So this also
    doesn't matter in practice.

    Finally in the CPU user feature mask, we're setting bits 0 and 2. Bit 2
    is not currently used, and bit 0 is:

      #define PPC_FEATURE_PPC_LE		0x00000001

    Which says the CPU supports the old style "PPC Little Endian" mode.
    Again this should be harmless in practice as no 64-bit CPUs implement
    that mode.

    Fix the code by adding the missing initialisation of the MMU feature.

    Also add a comment marking CPU user feature bit 2 (0x4) as reserved. It
    would be unsafe to start using it as old kernels incorrectly set it.

    Fixes: 44ae3ab3358e ("powerpc: Free up some CPU feature bits by moving out MMU-related features")
    Signed-off-by: Anton Blanchard <anton@samba.org>
    [mpe: Flesh out changelog, add comment reserving 0x4]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d7b49e545800e7ccf5b566d22d9f6572eaa0fbb3
Author: Andrey Gelman <andrey.gelman@compulab.co.il>
Date:   Tue Oct 6 15:43:43 2015 -0700

    Input: ads7846 - correct the value got from SPI

    commit 879f2fea8a5a748bcbf98d2cdce9139c045505d3 upstream.

    According to the touch controller spec, SPI return a 16 bit value, only 12
    bits are valid, they are bit[14-3].

    The value of MISO and MOSI can be configured when SPI is in idle mode.
    Currently this touch driver assumes the SPI bus sets the MOSI and MISO in
    low level when SPI bus is in idle mode. So the bit[15] of the value got
    from SPI bus is always 0. But when SPI bus congfigures the MOSI and MISO in
    high level during the SPI idle mode, the bit[15] of the value get from SPI
    is always 1. If bit[15] is not masked, we may get the wrong value.

    Mask the invalid bit to make sure the correct value gets returned.
    Regardless of the SPI bus idle configuration.

    Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
    Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
    Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5e1a1e7fca96f0cd8129bac3dd605cc7cd86fd50
Author: Jasem Mutlaq <mutlaqja@ikarustech.com>
Date:   Tue Apr 19 10:38:27 2016 +0300

    USB: serial: cp210x: add Straizona Focusers device ids

    commit 613ac23a46e10d4d4339febdd534fafadd68e059 upstream.

    Adding VID:PID for Straizona Focusers to cp210x driver.

    Signed-off-by: Jasem Mutlaq <mutlaqja@ikarustech.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 15e27ea97ae7d9833e55e5937a4ecfa4a5dbf81f
Author: Mike Manning <michael@bsch.com.au>
Date:   Mon Apr 18 12:13:23 2016 +0000

    USB: serial: cp210x: add ID for Link ECU

    commit 1d377f4d690637a0121eac8701f84a0aa1e69a69 upstream.

    The Link ECU is an aftermarket ECU computer for vehicles that provides
    full tuning abilities as well as datalogging and displaying capabilities
    via the USB to Serial adapter built into the device.

    Signed-off-by: Mike Manning <michael@bsch.com.au>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 505a7a684b7071972c565488f6d1f9b8835c0dbd
Author: Prarit Bhargava <prarit@redhat.com>
Date:   Wed May 4 13:48:56 2016 +0800

    ACPICA: Dispatcher: Update thread ID for recursive method calls

    commit 93d68841a23a5779cef6fb9aa0ef32e7c5bd00da upstream.

    ACPICA commit 7a3bd2d962f221809f25ddb826c9e551b916eb25

    Set the mutex owner thread ID.
    Original patch from: Prarit Bhargava <prarit@redhat.com>

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=115121
    Link: https://github.com/acpica/acpica/commit/7a3bd2d9
    Signed-off-by: Prarit Bhargava <prarit@redhat.com>
    Tested-by: Andy Lutomirski <luto@kernel.org> # On a Dell XPS 13 9350
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Cc: All applicable <stable@vger.kernel.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit cd275e9ade6b4954c7954f0c4e7ab2a1f4c3522c
Author: Matt Fleming <matt@codeblueprint.co.uk>
Date:   Tue May 3 20:29:39 2016 +0100

    MAINTAINERS: Remove asterisk from EFI directory names

    commit e8dfe6d8f6762d515fcd4f30577f7bfcf7659887 upstream.

    Mark reported that having asterisks on the end of directory names
    confuses get_maintainer.pl when it encounters subdirectories, and that
    my name does not appear when run on drivers/firmware/efi/libstub.

    Reported-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
    Cc: <stable@vger.kernel.org>
    Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1462303781-8686-2-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e712c5d602274d15e8e23da16ba9a9acfc8fc181
Author: Linus Lüssing <linus.luessing@c0d3.blue>
Date:   Fri Mar 11 14:04:49 2016 +0100

    batman-adv: Fix broadcast/ogm queue limit on a removed interface

    commit c4fdb6cff2aa0ae740c5f19b6f745cbbe786d42f upstream.

    When removing a single interface while a broadcast or ogm packet is
    still pending then we will free the forward packet without releasing the
    queue slots again.

    This patch is supposed to fix this issue.

    Fixes: 6d5808d4ae1b ("batman-adv: Add missing hardif_free_ref in forw_packet_free")
    Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
    [sven@narfation.org: fix conflicts with current version]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Antonio Quartulli <a@unstable.cc>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5210e2409a2350a9cdf1871bddc1b3e94879f017
Author: Mathias Krause <minipli@googlemail.com>
Date:   Thu May 5 16:22:26 2016 -0700

    proc: prevent accessing /proc/<PID>/environ until it's ready

    commit 8148a73c9901a8794a50f950083c00ccf97d43b3 upstream.

    If /proc/<PID>/environ gets read before the envp[] array is fully set up
    in create_{aout,elf,elf_fdpic,flat}_tables(), we might end up trying to
    read more bytes than are actually written, as env_start will already be
    set but env_end will still be zero, making the range calculation
    underflow, allowing to read beyond the end of what has been written.

    Fix this as it is done for /proc/<PID>/cmdline by testing env_end for
    zero.  It is, apparently, intentionally set last in create_*_tables().

    This bug was found by the PaX size_overflow plugin that detected the
    arithmetic underflow of 'this_len = env_end - (env_start + src)' when
    env_end is still zero.

    The expected consequence is that userland trying to access
    /proc/<PID>/environ of a not yet fully set up process may get
    inconsistent data as we're in the middle of copying in the environment
    variables.

    Fixes: https://forums.grsecurity.net/viewtopic.php?f=3&t=4363
    Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=116461
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Cc: Emese Revfy <re.emese@gmail.com>
    Cc: Pax Team <pageexec@freemail.hu>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Mateusz Guzik <mguzik@redhat.com>
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Cc: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: Jarod Wilson <jarod@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 7b640feea9d2e050c381d878db14748cb9005635
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date:   Wed Apr 20 13:34:31 2016 +0000

    ARM: SoCFPGA: Fix secondary CPU startup in thumb2 kernel

    commit 5616f36713ea77f57ae908bf2fef641364403c9f upstream.

    The secondary CPU starts up in ARM mode. When the kernel is compiled in
    thumb2 mode we have to explicitly compile the secondary startup
    trampoline in ARM mode, otherwise the CPU will go to Nirvana.

    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
    Reported-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
    Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
    Signed-off-by: Kevin Hilman <khilman@baylibre.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 834f5956da4a7cd908821ffe585fab49a00acaed
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Mar 14 15:29:44 2016 +0100

    lpfc: fix misleading indentation

    commit aeb6641f8ebdd61939f462a8255b316f9bfab707 upstream.

    gcc-6 complains about the indentation of the lpfc_destroy_vport_work_array()
    call in lpfc_online(), which clearly doesn't look right:

    drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_online':
    drivers/scsi/lpfc/lpfc_init.c:2880:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
       lpfc_destroy_vport_work_array(phba, vports);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/scsi/lpfc/lpfc_init.c:2863:2: note: ...this 'if' clause, but it is not
      if (vports != NULL)
      ^~

    Looking at the patch that introduced this code, it's clear that the
    behavior is correct and the indentation is wrong.

    This fixes the indentation and adds curly braces around the previous
    if() block for clarity, as that is most likely what caused the code
    to be misindented in the first place.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Fixes: 549e55cd2a1b ("[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list")
    Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
    Reviewed-by: Hannes Reinecke <hare@suse.com>
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit d3605b9c39cffb3cd67176083dc014696c29198c
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Wed Feb 24 09:39:11 2016 +0100

    clk: versatile: sp810: support reentrance

    commit ec7957a6aa0aaf981fb8356dc47a2cdd01cde03c upstream.

    Despite care take to allocate clocks state containers the
    SP810 driver actually just supports creating one instance:
    all clocks registered for every instance will end up with the
    exact same name and __clk_init() will fail.

    Rename the timclken<0> .. timclken<n> to sp810_<instance>_<n>
    so every clock on every instance gets a unique name.

    This is necessary for the RealView PBA8 which has two SP810
    blocks: the second block will not register its clocks unless
    every clock on every instance is unique and results in boot
    logs like this:

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 0 at ../drivers/clk/versatile/clk-sp810.c:137
      clk_sp810_of_setup+0x110/0x154()
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted
    4.5.0-rc2-00030-g352718fc39f6-dirty #225
    Hardware name: ARM RealView Machine (Device Tree Support)
    [<c00167f8>] (unwind_backtrace) from [<c0013204>]
                 (show_stack+0x10/0x14)
    [<c0013204>] (show_stack) from [<c01a049c>]
                 (dump_stack+0x84/0x9c)
    [<c01a049c>] (dump_stack) from [<c0024990>]
                 (warn_slowpath_common+0x74/0xb0)
    [<c0024990>] (warn_slowpath_common) from [<c0024a68>]
                 (warn_slowpath_null+0x1c/0x24)
    [<c0024a68>] (warn_slowpath_null) from [<c051eb44>]
                 (clk_sp810_of_setup+0x110/0x154)
    [<c051eb44>] (clk_sp810_of_setup) from [<c051e3a4>]
                 (of_clk_init+0x12c/0x1c8)
    [<c051e3a4>] (of_clk_init) from [<c0504714>]
                 (time_init+0x20/0x2c)
    [<c0504714>] (time_init) from [<c0501b18>]
                 (start_kernel+0x244/0x3c4)
    [<c0501b18>] (start_kernel) from [<7000807c>] (0x7000807c)
    ---[ end trace cb88537fdc8fa200 ]---

    Cc: Michael Turquette <mturquette@baylibre.com>
    Cc: Pawel Moll <pawel.moll@arm.com>
    Fixes: 6e973d2c4385 "clk: vexpress: Add separate SP810 driver"
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit f95bba828ffd675687395eef4e46894a6fd01594
Author: Dan Streetman <dan.streetman@canonical.com>
Date:   Thu Jan 14 13:42:32 2016 -0500

    nbd: ratelimit error msgs after socket close

    commit da6ccaaa79caca4f38b540b651238f87215217a2 upstream.

    Make the "Attempted send on closed socket" error messages generated in
    nbd_request_handler() ratelimited.

    When the nbd socket is shutdown, the nbd_request_handler() function emits
    an error message for every request remaining in its queue.  If the queue
    is large, this will spam a large amount of messages to the log.  There's
    no need for a separate error message for each request, so this patch
    ratelimits it.

    In the specific case this was found, the system was virtual and the error
    messages were logged to the serial port, which overwhelmed it.

    Fixes: 4d48a542b427 ("nbd: fix I/O hang on disconnected nbds")
    Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
    Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 049c18dabc8fa79b5b55cf78d615a93f2ccd97f0
Author: Marco Angaroni <marcoangaroni@gmail.com>
Date:   Sat Mar 5 12:10:02 2016 +0100

    ipvs: correct initial offset of Call-ID header search in SIP persistence engine

    commit 7617a24f83b5d67f4dab1844956be1cebc44aec8 upstream.

    The IPVS SIP persistence engine is not able to parse the SIP header
    "Call-ID" when such header is inserted in the first positions of
    the SIP message.

    When IPVS is configured with "--pe sip" option, like for example:
    ipvsadm -A -u 1.2.3.4:5060 -s rr --pe sip -p 120 -o
    some particular messages (see below for details) do not create entries
    in the connection template table, which can be listed with:
    ipvsadm -Lcn --persistent-conn

    Problematic SIP messages are SIP responses having "Call-ID" header
    positioned just after message first line:
    SIP/2.0 200 OK
    [Call-ID header here]
    [rest of the headers]

    When "Call-ID" header is positioned down (after a few other headers)
    it is correctly recognized.

    This is due to the data offset used in get_callid function call inside
    ip_vs_pe_sip.c file: since dptr already points to the start of the
    SIP message, the value of dataoff should be initially 0.
    Otherwise the header is searched starting from some bytes after the
    first character of the SIP message.

    Fixes: 758ff0338722 ("IPVS: sip persistence engine")
    Signed-off-by: Marco Angaroni <marcoangaroni@gmail.com>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 5d814ad8d35e5e23e0c27fb0f0b80c1044ecefad
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Thu Mar 31 09:38:51 2016 +0200

    compiler-gcc: disable -ftracer for __noclone functions

    commit 95272c29378ee7dc15f43fa2758cb28a5913a06d upstream.

    -ftracer can duplicate asm blocks causing compilation to fail in
    noclone functions.  For example, KVM declares a global variable
    in an asm like

        asm("2: ... \n
             .pushsection data \n
             .global vmx_return \n
             vmx_return: .long 2b");

    and -ftracer causes a double declaration.

    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Michal Marek <mmarek@suse.cz>
    Cc: stable@vger.kernel.org
    Cc: kvm@vger.kernel.org
    Reported-by: Linda Walsh <lkml@tlinx.org>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 26898db604e006918cead820ee8f897e09f37ca9
Author: Pali Rohár <pali.rohar@gmail.com>
Date:   Fri Feb 19 10:35:39 2016 -0800

    ARM: OMAP3: Add cpuidle parameters table for omap3430

    commit 98f42221501353067251fbf11e732707dbb68ce3 upstream.

    Based on CPU type choose generic omap3 or omap3430 specific cpuidle
    parameters. Parameters for omap3430 were measured on Nokia N900 device and
    added by commit 5a1b1d3a9efa ("OMAP3: RX-51: Pass cpu idle parameters")
    which were later removed by commit 231900afba52 ("ARM: OMAP3: cpuidle -
    remove rx51 cpuidle parameters table") due to huge code complexity.

    This patch brings cpuidle parameters for omap3430 devices again, but uses
    simple condition based on CPU type.

    Fixes: 231900afba52 ("ARM: OMAP3: cpuidle - remove rx51 cpuidle
    parameters table")
    Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
    Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit ab306782a133bc5274a357f7f25488375b04b201
Author: Borislav Petkov <bp@suse.de>
Date:   Mon Mar 7 16:44:44 2016 -0300

    perf stat: Document --detailed option

    commit f594bae08183fb6b57db55387794ece3e1edf6f6 upstream.

    I'm surprised this remained undocumented since at least 2011. And it is
    actually a very useful switch, as Steve and I came to realize recently.

    Add the text from

      2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")

    which added the incrementing aspect to -d.

    Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Davidlohr Bueso <dbueso@suse.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mel Gorman <mgorman@suse.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Fixes: 2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")
    Link: http://lkml.kernel.org/r/1457347294-32546-1-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 70415182b66cc3ca0167d989a7f40d5c437c4c0b
Author: Vitaly Kuznetsov <vkuznets@redhat.com>
Date:   Fri Feb 27 11:25:51 2015 -0800

    Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors

    commit e513229b4c386e6c9f66298c13fde92f73e6e1ac upstream.

    When an SMP Hyper-V guest is running on top of 2012R2 Server and secondary
    cpus are sent offline (with echo 0 > /sys/devices/system/cpu/cpu$cpu/online)
    the system freeze is observed. This happens due to the fact that on newer
    hypervisors (Win8, WS2012R2, ...) vmbus channel handlers are distributed
    across all cpus (see init_vp_index() function in drivers/hv/channel_mgmt.c)
    and on cpu offlining nobody reassigns them to CPU0. Prevent cpu offlining
    when vmbus is loaded until the issue is fixed host-side.

    This patch also disables hibernation but it is OK as it is also broken (MCE
    error is hit on resume). Suspend still works.

    Tested with WS2008R2 and WS2012R2.

    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
    [ 3chas3@gmail.com: rebase to 3.14-stable ]
    Signed-off-by: Chas Williams <3chas3@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit df1da5a5477cc4fb1e8fa330851b0ad78255bfd4
Author: Vasily Kulikov <segoon@openwall.com>
Date:   Wed Sep 9 15:36:00 2015 -0700

    include/linux/poison.h: fix LIST_POISON{1,2} offset

    commit 8a5e5e02fc83aaf67053ab53b359af08c6c49aaf upstream.

    Poison pointer values should be small enough to find a room in
    non-mmap'able/hardly-mmap'able space.  E.g.  on x86 "poison pointer space"
    is located starting from 0x0.  Given unprivileged users cannot mmap
    anything below mmap_min_addr, it should be safe to use poison pointers
    lower than mmap_min_addr.

    The current poison pointer values of LIST_POISON{1,2} might be too big for
    mmap_min_addr values equal or less than 1 MB (common case, e.g.  Ubuntu
    uses only 0x10000).  There is little point to use such a big value given
    the "poison pointer space" below 1 MB is not yet exhausted.  Changing it
    to a smaller value solves the problem for small mmap_min_addr setups.

    The values are suggested by Solar Designer:
    http://www.openwall.com/lists/oss-security/2015/05/02/6

    Signed-off-by: Vasily Kulikov <segoon@openwall.com>
    Cc: Solar Designer <solar@openwall.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 310c45d174f51fd2087aeff2676e01bdbc0e4d34
Author: Michael Hennerich <michael.hennerich@analog.com>
Date:   Mon Feb 22 10:20:24 2016 +0100

    drivers/misc/ad525x_dpot: AD5274 fix RDAC read back errors

    commit f3df53e4d70b5736368a8fe8aa1bb70c1cb1f577 upstream.

    Fix RDAC read back errors caused by a typo. Value must shift by 2.

    Fixes: a4bd394956f2 ("drivers/misc/ad525x_dpot.c: new features")
    Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit e35d98315485e10cf3865e0495ec7d1e0d3a3379
Author: Geert Uytterhoeven <geert@linux-m68k.org>
Date:   Tue Mar 1 09:50:01 2016 +0100

    rtc: vr41xx: Wire up alarm_irq_enable

    commit a25f4a95ec3cded34c1250364eba704c5e4fdac4 upstream.

    drivers/rtc/rtc-vr41xx.c:229: warning: �vr41xx_rtc_alarm_irq_enable� defined but not used

    Apparently the conversion to alarm_irq_enable forgot to wire up the
    callback.

    Fixes: 16380c153a69c378 ("RTC: Convert rtc drivers to use the alarm_irq_enable method")
    Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8e806835e276d42158f7e0d1c3405127a24926c2
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Mon Dec 14 14:29:23 2015 +0000

    misc/bmp085: Enable building as a module

    commit 50e6315dba721cbc24ccd6d7b299f1782f210a98 upstream.

    Commit 985087dbcb02 'misc: add support for bmp18x chips to the bmp085
    driver' changed the BMP085 config symbol to a boolean.  I see no
    reason why the shared code cannot be built as a module, so change it
    back to tristate.

    Fixes: 985087dbcb02 ("misc: add support for bmp18x chips to the bmp085 driver")
    Cc: Eric Andersson <eric.andersson@unixphere.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 78d64c695eed7a7266de28f2796b2301bd34d02c
Author: Sushaanth Srirangapathi <sushaanth.s@ti.com>
Date:   Mon Feb 29 18:42:19 2016 +0530

    fbdev: da8xx-fb: fix videomodes of lcd panels

    commit 713fced8d10fa1c759c8fb6bf9aaa681bae68cad upstream.

    Commit 028cd86b794f4a ("video: da8xx-fb: fix the polarities of the
    hsync/vsync pulse") fixes polarities of HSYNC/VSYNC pulse but
    forgot to update known_lcd_panels[] which had sync values
    according to old logic. This breaks LCD at least on DA850 EVM.

    This patch fixes this issue and I have tested this for panel
    "Sharp_LK043T1DG01" using DA850 EVM board.

    Fixes: 028cd86b794f4a ("video: da8xx-fb: fix the polarities of the hsync/vsync pulse")
    Signed-off-by: Sushaanth Srirangapathi <sushaanth.s@ti.com>
    Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 226a8ce3d88baef6a8160edf2d61826e15055d9b
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Mar 15 14:53:29 2016 -0700

    paride: make 'verbose' parameter an 'int' again

    commit dec63a4dec2d6d01346fd5d96062e67c0636852b upstream.

    gcc-6.0 found an ancient bug in the paride driver, which had a
    "module_param(verbose, bool, 0);" since before 2.6.12, but actually uses
    it to accept '0', '1' or '2' as arguments:

      drivers/block/paride/pd.c: In function 'pd_init_dev_parms':
      drivers/block/paride/pd.c:298:29: warning: comparison of constant '1' with boolean expression is always false [-Wbool-compare]
       #define DBMSG(msg) ((verbose>1)?(msg):NULL)

    In 2012, Rusty did a cleanup patch that also changed the type of the
    variable to 'bool', which introduced what is now a gcc warning.

    This changes the type back to 'int' and adapts the module_param() line
    instead, so it should work as documented in case anyone ever cares about
    running the ancient driver with debugging.

    Fixes: 90ab5ee94171 ("module_param: make bool parameters really bool (drivers & misc)")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Rusty Russell <rusty@rustcorp.com.au>
    Cc: Tim Waugh <tim@cyberelk.net>
    Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Cc: Jens Axboe <axboe@fb.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 378175d0ac887f3fb4b8644152f05ccccff7e8d2
Author: Ignat Korchagin <ignat.korchagin@gmail.com>
Date:   Thu Mar 17 18:00:29 2016 +0000

    USB: usbip: fix potential out-of-bounds write

    commit b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb upstream.

    Fix potential out-of-bounds write to urb->transfer_buffer
    usbip handles network communication directly in the kernel. When receiving a
    packet from its peer, usbip code parses headers according to protocol. As
    part of this parsing urb->actual_length is filled. Since the input for
    urb->actual_length comes from the network, it should be treated as untrusted.
    Any entity controlling the network may put any value in the input and the
    preallocated urb->transfer_buffer may not be large enough to hold the data.
    Thus, the malicious entity is able to write arbitrary data to kernel memory.

    Signed-off-by: Ignat Korchagin <ignat.korchagin@gmail.com>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>

commit 8a872b18df6f08c45ec89d55826ba08cd39756c3
Author: Roman Pen <roman.penyaev@profitbricks.com>
Date:   Tue Apr 26 13:15:35 2016 +0200

    workqueue: fix ghost PENDING flag while doing MQ IO

    commit 346c09f80459a3ad97df1816d6d606169a51001a upstream.

    The bug in a workqueue leads to a stalled IO request in MQ ctx->rq_list
    with the following backtrace:

    [  601.347452] INFO: task kworker/u129:5:1636 blocked for more than 120 seconds.
    [  601.347574]       Tainted: G           O    4.4.5-1-storage+ #6
    [  601.347651] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [  601.348142] kworker/u129:5  D ffff880803077988     0  1636      2 0x00000000
    [  601.348519] Workqueue: ibnbd_server_fileio_wq ibnbd_dev_file_submit_io_worker [ibnbd_server]
    [  601.348999]  ffff880803077988 ffff88080466b900 ffff8808033f9c80 ffff880803078000
    [  601.349662]  ffff880807c95000 7fffffffffffffff ffffffff815b0920 ffff880803077ad0
    [  601.350333]  ffff8808030779a0 ffffffff815b01d5 0000000000000000 ffff880803077a38
    [  601.350965] Call Trace:
    [  601.351203]  [<ffffffff815b0920>] ? bit_wait+0x60/0x60
    [  601.351444]  [<ffffffff815b01d5>] schedule+0x35/0x80
    [  601.351709]  [<ffffffff815b2dd2>] schedule_timeout+0x192/0x230
    [  601.351958]  [<ffffffff812d43f7>] ? blk_flush_plug_list+0xc7/0x220
    [  601.352208]  [<ffffffff810bd737>] ? ktime_get+0x37/0xa0
    [  601.352446]  [<f…
cyclon1978 pushed a commit to cyclon1978/android_kernel_elephone_p8000 that referenced this issue Jul 14, 2017
commit 420902c9d086848a7548c83e0a49021514bd71b7 upstream.

If we hold the superblock lock while calling reiserfs_quota_on_mount(), we can
deadlock our own worker - mount blocks kworker/3:2, sleeps forever more.

crash> ps|grep UN
    715      2   3  ffff880220734d30  UN   0.0       0      0  [kworker/3:2]
   9369   9341   2  ffff88021ffb7560  UN   1.3  493404 123184  Xorg
   9665   9664   3  ffff880225b92ab0  UN   0.0   47368    812  udisks-daemon
  10635  10403   3  ffff880222f22c70  UN   0.0   14904    936  mount
crash> bt ffff880220734d30
PID: 715    TASK: ffff880220734d30  CPU: 3   COMMAND: "kworker/3:2"
 #0 [ffff8802244c3c20] schedule at ffffffff8144584b
 janengelmohr#1 [ffff8802244c3cc8] __rt_mutex_slowlock at ffffffff814472b3
 janengelmohr#2 [ffff8802244c3d28] rt_mutex_slowlock at ffffffff814473f5
 janengelmohr#3 [ffff8802244c3dc8] reiserfs_write_lock at ffffffffa05f28fd [reiserfs]
 janengelmohr#4 [ffff8802244c3de8] flush_async_commits at ffffffffa05ec91d [reiserfs]
 janengelmohr#5 [ffff8802244c3e08] process_one_work at ffffffff81073726
 janengelmohr#6 [ffff8802244c3e68] worker_thread at ffffffff81073eba
 janengelmohr#7 [ffff8802244c3ec8] kthread at ffffffff810782e0
 janengelmohr#8 [ffff8802244c3f48] kernel_thread_helper at ffffffff81450064
crash> rd ffff8802244c3cc8 10
ffff8802244c3cc8:  ffffffff814472b3 ffff880222f23250   .rD.....P2."....
ffff8802244c3cd8:  0000000000000000 0000000000000286   ................
ffff8802244c3ce8:  ffff8802244c3d30 ffff880220734d80   0=L$.....Ms ....
ffff8802244c3cf8:  ffff880222e8f628 0000000000000000   (.."............
ffff8802244c3d08:  0000000000000000 0000000000000002   ................
crash> struct rt_mutex ffff880222e8f628
struct rt_mutex {
  wait_lock = {
    raw_lock = {
      slock = 65537
    }
  },
  wait_list = {
    node_list = {
      next = 0xffff8802244c3d48,
      prev = 0xffff8802244c3d48
    }
  },
  owner = 0xffff880222f22c71,
  save_state = 0
}
crash> bt 0xffff880222f22c70
PID: 10635  TASK: ffff880222f22c70  CPU: 3   COMMAND: "mount"
 #0 [ffff8802216a9868] schedule at ffffffff8144584b
 janengelmohr#1 [ffff8802216a9910] schedule_timeout at ffffffff81446865
 janengelmohr#2 [ffff8802216a99a0] wait_for_common at ffffffff81445f74
 janengelmohr#3 [ffff8802216a9a30] flush_work at ffffffff810712d3
 janengelmohr#4 [ffff8802216a9ab0] schedule_on_each_cpu at ffffffff81074463
 janengelmohr#5 [ffff8802216a9ae0] invalidate_bdev at ffffffff81178aba
 janengelmohr#6 [ffff8802216a9af0] vfs_load_quota_inode at ffffffff811a3632
 janengelmohr#7 [ffff8802216a9b50] dquot_quota_on_mount at ffffffff811a375c
 janengelmohr#8 [ffff8802216a9b80] finish_unfinished at ffffffffa05dd8b0 [reiserfs]
 janengelmohr#9 [ffff8802216a9cc0] reiserfs_fill_super at ffffffffa05de825 [reiserfs]
    RIP: 00007f7b9303997a  RSP: 00007ffff443c7a8  RFLAGS: 00010202
    RAX: 00000000000000a5  RBX: ffffffff8144ef12  RCX: 00007f7b932e9ee0
    RDX: 00007f7b93d9a400  RSI: 00007f7b93d9a3e0  RDI: 00007f7b93d9a3c0
    RBP: 00007f7b93d9a2c0   R8: 00007f7b93d9a550   R9: 0000000000000001
    R10: ffffffffc0ed040e  R11: 0000000000000202  R12: 000000000000040e
    R13: 0000000000000000  R14: 00000000c0ed040e  R15: 00007ffff443ca20
    ORIG_RAX: 00000000000000a5  CS: 0033  SS: 002b

Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Mike Galbraith <mgalbraith@suse.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
cyclon1978 pushed a commit to cyclon1978/android_kernel_elephone_p8000 that referenced this issue Jul 14, 2017
commit f5527fffff3f002b0a6b376163613b82f69de073 upstream.

This fixes CVE-2016-8650.

If mpi_powm() is given a zero exponent, it wants to immediately return
either 1 or 0, depending on the modulus.  However, if the result was
initalised with zero limb space, no limbs space is allocated and a
NULL-pointer exception ensues.

Fix this by allocating a minimal amount of limb space for the result when
the 0-exponent case when the result is 1 and not touching the limb space
when the result is 0.

This affects the use of RSA keys and X.509 certificates that carry them.

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [<ffffffff8138ce5d>] mpi_powm+0x32/0x7e6
PGD 0
Oops: 0002 [janengelmohr#1] SMP
Modules linked in:
CPU: 3 PID: 3014 Comm: keyctl Not tainted 4.9.0-rc6-fscache+ #278
Hardware name: ASUS All Series/H97-PLUS, BIOS 2306 10/09/2014
task: ffff8804011944c0 task.stack: ffff880401294000
RIP: 0010:[<ffffffff8138ce5d>]  [<ffffffff8138ce5d>] mpi_powm+0x32/0x7e6
RSP: 0018:ffff880401297ad8  EFLAGS: 00010212
RAX: 0000000000000000 RBX: ffff88040868bec0 RCX: ffff88040868bba0
RDX: ffff88040868b260 RSI: ffff88040868bec0 RDI: ffff88040868bee0
RBP: ffff880401297ba8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000047 R11: ffffffff8183b210 R12: 0000000000000000
R13: ffff8804087c7600 R14: 000000000000001f R15: ffff880401297c50
FS:  00007f7a7918c700(0000) GS:ffff88041fb80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000401250000 CR4: 00000000001406e0
Stack:
 ffff88040868bec0 0000000000000020 ffff880401297b00 ffffffff81376cd4
 0000000000000100 ffff880401297b10 ffffffff81376d12 ffff880401297b30
 ffffffff81376f37 0000000000000100 0000000000000000 ffff880401297ba8
Call Trace:
 [<ffffffff81376cd4>] ? __sg_page_iter_next+0x43/0x66
 [<ffffffff81376d12>] ? sg_miter_get_next_page+0x1b/0x5d
 [<ffffffff81376f37>] ? sg_miter_next+0x17/0xbd
 [<ffffffff8138ba3a>] ? mpi_read_raw_from_sgl+0xf2/0x146
 [<ffffffff8132a95c>] rsa_verify+0x9d/0xee
 [<ffffffff8132acca>] ? pkcs1pad_sg_set_buf+0x2e/0xbb
 [<ffffffff8132af40>] pkcs1pad_verify+0xc0/0xe1
 [<ffffffff8133cb5e>] public_key_verify_signature+0x1b0/0x228
 [<ffffffff8133d974>] x509_check_for_self_signed+0xa1/0xc4
 [<ffffffff8133cdde>] x509_cert_parse+0x167/0x1a1
 [<ffffffff8133d609>] x509_key_preparse+0x21/0x1a1
 [<ffffffff8133c3d7>] asymmetric_key_preparse+0x34/0x61
 [<ffffffff812fc9f3>] key_create_or_update+0x145/0x399
 [<ffffffff812fe227>] SyS_add_key+0x154/0x19e
 [<ffffffff81001c2b>] do_syscall_64+0x80/0x191
 [<ffffffff816825e4>] entry_SYSCALL64_slow_path+0x25/0x25
Code: 56 41 55 41 54 53 48 81 ec a8 00 00 00 44 8b 71 04 8b 42 04 4c 8b 67 18 45 85 f6 89 45 80 0f 84 b4 06 00 00 85 c0 75 2f 41 ff ce <49> c7 04 24 01 00 00 00 b0 01 75 0b 48 8b 41 18 48 83 38 01 0f
RIP  [<ffffffff8138ce5d>] mpi_powm+0x32/0x7e6
 RSP <ffff880401297ad8>
CR2: 0000000000000000
---[ end trace d82015255d4a5d8d ]---

Basically, this is a backport of a libgcrypt patch:

	http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=patch;h=6e1adb05d290aeeb1c230c763970695f4a538526

Fixes: cdec9cb ("crypto: GnuPG based MPI lib - source files (part 1)")
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
cc: linux-ima-devel@lists.sourceforge.net
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
cyclon1978 pushed a commit to cyclon1978/android_kernel_elephone_p8000 that referenced this issue Jul 14, 2017
Running fsx on tmpfs with concurrent memhog-swapoff-swapon, lots of

  BUG: sleeping function called from invalid context at kernel/fork.c:606
  in_atomic(): 0, irqs_disabled(): 0, pid: 1394, name: swapoff
  1 lock held by swapoff/1394:
   #0:  (rcu_read_lock){.+.+.+}, at: [<ffffffff812520a1>] radix_tree_locate_item+0x1f/0x2b6

followed by

  ================================================
  [ BUG: lock held when returning to user space! ]
  3.14.0-rc1 janengelmohr#3 Not tainted
  ------------------------------------------------
  swapoff/1394 is leaving the kernel with locks still held!
  1 lock held by swapoff/1394:
   #0:  (rcu_read_lock){.+.+.+}, at: [<ffffffff812520a1>] radix_tree_locate_item+0x1f/0x2b6

after which the system recovered nicely.

Whoops, I long ago forgot the rcu_read_unlock() on one unlikely branch.

Fixes e504f3f ("tmpfs radix_tree: locate_item to speed up swapoff")

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants