<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/fs/btrfs, branch mm-6.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=mm-6.0</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=mm-6.0'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2016-11-07T12:46:46+00:00</updated>
<entry>
<title>fs: push sync_filesystem() down to the file system's remount_fs()</title>
<updated>2016-11-07T12:46:46+00:00</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2014-03-13T14:14:33+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=271c484329cf93036bea89ebeb0ce7be7bec4adc'/>
<id>urn:sha1:271c484329cf93036bea89ebeb0ce7be7bec4adc</id>
<content type='text'>
Previously, the no-op "mount -o mount /dev/xxx" operation when the
file system is already mounted read-write causes an implied,
unconditional syncfs().  This seems pretty stupid, and it's certainly
documented or guaraunteed to do this, nor is it particularly useful,
except in the case where the file system was mounted rw and is getting
remounted read-only.

However, it's possible that there might be some file systems that are
actually depending on this behavior.  In most file systems, it's
probably fine to only call sync_filesystem() when transitioning from
read-write to read-only, and there are some file systems where this is
not needed at all (for example, for a pseudo-filesystem or something
like romfs).

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: linux-fsdevel@vger.kernel.org
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Artem Bityutskiy &lt;dedekind1@gmail.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Evgeniy Dushistov &lt;dushistov@mail.ru&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Cc: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Anders Larsen &lt;al@alarsen.net&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Mikulas Patocka &lt;mikulas@artax.karlin.mff.cuni.cz&gt;
Cc: Petr Vandrovec &lt;petr@vandrovec.name&gt;
Cc: xfs@oss.sgi.com
Cc: linux-btrfs@vger.kernel.org
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Cc: codalist@coda.cs.cmu.edu
Cc: linux-ext4@vger.kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Cc: fuse-devel@lists.sourceforge.net
Cc: cluster-devel@redhat.com
Cc: linux-mtd@lists.infradead.org
Cc: jfs-discussion@lists.sourceforge.net
Cc: linux-nfs@vger.kernel.org
Cc: linux-nilfs@vger.kernel.org
Cc: linux-ntfs-dev@lists.sourceforge.net
Cc: ocfs2-devel@oss.oracle.com
Cc: reiserfs-devel@vger.kernel.org
</content>
</entry>
<entry>
<title>block, bdi: an active gendisk always has a request_queue associated with it</title>
<updated>2016-09-13T11:35:23+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-09-07T23:03:56+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=68b47ca59d3cd76a825984b49c283cf5b39b220a'/>
<id>urn:sha1:68b47ca59d3cd76a825984b49c283cf5b39b220a</id>
<content type='text'>
bdev_get_queue() returns the request_queue associated with the
specified block_device.  blk_get_backing_dev_info() makes use of
bdev_get_queue() to determine the associated bdi given a block_device.

All the callers of bdev_get_queue() including
blk_get_backing_dev_info() assume that bdev_get_queue() may return
NULL and implement NULL handling; however, bdev_get_queue() requires
the passed in block_device is opened and attached to its gendisk.
Because an active gendisk always has a valid request_queue associated
with it, bdev_get_queue() can never return NULL and neither can
blk_get_backing_dev_info().

Make it clear that neither of the two functions can return NULL and
remove NULL handling from all the callers.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Chris Mason &lt;clm@fb.com&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Pranav Vashi &lt;neobuddy89@gmail.com&gt;
</content>
</entry>
<entry>
<title>Linux 3.10.99 (accumulative patch)</title>
<updated>2016-08-26T18:54:33+00:00</updated>
<author>
<name>Stefan Guendhoer</name>
<email>stefan@guendhoer.com</email>
</author>
<published>2016-03-05T13:50:44+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=945788518559f8dcef715a8ef4f18a9e5229cb9c'/>
<id>urn:sha1:945788518559f8dcef715a8ef4f18a9e5229cb9c</id>
<content type='text'>
commit e39c17904aadf3a107b2bc292c03bfd9f850fd08
Author: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Date:   Thu Mar 3 15:07:51 2016 -0800

    Linux 3.10.99

commit d012f71377e1dad1165a0926c2920043e4047438
Author: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
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..
      &lt;ffffffff8139ce1b&gt;] find_next_bit+0xb/0x10
      [&lt;ffffffff81387f22&gt;] cpumask_next_and+0x22/0x40
      [&lt;ffffffff813c1ef8&gt;] pci_device_probe+0xb8/0x120
      [&lt;ffffffff81529097&gt;] ? driver_sysfs_add+0x77/0xa0
      [&lt;ffffffff815293e4&gt;] driver_probe_device+0x1a4/0x2d0
      [&lt;ffffffff813c1ddd&gt;] ? pci_match_device+0xdd/0x110
      [&lt;ffffffff81529657&gt;] __device_attach_driver+0xa7/0xb0
      [&lt;ffffffff815295b0&gt;] ? __driver_attach+0xa0/0xa0
      [&lt;ffffffff81527622&gt;] bus_for_each_drv+0x62/0x90
      [&lt;ffffffff8152978d&gt;] __device_attach+0xbd/0x110
      [&lt;ffffffff815297fb&gt;] device_attach+0xb/0x10
      [&lt;ffffffff813b75ac&gt;] pci_bus_add_device+0x3c/0x70
      [&lt;ffffffff813b7618&gt;] pci_bus_add_devices+0x38/0x80
      [&lt;ffffffff813dc34e&gt;] pcifront_scan_root+0x13e/0x1a0
      [&lt;ffffffff817a0692&gt;] pcifront_backend_changed+0x262/0x60b
      [&lt;ffffffff814644c6&gt;] ? xenbus_gather+0xd6/0x160
      [&lt;ffffffff8120900f&gt;] ? put_object+0x2f/0x50
      [&lt;ffffffff81465c1d&gt;] xenbus_otherend_changed+0x9d/0xa0
      [&lt;ffffffff814678ee&gt;] backend_changed+0xe/0x10
      [&lt;ffffffff81463a28&gt;] xenwatch_thread+0xc8/0x190
      [&lt;ffffffff810f22f0&gt;] ? 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-&gt;node to what is in sd-&gt;node (offset 4):

    set_dev_node(&amp;dev-&gt;dev, pcibus_to_node(bus));

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

            return sd-&gt;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 &lt;konrad.wilk@oracle.com&gt;
    Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
    Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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

    do_last(): don't let a bogus return value from -&gt;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 -&gt;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 &lt;viro@zeniv.linux.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit b19e7a870c21104186d5834d469b6e4a60d5cc6a
Author: Simon Guinot &lt;simon.guinot@sequanux.org&gt;
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 &lt;plr.vincent@gmail.com&gt;
    Signed-off-by: Simon Guinot &lt;simon.guinot@sequanux.org&gt;
    Tested-by: Vincent Donnefort &lt;vdonnefort@gmail.com&gt;
    Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit a7d9970fb5419b78310fb827615bd14bf7d94963
Author: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
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 &lt; bufsize) {
              ...
              *dest++ = (h &lt;&lt; 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 &lt;stefanha@redhat.com&gt;
    Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit eb63a905ff5f0d258693fd9991a94bc49188dcc3
Author: Steven Rostedt (Red Hat) &lt;rostedt@goodmis.org&gt;
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 -&gt;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 &gt; 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 &lt;chuhu@redhat.com&gt;
    Fixes: 9b63776fa3ca9 "tracing: Do not enable function event with enable"
    Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit bd54a801362f13ac756b4de4bb65d1a48c7d5fad
Author: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
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:
    ([&lt;00000000001146b8&gt;] show_trace+0xf8/0x148)
    [&lt;000000000011476a&gt;] show_stack+0x62/0xe8
    [&lt;00000000004a36b8&gt;] dump_stack+0x70/0x98
    [&lt;0000000000272c3a&gt;] warn_alloc_failed+0xd2/0x148
    [&lt;000000000027709e&gt;] __alloc_pages_nodemask+0x94e/0xb38
    [&lt;00000000002cd36a&gt;] new_slab+0x382/0x400
    [&lt;00000000002cf7ac&gt;] ___slab_alloc.constprop.30+0x2dc/0x378
    [&lt;00000000002d03d0&gt;] kmem_cache_alloc+0x160/0x1d0
    [&lt;0000000000133db4&gt;] kvm_setup_async_pf+0x6c/0x198
    [&lt;000000000013dee8&gt;] kvm_arch_vcpu_ioctl_run+0xd48/0xd58
    [&lt;000000000012fcaa&gt;] kvm_vcpu_ioctl+0x372/0x690
    [&lt;00000000002f66f6&gt;] do_vfs_ioctl+0x3be/0x510
    [&lt;00000000002f68ec&gt;] SyS_ioctl+0xa4/0xb8
    [&lt;0000000000781c5e&gt;] system_call+0xd6/0x264
    [&lt;000003ffa24fa06a&gt;] 0x3ffa24fa06a

    Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
    Reviewed-by: Dominik Dingel &lt;dingel@linux.vnet.ibm.com&gt;
    Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9c8e8b9e50d8e19ae8cbc721cd0a4da8af17fa26
Author: Christoph Hellwig &lt;hch@lst.de&gt;
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 &lt;hch@lst.de&gt;
    Fixes: 433c92379d9c ("NFS: Clean up nfs_size_to_loff_t()")
    Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit dcc121e02f773b4b8fc88522810214af39ea8313
Author: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
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-&gt;prod_idx++
                                    aer_remove():
                                      wait_event(rpc-&gt;prod_idx == rpc-&gt;cons_idx)
                                      # now blocked until queue becomes empty
      aer_isr():                      # ...
        rpc-&gt;cons_idx++               # unblocked because queue is now empty
        ...                           kfree(rpc)
        mutex_unlock(&amp;rpc-&gt;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 &lt;bigeasy@linutronix.de&gt;
    Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 43a349917d77250e1fb7dbcb44e50a80b8cab026
Author: Tejun Heo &lt;tj@kernel.org&gt;
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:[&lt;ffffffff83a83409&gt;]  [&lt;ffffffff83a83409&gt;] ata_sff_hsm_move+0x619/0x1c60
      ...
      Call Trace:
       &lt;IRQ&gt;
       [&lt;ffffffff83a84c31&gt;] __ata_sff_port_intr+0x1e1/0x3a0 drivers/ata/libata-sff.c:1584
       [&lt;ffffffff83a85611&gt;] ata_bmdma_port_intr+0x71/0x400 drivers/ata/libata-sff.c:2877
       [&lt;     inline     &gt;] __ata_sff_interrupt drivers/ata/libata-sff.c:1629
       [&lt;ffffffff83a85bf3&gt;] ata_bmdma_interrupt+0x253/0x580 drivers/ata/libata-sff.c:2902
       [&lt;ffffffff81479f98&gt;] handle_irq_event_percpu+0x108/0x7e0 kernel/irq/handle.c:157
       [&lt;ffffffff8147a717&gt;] handle_irq_event+0xa7/0x140 kernel/irq/handle.c:205
       [&lt;ffffffff81484573&gt;] handle_edge_irq+0x1e3/0x8d0 kernel/irq/chip.c:623
       [&lt;     inline     &gt;] generic_handle_irq_desc include/linux/irqdesc.h:146
       [&lt;ffffffff811a92bc&gt;] handle_irq+0x10c/0x2a0 arch/x86/kernel/irq_64.c:78
       [&lt;ffffffff811a7e4d&gt;] do_IRQ+0x7d/0x1a0 arch/x86/kernel/irq.c:240
       [&lt;ffffffff86653d4c&gt;] common_interrupt+0x8c/0x8c arch/x86/entry/entry_64.S:520
       &lt;EOI&gt;
       [&lt;     inline     &gt;] rcu_lock_acquire include/linux/rcupdate.h:490
       [&lt;     inline     &gt;] rcu_read_lock include/linux/rcupdate.h:874
       [&lt;ffffffff8164b4a1&gt;] filemap_map_pages+0x131/0xba0 mm/filemap.c:2145
       [&lt;     inline     &gt;] do_fault_around mm/memory.c:2943
       [&lt;     inline     &gt;] do_read_fault mm/memory.c:2962
       [&lt;     inline     &gt;] do_fault mm/memory.c:3133
       [&lt;     inline     &gt;] handle_pte_fault mm/memory.c:3308
       [&lt;     inline     &gt;] __handle_mm_fault mm/memory.c:3418
       [&lt;ffffffff816efb16&gt;] handle_mm_fault+0x2516/0x49a0 mm/memory.c:3447
       [&lt;ffffffff8127dc16&gt;] __do_page_fault+0x376/0x960 arch/x86/mm/fault.c:1238
       [&lt;ffffffff8127e358&gt;] trace_do_page_fault+0xe8/0x420 arch/x86/mm/fault.c:1331
       [&lt;ffffffff8126f514&gt;] do_async_page_fault+0x14/0xd0 arch/x86/kernel/kvm.c:264
       [&lt;ffffffff86655578&gt;] 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 &lt;tj@kernel.org&gt;
    Reported-and-tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Link: http://lkml.kernel.org/g/CACT4Y+b_JsOxJu2EZyEf+mOXORc_zid5V1-pLZSroJVxyWdSpw@mail.gmail.com
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 49662cfccb3f4ade7beb77a1f67f2c2db0027edc
Author: Tejun Heo &lt;tj@kernel.org&gt;
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 &lt;tj@kernel.org&gt;
    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 &lt;umgwanakikbuti@gmail.com&gt;
    Cc: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
    Cc: Daniel Bilik &lt;daniel.bilik@neosystem.cz&gt;
    Cc: Jan Kara &lt;jack@suse.cz&gt;
    Cc: Shaohua Li &lt;shli@fb.com&gt;
    Cc: Sasha Levin &lt;sasha.levin@oracle.com&gt;
    Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
    Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Cc: Daniel Bilik &lt;daniel.bilik@neosystem.cz&gt;
    Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
    Cc: Michal Hocko &lt;mhocko@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 01e527fd4c73d05125d04ce3bfd4413eb5af2581
Author: Johannes Berg &lt;johannes.berg@intel.com&gt;
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 &lt;dvyukov@google.com&gt;
    Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit eb80decbf08882c0dc6573d329fd9b5c1aff3c31
Author: Oliver Neukum &lt;oneukum@suse.com&gt;
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 &lt;oneukum@suse.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 636a9c8a87da5056b4254ff9eaf67cf52c8c2d1d
Author: Ilya Dryomov &lt;idryomov@gmail.com&gt;
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 &lt;Varada.Kari@sandisk.com&gt;
    Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
    Tested-by: Varada Kari &lt;Varada.Kari@sandisk.com&gt;
    Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit b6c92a436f3e930f7d7d8d456cf3ac36602039cf
Author: Mike Marciniszyn &lt;mike.marciniszyn@intel.com&gt;
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:[&lt;ffffffffa0131d51&gt;] [&lt;ffffffffa0131d51&gt;]
    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]  [&lt;ffffffffa0132429&gt;] qib_multicast_detach+0x1e9/0x350
    [ib_qib]
    [1750924.568035]  [&lt;ffffffffa00cb313&gt;] ? ib_uverbs_modify_qp+0x323/0x3d0
    [ib_uverbs]
    [1750924.568035]  [&lt;ffffffffa0092d61&gt;] ib_detach_mcast+0x31/0x50 [ib_core]
    [1750924.568035]  [&lt;ffffffffa00cc213&gt;] ib_uverbs_detach_mcast+0x93/0x170
    [ib_uverbs]
    [1750924.568035]  [&lt;ffffffffa00c61f6&gt;] ib_uverbs_write+0xc6/0x2c0 [ib_uverbs]
    [1750924.568035]  [&lt;ffffffff81312e68&gt;] ? apparmor_file_permission+0x18/0x20
    [1750924.568035]  [&lt;ffffffff812d4cd3&gt;] ? security_file_permission+0x23/0xa0
    [1750924.568035]  [&lt;ffffffff811bd214&gt;] vfs_write+0xb4/0x1f0
    [1750924.568035]  [&lt;ffffffff811bdc49&gt;] SyS_write+0x49/0xa0
    [1750924.568035]  [&lt;ffffffff8172f7ed&gt;] 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
    &lt;f0&gt; ff 8f 40 01 00 00 74 0e 48 89 df e8 8e f8 06 e1 5b 5d c3 0f
    [1750924.568035] RIP  [&lt;ffffffffa0131d51&gt;] qib_mcast_qp_free+0x11/0x50
    [ib_qib]
    [1750924.568035]  RSP &lt;ffff88007af1dd70&gt;
    [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 &lt;dennis.dalessandro@intel.com&gt;
    Reported-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.com&gt;
    Signed-off-by: Mike Marciniszyn &lt;mike.marciniszyn@intel.com&gt;
    Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit a81bfc00a3f9eb778bad0d97551d91c332ec2f1b
Author: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
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 &lt;christian.koenig@amd.com&gt;
    Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
    Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 8d5e1e5af0c667545c202e8f4051f77aa3bf31b7
Author: Nicolai Hähnle &lt;nicolai.haehnle@amd.com&gt;
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 &lt;nicolai.haehnle@amd.com&gt;
    Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit cb071fb6ace47b8422edd02ee91116d4f31c2c92
Author: Alex Deucher &lt;alexander.deucher@amd.com&gt;
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 &lt;alexander.deucher@amd.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit a1c393a2a324f2a1210a72fa60e5c9da03b1f1ce
Author: Rob Clark &lt;robdclark@gmail.com&gt;
Date:   Wed Oct 15 15:00:47 2014 -0400

    drm/vmwgfx: respect 'nomodeset'

    commit 96c5d076f0a5e2023ecdb44d8261f87641ee71e0 upstream.

    Signed-off-by: Rob Clark &lt;robdclark@gmail.com&gt;
    Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;.
    Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 39e88dd4da3ddc4c07150fe75d9590a648d0eb0f
Author: Dmitry V. Levin &lt;ldv@altlinux.org&gt;
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-&gt;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 &lt;ldv@altlinux.org&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit bf64271c53bfc54deeebf7ffa69d2df03ae58cf5
Author: Linus Walleij &lt;linus.walleij@linaro.org&gt;
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 &lt;linus.walleij@linaro.org&gt;
    Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 794c33bd215bbd1f7a3513f9c70a8e0afcbfcd7a
Author: Richard Cochran &lt;richardcochran@gmail.com&gt;
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 &lt;elfring@users.sourceforge.net&gt;
    igned-off-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
    Cc: John Stultz &lt;john.stultz@linaro.org&gt;
    Cc: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
    Link: http://lkml.kernel.org/r/1450819198-17420-1-git-send-email-richardcochran@gmail.com
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit eeb7b0e01658684a743ccfd66a668e8a56d5ebb9
Author: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
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-&gt;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-&gt;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-&gt;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 &lt;mpatocka@redhat.com&gt;
    Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2cd529968dd0647bf75e24f4e36fef99fc536b58
Author: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
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 &lt;mchehab@osg.samsung.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 590d6fd45445a32e6efecd8158a96e8dd09f8281
Author: Antonio Ospite &lt;ao2@ao2.it&gt;
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:[&lt;ffffffffa079bd62&gt;]  [&lt;ffffffffa079bd62&gt;] 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:
       [&lt;ffffffffa07a6431&gt;] ? v4l_s_parm+0x21/0x50 [videodev]
       [&lt;ffffffffa077656e&gt;] ? vidioc_s_parm+0x4e/0x60 [gspca_main]
       [&lt;ffffffffa07a5e20&gt;] ? __video_do_ioctl+0x280/0x2f0 [videodev]
       [&lt;ffffffffa07a5ba0&gt;] ? video_ioctl2+0x20/0x20 [videodev]
       [&lt;ffffffffa07a59b9&gt;] ? video_usercopy+0x319/0x4e0 [videodev]
       [&lt;ffffffff81182dc1&gt;] ? page_add_new_anon_rmap+0x71/0xa0
       [&lt;ffffffff811afb92&gt;] ? mem_cgroup_commit_charge+0x52/0x90
       [&lt;ffffffff81179b18&gt;] ? handle_mm_fault+0xc18/0x1680
       [&lt;ffffffffa07a15cc&gt;] ? v4l2_ioctl+0xac/0xd0 [videodev]
       [&lt;ffffffff811c846f&gt;] ? do_vfs_ioctl+0x28f/0x480
       [&lt;ffffffff811c86d4&gt;] ? SyS_ioctl+0x74/0x80
       [&lt;ffffffff8154a8b6&gt;] ? 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 &lt;f7&gt;
        76 0c 80 bf ac 0c 00 00 00 88 87 4e 0e 00 00 74 09 80 bf 4f
      RIP  [&lt;ffffffffa079bd62&gt;] sd_set_streamparm+0x12/0x60 [gspca_ov534]
       RSP &lt;ffff880095c4fce8&gt;
      ---[ 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 &lt;ao2@ao2.it&gt;
    Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
    Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
    Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1b29bcfbae9971d931fd65f6ae075d394907517b
Author: Malcolm Priestley &lt;tvboxspy@gmail.com&gt;
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 &lt;tvboxspy@gmail.com&gt;
    Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 4c77a51256e0b05b0948c1f5dd06dfb2b5abe489
Author: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
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:[&lt;0000000061077df6&gt;]
      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:
       [&lt;60dedc67&gt;] SyS_bind+0xf7/0x110
       [&lt;600587be&gt;] handle_syscall+0x7e/0x80
       [&lt;60066ad7&gt;] userspace+0x3e7/0x4e0
       [&lt;6006321f&gt;] ? save_registers+0x1f/0x40
       [&lt;6006c88e&gt;] ? arch_prctl+0x1be/0x1f0
       [&lt;60054985&gt;] 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 &lt;vegard.nossum@oracle.com&gt;
    Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
    Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
    Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9cbb43b99bf138e44deef9957678bc464f3bfd82
Author: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
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 &lt;vegard.nossum@oracle.com&gt;
    Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 509a4bccfecaaf92af4bc27b9b212fa4a24e756c
Author: Stefan Haberland &lt;stefan.haberland@de.ibm.com&gt;
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 &lt;stefan.haberland@de.ibm.com&gt;
    Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9155d3f258f83643bad27297e7539a67bb81122c
Author: Stefan Haberland &lt;stefan.haberland@de.ibm.com&gt;
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 &lt;stefan.haberland@de.ibm.com&gt;
    Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 396a61bef1418705af82ab7b5d1e1a193a699dd2
Author: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
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 &lt;ard.biesheuvel@linaro.org&gt;
    Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
    Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit dbf7fab09e9e0612a23ec7fee9570663b21fdfc9
Author: Filipe Manana &lt;fdmanana@suse.com&gt;
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 &lt;fdmanana@suse.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1f81573daa963299aaf5692de7dfc39185f8a96d
Author: Filipe Manana &lt;fdmanana@suse.com&gt;
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 &lt;srb@cuci.nl&gt;
    Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit d6ecb7ece33b2da65dffa50ce13f28fec392ec54
Author: Josef Bacik &lt;jbacik@fb.com&gt;
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 &lt;jbacik@fb.com&gt;
    Reviewed-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
    Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit bf00d124e07fda629e60709c6187437d66848a9d
Author: Anand Jain &lt;anand.jain@oracle.com&gt;
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 &lt;anand.jain@oracle.com&gt;
    Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
    Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 099e9d4f2c57fba73d62db6764e09644636cbbc2
Author: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
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 &lt;rmk+kernel@arm.linux.org.uk&gt;
    Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit f80e6add955c84db83cc5a230c967635f0a808b9
Author: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
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 &lt;ptikhomirov@virtuozzo.com&gt;
    Tested-by: Pavel Tikhomirov &lt;ptikhomirov@virtuozzo.com&gt;
    Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit b8569305e453645f1227a627ec1ced1c68291d63
Author: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
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 &lt;andrea.gelmini@gelma.net&gt;
    Reviewed-by: Ewan D. Milne &lt;emilne@redhat.com&gt;
    Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
    Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit ffb785e178acd0d965e4338c561f82bdb2d054b6
Author: Johannes Berg &lt;johannes.berg@intel.com&gt;
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 &lt;johannes.berg@intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9cec78832326106ebd03bca2235a461aa6fac804
Author: Kirill A. Shutemov &lt;kirill@shutemov.name&gt;
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 &lt;kirill@shutemov.name&gt;
    Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
    Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 859ac05006374e785820017deba204859bbdf1ad
Author: Joe Thornber &lt;ejt@redhat.com&gt;
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 &lt;ejt@redhat.com&gt;
    Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit d6eab6f74f15e0f38d875d523f74e6bc55492ba7
Author: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
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 &lt;mpatocka@redhat.com&gt;
    Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 6bf97b05008739ad7d644758301a427460479537
Author: Sasha Levin &lt;sasha.levin@oracle.com&gt;
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 &lt;sasha.levin@oracle.com&gt;
    Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
    Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Cc: Mike Galbraith &lt;efault@gmx.de&gt;
    Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
    Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    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 &lt;mingo@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 4af5f2490fb0cab9e29f8b45b81cd69aa4d9babe
Author: Mirza Krak &lt;mirza.krak@hostmobility.com&gt;
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 &gt; /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 &lt;mirza.krak@hostmobility.com&gt;
    Reported-by: Christian Magnusson &lt;Christian.Magnusson@semcon.com&gt;
    Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit e2f3d50558b8e5deeaacf4990e478fc844444de5
Author: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
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 &lt;vegard.nossum@oracle.com&gt;
    Reviewed-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
    Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
    Signed-off-by: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1467bec9a74c7369fbf38c9fbd51f1f61a3f14c7
Author: Johannes Berg &lt;johannes.berg@intel.com&gt;
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 &lt;j@w1.fi&gt;
    Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 963e16256e30f627f5c105814a8d9658f2107b7e
Author: Suman Anna &lt;s-anna@ti.com&gt;
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 &lt;s-anna@ti.com&gt;
    Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 6039f028a9bbf7cb34ecfac31d5a9df68453221d
Author: Steven Rostedt (Red Hat) &lt;rostedt@goodmis.org&gt;
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 &lt;rostedt@goodmis.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit b63a96fada140801597b62a2a6a6818a96ae39e9
Author: Jan Kara &lt;jack@suse.cz&gt;
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&lt;&lt;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 &lt;dvyukov@google.com&gt;
    Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
    Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 677eea664a18f46ec7186d1b0a1595f8ac2cb959
Author: Vineet Gupta &lt;vgupta@synopsys.com&gt;
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 &lt;vgupta@synopsys.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2a27f61bd411e564eb4651c18d225f6e9e1de534
Author: Kees Cook &lt;keescook@chromium.org&gt;
Date:   Thu Nov 19 17:18:54 2015 -0800

    mac: validate mac_partition is within sector

    commit 02e2a5bfebe99edcf9d694575a75032d53fe1b73 upstream.

    If md-&gt;signature == MAC_DRIVER_MAGIC and md-&gt;block_size == 1023, a single
    512 byte sector would be read (secsize / 512). However the partition
    structure would be located past the end of the buffer (secsize % 512).

    Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
    Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit e3dda035201bd6299d95414c7d9943f721b7be87
Author: Luca Porzio &lt;lporzio@micron.com&gt;
Date:   Fri Nov 6 15:12:26 2015 +0000

    mmc: remove bondage between REQ_META and reliable write

    commit d3df0465db00cf4ed9f90d0bfc3b827d32b9c796 upstream.

    Anytime a write operation is performed with Reliable Write flag enabled,
    the eMMC device is enforced to bypass the cache and do a write to the
    underling NVM device by Jedec specification; this causes a performance
    penalty since write operations can't be optimized by the device cache.

    In our tests, we replayed a typical mobile daily trace pattern and found
    ~9% overall time reduction in trace replay by using this patch. Also the
    write ops within 4KB~64KB chunk size range get a 40~60% performance
    improvement by using the patch (as this range of write chunks are the ones
    affected by REQ_META).

    This patch has been discussed in the Mobile &amp; Embedded Linux Storage Forum
    and it's the results of feedbacks from many people. We also checked with
    fsdevl and f2fs mailing list developers that this change in the usage of
    REQ_META is not affecting FS behavior and we got positive feedbacks.
    Reporting here the feedbacks:
    http://comments.gmane.org/gmane.linux.file-systems/97219
    http://thread.gmane.org/gmane.linux.file-systems.f2fs/3178/focus=3183

    Signed-off-by: Bruce Ford &lt;bford@micron.com&gt;
    Signed-off-by: Luca Porzio &lt;lporzio@micron.com&gt;
    Fixes: ce39f9d17c14 ("mmc: support packed write command for eMMC4.5 devices")
    Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit eef125560fd129761cd4842ae061d543e81b533a
Author: sumit.saxena@avagotech.com &lt;sumit.saxena@avagotech.com&gt;
Date:   Thu Oct 15 13:40:54 2015 +0530

    megaraid_sas : SMAP restriction--do not access user memory from IOCTL code

    commit 323c4a02c631d00851d8edc4213c4d184ef83647 upstream.

    This is an issue on SMAP enabled CPUs and 32 bit apps running on 64 bit
    OS. Do not access user memory from kernel code. The SMAP bit restricts
    accessing user memory from kernel code.

    Signed-off-by: Sumit Saxena &lt;sumit.saxena@avagotech.com&gt;
    Signed-off-by: Kashyap Desai &lt;kashyap.desai@avagotech.com&gt;
    Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
    Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 64896131a6e3c60133360b2ff2a70487eb35f721
Author: sumit.saxena@avagotech.com &lt;sumit.saxena@avagotech.com&gt;
Date:   Thu Oct 15 13:40:04 2015 +0530

    megaraid_sas: Do not use PAGE_SIZE for max_sectors

    commit 357ae967ad66e357f78b5cfb5ab6ca07fb4a7758 upstream.

    Do not use PAGE_SIZE marco to calculate max_sectors per I/O
    request. Driver code assumes PAGE_SIZE will be always 4096 which can
    lead to wrongly calculated value if PAGE_SIZE is not 4096. This issue
    was reported in Ubuntu Bugzilla Bug #1475166.

    Signed-off-by: Sumit Saxena &lt;sumit.saxena@avagotech.com&gt;
    Signed-off-by: Kashyap Desai &lt;kashyap.desai@avagotech.com&gt;
    Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
    Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
    Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 621264c8898d4e0a5d14919ea900d82c2eab6262
Author: Valentin Rothberg &lt;valentinrothberg@gmail.com&gt;
Date:   Tue Sep 22 19:00:40 2015 +0200

    wm831x_power: Use IRQF_ONESHOT to request threaded IRQs

    commit 90adf98d9530054b8e665ba5a928de4307231d84 upstream.

    Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
    threaded IRQs without a primary handler need to be requested with
    IRQF_ONESHOT, otherwise the request will fail.

    scripts/coccinelle/misc/irqf_oneshot.cocci detected this issue.

    Fixes: b5874f33bbaf ("wm831x_power: Use genirq")
    Signed-off-by: Valentin Rothberg &lt;valentinrothberg@gmail.com&gt;
    Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 736652169c60e99df027befd07f9217bcaba840d
Author: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Date:   Mon Sep 21 19:21:51 2015 +0300

    devres: fix a for loop bounds check

    commit 1f35d04a02a652f14566f875aef3a6f2af4cb77b upstream.

    The iomap[] array has PCIM_IOMAP_MAX (6) elements and not
    DEVICE_COUNT_RESOURCE (16).  This bug was found using a static checker.
    It may be that the "if (!(mask &amp; (1 &lt;&lt; i)))" check means we never
    actually go past the end of the array in real life.

    Fixes: ec04b075843d ('iomap: implement pcim_iounmap_regions()')
    Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
    Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit db13625b0968e8ccaa14dfa0fcb2b347524be05e
Author: Andrey Ryabinin &lt;aryabinin@virtuozzo.com&gt;
Date:   Wed Sep 23 15:49:29 2015 +0300

    lockd: create NSM handles per net namespace

    commit 0ad95472bf169a3501991f8f33f5147f792a8116 upstream.

    Commit cb7323fffa85 ("lockd: create and use per-net NSM
     RPC clients on MON/UNMON requests") introduced per-net
    NSM RPC clients. Unfortunately this doesn't make any sense
    without per-net nsm_handle.

    E.g. the following scenario could happen
    Two hosts (X and Y) in different namespaces (A and B) share
    the same nsm struct.

    1. nsm_monitor(host_X) called =&gt; NSM rpc client created,
    	nsm-&gt;sm_monitored bit set.
    2. nsm_mointor(host-Y) called =&gt; nsm-&gt;sm_monitored already set,
    	we just exit. Thus in namespace B ln-&gt;nsm_clnt == NULL.
    3. host X destroyed =&gt; nsm-&gt;sm_count decremented to 1
    4. host Y destroyed =&gt; nsm_unmonitor() =&gt; nsm_mon_unmon() =&gt; NULL-ptr
    	dereference of *ln-&gt;nsm_clnt

    So this could be fixed by making per-net nsm_handles list,
    instead of global. Thus different net namespaces will not be able
    share the same nsm_handle.

    Signed-off-by: Andrey Ryabinin &lt;aryabinin@virtuozzo.com&gt;
    Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1644fe6cc1567ecde034ea8acd5f4d6146e395b5
Author: Roman Volkov &lt;rvolkov@v1ros.org&gt;
Date:   Fri Jan 1 16:24:41 2016 +0300

    clocksource/drivers/vt8500: Increase the minimum delta

    commit f9eccf24615672896dc13251410c3f2f33a14f95 upstream.

    The vt8500 clocksource driver declares itself as capable to handle the
    minimum delay of 4 cycles by passing the value into
    clockevents_config_and_register(). The vt8500_timer_set_next_event()
    requires the passed cycles value to be at least 16. The impact is that
    userspace hangs in nanosleep() calls with small delay intervals.

    This problem is reproducible in Linux 4.2 starting from:
    c6eb3f70d448 ('hrtimer: Get rid of hrtimer softirq')

    From Russell King, more detailed explanation:

    "It's a speciality of the StrongARM/PXA hardware. It takes a certain
    number of OSCR cycles for the value written to hit the compare registers.
    So, if a very small delta is written (eg, the compare register is written
    with a value of OSCR + 1), the OSCR will have incremented past this value
    before it hits the underlying hardware. The result is, that you end up
    waiting a very long time for the OSCR to wrap before the event fires.

    So, we introduce a check in set_next_event() to detect this and return
    -ETIME if the calculated delta is too small, which causes the generic
    clockevents code to retry after adding the min_delta specified in
    clockevents_config_and_register() to the current time value.

    min_delta must be sufficient that we don't re-trip the -ETIME check - if
    we do, we will return -ETIME, forward the next event time, try to set it,
    return -ETIME again, and basically lock the system up. So, min_delta
    must be larger than the check inside set_next_event(). A factor of two
    was chosen to ensure that this situation would never occur.

    The PXA code worked on PXA systems for years, and I'd suggest no one
    changes this mechanism without access to a wide range of PXA systems,
    otherwise they're risking breakage."

    Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
    Acked-by: Alexey Charkov &lt;alchark@gmail.com&gt;
    Signed-off-by: Roman Volkov &lt;rvolkov@v1ros.org&gt;
    Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit bf5cd0c632e49ca583cd3531b55693e615a2b332
Author: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Date:   Sun Dec 13 18:12:30 2015 +0100

    genirq: Prevent chip buslock deadlock

    commit abc7e40c81d113ef4bacb556f0a77ca63ac81d85 upstream.

    If a interrupt chip utilizes chip-&gt;buslock then free_irq() can
    deadlock in the following way:

    CPU0				CPU1
    				interrupt(X) (Shared or spurious)
    free_irq(X)			interrupt_thread(X)
    chip_bus_lock(X)
    				   irq_finalize_oneshot(X)
    				     chip_bus_lock(X)
    synchronize_irq(X)

    synchronize_irq() waits for the interrupt thread to complete,
    i.e. forever.

    Solution is simple: Drop chip_bus_lock() before calling
    synchronize_irq() as we do with the irq_desc lock. There is nothing to
    be protected after the point where irq_desc lock has been released.

    This adds chip_bus_lock/unlock() to the remove_irq() code path, but
    that's actually correct in the case where remove_irq() is called on
    such an interrupt. The current users of remove_irq() are not affected
    as none of those interrupts is on a chip which requires buslock.

    Reported-by: Fredrik Markström &lt;fredrik.markstrom@gmail.com&gt;
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 341f09c01a7f26a030f3bedb08e4ce91e3ca24d3
Author: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Date:   Wed Feb 3 02:11:03 2016 +0100

    unix: correctly track in-flight fds in sending process user_struct

    commit 415e3d3e90ce9e18727e8843ae343eda5a58fad6 upstream.

    The commit referenced in the Fixes tag incorrectly accounted the number
    of in-flight fds over a unix domain socket to the original opener
    of the file-descriptor. This allows another process to arbitrary
    deplete the original file-openers resource limit for the maximum of
    open files. Instead the sending processes and its struct cred should
    be credited.

    To do so, we add a reference counted struct user_struct pointer to the
    scm_fp_list and use it to account for the number of inflight unix fds.

    Fixes: 712f4aad406bb1 ("unix: properly account for FDs passed over unix sockets")
    Reported-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
    Cc: David Herrmann &lt;dh.herrmann@gmail.com&gt;
    Cc: Willy Tarreau &lt;w@1wt.eu&gt;
    Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 59ae7b1c13bd615b09bff9d03aaa335559af604a
Author: Olga Kornievskaia &lt;aglo@umich.edu&gt;
Date:   Mon Sep 14 19:54:36 2015 -0400

    Failing to send a CLOSE if file is opened WRONLY and server reboots on a 4.x mount

    commit a41cbe86df3afbc82311a1640e20858c0cd7e065 upstream.

    A test case is as the description says:
    open(foobar, O_WRONLY);
    sleep()  --&gt; reboot the server
    close(foobar)

    The bug is because in nfs4state.c in nfs4_reclaim_open_state() a few
    line before going to restart, there is
    clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &amp;state-&gt;flags).

    NFS4CLNT_RECLAIM_NOGRACE is a flag for the client states not open
    owner states. Value of NFS4CLNT_RECLAIM_NOGRACE is 4 which is the
    value of NFS_O_WRONLY_STATE in nfs4_state-&gt;flags. So clearing it wipes
    out state and when we go to close it, “call_close” doesn’t get set as
    state flag is not set and CLOSE doesn’t go on the wire.

    Signed-off-by: Olga Kornievskaia &lt;aglo@umich.edu&gt;
    Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 4c67196fd14f5f53eb865719bfca1908fa963618
Author: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Date:   Wed May 6 17:26:47 2015 +0200

    splice: sendfile() at once fails for big files

    commit 0ff28d9f4674d781e492bcff6f32f0fe48cf0fed upstream.

    Using sendfile with below small program to get MD5 sums of some files,
    it appear that big files (over 64kbytes with 4k pages system) get a
    wrong MD5 sum while small files get the correct sum.
    This program uses sendfile() to send a file to an AF_ALG socket
    for hashing.

    /* md5sum2.c */
    #include &lt;stdio.h&gt;
    #include &lt;stdlib.h&gt;
    #include &lt;unistd.h&gt;
    #include &lt;string.h&gt;
    #include &lt;fcntl.h&gt;
    #include &lt;sys/socket.h&gt;
    #include &lt;sys/stat.h&gt;
    #include &lt;sys/types.h&gt;
    #include &lt;linux/if_alg.h&gt;

    int main(int argc, char **argv)
    {
    	int sk = socket(AF_ALG, SOCK_SEQPACKET, 0);
    	struct stat st;
    	struct sockaddr_alg sa = {
    		.salg_family = AF_ALG,
    		.salg_type = "hash",
    		.salg_name = "md5",
    	};
    	int n;

    	bind(sk, (struct sockaddr*)&amp;sa, sizeof(sa));

    	for (n = 1; n &lt; argc; n++) {
    		int size;
    		int offset = 0;
    		char buf[4096];
    		int fd;
    		int sko;
    		int i;

    		fd = open(argv[n], O_RDONLY);
    		sko = accept(sk, NULL, 0);
    		fstat(fd, &amp;st);
    		size = st.st_size;
    		sendfile(sko, fd, &amp;offset, size);
    		size = read(sko, buf, sizeof(buf));
    		for (i = 0; i &lt; size; i++)
    			printf("%2.2x", buf[i]);
    		printf("  %s\n", argv[n]);
    		close(fd);
    		close(sko);
    	}
    	exit(0);
    }

    Test below is done using official linux patch files. First result is
    with a software based md5sum. Second result is with the program above.

    root@vgoip:~# ls -l patch-3.6.*
    -rw-r--r--    1 root     root         64011 Aug 24 12:01 patch-3.6.2.gz
    -rw-r--r--    1 root     root         94131 Aug 24 12:01 patch-3.6.3.gz

    root@vgoip:~# md5sum patch-3.6.*
    b3ffb9848196846f31b2ff133d2d6443  patch-3.6.2.gz
    c5e8f687878457db77cb7158c38a7e43  patch-3.6.3.gz

    root@vgoip:~# ./md5sum2 patch-3.6.*
    b3ffb9848196846f31b2ff133d2d6443  patch-3.6.2.gz
    5fd77b24e68bb24dcc72d6e57c64790e  patch-3.6.3.gz

    After investivation, it appears that sendfile() sends the files by blocks
    of 64kbytes (16 times PAGE_SIZE). The problem is that at the end of each
    block, the SPLICE_F_MORE flag is missing, therefore the hashing operation
    is reset as if it was the end of the file.

    This patch adds SPLICE_F_MORE to the flags when more data is pending.

    With the patch applied, we get the correct sums:

    root@vgoip:~# md5sum patch-3.6.*
    b3ffb9848196846f31b2ff133d2d6443  patch-3.6.2.gz
    c5e8f687878457db77cb7158c38a7e43  patch-3.6.3.gz

    root@vgoip:~# ./md5sum2 patch-3.6.*
    b3ffb9848196846f31b2ff133d2d6443  patch-3.6.2.gz
    c5e8f687878457db77cb7158c38a7e43  patch-3.6.3.gz

    Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
    Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
    Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 23a9a7dc6f75393a21c0378d13b380e46907b877
Author: James Hogan &lt;james.hogan@imgtec.com&gt;
Date:   Wed Nov 11 14:21:20 2015 +0000

    MIPS: KVM: Uninit VCPU in vcpu_create error path

    commit 585bb8f9a5e592f2ce7abbe5ed3112d5438d2754 upstream.

    If either of the memory allocations in kvm_arch_vcpu_create() fail, the
    vcpu which has been allocated and kvm_vcpu_init'd doesn't get uninit'd
    in the error handling path. Add a call to kvm_vcpu_uninit() to fix this.

    Fixes: 669e846e6c4e ("KVM/MIPS32: MIPS arch specific APIs for KVM")
    Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
    Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
    Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Cc: Gleb Natapov &lt;gleb@kernel.org&gt;
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 7b0fc4511317bbc71ca8bbcf032013ffbfe0a2bc
Author: James Hogan &lt;james.hogan@imgtec.com&gt;
Date:   Wed Nov 11 14:21:19 2015 +0000

    MIPS: KVM: Fix CACHE immediate offset sign extension

    commit c5c2a3b998f1ff5a586f9d37e154070b8d550d17 upstream.

    The immediate field of the CACHE instruction is signed, so ensure that
    it gets sign extended by casting it to an int16_t rather than just
    masking the low 16 bits.

    Fixes: e685c689f3a8 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
    Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
    Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
    Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Cc: Gleb Natapov &lt;gleb@kernel.org&gt;
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 5525dd65cd8e4f80ede26993f6f665df7eeec1dc
Author: James Hogan &lt;james.hogan@imgtec.com&gt;
Date:   Wed Nov 11 14:21:18 2015 +0000

    MIPS: KVM: Fix ASID restoration logic

    commit 002374f371bd02df864cce1fe85d90dc5b292837 upstream.

    ASID restoration on guest resume should determine the guest execution
    mode based on the guest Status register rather than bit 30 of the guest
    PC.

    Fix the two places in locore.S that do this, loading the guest status
    from the cop0 area. Note, this assembly is specific to the trap &amp;
    emulate implementation of KVM, so it doesn't need to check the
    supervisor bit as that mode is not implemented in the guest.

    Fixes: b680f70fc111 ("KVM/MIPS32: Entry point for trampolining to...")
    Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
    Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
    Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Cc: Gleb Natapov &lt;gleb@kernel.org&gt;
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1630624d5387a837112fb3663fe5daa22c680267
Author: Hariprasad S &lt;hariprasad@chelsio.com&gt;
Date:   Fri Dec 11 13:59:17 2015 +0530

    iw_cxgb3: Fix incorrectly returning error on success

    commit 67f1aee6f45059fd6b0f5b0ecb2c97ad0451f6b3 upstream.

    The cxgb3_*_send() functions return NET_XMIT_ values, which are
    positive integers values. So don't treat positive return values
    as an error.

    Signed-off-by: Steve Wise &lt;swise@opengridcomputing.com&gt;
    Signed-off-by: Hariprasad Shenai &lt;hariprasad@chelsio.com&gt;
    Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
    [a pox on developers and maintainers who do not cc: stable for bug fixes like this - gregkh]
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit b048b93f0e5b249b0add0bde6ec7ec75a07eac9c
Author: Corey Wright &lt;undefined@pobox.com&gt;
Date:   Sun Feb 28 02:42:39 2016 -0600

    proc: Fix ptrace-based permission checks for accessing task maps

    Modify mm_access() calls in fs/proc/task_mmu.c and fs/proc/task_nommu.c to
    have the mode include PTRACE_MODE_FSCREDS so accessing /proc/pid/maps and
    /proc/pid/pagemap is not denied to all users.

    In backporting upstream commit caaee623 to pre-3.18 kernel versions it was
    overlooked that mm_access() is used in fs/proc/task_*mmu.c as those calls
    were removed in 3.18 (by upstream commit 29a40ace) and did not exist at the
    time of the original commit.

    Signed-off-by: Corey Wright &lt;undefined@pobox.com&gt;
    Acked-by: Jann Horn &lt;jann@thejh.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit db9b6792736a57291901032e4a2036dfc9f0ab95
Author: Bjørn Mork &lt;bjorn@mork.no&gt;
Date:   Fri Feb 12 16:40:00 2016 +0100

    USB: option: add "4G LTE usb-modem U901"

    commit d061c1caa31d4d9792cfe48a2c6b309a0e01ef46 upstream.

    Thomas reports:

    T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  4 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=05c6 ProdID=6001 Rev=00.00
    S:  Manufacturer=USB Modem
    S:  Product=USB Modem
    S:  SerialNumber=1234567890ABCDEF
    C:  #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    I:  If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

    Reported-by: Thomas Schäfer &lt;tschaefer@t-online.de&gt;
    Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
    Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit b920f51b68e4d965b51cab8060fae66eeb21f218
Author: Andrey Skvortsov &lt;andrej.skvortzov@gmail.com&gt;
Date:   Fri Jan 29 00:07:30 2016 +0300

    USB: option: add support for SIM7100E

    commit 3158a8d416f4e1b79dcc867d67cb50013140772c upstream.

    $ lsusb:
    Bus 001 Device 101: ID 1e0e:9001 Qualcomm / Option

    $ usb-devices:
    T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=101 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  2
    P:  Vendor=1e0e ProdID=9001 Rev= 2.32
    S:  Manufacturer=SimTech, Incorporated
    S:  Product=SimTech, Incorporated
    S:  SerialNumber=0123456789ABCDEF
    C:* #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=500mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)

    The last interface (6) is used for Android Composite ADB interface.

    Serial port layout:
    0: QCDM/DIAG
    1: NMEA
    2: AT
    3: AT/PPP
    4: audio

    Signed-off-by: Andrey Skvortsov &lt;andrej.skvortzov@gmail.com&gt;
    Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9195b27396cbf8459e19593ec34586e66857ab01
Author: Ken Lin &lt;ken.lin@advantech.com.tw&gt;
Date:   Mon Feb 1 14:57:25 2016 -0500

    USB: cp210x: add IDs for GE B650V3 and B850V3 boards

    commit 6627ae19385283b89356a199d7f03c75ba35fb29 upstream.

    Add USB ID for cp2104/5 devices on GE B650v3 and B850v3 boards.

    Signed-off-by: Ken Lin &lt;ken.lin@advantech.com.tw&gt;
    Signed-off-by: Akshay Bhat &lt;akshay.bhat@timesys.com&gt;
    Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit fadc5c1769ba24cd8498359d93e31408b0e0fbb9
Author: Gerhard Uttenthaler &lt;uttenthaler@ems-wuensche.com&gt;
Date:   Tue Dec 22 17:29:16 2015 +0100

    can: ems_usb: Fix possible tx overflow

    commit 90cfde46586d2286488d8ed636929e936c0c9ab2 upstream.

    This patch fixes the problem that more CAN messages could be sent to the
    interface as could be send on the CAN bus. This was more likely for slow baud
    rates. The sleeping _start_xmit was woken up in the _write_bulk_callback. Under
    heavy TX load this produced another bulk transfer without checking the
    free_slots variable and hence caused the overflow in the interface.

    Signed-off-by: Gerhard Uttenthaler &lt;uttenthaler@ems-wuensche.com&gt;
    Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 86d80ecd4f96b63103abfd1269855a8a3b9d47cc
Author: Nikolay Borisov &lt;kernel@kyup.com&gt;
Date:   Thu Dec 17 18:03:35 2015 +0200

    dm thin: fix race condition when destroying thin pool workqueue

    commit 18d03e8c25f173f4107a40d0b8c24defb6ed69f3 upstream.

    When a thin pool is being destroyed delayed work items are
    cancelled using cancel_delayed_work(), which doesn't guarantee that on
    return the delayed item isn't running.  This can cause the work item to
    requeue itself on an already destroyed workqueue.  Fix this by using
    cancel_delayed_work_sync() which guarantees that on return the work item
    is not running anymore.

    Fixes: 905e51b39a555 ("dm thin: commit outstanding data every second")
    Fixes: 85ad643b7e7e5 ("dm thin: add timeout to stop out-of-data-space mode holding IO forever")
    Signed-off-by: Nikolay Borisov &lt;kernel@kyup.com&gt;
    Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9bb86db161a368f423958981869d17c53ae5f395
Author: Joe Thornber &lt;ejt@redhat.com&gt;
Date:   Wed Dec 9 16:23:24 2015 +0000

    dm thin metadata: fix bug when taking a metadata snapshot

    commit 49e99fc717f624aa75ca755d6e7bc029efd3f0e9 upstream.

    When you take a metadata snapshot the btree roots for the mapping and
    details tree need to have their reference counts incremented so they
    persist for the lifetime of the metadata snap.

    The roots being incremented were those currently written in the
    superblock, which could possibly be out of date if concurrent IO is
    triggering new mappings, breaking of sharing, etc.

    Fix this by performing a commit with the metadata lock held while taking
    a metadata snapshot.

    Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
    Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9ee0d9ad9309385fd877bf7f5a762d4d3b5a6462
Author: Ingo Molnar &lt;mingo@kernel.org&gt;
Date:   Tue Mar 3 07:34:33 2015 +0100

    efi: Disable interrupts around EFI calls, not in the epilog/prolog calls

    commit 23a0d4e8fa6d3a1d7fb819f79bcc0a3739c30ba9 upstream.

    Tapasweni Pathak reported that we do a kmalloc() in efi_call_phys_prolog()
    on x86-64 while having interrupts disabled, which is a big no-no, as
    kmalloc() can sleep.

    Solve this by removing the irq disabling from the prolog/epilog calls
    around EFI calls: it's unnecessary, as in this stage we are single
    threaded in the boot thread, and we don't ever execute this from
    interrupt contexts.

    Reported-by: Tapasweni Pathak &lt;tapaswenipathak@gmail.com&gt;
    Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
    Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
    [ luis: backported to 3.10: adjusted context ]
    Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit f2419de63e77bf6f63b5e67a57b1fa7cf535c4ca
Author: Dave Airlie &lt;airlied@redhat.com&gt;
Date:   Thu Aug 20 10:13:55 2015 +1000

    drm/radeon: fix hotplug race at startup

    commit 7f98ca454ad373fc1b76be804fa7138ff68c1d27 upstream.

    We apparantly get a hotplug irq before we've initialised
    modesetting,

    [drm] Loading R100 Microcode
    BUG: unable to handle kernel NULL pointer dereference at   (null)
    IP: [&lt;c125f56f&gt;] __mutex_lock_slowpath+0x23/0x91
    *pde = 00000000
    Oops: 0002 [#1]
    Modules linked in: radeon(+) drm_kms_helper ttm drm i2c_algo_bit backlight pcspkr psmouse evdev sr_mod input_leds led_class cdrom sg parport_pc parport floppy intel_agp intel_gtt lpc_ich acpi_cpufreq processor button mfd_core agpgart uhci_hcd ehci_hcd rng_core snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm usbcore usb_common i2c_i801 i2c_core snd_timer snd soundcore thermal_sys
    CPU: 0 PID: 15 Comm: kworker/0:1 Not tainted 4.2.0-rc7-00015-gbf67402 #111
    Hardware name: MicroLink                               /D850MV                         , BIOS MV85010A.86A.0067.P24.0304081124 04/08/2003
    Workqueue: events radeon_hotplug_work_func [radeon]
    task: f6ca5900 ti: f6d3e000 task.ti: f6d3e000
    EIP: 0060:[&lt;c125f56f&gt;] EFLAGS: 00010282 CPU: 0
    EIP is at __mutex_lock_slowpath+0x23/0x91
    EAX: 00000000 EBX: f5e900fc ECX: 00000000 EDX: fffffffe
    ESI: f6ca5900 EDI: f5e90100 EBP: f5e90000 ESP: f6d3ff0c
     DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
    CR0: 8005003b CR2: 00000000 CR3: 36f61000 CR4: 000006d0
    Stack:
     f5e90100 00000000 c103c4c1 f6d2a5a0 f5e900fc f6df394c c125f162 f8b0faca
     f6d2a5a0 c138ca00 f6df394c f7395600 c1034741 00d40000 00000000 f6d2a5a0
     c138ca00 f6d2a5b8 c138ca10 c1034b58 00000001 f6d40000 f6ca5900 f6d0c940
    Call Trace:
     [&lt;c103c4c1&gt;] ? dequeue_task_fair+0xa4/0xb7
     [&lt;c125f162&gt;] ? mutex_lock+0x9/0xa
     [&lt;f8b0faca&gt;] ? radeon_hotplug_work_func+0x17/0x57 [radeon]
     [&lt;c1034741&gt;] ? process_one_work+0xfc/0x194
     [&lt;c1034b58&gt;] ? worker_thread+0x18d/0x218
     [&lt;c10349cb&gt;] ? rescuer_thread+0x1d5/0x1d5
     [&lt;c103742a&gt;] ? kthread+0x7b/0x80
     [&lt;c12601c0&gt;] ? ret_from_kernel_thread+0x20/0x30
     [&lt;c10373af&gt;] ? init_completion+0x18/0x18
    Code: 42 08 e8 8e a6 dd ff c3 57 56 53 83 ec 0c 8b 35 48 f7 37 c1 8b 10 4a 74 1a 89 c3 8d 78 04 8b 40 08 89 63

    Reported-and-Tested-by: Meelis Roos &lt;mroos@linux.ee&gt;
    Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 8719b00b6bcbf3acf3d8c1efebf9e9743d1d2511
Author: Kamal Mostafa &lt;kamal@canonical.com&gt;
Date:   Wed Nov 11 14:25:34 2015 -0800

    tools: Add a "make all" rule

    commit f6ba98c5dc78708cb7fd29950c4a50c4c7e88f95 upstream.

    Signed-off-by: Kamal Mostafa &lt;kamal@canonical.com&gt;
    Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
    Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
    Cc: Jonathan Cameron &lt;jic23@kernel.org&gt;
    Cc: Pali Rohar &lt;pali.rohar@gmail.com&gt;
    Cc: Roberta Dobrescu &lt;roberta.dobrescu@gmail.com&gt;
    Link: http://lkml.kernel.org/r/1447280736-2161-2-git-send-email-kamal@canonical.com
    Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
    [ kamal: backport to 3.10-stable: build all tools for this version ]
    Signed-off-by: Kamal Mostafa &lt;kamal@canonical.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9fac660099785accf7c99670c9cceb096098e820
Author: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Date:   Sun Nov 29 17:21:57 2015 -0800

    bcache: unregister reboot notifier if bcache fails to unregister device

    commit 2ecf0cdb2b437402110ab57546e02abfa68a716b upstream.

    In bcache_init() function it forgot to unregister reboot notifier if
    bcache fails to unregister a block device.  This commit fixes this.

    Signed-off-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
    Tested-by: Joshua Schmid &lt;jschmid@suse.com&gt;
    Tested-by: Eric Wheeler &lt;bcache@linux.ewheeler.net&gt;
    Cc: Kent Overstreet &lt;kmo@daterainc.com&gt;
    Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit f79d019c4b9692afe3a383df849b927097ff4e1a
Author: Andrey Vagin &lt;avagin@openvz.org&gt;
Date:   Wed Jan 29 19:34:14 2014 +0100

    netfilter: nf_conntrack: fix RCU race in nf_conntrack_find_get

    commit c6825c0976fa7893692e0e43b09740b419b23c09 upstream.

    Lets look at destroy_conntrack:

    hlist_nulls_del_rcu(&amp;ct-&gt;tuplehash[IP_CT_DIR_ORIGINAL].hnnode);
    ...
    nf_conntrack_free(ct)
    	kmem_cache_free(net-&gt;ct.nf_conntrack_cachep, ct);

    net-&gt;ct.nf_conntrack_cachep is created with SLAB_DESTROY_BY_RCU.

    The hash is protected by rcu, so readers look up conntracks without
    locks.
    A conntrack is removed from the hash, but in this moment a few readers
    still can use the conntrack. Then this conntrack is released and another
    thread creates conntrack with the same address and the equal tuple.
    After this a reader starts to validate the conntrack:
    * It's not dying, because a new conntrack was created
    * nf_ct_tuple_equal() returns true.

    But this conntrack is not initialized yet, so it can not be used by two
    threads concurrently. In this case BUG_ON may be triggered from
    nf_nat_setup_info().

    Florian Westphal suggested to check the confirm bit too. I think it's
    right.

    task 1			task 2			task 3
    			nf_conntrack_find_get
    			 ____nf_conntrack_find
    destroy_conntrack
     hlist_nulls_del_rcu
     nf_conntrack_free
     kmem_cache_free
    						__nf_conntrack_alloc
    						 kmem_cache_alloc
    						 memset(&amp;ct-&gt;tuplehash[IP_CT_DIR_MAX],
    			 if (nf_ct_is_dying(ct))
    			 if (!nf_ct_tuple_equal()

    I'm not sure, that I have ever seen this race condition in a real life.
    Currently we are investigating a bug, which is reproduced on a few nodes.
    In our case one conntrack is initialized from a few tasks concurrently,
    we don't have any other explanation for this.

    &lt;2&gt;[46267.083061] kernel BUG at net/ipv4/netfilter/nf_nat_core.c:322!
    ...
    &lt;4&gt;[46267.083951] RIP: 0010:[&lt;ffffffffa01e00a4&gt;]  [&lt;ffffffffa01e00a4&gt;] nf_nat_setup_info+0x564/0x590 [nf_nat]
    ...
    &lt;4&gt;[46267.085549] Call Trace:
    &lt;4&gt;[46267.085622]  [&lt;ffffffffa023421b&gt;] alloc_null_binding+0x5b/0xa0 [iptable_nat]
    &lt;4&gt;[46267.085697]  [&lt;ffffffffa02342bc&gt;] nf_nat_rule_find+0x5c/0x80 [iptable_nat]
    &lt;4&gt;[46267.085770]  [&lt;ffffffffa0234521&gt;] nf_nat_fn+0x111/0x260 [iptable_nat]
    &lt;4&gt;[46267.085843]  [&lt;ffffffffa0234798&gt;] nf_nat_out+0x48/0xd0 [iptable_nat]
    &lt;4&gt;[46267.085919]  [&lt;ffffffff814841b9&gt;] nf_iterate+0x69/0xb0
    &lt;4&gt;[46267.085991]  [&lt;ffffffff81494e70&gt;] ? ip_finish_output+0x0/0x2f0
    &lt;4&gt;[46267.086063]  [&lt;ffffffff81484374&gt;] nf_hook_slow+0x74/0x110
    &lt;4&gt;[46267.086133]  [&lt;ffffffff81494e70&gt;] ? ip_finish_output+0x0/0x2f0
    &lt;4&gt;[46267.086207]  [&lt;ffffffff814b5890&gt;] ? dst_output+0x0/0x20
    &lt;4&gt;[46267.086277]  [&lt;ffffffff81495204&gt;] ip_output+0xa4/0xc0
    &lt;4&gt;[46267.086346]  [&lt;ffffffff814b65a4&gt;] raw_sendmsg+0x8b4/0x910
    &lt;4&gt;[46267.086419]  [&lt;ffffffff814c10fa&gt;] inet_sendmsg+0x4a/0xb0
    &lt;4&gt;[46267.086491]  [&lt;ffffffff814459aa&gt;] ? sock_update_classid+0x3a/0x50
    &lt;4&gt;[46267.086562]  [&lt;ffffffff81444d67&gt;] sock_sendmsg+0x117/0x140
    &lt;4&gt;[46267.086638]  [&lt;ffffffff8151997b&gt;] ? _spin_unlock_bh+0x1b/0x20
    &lt;4&gt;[46267.086712]  [&lt;ffffffff8109d370&gt;] ? autoremove_wake_function+0x0/0x40
    &lt;4&gt;[46267.086785]  [&lt;ffffffff81495e80&gt;] ? do_ip_setsockopt+0x90/0xd80
    &lt;4&gt;[46267.086858]  [&lt;ffffffff8100be0e&gt;] ? call_function_interrupt+0xe/0x20
    &lt;4&gt;[46267.086936]  [&lt;ffffffff8118cb10&gt;] ? ub_slab_ptr+0x20/0x90
    &lt;4&gt;[46267.087006]  [&lt;ffffffff8118cb10&gt;] ? ub_slab_ptr+0x20/0x90
    &lt;4&gt;[46267.087081]  [&lt;ffffffff8118f2e8&gt;] ? kmem_cache_alloc+0xd8/0x1e0
    &lt;4&gt;[46267.087151]  [&lt;ffffffff81445599&gt;] sys_sendto+0x139/0x190
    &lt;4&gt;[46267.087229]  [&lt;ffffffff81448c0d&gt;] ? sock_setsockopt+0x16d/0x6f0
    &lt;4&gt;[46267.087303]  [&lt;ffffffff810efa47&gt;] ? audit_syscall_entry+0x1d7/0x200
    &lt;4&gt;[46267.087378]  [&lt;ffffffff810ef795&gt;] ? __audit_syscall_exit+0x265/0x290
    &lt;4&gt;[46267.087454]  [&lt;ffffffff81474885&gt;] ? compat_sys_setsockopt+0x75/0x210
    &lt;4&gt;[46267.087531]  [&lt;ffffffff81474b5f&gt;] compat_sys_socketcall+0x13f/0x210
    &lt;4&gt;[46267.087607]  [&lt;ffffffff8104dea3&gt;] ia32_sysret+0x0/0x5
    &lt;4&gt;[46267.087676] Code: 91 20 e2 01 75 29 48 89 de 4c 89 f7 e8 56 fa ff ff 85 c0 0f 84 68 fc ff ff 0f b6 4d c6 41 8b 45 00 e9 4d fb ff ff e8 7c 19 e9 e0 &lt;0f&gt; 0b eb fe f6 05 17 91 20 e2 80 74 ce 80 3d 5f 2e 00 00 00 74
    &lt;1&gt;[46267.088023] RIP  [&lt;ffffffffa01e00a4&gt;] nf_nat_setup_info+0x564/0x590

    Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
    Cc: Florian Westphal &lt;fw@strlen.de&gt;
    Cc: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
    Cc: Patrick McHardy &lt;kaber@trash.net&gt;
    Cc: Jozsef Kadlecsik &lt;kadlec@blackhole.kfki.hu&gt;
    Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
    Cc: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
    Signed-off-by: Andrey Vagin &lt;avagin@openvz.org&gt;
    Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9f5bc010e9feef21555b9870ee4b5b06c9feae73
Author: Egbert Eich &lt;eich@suse.de&gt;
Date:   Wed Jun 11 14:59:55 2014 +0200

    drm/ast: Initialized data needed to map fbdev memory

    commit 28fb4cb7fa6f63dc2fbdb5f2564dcbead8e3eee0 upstream.

    Due to a missing initialization there was no way to map fbdev memory.
    Thus for example using the Xserver with the fbdev driver failed.
    This fix adds initialization for fix.smem_start and fix.smem_len
    in the fb_info structure, which fixes this problem.

    Requested-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
    Signed-off-by: Egbert Eich &lt;eich@suse.de&gt;
    [pulled from SuSE tree by me - airlied]
    Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit c3e07084a8e08c4d4a02ef352e20419ba9835149
Author: Steven Rostedt (Red Hat) &lt;rostedt@goodmis.org&gt;
Date:   Mon Feb 15 12:36:14 2016 -0500

    tracepoints: Do not trace when cpu is offline

    commit f37755490fe9bf76f6ba1d8c6591745d3574a6a6 upstream.

    The tracepoint infrastructure uses RCU sched protection to enable and
    disable tracepoints safely. There are some instances where tracepoints are
    used in infrastructure code (like kfree()) that get called after a CPU is
    going offline, and perhaps when it is coming back online but hasn't been
    registered yet.

    This can probuce the following warning:

     [ INFO: suspicious RCU usage. ]
     4.4.0-00006-g0fe53e8-dirty #34 Tainted: G S
     -------------------------------
     include/trace/events/kmem.h:141 suspicious rcu_dereference_check() usage!

     other info that might help us debug this:

     RCU used illegally from offline CPU!  rcu_scheduler_active = 1, debug_locks = 1
     no locks held by swapper/8/0.

     stack backtrace:
      CPU: 8 PID: 0 Comm: swapper/8 Tainted: G S              4.4.0-00006-g0fe53e8-dirty #34
      Call Trace:
      [c0000005b76c78d0] [c0000000008b9540] .dump_stack+0x98/0xd4 (unreliable)
      [c0000005b76c7950] [c00000000010c898] .lockdep_rcu_suspicious+0x108/0x170
      [c0000005b76c79e0] [c00000000029adc0] .kfree+0x390/0x440
      [c0000005b76c7a80] [c000000000055f74] .destroy_context+0x44/0x100
      [c0000005b76c7b00] [c0000000000934a0] .__mmdrop+0x60/0x150
      [c0000005b76c7b90] [c0000000000e3ff0] .idle_task_exit+0x130/0x140
      [c0000005b76c7c20] [c000000000075804] .pseries_mach_cpu_die+0x64/0x310
      [c0000005b76c7cd0] [c000000000043e7c] .cpu_die+0x3c/0x60
      [c0000005b76c7d40] [c0000000000188d8] .arch_cpu_idle_dead+0x28/0x40
      [c0000005b76c7db0] [c000000000101e6c] .cpu_startup_entry+0x50c/0x560
      [c0000005b76c7ed0] [c000000000043bd8] .start_secondary+0x328/0x360
      [c0000005b76c7f90] [c000000000008a6c] start_secondary_prolog+0x10/0x14

    This warning is not a false positive either. RCU is not protecting code that
    is being executed while the CPU is offline.

    Instead of playing "whack-a-mole(TM)" and adding conditional statements to
    the tracepoints we find that are used in this instance, simply add a
    cpu_online() test to the tracepoint code where the tracepoint will be
    ignored if the CPU is offline.

    Use of raw_smp_processor_id() is fine, as there should never be a case where
    the tracepoint code goes from running on a CPU that is online and suddenly
    gets migrated to a CPU that is offline.

    Link: http://lkml.kernel.org/r/1455387773-4245-1-git-send-email-kda@linux-powerpc.org

    Reported-by: Denis Kirjanov &lt;kda@linux-powerpc.org&gt;
    Fixes: 97e1c18e8d17b ("tracing: Kernel Tracepoints")
    Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Linux 3.10.98 (accumulative patch)</title>
<updated>2016-08-26T18:54:24+00:00</updated>
<author>
<name>Stefan Guendhoer</name>
<email>stefan@guendhoer.com</email>
</author>
<published>2016-03-05T13:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=dc5cd1f644c11c39dbbc54c0e30d00fe0bfd0fc0'/>
<id>urn:sha1:dc5cd1f644c11c39dbbc54c0e30d00fe0bfd0fc0</id>
<content type='text'>
commit 90915bdf5d75f981251d78f45dce37d39e679ac1
Author: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Date:   Thu Feb 25 11:58:19 2016 -0800

    Linux 3.10.98

commit dd6f1f0d444d8c9fe4307c1527987e474819d5d7
Author: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
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 &lt;rusty@rustcorp.com.au&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 40ea6e6f67636529f3ed27d4e2f7589f3ae869c7
Author: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
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 &lt;hannes@stressinduktion.org&gt;
    Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit a895706740ceaac0c7f99ddc48e05c40cb21c361
Author: Thomas Gleixner &lt;tglx@linutronix.de&gt;
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 &lt;tglx@linutronix.de&gt;
    Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
    Cc: Darren Hart &lt;darren@dvhart.com&gt;
    Cc: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
    Cc: Bhuvanesh_Surachari@mentor.com
    Cc: Andy Lowe &lt;Andy_Lowe@mentor.com&gt;
    Link: http://lkml.kernel.org/r/20151219200607.178132067@linutronix.de
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 4800af91229e06e9d8517a6961f5b5d304b7e9bf
Author: Andy Lutomirski &lt;luto@kernel.org&gt;
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 &lt;early_idt_handlers&gt;:
         0:   6a 00                   pushq  $0x0
         2:   6a 00                   pushq  $0x0
         4:   e9 00 00 00 00          jmpq   9 &lt;early_idt_handlers+0x9&gt;
                              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 &lt;early_idt_handlers+0x51&gt;
                              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 &lt;early_idt_handler&gt;
                              11c: R_X86_64_PC32      early_idt_handler-0x4

    After:

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

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

commit 08fc7d3fdfef75fdf2d44f848cef1f3e1babb8bf
Author: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
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 &lt;dan.carpenter@oracle.com&gt;
    Signed-off-by: Darren Hart &lt;dvhart@linux.intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit c750edf63ce45ff34155723b73828527c1d96353
Author: Konstantin Khlebnikov &lt;koct9i@gmail.com&gt;
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-&gt;tags is filled with single bit.

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

commit a202017766a111064dc0a99ee38d85886816b27a
Author: Matthew Wilcox &lt;willy@linux.intel.com&gt;
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 &lt;willy@linux.intel.com&gt;
    Cc: Hugh Dickins &lt;hughd@google.com&gt;
    Cc: Ohad Ben-Cohen &lt;ohad@wizery.com&gt;
    Cc: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
    Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
    Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit a28c4bb3990dd3f65279ec02c6fa1762044325da
Author: Martijn Coenen &lt;maco@google.com&gt;
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-&gt;primary after it is freed.

    Fixed by only freeing after synchronize_rcu().

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

commit d5b8e6bb2595ed5ae550e44939016fb9d022fabf
Author: Sergey Senozhatsky &lt;sergey.senozhatsky.work@gmail.com&gt;
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 &lt;sergey.senozhatsky@gmail.com&gt;
    Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
    Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2942425f64895dead4dfe46462e00c9871c2bc12
Author: Laura Abbott &lt;labbott@fedoraproject.org&gt;
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/&lt;567B1176.4000106@redhat.com&gt;

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

commit ac6cef6cfa6230d989e24325ea04280a5b1fc5e7
Author: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
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 &lt;fengguang.wu@intel.com&gt;
    Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
    Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
    Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit e399e769b8f894dac701dc257be093221330cbd2
Author: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
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 &lt;joe.lawrence@stratus.com&gt;
    Tested-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
    Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit f8f1013f5c6180cf6f812e6d3f823680a6a77cc7
Author: Andrew Banman &lt;abanman@sgi.com&gt;
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 &lt;abanman@sgi.com&gt;
    Acked-by: Alex Thorlton &lt;athorlton@sgi.com&gt;
    Cc: Russ Anderson &lt;rja@sgi.com&gt;
    Cc: Alex Thorlton &lt;athorlton@sgi.com&gt;
    Cc: Yinghai Lu &lt;yinghai@kernel.org&gt;
    Cc: Greg KH &lt;greg@kroah.com&gt;
    Cc: Seth Jennings &lt;sjennings@variantweb.net&gt;
    Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
    Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1631f17998c51d57182370b84f582729b94bfdf6
Author: CQ Tang &lt;cq.tang@intel.com&gt;
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 &lt;cq.tang@intel.com&gt;
    Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit af5d9b4be5c19097a8e3bbb28eb15fb1b4e1b188
Author: Aurélien Francillon &lt;aurelien@francillon.net&gt;
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 &lt;aurelien@francillon.net&gt;
    Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 209bde19c95ace3386a66e521dc518e7fd9b26c9
Author: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
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 &lt;benjamin.tissoires@redhat.com&gt;
    Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 220e1e03fbf0f1e21860ebae237ec39a40732777
Author: Takashi Iwai &lt;tiwai@suse.de&gt;
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 &lt;tiwai@suse.de&gt;
    Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 523ea6a0029ea766f139d58182e459b64b378f4f
Author: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
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(&amp;page-&gt;_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:[&lt;ffffffff8118998c&gt;]  [&lt;ffffffff8118998c&gt;] 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 &lt;0f&gt; 0b 66 90 66 66 66 66 90 55 48 89 e5 41 55 41 54 53 48 8b 47
       RIP  [&lt;ffffffff8118998c&gt;] put_page+0x5c/0x60
        RSP &lt;ffff88007c213e00&gt;

    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 &lt;n-horiguchi@ah.jp.nec.com&gt;
    Cc: Sasha Levin &lt;sasha.levin@oracle.com&gt;
    Cc: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
    Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
    Cc: Jerome Marchand &lt;jmarchan@redhat.com&gt;
    Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
    Cc: Hugh Dickins &lt;hughd@google.com&gt;
    Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
    Cc: Mel Gorman &lt;mgorman@suse.de&gt;
    Cc: Rik van Riel &lt;riel@redhat.com&gt;
    Cc: Steve Capper &lt;steve.capper@linaro.org&gt;
    Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
    Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
    Cc: Christoph Lameter &lt;cl@linux.com&gt;
    Cc: David Rientjes &lt;rientjes@google.com&gt;
    Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
    Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 020ef19153db7b81f94935ec03adecb4a8ab8964
Author: Roman Gushchin &lt;klamm@yandex-team.ru&gt;
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 -&gt; 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 &lt;akpm@linux-foundation.org&gt;
    Cc: Maxim Patlasov &lt;mpatlasov@parallels.com&gt;
    Cc: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
    Signed-off-by: Roman Gushchin &lt;klamm@yandex-team.ru&gt;
    Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
    Fixes: ea9b9907b82a ("fuse: implement perform_write")
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit fa4aa48526e852a550613acffc81cacc5233848e
Author: Linus Walleij &lt;linus.walleij@linaro.org&gt;
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 &lt;pawel.moll@arm.com&gt;
    Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
    Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 57cd1f0a2031e82ac1cc13e56f12b7d979ee5403
Author: Linus Walleij &lt;linus.walleij@linaro.org&gt;
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 &lt;dcb314@hotmail.com&gt;
    Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
    Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit e2889463b33d8b7f4bfe4d7d824dd3d621f2e3ef
Author: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
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 &lt;andrew_gabbasov@mentor.com&gt;
    Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit f548c900b08de916732524992aaccb83cfe65312
Author: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
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 &lt;andrew_gabbasov@mentor.com&gt;
    Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 6b3a508f58f55ce1271c422d71e07f94f6ce7de5
Author: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
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 &lt;vegard.nossum@oracle.com&gt;
    Cc: Jan Kara &lt;jack@suse.com&gt;
    Cc: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
    Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
    Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 45a74b1ce8a11efc82d49100648f7c5dc753cbb8
Author: Andrew Elble &lt;aweits@rit.edu&gt;
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 -&gt; #1 open (for write) reply seqid=1
    1964393 -&gt; #2 open (for read) reply seqid=2

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

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

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

       next step would be update_open_stateflags(), pending so_lock

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

       nfs4_close_prepare() gets so_lock and recalcs flags -&gt; send close

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

       __update_open_stateid() gets so_lock
     * update_open_stateflags() updates state-&gt;n_wronly.
       nfs4_state_set_mode_locked() updates state-&gt;state

       state-&gt;flags is [RW]
       state-&gt;state is [RW], state-&gt;n_wronly == 1, state-&gt;n_rdonly == 1

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

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

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

    1964409 -&gt; write reply (fails, openmode)

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

commit 65b1cbfcc31b63903265bdb6851bfb32ed71c8db
Author: Anton Protopopov &lt;a.s.protopopov@gmail.com&gt;
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 &lt;a.s.protopopov@gmail.com&gt;
    Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2388eb1b0645f815b193165b17c0ab0f161ec17e
Author: Yong Li &lt;sdliyong@gmail.com&gt;
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 &lt;sdliyong@gmail.com&gt;
    Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9d080ce6c4f118fa425f072e28c0b75ee715a69c
Author: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
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 &lt;lars@metafoo.de&gt;
    Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 3effd3faeaa18907ba672f4545d0ba4602a2eb8b
Author: Michael Hennerich &lt;michael.hennerich@analog.com&gt;
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 &lt;michael.hennerich@analog.com&gt;
    Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
    Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit aac11e32617a7de35937748d1f33aae33be0dff0
Author: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
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:
        [&lt;&gt;] (dump_backtrace) from [&lt;&gt;] (show_stack+0x18/0x1c)
        [&lt;&gt;] (show_stack) from [&lt;&gt;] (dump_stack+0x20/0x28)
        [&lt;&gt;] (dump_stack) from [&lt;&gt;] (warn_slowpath_common+0x90/0xb8)
        [&lt;&gt;] (warn_slowpath_common) from [&lt;&gt;] (warn_slowpath_null+0x24/0x2c)
        [&lt;&gt;] (warn_slowpath_null) from [&lt;&gt;] (clk_core_enable+0x2c/0xa4)
        [&lt;&gt;] (clk_core_enable) from [&lt;&gt;] (clk_enable+0x24/0x38)
        [&lt;&gt;] (clk_enable) from [&lt;&gt;] (lpc32xx_read_raw+0x38/0x80)
        [&lt;&gt;] (lpc32xx_read_raw) from [&lt;&gt;] (iio_read_channel_info+0x70/0x94)
        [&lt;&gt;] (iio_read_channel_info) from [&lt;&gt;] (dev_attr_show+0x28/0x4c)
        [&lt;&gt;] (dev_attr_show) from [&lt;&gt;] (sysfs_kf_seq_show+0x8c/0xf0)
        [&lt;&gt;] (sysfs_kf_seq_show) from [&lt;&gt;] (kernfs_seq_show+0x2c/0x30)
        [&lt;&gt;] (kernfs_seq_show) from [&lt;&gt;] (seq_read+0x1c8/0x440)
        [&lt;&gt;] (seq_read) from [&lt;&gt;] (kernfs_fop_read+0x38/0x170)
        [&lt;&gt;] (kernfs_fop_read) from [&lt;&gt;] (do_readv_writev+0x16c/0x238)
        [&lt;&gt;] (do_readv_writev) from [&lt;&gt;] (vfs_readv+0x50/0x58)
        [&lt;&gt;] (vfs_readv) from [&lt;&gt;] (default_file_splice_read+0x1a4/0x308)
        [&lt;&gt;] (default_file_splice_read) from [&lt;&gt;] (do_splice_to+0x78/0x84)
        [&lt;&gt;] (do_splice_to) from [&lt;&gt;] (splice_direct_to_actor+0xc8/0x1cc)
        [&lt;&gt;] (splice_direct_to_actor) from [&lt;&gt;] (do_splice_direct+0xa0/0xb8)
        [&lt;&gt;] (do_splice_direct) from [&lt;&gt;] (do_sendfile+0x1a8/0x30c)
        [&lt;&gt;] (do_sendfile) from [&lt;&gt;] (SyS_sendfile64+0x104/0x10c)
        [&lt;&gt;] (SyS_sendfile64) from [&lt;&gt;] (ret_fast_syscall+0x0/0x38)

    Signed-off-by: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
    Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1a640c6b2d1d4fdbf424b2958daa23ffbbbb9e06
Author: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
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 &lt;lars@metafoo.de&gt;
    Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 8a3f8369fb82b6c2dd8bed82e219b8a49abade2d
Author: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
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:[&lt;c07e7044&gt;] 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]  [&lt;c066b0f7&gt;] scsi_remove_target+0x167/0x1c0
    [  444.088002]  [&lt;f8f0a4ed&gt;] fc_rport_final_delete+0x9d/0x1e0 [scsi_transport_fc]
    [  444.088002]  [&lt;c026cb25&gt;] process_one_work+0x155/0x3e0
    [  444.088002]  [&lt;c026cde7&gt;] worker_thread+0x37/0x490
    [  444.088002]  [&lt;c027214b&gt;] kthread+0x9b/0xb0
    [  444.088002]  [&lt;c07e72c1&gt;] 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 &lt;herbszt@gmx.de&gt;
    Tested-by: Sebastian Herbszt &lt;herbszt@gmx.de&gt;
    Fixes: 40998193560dab6c3ce8d25f4fa58a23e252ef38
    Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 50ec3624a2eadcf6d06fa32a8d89324639066c53
Author: Hannes Reinecke &lt;hare@suse.de&gt;
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 &lt;hare@suse.de&gt;
    Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
    Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 014212bf4f4bd566c88dd7809882b1be0eb79c51
Author: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
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 &lt;fcntl.h&gt;
        #include &lt;unistd.h&gt;
        #include &lt;sys/mman.h&gt;
        #include &lt;numaif.h&gt;

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

commit 3d1df27856ea8b9455e4a59dd22eee9afa40ead9
Author: Alan Stern &lt;stern@rowland.harvard.edu&gt;
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 &lt;https://bugs.debian.org/801925&gt;.

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

commit bac26cabd29db3237c288d054054a1dfbea835f6
Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
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-&gt;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-&gt;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-&gt;sess_kref reference counting for both se_node_acl
    deletion + se_node_acl-&gt;queue_depth se_session restart.

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

commit 2bfa7bba55afcfbd887de08f936c3186ca2fae82
Author: Ken Xue &lt;ken.xue@amd.com&gt;
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-&gt;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-&gt;dev pointer.

    This patch fixes the problem by checking q-&gt;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&amp;m=144163730531875&amp;w=2

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

commit 0c808c2962e2cfc9ded0b96a211ed819562e45ba
Author: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
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&lt;2; i++)); do
      srp_daemon -oac |
      while read line; do
        echo $line &gt;/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:
        [&lt;ffffffff8151014a&gt;] kmemleak_alloc+0x7a/0xc0
        [&lt;ffffffff81165c1e&gt;] __kmalloc_track_caller+0xfe/0x160
        [&lt;ffffffff81260d2b&gt;] kvasprintf+0x5b/0x90
        [&lt;ffffffff81260e2d&gt;] kvasprintf_const+0x8d/0xb0
        [&lt;ffffffff81254b0c&gt;] kobject_set_name_vargs+0x3c/0xa0
        [&lt;ffffffff81337e3c&gt;] dev_set_name+0x3c/0x40
        [&lt;ffffffff81355757&gt;] scsi_host_alloc+0x327/0x4b0
        [&lt;ffffffffa03edc8e&gt;] srp_create_target+0x4e/0x8a0 [ib_srp]
        [&lt;ffffffff8133778b&gt;] dev_attr_store+0x1b/0x20
        [&lt;ffffffff811f27fa&gt;] sysfs_kf_write+0x4a/0x60
        [&lt;ffffffff811f1e8e&gt;] kernfs_fop_write+0x14e/0x180
        [&lt;ffffffff81176eef&gt;] __vfs_write+0x2f/0xf0
        [&lt;ffffffff811771e4&gt;] vfs_write+0xa4/0x100
        [&lt;ffffffff81177c64&gt;] SyS_write+0x54/0xc0
        [&lt;ffffffff8151b257&gt;] entry_SYSCALL_64_fastpath+0x12/0x6f

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

commit 481c34209a7e52a9f74ce60e539b9c00036e66b3
Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
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-&gt;rx_login_comp.

    Note this bug is a regression introduced by:

      commit e54198657b65625085834847ab6271087323ffea
      Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
      Date:   Wed Jul 22 23:14:19 2015 -0700

          iscsi-target: Fix iscsit_start_kthreads failure OOPs

    To address this bug, complete -&gt;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 &lt;sagig@mellanox.com&gt;
    Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit f7d615b9cc7bcfaf064d715770b061b995b44bce
Author: Peter Oberparleiter &lt;oberpar@linux.vnet.ibm.com&gt;
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/&lt;sdev&gt;/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 &lt;oberpar@linux.vnet.ibm.com&gt;
    Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
    Reviewed-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
    Reviewed-by: Ewan D. Milne &lt;emilne@redhat.com&gt;
    Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2544cce12c7bd18e880b09c21b1a2d944a3423eb
Author: Christoph Hellwig &lt;hch@lst.de&gt;
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 &lt;djbw@fb.com&gt;
    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 &lt;JBottomley@Parallels.com&gt;
    Date:   Tue Jan 21 07:01:41 2014 -0800

        [SCSI] dual scan thread bug fix

    Thanks go to Dan Williams &lt;dan.j.williams@intel.com&gt; for tracking all this
    prior history down.

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

commit 00707985578715324f32a0d71dbf6221bc4a2fc7
Author: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
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: [&lt;ffffffff81321eef&gt;] dump_stack+0x44/0x55
    Dec  3 13:22:02 localhost kernel: [&lt;ffffffff8107ca52&gt;] warn_slowpath_common+0x82/0xc0
    Dec  3 13:22:02 localhost kernel: [&lt;ffffffff814542b0&gt;] ? proc_scsi_show+0x20/0x20
    Dec  3 13:22:02 localhost kernel: [&lt;ffffffff8107cb4a&gt;] warn_slowpath_null+0x1a/0x20
    Dec  3 13:22:02 localhost kernel: [&lt;ffffffff8167225d&gt;] klist_iter_init_node+0x3d/0x50
    Dec  3 13:22:02 localhost kernel: [&lt;ffffffff81421d41&gt;] bus_find_device+0x51/0xb0
    Dec  3 13:22:02 localhost kernel: [&lt;ffffffff814545ad&gt;] 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 &lt;emilne@redhat.com&gt;
    Tested-by: Ewan D. Milne &lt;emilne@redhat.com&gt;
    Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 710636bc7a255376fe26c768377afa8aee030d86
Author: Arnd Bergmann &lt;arnd@arndb.de&gt;
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-&gt;config.adc_clock)
                    adc_clock = state-&gt;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 &lt;nico@linaro.org&gt;
    Fixes: ab3c9c686e22 ("branch tracer, intel-iommu: fix build with CONFIG_BRANCH_TRACER=y")
    Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
    Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit c3b066b6e4d524dd27f23a4417ac2c3633b13327
Author: Steven Rostedt &lt;rostedt@goodmis.org&gt;
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 &lt;rostedt@goodmis.org&gt;
    Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
    Link: http://lkml.kernel.org/r/20151116172516.4b79b109@gandalf.local.home
    Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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

commit 05c5582559ac40ab12a4624681d41f2771239c8e
Author: Peter Zijlstra &lt;peterz@infradead.org&gt;
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 &lt;acme@kernel.org&gt;
    Tested-by: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
    Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
    Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
    Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
    Cc: David Ahern &lt;dsahern@gmail.com&gt;
    Cc: Frédéric Weisbecker &lt;fweisbec@gmail.com&gt;
    Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
    Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
    Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
    Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
    Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
    Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Cc: Wang Nan &lt;wangnan0@huawei.com&gt;
    Link: http://lkml.kernel.org/r/20151102095051.GN17308@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 590a2f0b8c5d10279bf8cb6d07ca426e6086b349
Author: Filipe Manana &lt;fdmanana@suse.com&gt;
Date:   Wed Feb 3 19:17:27 2016 +0000

    Btrfs: fix hang on extent buffer lock caused by the inode_paths ioctl

    commit 0c0fe3b0fa45082cd752553fdb3a4b42503a118e upstream.

    While doing some tests I ran into an hang on an extent buffer's rwlock
    that produced the following trace:

    [39389.800012] NMI watchdog: BUG: soft lockup - CPU#15 stuck for 22s! [fdm-stress:32166]
    [39389.800016] NMI watchdog: BUG: soft lockup - CPU#14 stuck for 22s! [fdm-stress:32165]
    [39389.800016] Modules linked in: btrfs dm_mod ppdev xor sha256_generic hmac raid6_pq drbg ansi_cprng aesni_intel i2c_piix4 acpi_cpufreq aes_x86_64 ablk_helper tpm_tis parport_pc i2c_core sg cryptd evdev psmouse lrw tpm parport gf128mul serio_raw pcspkr glue_helper processor button loop autofs4 ext4 crc16 mbcache jbd2 sd_mod sr_mod cdrom ata_generic virtio_scsi ata_piix libata virtio_pci virtio_ring crc32c_intel scsi_mod e1000 virtio floppy [last unloaded: btrfs]
    [39389.800016] irq event stamp: 0
    [39389.800016] hardirqs last  enabled at (0): [&lt;          (null)&gt;]           (null)
    [39389.800016] hardirqs last disabled at (0): [&lt;ffffffff8104e58d&gt;] copy_process+0x638/0x1a35
    [39389.800016] softirqs last  enabled at (0): [&lt;ffffffff8104e58d&gt;] copy_process+0x638/0x1a35
    [39389.800016] softirqs last disabled at (0): [&lt;          (null)&gt;]           (null)
    [39389.800016] CPU: 14 PID: 32165 Comm: fdm-stress Not tainted 4.4.0-rc6-btrfs-next-18+ #1
    [39389.800016] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014
    [39389.800016] task: ffff880175b1ca40 ti: ffff8800a185c000 task.ti: ffff8800a185c000
    [39389.800016] RIP: 0010:[&lt;ffffffff810902af&gt;]  [&lt;ffffffff810902af&gt;] queued_spin_lock_slowpath+0x57/0x158
    [39389.800016] RSP: 0018:ffff8800a185fb80  EFLAGS: 00000202
    [39389.800016] RAX: 0000000000000101 RBX: ffff8801710c4e9c RCX: 0000000000000101
    [39389.800016] RDX: 0000000000000100 RSI: 0000000000000001 RDI: 0000000000000001
    [39389.800016] RBP: ffff8800a185fb98 R08: 0000000000000001 R09: 0000000000000000
    [39389.800016] R10: ffff8800a185fb68 R11: 6db6db6db6db6db7 R12: ffff8801710c4e98
    [39389.800016] R13: ffff880175b1ca40 R14: ffff8800a185fc10 R15: ffff880175b1ca40
    [39389.800016] FS:  00007f6d37fff700(0000) GS:ffff8802be9c0000(0000) knlGS:0000000000000000
    [39389.800016] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [39389.800016] CR2: 00007f6d300019b8 CR3: 0000000037c93000 CR4: 00000000001406e0
    [39389.800016] Stack:
    [39389.800016]  ffff8801710c4e98 ffff8801710c4e98 ffff880175b1ca40 ffff8800a185fbb0
    [39389.800016]  ffffffff81091e11 ffff8801710c4e98 ffff8800a185fbc8 ffffffff81091895
    [39389.800016]  ffff8801710c4e98 ffff8800a185fbe8 ffffffff81486c5c ffffffffa067288c
    [39389.800016] Call Trace:
    [39389.800016]  [&lt;ffffffff81091e11&gt;] queued_read_lock_slowpath+0x46/0x60
    [39389.800016]  [&lt;ffffffff81091895&gt;] do_raw_read_lock+0x3e/0x41
    [39389.800016]  [&lt;ffffffff81486c5c&gt;] _raw_read_lock+0x3d/0x44
    [39389.800016]  [&lt;ffffffffa067288c&gt;] ? btrfs_tree_read_lock+0x54/0x125 [btrfs]
    [39389.800016]  [&lt;ffffffffa067288c&gt;] btrfs_tree_read_lock+0x54/0x125 [btrfs]
    [39389.800016]  [&lt;ffffffffa0622ced&gt;] ? btrfs_find_item+0xa7/0xd2 [btrfs]
    [39389.800016]  [&lt;ffffffffa069363f&gt;] btrfs_ref_to_path+0xd6/0x174 [btrfs]
    [39389.800016]  [&lt;ffffffffa0693730&gt;] inode_to_path+0x53/0xa2 [btrfs]
    [39389.800016]  [&lt;ffffffffa0693e2e&gt;] paths_from_inode+0x117/0x2ec [btrfs]
    [39389.800016]  [&lt;ffffffffa0670cff&gt;] btrfs_ioctl+0xd5b/0x2793 [btrfs]
    [39389.800016]  [&lt;ffffffff8108a8b0&gt;] ? arch_local_irq_save+0x9/0xc
    [39389.800016]  [&lt;ffffffff81276727&gt;] ? __this_cpu_preempt_check+0x13/0x15
    [39389.800016]  [&lt;ffffffff8108a8b0&gt;] ? arch_local_irq_save+0x9/0xc
    [39389.800016]  [&lt;ffffffff8118b3d4&gt;] ? rcu_read_unlock+0x3e/0x5d
    [39389.800016]  [&lt;ffffffff811822f8&gt;] do_vfs_ioctl+0x42b/0x4ea
    [39389.800016]  [&lt;ffffffff8118b4f3&gt;] ? __fget_light+0x62/0x71
    [39389.800016]  [&lt;ffffffff8118240e&gt;] SyS_ioctl+0x57/0x79
    [39389.800016]  [&lt;ffffffff814872d7&gt;] entry_SYSCALL_64_fastpath+0x12/0x6f
    [39389.800016] Code: b9 01 01 00 00 f7 c6 00 ff ff ff 75 32 83 fe 01 89 ca 89 f0 0f 45 d7 f0 0f b1 13 39 f0 74 04 89 c6 eb e2 ff ca 0f 84 fa 00 00 00 &lt;8b&gt; 03 84 c0 74 04 f3 90 eb f6 66 c7 03 01 00 e9 e6 00 00 00 e8
    [39389.800012] Modules linked in: btrfs dm_mod ppdev xor sha256_generic hmac raid6_pq drbg ansi_cprng aesni_intel i2c_piix4 acpi_cpufreq aes_x86_64 ablk_helper tpm_tis parport_pc i2c_core sg cryptd evdev psmouse lrw tpm parport gf128mul serio_raw pcspkr glue_helper processor button loop autofs4 ext4 crc16 mbcache jbd2 sd_mod sr_mod cdrom ata_generic virtio_scsi ata_piix libata virtio_pci virtio_ring crc32c_intel scsi_mod e1000 virtio floppy [last unloaded: btrfs]
    [39389.800012] irq event stamp: 0
    [39389.800012] hardirqs last  enabled at (0): [&lt;          (null)&gt;]           (null)
    [39389.800012] hardirqs last disabled at (0): [&lt;ffffffff8104e58d&gt;] copy_process+0x638/0x1a35
    [39389.800012] softirqs last  enabled at (0): [&lt;ffffffff8104e58d&gt;] copy_process+0x638/0x1a35
    [39389.800012] softirqs last disabled at (0): [&lt;          (null)&gt;]           (null)
    [39389.800012] CPU: 15 PID: 32166 Comm: fdm-stress Tainted: G             L  4.4.0-rc6-btrfs-next-18+ #1
    [39389.800012] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014
    [39389.800012] task: ffff880179294380 ti: ffff880034a60000 task.ti: ffff880034a60000
    [39389.800012] RIP: 0010:[&lt;ffffffff81091e8d&gt;]  [&lt;ffffffff81091e8d&gt;] queued_write_lock_slowpath+0x62/0x72
    [39389.800012] RSP: 0018:ffff880034a639f0  EFLAGS: 00000206
    [39389.800012] RAX: 0000000000000101 RBX: ffff8801710c4e98 RCX: 0000000000000000
    [39389.800012] RDX: 00000000000000ff RSI: 0000000000000000 RDI: ffff8801710c4e9c
    [39389.800012] RBP: ffff880034a639f8 R08: 0000000000000001 R09: 0000000000000000
    [39389.800012] R10: ffff880034a639b0 R11: 0000000000001000 R12: ffff8801710c4e98
    [39389.800012] R13: 0000000000000001 R14: ffff880172cbc000 R15: ffff8801710c4e00
    [39389.800012] FS:  00007f6d377fe700(0000) GS:ffff8802be9e0000(0000) knlGS:0000000000000000
    [39389.800012] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [39389.800012] CR2: 00007f6d3d3c1000 CR3: 0000000037c93000 CR4: 00000000001406e0
    [39389.800012] Stack:
    [39389.800012]  ffff8801710c4e98 ffff880034a63a10 ffffffff81091963 ffff8801710c4e98
    [39389.800012]  ffff880034a63a30 ffffffff81486f1b ffffffffa0672cb3 ffff8801710c4e00
    [39389.800012]  ffff880034a63a78 ffffffffa0672cb3 ffff8801710c4e00 ffff880034a63a58
    [39389.800012] Call Trace:
    [39389.800012]  [&lt;ffffffff81091963&gt;] do_raw_write_lock+0x72/0x8c
    [39389.800012]  [&lt;ffffffff81486f1b&gt;] _raw_write_lock+0x3a/0x41
    [39389.800012]  [&lt;ffffffffa0672cb3&gt;] ? btrfs_tree_lock+0x119/0x251 [btrfs]
    [39389.800012]  [&lt;ffffffffa0672cb3&gt;] btrfs_tree_lock+0x119/0x251 [btrfs]
    [39389.800012]  [&lt;ffffffffa061aeba&gt;] ? rcu_read_unlock+0x5b/0x5d [btrfs]
    [39389.800012]  [&lt;ffffffffa061ce13&gt;] ? btrfs_root_node+0xda/0xe6 [btrfs]
    [39389.800012]  [&lt;ffffffffa061ce83&gt;] btrfs_lock_root_node+0x22/0x42 [btrfs]
    [39389.800012]  [&lt;ffffffffa062046b&gt;] btrfs_search_slot+0x1b8/0x758 [btrfs]
    [39389.800012]  [&lt;ffffffff810fc6b0&gt;] ? time_hardirqs_on+0x15/0x28
    [39389.800012]  [&lt;ffffffffa06365db&gt;] btrfs_lookup_inode+0x31/0x95 [btrfs]
    [39389.800012]  [&lt;ffffffff8108d62f&gt;] ? trace_hardirqs_on+0xd/0xf
    [39389.800012]  [&lt;ffffffff8148482b&gt;] ? mutex_lock_nested+0x397/0x3bc
    [39389.800012]  [&lt;ffffffffa068821b&gt;] __btrfs_update_delayed_inode+0x59/0x1c0 [btrfs]
    [39389.800012]  [&lt;ffffffffa068858e&gt;] __btrfs_commit_inode_delayed_items+0x194/0x5aa [btrfs]
    [39389.800012]  [&lt;ffffffff81486ab7&gt;] ? _raw_spin_unlock+0x31/0x44
    [39389.800012]  [&lt;ffffffffa0688a48&gt;] __btrfs_run_delayed_items+0xa4/0x15c [btrfs]
    [39389.800012]  [&lt;ffffffffa0688d62&gt;] btrfs_run_delayed_items+0x11/0x13 [btrfs]
    [39389.800012]  [&lt;ffffffffa064048e&gt;] btrfs_commit_transaction+0x234/0x96e [btrfs]
    [39389.800012]  [&lt;ffffffffa0618d10&gt;] btrfs_sync_fs+0x145/0x1ad [btrfs]
    [39389.800012]  [&lt;ffffffffa0671176&gt;] btrfs_ioctl+0x11d2/0x2793 [btrfs]
    [39389.800012]  [&lt;ffffffff8108a8b0&gt;] ? arch_local_irq_save+0x9/0xc
    [39389.800012]  [&lt;ffffffff81140261&gt;] ? __might_fault+0x4c/0xa7
    [39389.800012]  [&lt;ffffffff81140261&gt;] ? __might_fault+0x4c/0xa7
    [39389.800012]  [&lt;ffffffff8108a8b0&gt;] ? arch_local_irq_save+0x9/0xc
    [39389.800012]  [&lt;ffffffff8118b3d4&gt;] ? rcu_read_unlock+0x3e/0x5d
    [39389.800012]  [&lt;ffffffff811822f8&gt;] do_vfs_ioctl+0x42b/0x4ea
    [39389.800012]  [&lt;ffffffff8118b4f3&gt;] ? __fget_light+0x62/0x71
    [39389.800012]  [&lt;ffffffff8118240e&gt;] SyS_ioctl+0x57/0x79
    [39389.800012]  [&lt;ffffffff814872d7&gt;] entry_SYSCALL_64_fastpath+0x12/0x6f
    [39389.800012] Code: f0 0f b1 13 85 c0 75 ef eb 2a f3 90 8a 03 84 c0 75 f8 f0 0f b0 13 84 c0 75 f0 ba ff 00 00 00 eb 0a f0 0f b1 13 ff c8 74 0b f3 90 &lt;8b&gt; 03 83 f8 01 75 f7 eb ed c6 43 04 00 5b 5d c3 0f 1f 44 00 00

    This happens because in the code path executed by the inode_paths ioctl we
    end up nesting two calls to read lock a leaf's rwlock when after the first
    call to read_lock() and before the second call to read_lock(), another
    task (running the delayed items as part of a transaction commit) has
    already called write_lock() against the leaf's rwlock. This situation is
    illustrated by the following diagram:

             Task A                       Task B

      btrfs_ref_to_path()               btrfs_commit_transaction()
        read_lock(&amp;eb-&gt;lock);

                                          btrfs_run_delayed_items()
                                            __btrfs_commit_inode_delayed_items()
                                              __btrfs_update_delayed_inode()
                                                btrfs_lookup_inode()

                                                  write_lock(&amp;eb-&gt;lock);
                                                    --&gt; task waits for lock

        read_lock(&amp;eb-&gt;lock);
        --&gt; makes this task hang
            forever (and task B too
    	of course)

    So fix this by avoiding doing the nested read lock, which is easily
    avoidable. This issue does not happen if task B calls write_lock() after
    task A does the second call to read_lock(), however there does not seem
    to exist anything in the documentation that mentions what is the expected
    behaviour for recursive locking of rwlocks (leaving the idea that doing
    so is not a good usage of rwlocks).

    Also, as a side effect necessary for this fix, make sure we do not
    needlessly read lock extent buffers when the input path has skip_locking
    set (used when called from send).

    Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 819f428a70930100319b7e30716e467c6a183737
Author: Insu Yun &lt;wuninsu@gmail.com&gt;
Date:   Fri Feb 12 01:15:59 2016 -0500

    ext4: fix potential integer overflow

    commit 46901760b46064964b41015d00c140c83aa05bcf upstream.

    Since sizeof(ext_new_group_data) &gt; sizeof(ext_new_flex_group_data),
    integer overflow could be happened.
    Therefore, need to fix integer overflow sanitization.

    Signed-off-by: Insu Yun &lt;wuninsu@gmail.com&gt;
    Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit ff19ac8fb71e8a2bf07d61b959062998139c1104
Author: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Date:   Fri Feb 19 17:36:21 2016 -0800

    AIO: properly check iovec sizes

    In Linus's tree, the iovec code has been reworked massively, but in
    older kernels the AIO layer should be checking this before passing the
    request on to other layers.

    Many thanks to Ben Hawkes of Google Project Zero for pointing out the
    issue.

    Reported-by: Ben Hawkes &lt;hawkes@google.com&gt;
    Acked-by: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
    Tested-by: Willy Tarreau &lt;w@1wt.eu&gt;
    [backported to 3.10 - willy]
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 8355335f9bea09864ca2cba55abf25e4486c13f9
Author: Herton R. Krzesinski &lt;herton@redhat.com&gt;
Date:   Thu Jan 14 17:56:58 2016 -0200

    pty: make sure super_block is still valid in final /dev/tty close

    commit 1f55c718c290616889c04946864a13ef30f64929 upstream.

    Considering current pty code and multiple devpts instances, it's possible
    to umount a devpts file system while a program still has /dev/tty opened
    pointing to a previosuly closed pty pair in that instance. In the case all
    ptmx and pts/N files are closed, umount can be done. If the program closes
    /dev/tty after umount is done, devpts_kill_index will use now an invalid
    super_block, which was already destroyed in the umount operation after
    running -&gt;kill_sb. This is another "use after free" type of issue, but now
    related to the allocated super_block instance.

    To avoid the problem (warning at ida_remove and potential crashes) for
    this specific case, I added two functions in devpts which grabs additional
    references to the super_block, which pty code now uses so it makes sure
    the super block structure is still valid until pty shutdown is done.
    I also moved the additional inode references to the same functions, which
    also covered similar case with inode being freed before /dev/tty final
    close/shutdown.

    Signed-off-by: Herton R. Krzesinski &lt;herton@redhat.com&gt;
    Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 042105bb8df0b22c4cd5867f15cfdd0048326f86
Author: Herton R. Krzesinski &lt;herton@redhat.com&gt;
Date:   Mon Jan 11 12:07:43 2016 -0200

    pty: fix possible use after free of tty-&gt;driver_data

    commit 2831c89f42dcde440cfdccb9fee9f42d54bbc1ef upstream.

    This change fixes a bug for a corner case where we have the the last
    release from a pty master/slave coming from a previously opened /dev/tty
    file. When this happens, the tty-&gt;driver_data can be stale, due to all
    ptmx or pts/N files having already been closed before (and thus the inode
    related to these files, which tty-&gt;driver_data points to, being already
    freed/destroyed).

    The fix here is to keep a reference on the opened master ptmx inode.
    We maintain the inode referenced until the final pty_unix98_shutdown,
    and only pass this inode to devpts_kill_index.

    Signed-off-by: Herton R. Krzesinski &lt;herton@redhat.com&gt;
    Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit d2878b36ad382cb3184e37737b6d7f24162321f8
Author: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Date:   Sun Jan 10 22:40:58 2016 -0800

    staging/speakup: Use tty_ldisc_ref() for paste kworker

    commit f4f9edcf9b5289ed96113e79fa65a7bf27ecb096 upstream.

    As the function documentation for tty_ldisc_ref_wait() notes, it is
    only callable from a tty file_operations routine; otherwise there
    is no guarantee the ref won't be NULL.

    The key difference with the VT's paste_selection() is that is an ioctl,
    where __speakup_paste_selection() is completely async kworker, kicked
    off from interrupt context.

    Fixes: 28a821c30688 ("Staging: speakup: Update __speakup_paste_selection()
           tty (ab)usage to match vt")
    Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2ea15d97629bda8f5616a46c01fe7057f046a743
Author: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Date:   Fri Nov 27 14:18:39 2015 -0500

    wan/x25: Fix use-after-free in x25_asy_open_tty()

    commit ee9159ddce14bc1dec9435ae4e3bd3153e783706 upstream.

    The N_X25 line discipline may access the previous line discipline's closed
    and already-freed private data on open [1].

    The tty-&gt;disc_data field _never_ refers to valid data on entry to the
    line discipline's open() method. Rather, the ldisc is expected to
    initialize that field for its own use for the lifetime of the instance
    (ie. from open() to close() only).

    [1]
        [  634.336761] ==================================================================
        [  634.338226] BUG: KASAN: use-after-free in x25_asy_open_tty+0x13d/0x490 at addr ffff8800a743efd0
        [  634.339558] Read of size 4 by task syzkaller_execu/8981
        [  634.340359] =============================================================================
        [  634.341598] BUG kmalloc-512 (Not tainted): kasan: bad access detected
        ...
        [  634.405018] Call Trace:
        [  634.405277] dump_stack (lib/dump_stack.c:52)
        [  634.405775] print_trailer (mm/slub.c:655)
        [  634.406361] object_err (mm/slub.c:662)
        [  634.406824] kasan_report_error (mm/kasan/report.c:138 mm/kasan/report.c:236)
        [  634.409581] __asan_report_load4_noabort (mm/kasan/report.c:279)
        [  634.411355] x25_asy_open_tty (drivers/net/wan/x25_asy.c:559 (discriminator 1))
        [  634.413997] tty_ldisc_open.isra.2 (drivers/tty/tty_ldisc.c:447)
        [  634.414549] tty_set_ldisc (drivers/tty/tty_ldisc.c:567)
        [  634.415057] tty_ioctl (drivers/tty/tty_io.c:2646 drivers/tty/tty_io.c:2879)
        [  634.423524] do_vfs_ioctl (fs/ioctl.c:43 fs/ioctl.c:607)
        [  634.427491] SyS_ioctl (fs/ioctl.c:622 fs/ioctl.c:613)
        [  634.427945] entry_SYSCALL_64_fastpath (arch/x86/entry/entry_64.S:188)

    Reported-and-tested-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
    Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 549584e9e1241756e244b35398a25e63de37f11c
Author: Takashi Iwai &lt;tiwai@suse.de&gt;
Date:   Tue Feb 16 14:15:59 2016 +0100

    ALSA: seq: Fix double port list deletion

    commit 13d5e5d4725c64ec06040d636832e78453f477b7 upstream.

    The commit [7f0973e973cd: ALSA: seq: Fix lockdep warnings due to
    double mutex locks] split the management of two linked lists (source
    and destination) into two individual calls for avoiding the AB/BA
    deadlock.  However, this may leave the possible double deletion of one
    of two lists when the counterpart is being deleted concurrently.
    It ends up with a list corruption, as revealed by syzkaller fuzzer.

    This patch fixes it by checking the list emptiness and skipping the
    deletion and the following process.

    BugLink: http://lkml.kernel.org/r/CACT4Y+bay9qsrz6dQu31EcGaH9XwfW7o3oBzSQUG9fMszoh=Sg@mail.gmail.com
    Fixes: 7f0973e973cd ('ALSA: seq: Fix lockdep warnings due to 'double mutex locks)
    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Linux 3.10.95 (accumulative patch)</title>
<updated>2016-08-26T18:47:31+00:00</updated>
<author>
<name>Stefan Guendhoer</name>
<email>stefan@guendhoer.com</email>
</author>
<published>2016-01-23T13:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=982ceba27dcd67080055fd9d1f21e7cc1ca852af'/>
<id>urn:sha1:982ceba27dcd67080055fd9d1f21e7cc1ca852af</id>
<content type='text'>
commit 14b58660bc26be42d272f7fb0d153ed8fc0a0c4e
Author: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Date:   Fri Jan 22 20:33:57 2016 -0800

    Linux 3.10.95

commit 84de97ff5075bb6b4c25e8cbbcd40e55da1c1d4c
Author: Yevgeny Pats &lt;yevgeny@perception-point.io&gt;
Date:   Tue Jan 19 22:09:04 2016 +0000

    KEYS: Fix keyring ref leak in join_session_keyring()

    commit 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2 upstream.

    This fixes CVE-2016-0728.

    If a thread is asked to join as a session keyring the keyring that's already
    set as its session, we leak a keyring reference.

    This can be tested with the following program:

    	#include &lt;stddef.h&gt;
    	#include &lt;stdio.h&gt;
    	#include &lt;sys/types.h&gt;
    	#include &lt;keyutils.h&gt;

    	int main(int argc, const char *argv[])
    	{
    		int i = 0;
    		key_serial_t serial;

    		serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
    				"leaked-keyring");
    		if (serial &lt; 0) {
    			perror("keyctl");
    			return -1;
    		}

    		if (keyctl(KEYCTL_SETPERM, serial,
    			   KEY_POS_ALL | KEY_USR_ALL) &lt; 0) {
    			perror("keyctl");
    			return -1;
    		}

    		for (i = 0; i &lt; 100; i++) {
    			serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
    					"leaked-keyring");
    			if (serial &lt; 0) {
    				perror("keyctl");
    				return -1;
    			}
    		}

    		return 0;
    	}

    If, after the program has run, there something like the following line in
    /proc/keys:

    3f3d898f I--Q---   100 perm 3f3f0000     0     0 keyring   leaked-keyring: empty

    with a usage count of 100 * the number of times the program has been run,
    then the kernel is malfunctioning.  If leaked-keyring has zero usages or
    has been garbage collected, then the problem is fixed.

    Reported-by: Yevgeny Pats &lt;yevgeny@perception-point.io&gt;
    Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
    Acked-by: Don Zickus &lt;dzickus@redhat.com&gt;
    Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
    Acked-by: Jarod Wilson &lt;jarod@redhat.com&gt;
    Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit afd8f582ae388b0d1c7d0532dc31f4f85c1098dc
Author: David Howells &lt;dhowells@redhat.com&gt;
Date:   Fri Dec 18 01:34:26 2015 +0000

    KEYS: Fix race between read and revoke

    commit b4a1b4f5047e4f54e194681125c74c0aa64d637d upstream.

    This fixes CVE-2015-7550.

    There's a race between keyctl_read() and keyctl_revoke().  If the revoke
    happens between keyctl_read() checking the validity of a key and the key's
    semaphore being taken, then the key type read method will see a revoked key.

    This causes a problem for the user-defined key type because it assumes in
    its read method that there will always be a payload in a non-revoked key
    and doesn't check for a NULL pointer.

    Fix this by making keyctl_read() check the validity of a key after taking
    semaphore instead of before.

    I think the bug was introduced with the original keyrings code.

    This was discovered by a multithreaded test program generated by syzkaller
    (http://github.com/google/syzkaller).  Here's a cleaned up version:

    	#include &lt;sys/types.h&gt;
    	#include &lt;keyutils.h&gt;
    	#include &lt;pthread.h&gt;
    	void *thr0(void *arg)
    	{
    		key_serial_t key = (unsigned long)arg;
    		keyctl_revoke(key);
    		return 0;
    	}
    	void *thr1(void *arg)
    	{
    		key_serial_t key = (unsigned long)arg;
    		char buffer[16];
    		keyctl_read(key, buffer, 16);
    		return 0;
    	}
    	int main()
    	{
    		key_serial_t key = add_key("user", "%", "foo", 3, KEY_SPEC_USER_KEYRING);
    		pthread_t th[5];
    		pthread_create(&amp;th[0], 0, thr0, (void *)(unsigned long)key);
    		pthread_create(&amp;th[1], 0, thr1, (void *)(unsigned long)key);
    		pthread_create(&amp;th[2], 0, thr0, (void *)(unsigned long)key);
    		pthread_create(&amp;th[3], 0, thr1, (void *)(unsigned long)key);
    		pthread_join(th[0], 0);
    		pthread_join(th[1], 0);
    		pthread_join(th[2], 0);
    		pthread_join(th[3], 0);
    		return 0;
    	}

    Build as:

    	cc -o keyctl-race keyctl-race.c -lkeyutils -lpthread

    Run as:

    	while keyctl-race; do :; done

    as it may need several iterations to crash the kernel.  The crash can be
    summarised as:

    	BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
    	IP: [&lt;ffffffff81279b08&gt;] user_read+0x56/0xa3
    	...
    	Call Trace:
    	 [&lt;ffffffff81276aa9&gt;] keyctl_read_key+0xb6/0xd7
    	 [&lt;ffffffff81277815&gt;] SyS_keyctl+0x83/0xe0
    	 [&lt;ffffffff815dbb97&gt;] entry_SYSCALL_64_fastpath+0x12/0x6f

    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
    Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 577ee88e9632fe613c28381dc1a1cc32198fc924
Author: David Howells &lt;dhowells@redhat.com&gt;
Date:   Thu Oct 15 17:21:37 2015 +0100

    KEYS: Fix crash when attempt to garbage collect an uninstantiated keyring

    commit f05819df10d7b09f6d1eb6f8534a8f68e5a4fe61 upstream.

    The following sequence of commands:

        i=`keyctl add user a a @s`
        keyctl request2 keyring foo bar @t
        keyctl unlink $i @s

    tries to invoke an upcall to instantiate a keyring if one doesn't already
    exist by that name within the user's keyring set.  However, if the upcall
    fails, the code sets keyring-&gt;type_data.reject_error to -ENOKEY or some
    other error code.  When the key is garbage collected, the key destroy
    function is called unconditionally and keyring_destroy() uses list_empty()
    on keyring-&gt;type_data.link - which is in a union with reject_error.
    Subsequently, the kernel tries to unlink the keyring from the keyring names
    list - which oopses like this:

    	BUG: unable to handle kernel paging request at 00000000ffffff8a
    	IP: [&lt;ffffffff8126e051&gt;] keyring_destroy+0x3d/0x88
    	...
    	Workqueue: events key_garbage_collector
    	...
    	RIP: 0010:[&lt;ffffffff8126e051&gt;] keyring_destroy+0x3d/0x88
    	RSP: 0018:ffff88003e2f3d30  EFLAGS: 00010203
    	RAX: 00000000ffffff82 RBX: ffff88003bf1a900 RCX: 0000000000000000
    	RDX: 0000000000000000 RSI: 000000003bfc6901 RDI: ffffffff81a73a40
    	RBP: ffff88003e2f3d38 R08: 0000000000000152 R09: 0000000000000000
    	R10: ffff88003e2f3c18 R11: 000000000000865b R12: ffff88003bf1a900
    	R13: 0000000000000000 R14: ffff88003bf1a908 R15: ffff88003e2f4000
    	...
    	CR2: 00000000ffffff8a CR3: 000000003e3ec000 CR4: 00000000000006f0
    	...
    	Call Trace:
    	 [&lt;ffffffff8126c756&gt;] key_gc_unused_keys.constprop.1+0x5d/0x10f
    	 [&lt;ffffffff8126ca71&gt;] key_garbage_collector+0x1fa/0x351
    	 [&lt;ffffffff8105ec9b&gt;] process_one_work+0x28e/0x547
    	 [&lt;ffffffff8105fd17&gt;] worker_thread+0x26e/0x361
    	 [&lt;ffffffff8105faa9&gt;] ? rescuer_thread+0x2a8/0x2a8
    	 [&lt;ffffffff810648ad&gt;] kthread+0xf3/0xfb
    	 [&lt;ffffffff810647ba&gt;] ? kthread_create_on_node+0x1c2/0x1c2
    	 [&lt;ffffffff815f2ccf&gt;] ret_from_fork+0x3f/0x70
    	 [&lt;ffffffff810647ba&gt;] ? kthread_create_on_node+0x1c2/0x1c2

    Note the value in RAX.  This is a 32-bit representation of -ENOKEY.

    The solution is to only call -&gt;destroy() if the key was successfully
    instantiated.

    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
    Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit ccc152bf4abb68e6d2c55091252f870bc4ee7a92
Author: David Howells &lt;dhowells@redhat.com&gt;
Date:   Fri Sep 25 16:30:08 2015 +0100

    KEYS: Fix race between key destruction and finding a keyring by name

    commit 94c4554ba07adbdde396748ee7ae01e86cf2d8d7 upstream.

    There appears to be a race between:

     (1) key_gc_unused_keys() which frees key-&gt;security and then calls
         keyring_destroy() to unlink the name from the name list

     (2) find_keyring_by_name() which calls key_permission(), thus accessing
         key-&gt;security, on a key before checking to see whether the key usage is 0
         (ie. the key is dead and might be cleaned up).

    Fix this by calling -&gt;destroy() before cleaning up the core key data -
    including key-&gt;security.

    Reported-by: Petr Matousek &lt;pmatouse@redhat.com&gt;
    Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 3a57e783016bf43ab9326172217f564941b85b17
Author: Rainer Weikusat &lt;rweikusat@mobileactivedefense.com&gt;
Date:   Wed Dec 16 20:09:25 2015 +0000

    af_unix: Revert 'lock_interruptible' in stream receive code

    [ Upstream commit 3822b5c2fc62e3de8a0f33806ff279fb7df92432 ]

    With b3ca9b02b00704053a38bfe4c31dbbb9c13595d0, the AF_UNIX SOCK_STREAM
    receive code was changed from using mutex_lock(&amp;u-&gt;readlock) to
    mutex_lock_interruptible(&amp;u-&gt;readlock) to prevent signals from being
    delayed for an indefinite time if a thread sleeping on the mutex
    happened to be selected for handling the signal. But this was never a
    problem with the stream receive code (as opposed to its datagram
    counterpart) as that never went to sleep waiting for new messages with the
    mutex held and thus, wouldn't cause secondary readers to block on the
    mutex waiting for the sleeping primary reader. As the interruptible
    locking makes the code more complicated in exchange for no benefit,
    change it back to using mutex_lock.

    Signed-off-by: Rainer Weikusat &lt;rweikusat@mobileactivedefense.com&gt;
    Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit aea23834fd3daa60039be8773aa39fb039aac945
Author: David S. Miller &lt;davem@davemloft.net&gt;
Date:   Tue Dec 15 15:39:08 2015 -0500

    bluetooth: Validate socket address length in sco_sock_bind().

    [ Upstream commit 5233252fce714053f0151680933571a2da9cbfb4 ]

    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 83f2b0860770d05f14cb8ce29ffd18f2f5585a4e
Author: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
Date:   Mon Dec 14 13:48:36 2015 -0800

    pptp: verify sockaddr_len in pptp_bind() and pptp_connect()

    [ Upstream commit 09ccfd238e5a0e670d8178cf50180ea81ae09ae1 ]

    Reported-by: Dmitry Vyukov &lt;dvyukov@gmail.com&gt;
    Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 457fca596cd37ea06006b290bdbc5c7c5d8a12e3
Author: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Date:   Fri Dec 4 01:45:40 2015 +0300

    sh_eth: fix kernel oops in skb_put()

    [ Upstream commit 248be83dcb3feb3f6332eb3d010a016402138484 ]

    In a low memory situation the following kernel oops occurs:

    Unable to handle kernel NULL pointer dereference at virtual address 00000050
    pgd = 8490c000
    [00000050] *pgd=4651e831, *pte=00000000, *ppte=00000000
    Internal error: Oops: 17 [#1] PREEMPT ARM
    Modules linked in:
    CPU: 0    Not tainted  (3.4-at16 #9)
    PC is at skb_put+0x10/0x98
    LR is at sh_eth_poll+0x2c8/0xa10
    pc : [&lt;8035f780&gt;]    lr : [&lt;8028bf50&gt;]    psr: 60000113
    sp : 84eb1a90  ip : 84eb1ac8  fp : 84eb1ac4
    r10: 0000003f  r9 : 000005ea  r8 : 00000000
    r7 : 00000000  r6 : 940453b0  r5 : 00030000  r4 : 9381b180
    r3 : 00000000  r2 : 00000000  r1 : 000005ea  r0 : 00000000
    Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    Control: 10c53c7d  Table: 4248c059  DAC: 00000015
    Process klogd (pid: 2046, stack limit = 0x84eb02e8)
    [...]

    This is  because netdev_alloc_skb() fails and 'mdp-&gt;rx_skbuff[entry]' is left
    NULL but sh_eth_rx() later  uses it without checking.  Add such check...

    Reported-by: Yasushi SHOJI &lt;yashi@atmark-techno.com&gt;
    Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 0b15bc29250706ab64cbebb6a4739d3a76e23103
Author: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Date:   Mon Dec 14 22:03:39 2015 +0100

    net: add validation for the socket syscall protocol argument

    [ Upstream commit 79462ad02e861803b3840cc782248c7359451cd9 ]

    郭永刚 reported that one could simply crash the kernel as root by
    using a simple program:

    	int socket_fd;
    	struct sockaddr_in addr;
    	addr.sin_port = 0;
    	addr.sin_addr.s_addr = INADDR_ANY;
    	addr.sin_family = 10;

    	socket_fd = socket(10,3,0x40000000);
    	connect(socket_fd , &amp;addr,16);

    AF_INET, AF_INET6 sockets actually only support 8-bit protocol
    identifiers. inet_sock's skc_protocol field thus is sized accordingly,
    thus larger protocol identifiers simply cut off the higher bits and
    store a zero in the protocol fields.

    This could lead to e.g. NULL function pointer because as a result of
    the cut off inet_num is zero and we call down to inet_autobind, which
    is NULL for raw sockets.

    kernel: Call Trace:
    kernel:  [&lt;ffffffff816db90e&gt;] ? inet_autobind+0x2e/0x70
    kernel:  [&lt;ffffffff816db9a4&gt;] inet_dgram_connect+0x54/0x80
    kernel:  [&lt;ffffffff81645069&gt;] SYSC_connect+0xd9/0x110
    kernel:  [&lt;ffffffff810ac51b&gt;] ? ptrace_notify+0x5b/0x80
    kernel:  [&lt;ffffffff810236d8&gt;] ? syscall_trace_enter_phase2+0x108/0x200
    kernel:  [&lt;ffffffff81645e0e&gt;] SyS_connect+0xe/0x10
    kernel:  [&lt;ffffffff81779515&gt;] tracesys_phase2+0x84/0x89

    I found no particular commit which introduced this problem.

    CVE: CVE-2015-8543
    Cc: Cong Wang &lt;cwang@twopensource.com&gt;
    Reported-by: 郭永刚 &lt;guoyonggang@360.cn&gt;
    Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 62c8fcbdf619bf5c1c7f666cefefb88401904203
Author: Eric Dumazet &lt;edumazet@google.com&gt;
Date:   Wed Dec 9 07:25:06 2015 -0800

    ipv6: sctp: clone options to avoid use after free

    [ Upstream commit 9470e24f35ab81574da54e69df90c1eb4a96b43f ]

    SCTP is lacking proper np-&gt;opt cloning at accept() time.

    TCP and DCCP use ipv6_dup_options() helper, do the same
    in SCTP.

    We might later factorize this code in a common helper to avoid
    future mistakes.

    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Acked-by: Vlad Yasevich &lt;vyasevich@gmail.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 33fbe78ae82b7750da133439043847d0f79cb5ae
Author: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Date:   Fri Dec 4 15:14:04 2015 -0200

    sctp: update the netstamp_needed counter when copying sockets

    [ Upstream commit 01ce63c90170283a9855d1db4fe81934dddce648 ]

    Dmitry Vyukov reported that SCTP was triggering a WARN on socket destroy
    related to disabling sock timestamp.

    When SCTP accepts an association or peel one off, it copies sock flags
    but forgot to call net_enable_timestamp() if a packet timestamping flag
    was copied, leading to extra calls to net_disable_timestamp() whenever
    such clones were closed.

    The fix is to call net_enable_timestamp() whenever we copy a sock with
    that flag on, like tcp does.

    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
    Acked-by: Vlad Yasevich &lt;vyasevich@gmail.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit cbc3e98d4cba328bbb1aec5da784c5e84f601954
Author: Pavel Machek &lt;pavel@ucw.cz&gt;
Date:   Fri Dec 4 09:50:00 2015 +0100

    atl1c: Improve driver not to do order 4 GFP_ATOMIC allocation

    [ Upstream commit f2a3771ae8aca879c32336c76ad05a017629bae2 ]

    atl1c driver is doing order-4 allocation with GFP_ATOMIC
    priority. That often breaks  networking after resume. Switch to
    GFP_KERNEL. Still not ideal, but should be significantly better.

    atl1c_setup_ring_resources() is called from .open() function, and
    already uses GFP_KERNEL, so this change is safe.

    Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
    Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 6089a80384074617cbe77ba8d315f24a7741a437
Author: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Date:   Thu Dec 3 17:21:50 2015 +0100

    gre6: allow to update all parameters via rtnl

    [ Upstream commit 6a61d4dbf4f54b5683e0f1e58d873cecca7cb977 ]

    Parameters were updated only if the kernel was unable to find the tunnel
    with the new parameters, ie only if core pamareters were updated (keys,
    addr, link, type).
    Now it's possible to update ttl, hoplimit, flowinfo and flags.

    Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
    Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 7541d74e478278844cc643c9d7c4878dd51eae5e
Author: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Date:   Wed Nov 18 02:01:21 2015 +0000

    usb: Use the USB_SS_MULT() macro to decode burst multiplier for log message

    commit 5377adb092664d336ac212499961cac5e8728794 upstream.

    usb_parse_ss_endpoint_companion() now decodes the burst multiplier
    correctly in order to check that it's &lt;= 3, but still uses the wrong
    expression if warning that it's &gt; 3.

    Fixes: ff30cbc8da42 ("usb: Use the USB_SS_MULT() macro to get the ...")
    Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 42ef7474dcf3b8502dfa0dd9700caf1a6139d521
Author: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Date:   Sat Nov 21 00:36:44 2015 +0300

    USB: whci-hcd: add check for dma mapping error

    commit f9fa1887dcf26bd346665a6ae3d3f53dec54cba1 upstream.

    qset_fill_page_list() do not check for dma mapping errors.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 506d8269fb6184db68062df4d9fe787b95535ee4
Author: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Date:   Thu Dec 10 15:27:21 2015 -0500

    USB: add quirk for devices with broken LPM

    commit ad87e03213b552a5c33d5e1e7a19a73768397010 upstream.

    Some USB device / host controller combinations seem to have problems
    with Link Power Management.  For example, Steinar found that his xHCI
    controller wouldn't handle bandwidth calculations correctly for two
    video cards simultaneously when LPM was enabled, even though the bus
    had plenty of bandwidth available.

    This patch introduces a new quirk flag for devices that should remain
    disabled for LPM, and creates quirk entries for Steinar's devices.

    Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
    Reported-by: Steinar H. Gunderson &lt;sgunderson@bigfoot.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit e68f3e07d9f90b08083e903e24361241e0c9e0c7
Author: Konstantin Shkolnyy &lt;konstantin.shkolnyy@gmail.com&gt;
Date:   Tue Nov 10 16:40:13 2015 -0600

    USB: cp210x: Remove CP2110 ID from compatibility list

    commit 7c90e610b60cd1ed6abafd806acfaedccbbe52d1 upstream.

    CP2110 ID (0x10c4, 0xea80) doesn't belong here because it's a HID
    and completely different from CP210x devices.

    Signed-off-by: Konstantin Shkolnyy &lt;konstantin.shkolnyy@gmail.com&gt;
    Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 7f877278601066e09833e1c3b47c483065ddc8fd
Author: Jonas Jonsson &lt;jonas@ludd.ltu.se&gt;
Date:   Sun Nov 22 11:47:17 2015 +0100

    USB: cdc_acm: Ignore Infineon Flash Loader utility

    commit f33a7f72e5fc033daccbb8d4753d7c5c41a4d67b upstream.

    Some modems, such as the Telit UE910, are using an Infineon Flash Loader
    utility. It has two interfaces, 2/2/0 (Abstract Modem) and 10/0/0 (CDC
    Data). The latter can be used as a serial interface to upgrade the
    firmware of the modem. However, that isn't possible when the cdc-acm
    driver takes control of the device.

    The following is an explanation of the behaviour by Daniele Palmas during
    discussion on linux-usb.

    "This is what happens when the device is turned on (without modifying
    the drivers):

    [155492.352031] usb 1-3: new high-speed USB device number 27 using ehci-pci
    [155492.485429] usb 1-3: config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 255, changing to 11
    [155492.485436] usb 1-3: New USB device found, idVendor=058b, idProduct=0041
    [155492.485439] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [155492.485952] cdc_acm 1-3:1.0: ttyACM0: USB ACM device

    This is the flashing device that is caught by the cdc-acm driver. Once
    the ttyACM appears, the application starts sending a magic string
    (simple write on the file descriptor) to keep the device in flashing
    mode. If this magic string is not properly received in a certain time
    interval, the modem goes on in normal operative mode:

    [155493.748094] usb 1-3: USB disconnect, device number 27
    [155494.916025] usb 1-3: new high-speed USB device number 28 using ehci-pci
    [155495.059978] usb 1-3: New USB device found, idVendor=1bc7, idProduct=0021
    [155495.059983] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [155495.059986] usb 1-3: Product: 6 CDC-ACM + 1 CDC-ECM
    [155495.059989] usb 1-3: Manufacturer: Telit
    [155495.059992] usb 1-3: SerialNumber: 359658044004697
    [155495.138958] cdc_acm 1-3:1.0: ttyACM0: USB ACM device
    [155495.140832] cdc_acm 1-3:1.2: ttyACM1: USB ACM device
    [155495.142827] cdc_acm 1-3:1.4: ttyACM2: USB ACM device
    [155495.144462] cdc_acm 1-3:1.6: ttyACM3: USB ACM device
    [155495.145967] cdc_acm 1-3:1.8: ttyACM4: USB ACM device
    [155495.147588] cdc_acm 1-3:1.10: ttyACM5: USB ACM device
    [155495.154322] cdc_ether 1-3:1.12 wwan0: register 'cdc_ether' at usb-0000:00:1a.7-3, Mobile Broadband Network Device, 00:00:11:12:13:14

    Using the cdc-acm driver, the string, though being sent in the same way
    than using the usb-serial-simple driver (I can confirm that the data is
    passing properly since I used an hw usb sniffer), does not make the
    device to stay in flashing mode."

    Signed-off-by: Jonas Jonsson &lt;jonas@ludd.ltu.se&gt;
    Tested-by: Daniele Palmas &lt;dnlplm@gmail.com&gt;
    Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 7fdb403bf19da6702f3a37be080f1ccdb8572d08
Author: Jeff Layton &lt;jlayton@poochiereds.net&gt;
Date:   Wed Nov 25 13:50:11 2015 -0500

    nfs: if we have no valid attrs, then don't declare the attribute cache valid

    commit c812012f9ca7cf89c9e1a1cd512e6c3b5be04b85 upstream.

    If we pass in an empty nfs_fattr struct to nfs_update_inode, it will
    (correctly) not update any of the attributes, but it then clears the
    NFS_INO_INVALID_ATTR flag, which indicates that the attributes are
    up to date. Don't clear the flag if the fattr struct has no valid
    attrs to apply.

    Reviewed-by: Steve French &lt;steve.french@primarydata.com&gt;
    Signed-off-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
    Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 308b77ea2d4add613708e2c82bc9f4d987095e12
Author: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Date:   Fri Nov 20 09:56:20 2015 -0500

    nfs4: start callback_ident at idr 1

    commit c68a027c05709330fe5b2f50c50d5fa02124b5d8 upstream.

    If clp-&gt;cl_cb_ident is zero, then nfs_cb_idr_remove_locked() skips removing
    it when the nfs_client is freed.  A decoding or server bug can then find
    and try to put that first nfs_client which would lead to a crash.

    Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
    Fixes: d6870312659d ("nfs4client: convert to idr_alloc()")
    Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit ef29913621a4fcfcf85d46935ddd4fb510f559bf
Author: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Date:   Tue Nov 3 01:46:21 2015 +0100

    firewire: ohci: fix JMicron JMB38x IT context discovery

    commit 100ceb66d5c40cc0c7018e06a9474302470be73c upstream.

    Reported by Clifford and Craig for JMicron OHCI-1394 + SDHCI combo
    controllers:  Often or even most of the time, the controller is
    initialized with the message "added OHCI v1.10 device as card 0, 4 IR +
    0 IT contexts, quirks 0x10".  With 0 isochronous transmit DMA contexts
    (IT contexts), applications like audio output are impossible.

    However, OHCI-1394 demands that at least 4 IT contexts are implemented
    by the link layer controller, and indeed JMicron JMB38x do implement
    four of them.  Only their IsoXmitIntMask register is unreliable at early
    access.

    With my own JMB381 single function controller I found:
      - I can reproduce the problem with a lower probability than Craig's.
      - If I put a loop around the section which clears and reads
        IsoXmitIntMask, then either the first or the second attempt will
        return the correct initial mask of 0x0000000f.  I never encountered
        a case of needing more than a second attempt.
      - Consequently, if I put a dummy reg_read(...IsoXmitIntMaskSet)
        before the first write, the subsequent read will return the correct
        result.
      - If I merely ignore a wrong read result and force the known real
        result, later isochronous transmit DMA usage works just fine.

    So let's just fix this chip bug up by the latter method.  Tested with
    JMB381 on kernel 3.13 and 4.3.

    Since OHCI-1394 generally requires 4 IT contexts at a minium, this
    workaround is simply applied whenever the initial read of IsoXmitIntMask
    returns 0, regardless whether it's a JMicron chip or not.  I never heard
    of this issue together with any other chip though.

    I am not 100% sure that this fix works on the OHCI-1394 part of JMB380
    and JMB388 combo controllers exactly the same as on the JMB381 single-
    function controller, but so far I haven't had a chance to let an owner
    of a combo chip run a patched kernel.

    Strangely enough, IsoRecvIntMask is always reported correctly, even
    though it is probed right before IsoXmitIntMask.

    Reported-by: Clifford Dunn
    Reported-by: Craig Moore &lt;craig.moore@qenos.com&gt;
    Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit fe4b6c2682109967c21ff28a47adfb5cb7d361aa
Author: Daeho Jeong &lt;daeho.jeong@samsung.com&gt;
Date:   Sun Oct 18 17:02:56 2015 -0400

    ext4, jbd2: ensure entering into panic after recording an error in superblock

    commit 4327ba52afd03fc4b5afa0ee1d774c9c5b0e85c5 upstream.

    If a EXT4 filesystem utilizes JBD2 journaling and an error occurs, the
    journaling will be aborted first and the error number will be recorded
    into JBD2 superblock and, finally, the system will enter into the
    panic state in "errors=panic" option.  But, in the rare case, this
    sequence is little twisted like the below figure and it will happen
    that the system enters into panic state, which means the system reset
    in mobile environment, before completion of recording an error in the
    journal superblock. In this case, e2fsck cannot recognize that the
    filesystem failure occurred in the previous run and the corruption
    wouldn't be fixed.

    Task A                        Task B
    ext4_handle_error()
    -&gt; jbd2_journal_abort()
      -&gt; __journal_abort_soft()
        -&gt; __jbd2_journal_abort_hard()
        | -&gt; journal-&gt;j_flags |= JBD2_ABORT;
        |
        |                         __ext4_abort()
        |                         -&gt; jbd2_journal_abort()
        |                         | -&gt; __journal_abort_soft()
        |                         |   -&gt; if (journal-&gt;j_flags &amp; JBD2_ABORT)
        |                         |           return;
        |                         -&gt; panic()
        |
        -&gt; jbd2_journal_update_sb_errno()

    Tested-by: Hobin Woo &lt;hobin.woo@samsung.com&gt;
    Signed-off-by: Daeho Jeong &lt;daeho.jeong@samsung.com&gt;
    Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit af8e014acf6baf20e4c1be0b0c472c9a9e1d3543
Author: Filipe Manana &lt;fdmanana@suse.com&gt;
Date:   Mon Nov 9 00:33:58 2015 +0000

    Btrfs: fix race leading to BUG_ON when running delalloc for nodatacow

    commit 1d512cb77bdbda80f0dd0620a3b260d697fd581d upstream.

    If we are using the NO_HOLES feature, we have a tiny time window when
    running delalloc for a nodatacow inode where we can race with a concurrent
    link or xattr add operation leading to a BUG_ON.

    This happens because at run_delalloc_nocow() we end up casting a leaf item
    of type BTRFS_INODE_[REF|EXTREF]_KEY or of type BTRFS_XATTR_ITEM_KEY to a
    file extent item (struct btrfs_file_extent_item) and then analyse its
    extent type field, which won't match any of the expected extent types
    (values BTRFS_FILE_EXTENT_[REG|PREALLOC|INLINE]) and therefore trigger an
    explicit BUG_ON(1).

    The following sequence diagram shows how the race happens when running a
    no-cow dellaloc range [4K, 8K[ for inode 257 and we have the following
    neighbour leafs:

                 Leaf X (has N items)                    Leaf Y

     [ ... (257 INODE_ITEM 0) (257 INODE_REF 256) ]  [ (257 EXTENT_DATA 8192), ... ]
                  slot N - 2         slot N - 1              slot 0

     (Note the implicit hole for inode 257 regarding the [0, 8K[ range)

           CPU 1                                         CPU 2

     run_dealloc_nocow()
       btrfs_lookup_file_extent()
         --&gt; searches for a key with value
             (257 EXTENT_DATA 4096) in the
             fs/subvol tree
         --&gt; returns us a path with
             path-&gt;nodes[0] == leaf X and
             path-&gt;slots[0] == N

       because path-&gt;slots[0] is &gt;=
       btrfs_header_nritems(leaf X), it
       calls btrfs_next_leaf()

       btrfs_next_leaf()
         --&gt; releases the path

                                                  hard link added to our inode,
                                                  with key (257 INODE_REF 500)
                                                  added to the end of leaf X,
                                                  so leaf X now has N + 1 keys

         --&gt; searches for the key
             (257 INODE_REF 256), because
             it was the last key in leaf X
             before it released the path,
             with path-&gt;keep_locks set to 1

         --&gt; ends up at leaf X again and
             it verifies that the key
             (257 INODE_REF 256) is no longer
             the last key in the leaf, so it
             returns with path-&gt;nodes[0] ==
             leaf X and path-&gt;slots[0] == N,
             pointing to the new item with
             key (257 INODE_REF 500)

       the loop iteration of run_dealloc_nocow()
       does not break out the loop and continues
       because the key referenced in the path
       at path-&gt;nodes[0] and path-&gt;slots[0] is
       for inode 257, its type is &lt; BTRFS_EXTENT_DATA_KEY
       and its offset (500) is less then our delalloc
       range's end (8192)

       the item pointed by the path, an inode reference item,
       is (incorrectly) interpreted as a file extent item and
       we get an invalid extent type, leading to the BUG_ON(1):

       if (extent_type == BTRFS_FILE_EXTENT_REG ||
          extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
           (...)
       } else if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
           (...)
       } else {
           BUG_ON(1)
       }

    The same can happen if a xattr is added concurrently and ends up having
    a key with an offset smaller then the delalloc's range end.

    So fix this by skipping keys with a type smaller than
    BTRFS_EXTENT_DATA_KEY.

    Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 622af8c8e93802e9ae2cdde93563c69a68feeccb
Author: Eric Dumazet &lt;edumazet@google.com&gt;
Date:   Tue Dec 1 07:20:07 2015 -0800

    ipv6: sctp: implement sctp_v6_destroy_sock()

    [ Upstream commit 602dd62dfbda3e63a2d6a3cbde953ebe82bf5087 ]

    Dmitry Vyukov reported a memory leak using IPV6 SCTP sockets.

    We need to call inet6_destroy_sock() to properly release
    inet6 specific fields.

    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 7cd9f6022097acdeb1f14bc9a5d44c40629d11a9
Author: Michal Kubeček &lt;mkubecek@suse.cz&gt;
Date:   Tue Nov 24 15:07:11 2015 +0100

    ipv6: distinguish frag queues by device for multicast and link-local packets

    [ Upstream commit 264640fc2c5f4f913db5c73fa3eb1ead2c45e9d7 ]

    If a fragmented multicast packet is received on an ethernet device which
    has an active macvlan on top of it, each fragment is duplicated and
    received both on the underlying device and the macvlan. If some
    fragments for macvlan are processed before the whole packet for the
    underlying device is reassembled, the "overlapping fragments" test in
    ip6_frag_queue() discards the whole fragment queue.

    To resolve this, add device ifindex to the search key and require it to
    match reassembling multicast packets and packets to link-local
    addresses.

    Note: similar patch has been already submitted by Yoshifuji Hideaki in

      http://patchwork.ozlabs.org/patch/220979/

    but got lost and forgotten for some reason.

    Signed-off-by: Michal Kubecek &lt;mkubecek@suse.cz&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit c5d998a60ac73841a42c0351e248a65747480b64
Author: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Date:   Sun Nov 22 01:08:54 2015 +0200

    broadcom: fix PHY_ID_BCM5481 entry in the id table

    [ Upstream commit 3c25a860d17b7378822f35d8c9141db9507e3beb ]

    Commit fcb26ec5b18d ("broadcom: move all PHY_ID's to header")
    updated broadcom_tbl to use PHY_IDs, but incorrectly replaced 0x0143bca0
    with PHY_ID_BCM5482 (making a duplicate entry, and completely omitting
    the original). Fix that.

    Fixes: fcb26ec5b18d ("broadcom: move all PHY_ID's to header")
    Signed-off-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 07ea536a4530c41ff2d5266359b45eed2500e04f
Author: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Date:   Fri Nov 20 13:54:20 2015 +0100

    net: ip6mr: fix static mfc/dev leaks on table destruction

    [ Upstream commit 4c6980462f32b4f282c5d8e5f7ea8070e2937725 ]

    Similar to ipv4, when destroying an mrt table the static mfc entries and
    the static devices are kept, which leads to devices that can never be
    destroyed (because of refcnt taken) and leaked memory. Make sure that
    everything is cleaned up on netns destruction.

    Fixes: 8229efdaef1e ("netns: ip6mr: enable namespace support in ipv6 multicast forwarding code")
    CC: Benjamin Thery &lt;benjamin.thery@bull.net&gt;
    Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
    Reviewed-by: Cong Wang &lt;cwang@twopensource.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 5a88886f6bed598298f98b2657cd9df1a2104063
Author: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Date:   Fri Nov 20 13:54:19 2015 +0100

    net: ipmr: fix static mfc/dev leaks on table destruction

    [ Upstream commit 0e615e9601a15efeeb8942cf7cd4dadba0c8c5a7 ]

    When destroying an mrt table the static mfc entries and the static
    devices are kept, which leads to devices that can never be destroyed
    (because of refcnt taken) and leaked memory, for example:
    unreferenced object 0xffff880034c144c0 (size 192):
      comm "mfc-broken", pid 4777, jiffies 4320349055 (age 46001.964s)
      hex dump (first 32 bytes):
        98 53 f0 34 00 88 ff ff 98 53 f0 34 00 88 ff ff  .S.4.....S.4....
        ef 0a 0a 14 01 02 03 04 00 00 00 00 01 00 00 00  ................
      backtrace:
        [&lt;ffffffff815c1b9e&gt;] kmemleak_alloc+0x4e/0xb0
        [&lt;ffffffff811ea6e0&gt;] kmem_cache_alloc+0x190/0x300
        [&lt;ffffffff815931cb&gt;] ip_mroute_setsockopt+0x5cb/0x910
        [&lt;ffffffff8153d575&gt;] do_ip_setsockopt.isra.11+0x105/0xff0
        [&lt;ffffffff8153e490&gt;] ip_setsockopt+0x30/0xa0
        [&lt;ffffffff81564e13&gt;] raw_setsockopt+0x33/0x90
        [&lt;ffffffff814d1e14&gt;] sock_common_setsockopt+0x14/0x20
        [&lt;ffffffff814d0b51&gt;] SyS_setsockopt+0x71/0xc0
        [&lt;ffffffff815cdbf6&gt;] entry_SYSCALL_64_fastpath+0x16/0x7a
        [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

    Make sure that everything is cleaned on netns destruction.

    Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
    Reviewed-by: Cong Wang &lt;cwang@twopensource.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 40e1d40862d8fbe5198179804ccc5df9fa4d47b7
Author: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Date:   Fri Nov 20 00:11:56 2015 +0100

    net, scm: fix PaX detected msg_controllen overflow in scm_detach_fds

    [ Upstream commit 6900317f5eff0a7070c5936e5383f589e0de7a09 ]

    David and HacKurx reported a following/similar size overflow triggered
    in a grsecurity kernel, thanks to PaX's gcc size overflow plugin:

    (Already fixed in later grsecurity versions by Brad and PaX Team.)

    [ 1002.296137] PAX: size overflow detected in function scm_detach_fds net/core/scm.c:314
                   cicus.202_127 min, count: 4, decl: msg_controllen; num: 0; context: msghdr;
    [ 1002.296145] CPU: 0 PID: 3685 Comm: scm_rights_recv Not tainted 4.2.3-grsec+ #7
    [ 1002.296149] Hardware name: Apple Inc. MacBookAir5,1/Mac-66F35F19FE2A0D05, [...]
    [ 1002.296153]  ffffffff81c27366 0000000000000000 ffffffff81c27375 ffffc90007843aa8
    [ 1002.296162]  ffffffff818129ba 0000000000000000 ffffffff81c27366 ffffc90007843ad8
    [ 1002.296169]  ffffffff8121f838 fffffffffffffffc fffffffffffffffc ffffc90007843e60
    [ 1002.296176] Call Trace:
    [ 1002.296190]  [&lt;ffffffff818129ba&gt;] dump_stack+0x45/0x57
    [ 1002.296200]  [&lt;ffffffff8121f838&gt;] report_size_overflow+0x38/0x60
    [ 1002.296209]  [&lt;ffffffff816a979e&gt;] scm_detach_fds+0x2ce/0x300
    [ 1002.296220]  [&lt;ffffffff81791899&gt;] unix_stream_read_generic+0x609/0x930
    [ 1002.296228]  [&lt;ffffffff81791c9f&gt;] unix_stream_recvmsg+0x4f/0x60
    [ 1002.296236]  [&lt;ffffffff8178dc00&gt;] ? unix_set_peek_off+0x50/0x50
    [ 1002.296243]  [&lt;ffffffff8168fac7&gt;] sock_recvmsg+0x47/0x60
    [ 1002.296248]  [&lt;ffffffff81691522&gt;] ___sys_recvmsg+0xe2/0x1e0
    [ 1002.296257]  [&lt;ffffffff81693496&gt;] __sys_recvmsg+0x46/0x80
    [ 1002.296263]  [&lt;ffffffff816934fc&gt;] SyS_recvmsg+0x2c/0x40
    [ 1002.296271]  [&lt;ffffffff8181a3ab&gt;] entry_SYSCALL_64_fastpath+0x12/0x85

    Further investigation showed that this can happen when an *odd* number of
    fds are being passed over AF_UNIX sockets.

    In these cases CMSG_LEN(i * sizeof(int)) and CMSG_SPACE(i * sizeof(int)),
    where i is the number of successfully passed fds, differ by 4 bytes due
    to the extra CMSG_ALIGN() padding in CMSG_SPACE() to an 8 byte boundary
    on 64 bit. The padding is used to align subsequent cmsg headers in the
    control buffer.

    When the control buffer passed in from the receiver side *lacks* these 4
    bytes (e.g. due to buggy/wrong API usage), then msg-&gt;msg_controllen will
    overflow in scm_detach_fds():

      int cmlen = CMSG_LEN(i * sizeof(int));  &lt;--- cmlen w/o tail-padding
      err = put_user(SOL_SOCKET, &amp;cm-&gt;cmsg_level);
      if (!err)
        err = put_user(SCM_RIGHTS, &amp;cm-&gt;cmsg_type);
      if (!err)
        err = put_user(cmlen, &amp;cm-&gt;cmsg_len);
      if (!err) {
        cmlen = CMSG_SPACE(i * sizeof(int));  &lt;--- cmlen w/ 4 byte extra tail-padding
        msg-&gt;msg_control += cmlen;
        msg-&gt;msg_controllen -= cmlen;         &lt;--- iff no tail-padding space here ...
      }                                            ... wrap-around

    F.e. it will wrap to a length of 18446744073709551612 bytes in case the
    receiver passed in msg-&gt;msg_controllen of 20 bytes, and the sender
    properly transferred 1 fd to the receiver, so that its CMSG_LEN results
    in 20 bytes and CMSG_SPACE in 24 bytes.

    In case of MSG_CMSG_COMPAT (scm_detach_fds_compat()), I haven't seen an
    issue in my tests as alignment seems always on 4 byte boundary. Same
    should be in case of native 32 bit, where we end up with 4 byte boundaries
    as well.

    In practice, passing msg-&gt;msg_controllen of 20 to recvmsg() while receiving
    a single fd would mean that on successful return, msg-&gt;msg_controllen is
    being set by the kernel to 24 bytes instead, thus more than the input
    buffer advertised. It could f.e. become an issue if such application later
    on zeroes or copies the control buffer based on the returned msg-&gt;msg_controllen
    elsewhere.

    Maximum number of fds we can send is a hard upper limit SCM_MAX_FD (253).

    Going over the code, it seems like msg-&gt;msg_controllen is not being read
    after scm_detach_fds() in scm_recv() anymore by the kernel, good!

    Relevant recvmsg() handler are unix_dgram_recvmsg() (unix_seqpacket_recvmsg())
    and unix_stream_recvmsg(). Both return back to their recvmsg() caller,
    and ___sys_recvmsg() places the updated length, that is, new msg_control -
    old msg_control pointer into msg-&gt;msg_controllen (hence the 24 bytes seen
    in the example).

    Long time ago, Wei Yongjun fixed something related in commit 1ac70e7ad24a
    ("[NET]: Fix function put_cmsg() which may cause usr application memory
    overflow").

    RFC3542, section 20.2. says:

      The fields shown as "XX" are possible padding, between the cmsghdr
      structure and the data, and between the data and the next cmsghdr
      structure, if required by the implementation. While sending an
      application may or may not include padding at the end of last
      ancillary data in msg_controllen and implementations must accept both
      as valid. On receiving a portable application must provide space for
      padding at the end of the last ancillary data as implementations may
      copy out the padding at the end of the control message buffer and
      include it in the received msg_controllen. When recvmsg() is called
      if msg_controllen is too small for all the ancillary data items
      including any trailing padding after the last item an implementation
      may set MSG_CTRUNC.

    Since we didn't place MSG_CTRUNC for already quite a long time, just do
    the same as in 1ac70e7ad24a to avoid an overflow.

    Btw, even man-page author got this wrong :/ See db939c9b26e9 ("cmsg.3: Fix
    error in SCM_RIGHTS code sample"). Some people must have copied this (?),
    thus it got triggered in the wild (reported several times during boot by
    David and HacKurx).

    No Fixes tag this time as pre 2002 (that is, pre history tree).

    Reported-by: David Sterba &lt;dave@jikos.cz&gt;
    Reported-by: HacKurx &lt;hackurx@gmail.com&gt;
    Cc: PaX Team &lt;pageexec@freemail.hu&gt;
    Cc: Emese Revfy &lt;re.emese@gmail.com&gt;
    Cc: Brad Spengler &lt;spender@grsecurity.net&gt;
    Cc: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
    Cc: Eric Dumazet &lt;edumazet@google.com&gt;
    Reviewed-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
    Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 3547cdcbe5212a5725441493c6fcf5f60ac4159f
Author: Eric Dumazet &lt;edumazet@google.com&gt;
Date:   Thu Nov 26 08:18:14 2015 -0800

    tcp: initialize tp-&gt;copied_seq in case of cross SYN connection

    [ Upstream commit 142a2e7ece8d8ac0e818eb2c91f99ca894730e2a ]

    Dmitry provided a syzkaller (http://github.com/google/syzkaller)
    generated program that triggers the WARNING at
    net/ipv4/tcp.c:1729 in tcp_recvmsg() :

    WARN_ON(tp-&gt;copied_seq != tp-&gt;rcv_nxt &amp;&amp;
            !(flags &amp; (MSG_PEEK | MSG_TRUNC)));

    His program is specifically attempting a Cross SYN TCP exchange,
    that we support (for the pleasure of hackers ?), but it looks we
    lack proper tcp-&gt;copied_seq initialization.

    Thanks again Dmitry for your report and testings.

    Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 98d2ffdc2c14d782d1b2982a5c05fb1f2f9eabe5
Author: Eric Dumazet &lt;edumazet@google.com&gt;
Date:   Wed Nov 18 12:40:13 2015 -0800

    tcp: md5: fix lockdep annotation

    [ Upstream commit 1b8e6a01e19f001e9f93b39c32387961c91ed3cc ]

    When a passive TCP is created, we eventually call tcp_md5_do_add()
    with sk pointing to the child. It is not owner by the user yet (we
    will add this socket into listener accept queue a bit later anyway)

    But we do own the spinlock, so amend the lockdep annotation to avoid
    following splat :

    [ 8451.090932] net/ipv4/tcp_ipv4.c:923 suspicious rcu_dereference_protected() usage!
    [ 8451.090932]
    [ 8451.090932] other info that might help us debug this:
    [ 8451.090932]
    [ 8451.090934]
    [ 8451.090934] rcu_scheduler_active = 1, debug_locks = 1
    [ 8451.090936] 3 locks held by socket_sockopt_/214795:
    [ 8451.090936]  #0:  (rcu_read_lock){.+.+..}, at: [&lt;ffffffff855c6ac1&gt;] __netif_receive_skb_core+0x151/0xe90
    [ 8451.090947]  #1:  (rcu_read_lock){.+.+..}, at: [&lt;ffffffff85618143&gt;] ip_local_deliver_finish+0x43/0x2b0
    [ 8451.090952]  #2:  (slock-AF_INET){+.-...}, at: [&lt;ffffffff855acda5&gt;] sk_clone_lock+0x1c5/0x500
    [ 8451.090958]
    [ 8451.090958] stack backtrace:
    [ 8451.090960] CPU: 7 PID: 214795 Comm: socket_sockopt_

    [ 8451.091215] Call Trace:
    [ 8451.091216]  &lt;IRQ&gt;  [&lt;ffffffff856fb29c&gt;] dump_stack+0x55/0x76
    [ 8451.091229]  [&lt;ffffffff85123b5b&gt;] lockdep_rcu_suspicious+0xeb/0x110
    [ 8451.091235]  [&lt;ffffffff8564544f&gt;] tcp_md5_do_add+0x1bf/0x1e0
    [ 8451.091239]  [&lt;ffffffff85645751&gt;] tcp_v4_syn_recv_sock+0x1f1/0x4c0
    [ 8451.091242]  [&lt;ffffffff85642b27&gt;] ? tcp_v4_md5_hash_skb+0x167/0x190
    [ 8451.091246]  [&lt;ffffffff85647c78&gt;] tcp_check_req+0x3c8/0x500
    [ 8451.091249]  [&lt;ffffffff856451ae&gt;] ? tcp_v4_inbound_md5_hash+0x11e/0x190
    [ 8451.091253]  [&lt;ffffffff85647170&gt;] tcp_v4_rcv+0x3c0/0x9f0
    [ 8451.091256]  [&lt;ffffffff85618143&gt;] ? ip_local_deliver_finish+0x43/0x2b0
    [ 8451.091260]  [&lt;ffffffff856181b6&gt;] ip_local_deliver_finish+0xb6/0x2b0
    [ 8451.091263]  [&lt;ffffffff85618143&gt;] ? ip_local_deliver_finish+0x43/0x2b0
    [ 8451.091267]  [&lt;ffffffff85618d38&gt;] ip_local_deliver+0x48/0x80
    [ 8451.091270]  [&lt;ffffffff85618510&gt;] ip_rcv_finish+0x160/0x700
    [ 8451.091273]  [&lt;ffffffff8561900e&gt;] ip_rcv+0x29e/0x3d0
    [ 8451.091277]  [&lt;ffffffff855c74b7&gt;] __netif_receive_skb_core+0xb47/0xe90

    Fixes: a8afca0329988 ("tcp: md5: protects md5sig_info with RCU")
    Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Reported-by: Willem de Bruijn &lt;willemb@google.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit c5806c7c2c703a2f3a879c2e3399529333a2b349
Author: Bjørn Mork &lt;bjorn@mork.no&gt;
Date:   Wed Nov 18 21:13:07 2015 +0100

    net: qmi_wwan: add XS Stick W100-2 from 4G Systems

    [ Upstream commit 68242a5a1e2edce39b069385cbafb82304eac0f1 ]

    Thomas reports
    "
    4gsystems sells two total different LTE-surfsticks under the same name.
    ..
    The newer version of XS Stick W100 is from "omega"
    ..
    Under windows the driver switches to the same ID, and uses MI03\6 for
    network and MI01\6 for modem.
    ..
    echo "1c9e 9b01" &gt; /sys/bus/usb/drivers/qmi_wwan/new_id
    echo "1c9e 9b01" &gt; /sys/bus/usb-serial/drivers/option1/new_id

    T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  4 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1c9e ProdID=9b01 Rev=02.32
    S:  Manufacturer=USB Modem
    S:  Product=USB Modem
    S:  SerialNumber=
    C:  #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    I:  If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

    Now all important things are there:

    wwp0s29f7u2i3 (net), ttyUSB2 (at), cdc-wdm0 (qmi), ttyUSB1 (at)

    There is also ttyUSB0, but it is not usable, at least not for at.

    The device works well with qmi and ModemManager-NetworkManager.
    "

    Reported-by: Thomas Schäfer &lt;tschaefer@t-online.de&gt;
    Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 08f97ac765394b2370c311be1930553cd27d9245
Author: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Date:   Mon Nov 16 13:09:10 2015 -0500

    snmp: Remove duplicate OUTMCAST stat increment

    [ Upstream commit 41033f029e393a64e81966cbe34d66c6cf8a2e7e ]

    the OUTMCAST stat is double incremented, getting bumped once in the mcast code
    itself, and again in the common ip output path.  Remove the mcast bump, as its
    not needed

    Validated by the reporter, with good results

    Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
    Reported-by: Claus Jensen &lt;claus.jensen@microsemi.com&gt;
    CC: Claus Jensen &lt;claus.jensen@microsemi.com&gt;
    CC: David Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 3fb28c97238bc1ddd66229bb6d2bc07b2452c6ab
Author: lucien &lt;lucien.xin@gmail.com&gt;
Date:   Thu Nov 12 13:07:07 2015 +0800

    sctp: translate host order to network order when setting a hmacid

    [ Upstream commit ed5a377d87dc4c87fb3e1f7f698cba38cd893103 ]

    now sctp auth cannot work well when setting a hmacid manually, which
    is caused by that we didn't use the network order for hmacid, so fix
    it by adding the transformation in sctp_auth_ep_set_hmacs.

    even we set hmacid with the network order in userspace, it still
    can't work, because of this condition in sctp_auth_ep_set_hmacs():

    		if (id &gt; SCTP_AUTH_HMAC_ID_MAX)
    			return -EOPNOTSUPP;

    so this wasn't working before and thus it won't break compatibility.

    Fixes: 65b07e5d0d09 ("[SCTP]: API updates to suport SCTP-AUTH extensions.")
    Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
    Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
    Acked-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
    Acked-by: Vlad Yasevich &lt;vyasevich@gmail.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit da8db0830a2ce63f628150307a01a315f5081202
Author: Rainer Weikusat &lt;rweikusat@mobileactivedefense.com&gt;
Date:   Fri Nov 20 22:07:23 2015 +0000

    unix: avoid use-after-free in ep_remove_wait_queue

    [ Upstream commit 7d267278a9ece963d77eefec61630223fce08c6c ]

    Rainer Weikusat &lt;rweikusat@mobileactivedefense.com&gt; writes:
    An AF_UNIX datagram socket being the client in an n:1 association with
    some server socket is only allowed to send messages to the server if the
    receive queue of this socket contains at most sk_max_ack_backlog
    datagrams. This implies that prospective writers might be forced to go
    to sleep despite none of the message presently enqueued on the server
    receive queue were sent by them. In order to ensure that these will be
    woken up once space becomes again available, the present unix_dgram_poll
    routine does a second sock_poll_wait call with the peer_wait wait queue
    of the server socket as queue argument (unix_dgram_recvmsg does a wake
    up on this queue after a datagram was received). This is inherently
    problematic because the server socket is only guaranteed to remain alive
    for as long as the client still holds a reference to it. In case the
    connection is dissolved via connect or by the dead peer detection logic
    in unix_dgram_sendmsg, the server socket may be freed despite "the
    polling mechanism" (in particular, epoll) still has a pointer to the
    corresponding peer_wait queue. There's no way to forcibly deregister a
    wait queue with epoll.

    Based on an idea by Jason Baron, the patch below changes the code such
    that a wait_queue_t belonging to the client socket is enqueued on the
    peer_wait queue of the server whenever the peer receive queue full
    condition is detected by either a sendmsg or a poll. A wake up on the
    peer queue is then relayed to the ordinary wait queue of the client
    socket via wake function. The connection to the peer wait queue is again
    dissolved if either a wake up is about to be relayed or the client
    socket reconnects or a dead peer is detected or the client socket is
    itself closed. This enables removing the second sock_poll_wait from
    unix_dgram_poll, thus avoiding the use-after-free, while still ensuring
    that no blocked writer sleeps forever.

    Signed-off-by: Rainer Weikusat &lt;rweikusat@mobileactivedefense.com&gt;
    Fixes: ec0d215f9420 ("af_unix: fix 'poll for write'/connected DGRAM sockets")
    Reviewed-by: Jason Baron &lt;jbaron@akamai.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>btrfs: skip waiting on ordered range for special files</title>
<updated>2016-08-26T18:44:33+00:00</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.com</email>
</author>
<published>2015-09-12T01:44:17+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=f856e08a348f96ada164bc5ad1b5ec31a67fd9b8'/>
<id>urn:sha1:f856e08a348f96ada164bc5ad1b5ec31a67fd9b8</id>
<content type='text'>
commit a30e577c96f59b1e1678ea5462432b09bf7d5cbc upstream.

In btrfs_evict_inode, we properly truncate the page cache for evicted
inodes but then we call btrfs_wait_ordered_range for every inode as well.
It's the right thing to do for regular files but results in incorrect
behavior for device inodes for block devices.

filemap_fdatawrite_range gets called with inode-&gt;i_mapping which gets
resolved to the block device inode before getting passed to
wbc_attach_fdatawrite_inode and ultimately to inode_to_bdi.  What happens
next depends on whether there's an open file handle associated with the
inode.  If there is, we write to the block device, which is unexpected
behavior.  If there isn't, we through normally and inode-&gt;i_data is used.
We can also end up racing against open/close which can result in crashes
when i_mapping points to a block device inode that has been closed.

Since there can't be any page cache associated with special file inodes,
it's safe to skip the btrfs_wait_ordered_range call entirely and avoid
the problem.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100911
Tested-by: Christoph Biedl &lt;linux-kernel.bfrz@manchmal.in-ulm.de&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Reviewed-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Stefan Guendhoer &lt;stefan@guendhoer.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: use kmem_cache_free when freeing entry in inode cache</title>
<updated>2016-08-26T17:30:26+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2015-06-13T05:52:56+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=073a07daafed2fab24a6b1d796178ddb435711ed'/>
<id>urn:sha1:073a07daafed2fab24a6b1d796178ddb435711ed</id>
<content type='text'>
commit c3f4a1685bb87e59c886ee68f7967eae07d4dffa upstream.

The free space entries are allocated using kmem_cache_zalloc(),
through __btrfs_add_free_space(), therefore we should use
kmem_cache_free() and not kfree() to avoid any confusion and
any potential problem. Looking at the kfree() definition at
mm/slab.c it has the following comment:

  /*
   * (...)
   *
   * Don't free memory not originally allocated by kmalloc()
   * or you will run into trouble.
   */

So better be safe and use kmem_cache_free().

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Stefan Guendhoer &lt;stefan@guendhoer.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: make xattr replace operations atomic</title>
<updated>2016-08-26T17:15:08+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2014-11-09T08:38:39+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=0316c381a1be9b991fe0822e815e29f4a6a3e983'/>
<id>urn:sha1:0316c381a1be9b991fe0822e815e29f4a6a3e983</id>
<content type='text'>
commit 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 upstream.

Replacing a xattr consists of doing a lookup for its existing value, delete
the current value from the respective leaf, release the search path and then
finally insert the new value. This leaves a time window where readers (getxattr,
listxattrs) won't see any value for the xattr. Xattrs are used to store ACLs,
so this has security implications.

This change also fixes 2 other existing issues which were:

*) Deleting the old xattr value without verifying first if the new xattr will
   fit in the existing leaf item (in case multiple xattrs are packed in the
   same item due to name hash collision);

*) Returning -EEXIST when the flag XATTR_CREATE is given and the xattr doesn't
   exist but we have have an existing item that packs muliple xattrs with
   the same name hash as the input xattr. In this case we should return ENOSPC.

A test case for xfstests follows soon.

Thanks to Alexandre Oliva for reporting the non-atomicity of the xattr replace
implementation.

Reported-by: Alexandre Oliva &lt;oliva@gnu.org&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
[shengyong: backport to 3.10
 - FIX: CVE-2014-9710
 - adjust context
 - ASSERT() was added v3.12, so we do check with if statement
 - set the first parameter of btrfs_item_nr() as NULL, because it is not
   used, and is removed in v3.13
]
Signed-off-by: Sheng Yong &lt;shengyong1@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Stefan Guendhoer &lt;stefan@guendhoer.com&gt;
</content>
</entry>
<entry>
<title>3.10.80 -&gt; 3.10.81</title>
<updated>2016-08-26T14:16:56+00:00</updated>
<author>
<name>Jan Engelmohr</name>
<email>jan.engelmohr@mailbox.tu-dresden.de</email>
</author>
<published>2016-08-01T11:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=75cc0b48839a29a553bf6e6d131c08ffbc46ca3e'/>
<id>urn:sha1:75cc0b48839a29a553bf6e6d131c08ffbc46ca3e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>3.10.76 -&gt; 3.10.77</title>
<updated>2016-08-26T14:15:25+00:00</updated>
<author>
<name>Jan Engelmohr</name>
<email>jan.engelmohr@mailbox.tu-dresden.de</email>
</author>
<published>2016-08-01T11:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=97ef32aefecf27ce57455ac16a2da18ac7e2c1d6'/>
<id>urn:sha1:97ef32aefecf27ce57455ac16a2da18ac7e2c1d6</id>
<content type='text'>
</content>
</entry>
</feed>
