commit e890f13e596ef311c219d8ffe8d7107e56971ee4
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Thu Mar 3 13:28:30 2016 +0100

    Linux 3.12.56

commit 7b1db06ff530bd1fa18e492ba61c5f7dc4e181a4
Author: Hannes Reinecke <hare@suse.de>
Date:   Fri Feb 12 09:39:15 2016 +0100

    bio: return EINTR if copying to user space got interrupted
    
    commit 2d99b55d378c996b9692a0c93dd25f4ed5d58934 upstream.
    
    Commit 35dc248383bbab0a7203fca4d722875bc81ef091 introduced a check for
    current->mm to see if we have a user space context and only copies data
    if we do. Now if an IO gets interrupted by a signal data isn't copied
    into user space any more (as we don't have a user space context) but
    user space isn't notified about it.
    
    This patch modifies the behaviour to return -EINTR from bio_uncopy_user()
    to notify userland that a signal has interrupted the syscall, otherwise
    it could lead to a situation where the caller may get a buffer with
    no data returned.
    
    This can be reproduced by issuing SG_IO ioctl()s in one thread while
    constantly sending signals to it.
    
    [js] backport to 3.12
    
    Fixes: 35dc248 [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal
    Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: Hannes Reinecke <hare@suse.de>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 1e719417f896f35e25e27e974a4f1bbffb87b4c1
Author: Borislav Petkov <bp@suse.de>
Date:   Tue Dec 1 15:52:36 2015 +0100

    EDAC, mc_sysfs: Fix freeing bus' name
    
    commit 12e26969b32c79018165d52caff3762135614aa1 upstream.
    
    I get the splat below when modprobing/rmmoding EDAC drivers. It happens
    because bus->name is invalid after bus_unregister() has run. The Code: section
    below corresponds to:
    
      .loc 1 1108 0
      movq    672(%rbx), %rax # mci_1(D)->bus, mci_1(D)->bus
      .loc 1 1109 0
      popq    %rbx    #
    
      .loc 1 1108 0
      movq    (%rax), %rdi    # _7->name,
      jmp     kfree   #
    
    and %rax has some funky stuff 2030203020312030 which looks a lot like
    something walked over it.
    
    Fix that by saving the name ptr before doing stuff to string it points to.
    
      general protection fault: 0000 [#1] SMP
      Modules linked in: ...
      CPU: 4 PID: 10318 Comm: modprobe Tainted: G          I EN  3.12.51-11-default+ #48
      Hardware name: HP ProLiant DL380 G7, BIOS P67 05/05/2011
      task: ffff880311320280 ti: ffff88030da3e000 task.ti: ffff88030da3e000
      RIP: 0010:[<ffffffffa019da92>]  [<ffffffffa019da92>] edac_unregister_sysfs+0x22/0x30 [edac_core]
      RSP: 0018:ffff88030da3fe28  EFLAGS: 00010292
      RAX: 2030203020312030 RBX: ffff880311b4e000 RCX: 000000000000095c
      RDX: 0000000000000001 RSI: ffff880327bb9600 RDI: 0000000000000286
      RBP: ffff880311b4e750 R08: 0000000000000000 R09: ffffffff81296110
      R10: 0000000000000400 R11: 0000000000000000 R12: ffff88030ba1ac68
      R13: 0000000000000001 R14: 00000000011b02f0 R15: 0000000000000000
      FS:  00007fc9bf8f5700(0000) GS:ffff8801a7c40000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 0000000000403c90 CR3: 000000019ebdf000 CR4: 00000000000007e0
      Stack:
      Call Trace:
        i7core_unregister_mci.isra.9
        i7core_remove
        pci_device_remove
        __device_release_driver
        driver_detach
        bus_remove_driver
        pci_unregister_driver
        i7core_exit
        SyS_delete_module
        system_call_fastpath
        0x7fc9bf426536
      Code: 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 53 48 89 fb e8 52 2a 1f e1 48 8b bb a0 02 00 00 e8 46 59 1f e1 48 8b 83 a0 02 00 00 5b <48> 8b 38 e9 26 9a fe e0 66 0f 1f 44 00 00 66 66 66 66 90 48 8b
      RIP  [<ffffffffa019da92>] edac_unregister_sysfs+0x22/0x30 [edac_core]
       RSP <ffff88030da3fe28>
    
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Fixes: 7a623c039075 ("edac: rewrite the sysfs code to use struct device")
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2da2c15ffb7ed572f0d504cb1bd97fd66f3d9186
Author: Jeff Layton <jeff.layton@primarydata.com>
Date:   Thu Jan 7 16:38:10 2016 -0500

    locks: fix unlock when fcntl_setlk races with a close
    
    commit 7f3697e24dc3820b10f445a4a7d914fc356012d1 upstream.
    
    Dmitry reported that he was able to reproduce the WARN_ON_ONCE that
    fires in locks_free_lock_context when the flc_posix list isn't empty.
    
    The problem turns out to be that we're basically rebuilding the
    file_lock from scratch in fcntl_setlk when we discover that the setlk
    has raced with a close. If the l_whence field is SEEK_CUR or SEEK_END,
    then we may end up with fl_start and fl_end values that differ from
    when the lock was initially set, if the file position or length of the
    file has changed in the interim.
    
    Fix this by just reusing the same lock request structure, and simply
    override fl_type value with F_UNLCK as appropriate. That ensures that
    we really are unlocking the lock that was initially set.
    
    While we're there, make sure that we do pop a WARN_ON_ONCE if the
    removal ever fails. Also return -EBADF in this event, since that's
    what we would have returned if the close had happened earlier.
    
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Fixes: c293621bbf67 (stale POSIX lock handling)
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
    Acked-by: "J. Bruce Fields" <bfields@fieldses.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

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

    xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted.
    
    commit 4d8c8bd6f2062c9988817183a91fe2e623c8aa5e upstream.
    
    Occasionaly PV guests would crash with:
    
    pciback 0000:00:00.1: Xen PCI mapped GSI0 to IRQ16
    BUG: unable to handle kernel paging request at 0000000d1a8c0be0
    .. snip..
      <ffffffff8139ce1b>] find_next_bit+0xb/0x10
      [<ffffffff81387f22>] cpumask_next_and+0x22/0x40
      [<ffffffff813c1ef8>] pci_device_probe+0xb8/0x120
      [<ffffffff81529097>] ? driver_sysfs_add+0x77/0xa0
      [<ffffffff815293e4>] driver_probe_device+0x1a4/0x2d0
      [<ffffffff813c1ddd>] ? pci_match_device+0xdd/0x110
      [<ffffffff81529657>] __device_attach_driver+0xa7/0xb0
      [<ffffffff815295b0>] ? __driver_attach+0xa0/0xa0
      [<ffffffff81527622>] bus_for_each_drv+0x62/0x90
      [<ffffffff8152978d>] __device_attach+0xbd/0x110
      [<ffffffff815297fb>] device_attach+0xb/0x10
      [<ffffffff813b75ac>] pci_bus_add_device+0x3c/0x70
      [<ffffffff813b7618>] pci_bus_add_devices+0x38/0x80
      [<ffffffff813dc34e>] pcifront_scan_root+0x13e/0x1a0
      [<ffffffff817a0692>] pcifront_backend_changed+0x262/0x60b
      [<ffffffff814644c6>] ? xenbus_gather+0xd6/0x160
      [<ffffffff8120900f>] ? put_object+0x2f/0x50
      [<ffffffff81465c1d>] xenbus_otherend_changed+0x9d/0xa0
      [<ffffffff814678ee>] backend_changed+0xe/0x10
      [<ffffffff81463a28>] xenwatch_thread+0xc8/0x190
      [<ffffffff810f22f0>] ? woken_wake_function+0x10/0x10
    
    which was the result of two things:
    
    When we call pci_scan_root_bus we would pass in 'sd' (sysdata)
    pointer which was an 'pcifront_sd' structure. However in the
    pci_device_add it expects that the 'sd' is 'struct sysdata' and
    sets the dev->node to what is in sd->node (offset 4):
    
    set_dev_node(&dev->dev, pcibus_to_node(bus));
    
     __pcibus_to_node(const struct pci_bus *bus)
    {
            const struct pci_sysdata *sd = bus->sysdata;
    
            return sd->node;
    }
    
    However our structure was pcifront_sd which had nothing at that
    offset:
    
    struct pcifront_sd {
            int                        domain;    /*     0     4 */
            /* XXX 4 bytes hole, try to pack */
            struct pcifront_device *   pdev;      /*     8     8 */
    }
    
    That is an hole - filled with garbage as we used kmalloc instead of
    kzalloc (the second problem).
    
    This patch fixes the issue by:
     1) Use kzalloc to initialize to a well known state.
     2) Put 'struct pci_sysdata' at the start of 'pcifront_sd'. That
        way access to the 'node' will access the right offset.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

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

    do_last(): don't let a bogus return value from ->open() et.al. to confuse us
    
    commit c80567c82ae4814a41287618e315a60ecf513be6 upstream.
    
    ... into returning a positive to path_openat(), which would interpret that
    as "symlink had been encountered" and proceed to corrupt memory, etc.
    It can only happen due to a bug in some ->open() instance or in some LSM
    hook, etc., so we report any such event *and* make sure it doesn't trick
    us into further unpleasantness.
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2976c211bd096c472f996a368030eb1c18cb174c
Author: Simon Guinot <simon.guinot@sequanux.org>
Date:   Thu Sep 10 00:15:18 2015 +0200

    kernel/resource.c: fix muxed resource handling in __request_region()
    
    commit 59ceeaaf355fa0fb16558ef7c24413c804932ada upstream.
    
    In __request_region, if a conflict with a BUSY and MUXED resource is
    detected, then the caller goes to sleep and waits for the resource to be
    released.  A pointer on the conflicting resource is kept.  At wake-up
    this pointer is used as a parent to retry to request the region.
    
    A first problem is that this pointer might well be invalid (if for
    example the conflicting resource have already been freed).  Another
    problem is that the next call to __request_region() fails to detect a
    remaining conflict.  The previously conflicting resource is passed as a
    parameter and __request_region() will look for a conflict among the
    children of this resource and not at the resource itself.  It is likely
    to succeed anyway, even if there is still a conflict.
    
    Instead, the parent of the conflicting resource should be passed to
    __request_region().
    
    As a fix, this patch doesn't update the parent resource pointer in the
    case we have to wait for a muxed region right after.
    
    Reported-and-tested-by: Vincent Pelletier <plr.vincent@gmail.com>
    Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
    Tested-by: Vincent Donnefort <vdonnefort@gmail.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6e234db52528f10632aa37c17e7bc164192c16f1
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Thu Feb 18 18:55:54 2016 +0000

    sunrpc/cache: fix off-by-one in qword_get()
    
    commit b7052cd7bcf3c1478796e93e3dff2b44c9e82943 upstream.
    
    The qword_get() function NUL-terminates its output buffer.  If the input
    string is in hex format \xXXXX... and the same length as the output
    buffer, there is an off-by-one:
    
      int qword_get(char **bpp, char *dest, int bufsize)
      {
          ...
          while (len < bufsize) {
              ...
              *dest++ = (h << 4) | l;
              len++;
          }
          ...
          *dest = '\0';
          return len;
      }
    
    This patch ensures the NUL terminator doesn't fall outside the output
    buffer.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b16ad9e9cf5fe5f4eac472d60db935fce212a78e
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Wed Feb 24 09:04:24 2016 -0500

    tracing: Fix showing function event in available_events
    
    commit d045437a169f899dfb0f6f7ede24cc042543ced9 upstream.
    
    The ftrace:function event is only displayed for parsing the function tracer
    data. It is not used to enable function tracing, and does not include an
    "enable" file in its event directory.
    
    Originally, this event was kept separate from other events because it did
    not have a ->reg parameter. But perf added a "reg" parameter for its use
    which caused issues, because it made the event available to functions where
    it was not compatible for.
    
    Commit 9b63776fa3ca9 "tracing: Do not enable function event with enable"
    added a TRACE_EVENT_FL_IGNORE_ENABLE flag that prevented the function event
    from being enabled by normal trace events. But this commit missed keeping
    the function event from being displayed by the "available_events" directory,
    which is used to show what events can be enabled by set_event.
    
    One documented way to enable all events is to:
    
     cat available_events > set_event
    
    But because the function event is displayed in the available_events, this
    now causes an INVALID error:
    
     cat: write error: Invalid argument
    
    Reported-by: Chunyu Hu <chuhu@redhat.com>
    Fixes: 9b63776fa3ca9 "tracing: Do not enable function event with enable"
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 56ba745dfc83ec1d94e4caec9b5315dc5e63f8ad
Author: Christian Borntraeger <borntraeger@de.ibm.com>
Date:   Fri Feb 19 13:11:46 2016 +0100

    KVM: async_pf: do not warn on page allocation failures
    
    commit d7444794a02ff655eda87e3cc54e86b940e7736f upstream.
    
    In async_pf we try to allocate with NOWAIT to get an element quickly
    or fail. This code also handle failures gracefully. Lets silence
    potential page allocation failures under load.
    
    qemu-system-s39: page allocation failure: order:0,mode:0x2200000
    [...]
    Call Trace:
    ([<00000000001146b8>] show_trace+0xf8/0x148)
    [<000000000011476a>] show_stack+0x62/0xe8
    [<00000000004a36b8>] dump_stack+0x70/0x98
    [<0000000000272c3a>] warn_alloc_failed+0xd2/0x148
    [<000000000027709e>] __alloc_pages_nodemask+0x94e/0xb38
    [<00000000002cd36a>] new_slab+0x382/0x400
    [<00000000002cf7ac>] ___slab_alloc.constprop.30+0x2dc/0x378
    [<00000000002d03d0>] kmem_cache_alloc+0x160/0x1d0
    [<0000000000133db4>] kvm_setup_async_pf+0x6c/0x198
    [<000000000013dee8>] kvm_arch_vcpu_ioctl_run+0xd48/0xd58
    [<000000000012fcaa>] kvm_vcpu_ioctl+0x372/0x690
    [<00000000002f66f6>] do_vfs_ioctl+0x3be/0x510
    [<00000000002f68ec>] SyS_ioctl+0xa4/0xb8
    [<0000000000781c5e>] system_call+0xd6/0x264
    [<000003ffa24fa06a>] 0x3ffa24fa06a
    
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 3fa6f32aae8767a072a5bd97653f704455fc3e2b
Author: Benjamin Coddington <bcodding@redhat.com>
Date:   Wed Feb 17 10:41:41 2016 -0500

    NFSv4: Fix a dentry leak on alias use
    
    commit d9dfd8d741683347ee159d25f5b50c346a0df557 upstream.
    
    In the case where d_add_unique() finds an appropriate alias to use it will
    have already incremented the reference count.  An additional dget() to swap
    the open context's dentry is unnecessary and will leak a reference.
    
    Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
    Fixes: 275bb307865a3 ("NFSv4: Move dentry instantiation into the NFSv4-...")
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit febaddd7d970970cdd261176fd84d1d605045738
Author: Christoph Hellwig <hch@lst.de>
Date:   Mon Feb 8 21:11:50 2016 +0100

    nfs: fix nfs_size_to_loff_t
    
    commit 50ab8ec74a153eb30db26529088bc57dd700b24c upstream.
    
    See http: //www.infradead.org/rpr.html
    X-Evolution-Source: 1451162204.2173.11@leira.trondhjem.org
    Content-Transfer-Encoding: 8bit
    Mime-Version: 1.0
    
    We support OFFSET_MAX just fine, so don't round down below it.  Also
    switch to using min_t to make the helper more readable.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Fixes: 433c92379d9c ("NFS: Clean up nfs_size_to_loff_t()")
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b98e34c37756d8601fd29ecbed68beb9c0ee2f4e
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Jan 25 10:08:00 2016 -0600

    PCI/AER: Flush workqueue on device remove to avoid use-after-free
    
    commit 4ae2182b1e3407de369f8c5d799543b7db74221b upstream.
    
    A Root Port's AER structure (rpc) contains a queue of events.  aer_irq()
    enqueues AER status information and schedules aer_isr() to dequeue and
    process it.  When we remove a device, aer_remove() waits for the queue to
    be empty, then frees the rpc struct.
    
    But aer_isr() references the rpc struct after dequeueing and possibly
    emptying the queue, which can cause a use-after-free error as in the
    following scenario with two threads, aer_isr() on the left and a
    concurrent aer_remove() on the right:
    
      Thread A                      Thread B
      --------                      --------
      aer_irq():
        rpc->prod_idx++
                                    aer_remove():
                                      wait_event(rpc->prod_idx == rpc->cons_idx)
                                      # now blocked until queue becomes empty
      aer_isr():                      # ...
        rpc->cons_idx++               # unblocked because queue is now empty
        ...                           kfree(rpc)
        mutex_unlock(&rpc->rpc_mutex)
    
    To prevent this problem, use flush_work() to wait until the last scheduled
    instance of aer_isr() has completed before freeing the rpc struct in
    aer_remove().
    
    I reproduced this use-after-free by flashing a device FPGA and
    re-enumerating the bus to find the new device.  With SLUB debug, this
    crashes with 0x6b bytes (POISON_FREE, the use-after-free magic number) in
    GPR25:
    
      pcieport 0000:00:00.0: AER: Multiple Corrected error received: id=0000
      Unable to handle kernel paging request for data at address 0x27ef9e3e
      Workqueue: events aer_isr
      GPR24: dd6aa000 6b6b6b6b 605f8378 605f8360 d99b12c0 604fc674 606b1704 d99b12c0
      NIP [602f5328] pci_walk_bus+0xd4/0x104
    
    [bhelgaas: changelog, stable tag]
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 753a93a13c01eeda7e549bdc449c6a9f7f8a3ac1
Author: Tejun Heo <tj@kernel.org>
Date:   Mon Feb 1 11:33:21 2016 -0500

    libata: fix sff host state machine locking while polling
    
    commit 8eee1d3ed5b6fc8e14389567c9a6f53f82bb7224 upstream.
    
    The bulk of ATA host state machine is implemented by
    ata_sff_hsm_move().  The function is called from either the interrupt
    handler or, if polling, a work item.  Unlike from the interrupt path,
    the polling path calls the function without holding the host lock and
    ata_sff_hsm_move() selectively grabs the lock.
    
    This is completely broken.  If an IRQ triggers while polling is in
    progress, the two can easily race and end up accessing the hardware
    and updating state machine state at the same time.  This can put the
    state machine in an illegal state and lead to a crash like the
    following.
    
      kernel BUG at drivers/ata/libata-sff.c:1302!
      invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN
      Modules linked in:
      CPU: 1 PID: 10679 Comm: syz-executor Not tainted 4.5.0-rc1+ #300
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      task: ffff88002bd00000 ti: ffff88002e048000 task.ti: ffff88002e048000
      RIP: 0010:[<ffffffff83a83409>]  [<ffffffff83a83409>] ata_sff_hsm_move+0x619/0x1c60
      ...
      Call Trace:
       <IRQ>
       [<ffffffff83a84c31>] __ata_sff_port_intr+0x1e1/0x3a0 drivers/ata/libata-sff.c:1584
       [<ffffffff83a85611>] ata_bmdma_port_intr+0x71/0x400 drivers/ata/libata-sff.c:2877
       [<     inline     >] __ata_sff_interrupt drivers/ata/libata-sff.c:1629
       [<ffffffff83a85bf3>] ata_bmdma_interrupt+0x253/0x580 drivers/ata/libata-sff.c:2902
       [<ffffffff81479f98>] handle_irq_event_percpu+0x108/0x7e0 kernel/irq/handle.c:157
       [<ffffffff8147a717>] handle_irq_event+0xa7/0x140 kernel/irq/handle.c:205
       [<ffffffff81484573>] handle_edge_irq+0x1e3/0x8d0 kernel/irq/chip.c:623
       [<     inline     >] generic_handle_irq_desc include/linux/irqdesc.h:146
       [<ffffffff811a92bc>] handle_irq+0x10c/0x2a0 arch/x86/kernel/irq_64.c:78
       [<ffffffff811a7e4d>] do_IRQ+0x7d/0x1a0 arch/x86/kernel/irq.c:240
       [<ffffffff86653d4c>] common_interrupt+0x8c/0x8c arch/x86/entry/entry_64.S:520
       <EOI>
       [<     inline     >] rcu_lock_acquire include/linux/rcupdate.h:490
       [<     inline     >] rcu_read_lock include/linux/rcupdate.h:874
       [<ffffffff8164b4a1>] filemap_map_pages+0x131/0xba0 mm/filemap.c:2145
       [<     inline     >] do_fault_around mm/memory.c:2943
       [<     inline     >] do_read_fault mm/memory.c:2962
       [<     inline     >] do_fault mm/memory.c:3133
       [<     inline     >] handle_pte_fault mm/memory.c:3308
       [<     inline     >] __handle_mm_fault mm/memory.c:3418
       [<ffffffff816efb16>] handle_mm_fault+0x2516/0x49a0 mm/memory.c:3447
       [<ffffffff8127dc16>] __do_page_fault+0x376/0x960 arch/x86/mm/fault.c:1238
       [<ffffffff8127e358>] trace_do_page_fault+0xe8/0x420 arch/x86/mm/fault.c:1331
       [<ffffffff8126f514>] do_async_page_fault+0x14/0xd0 arch/x86/kernel/kvm.c:264
       [<ffffffff86655578>] async_page_fault+0x28/0x30 arch/x86/entry/entry_64.S:986
    
    Fix it by ensuring that the polling path is holding the host lock
    before entering ata_sff_hsm_move() so that all hardware accesses and
    state updates are performed under the host lock.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
    Link: http://lkml.kernel.org/g/CACT4Y+b_JsOxJu2EZyEf+mOXORc_zid5V1-pLZSroJVxyWdSpw@mail.gmail.com
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ce5ed0e63db6961eb7cf6118dce131ce2c57f456
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Jan 26 11:29:03 2016 +0100

    rfkill: fix rfkill_fop_read wait_event usage
    
    commit 6736fde9672ff6717ac576e9bba2fd5f3dfec822 upstream.
    
    The code within wait_event_interruptible() is called with
    !TASK_RUNNING, so mustn't call any functions that can sleep,
    like mutex_lock().
    
    Since we re-check the list_empty() in a loop after the wait,
    it's safe to simply use list_empty() without locking.
    
    This bug has existed forever, but was only discovered now
    because all userspace implementations, including the default
    'rfkill' tool, use poll() or select() to get a readable fd
    before attempting to read.
    
    Fixes: c64fb01627e24 ("rfkill: create useful userspace interface")
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 42dad46c1a28592829c24b4a10525e39a2323e19
Author: Oliver Neukum <oneukum@suse.com>
Date:   Mon Jan 18 15:45:18 2016 +0100

    cdc-acm:exclude Samsung phone 04e8:685d
    
    commit e912e685f372ab62a2405a1acd923597f524e94a upstream.
    
    This phone needs to be handled by a specialised firmware tool
    and is reported to crash irrevocably if cdc-acm takes it.
    
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 715a01aa261cd312c2aaa8614eadd6b28fd3a018
Author: Ilya Dryomov <idryomov@gmail.com>
Date:   Wed Feb 17 20:04:08 2016 +0100

    libceph: don't bail early from try_read() when skipping a message
    
    commit e7a88e82fe380459b864e05b372638aeacb0f52d upstream.
    
    The contract between try_read() and try_write() is that when called
    each processes as much data as possible.  When instructed by osd_client
    to skip a message, try_read() is violating this contract by returning
    after receiving and discarding a single message instead of checking for
    more.  try_write() then gets a chance to write out more requests,
    generating more replies/skips for try_read() to handle, forcing the
    messenger into a starvation loop.
    
    Reported-by: Varada Kari <Varada.Kari@sandisk.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Tested-by: Varada Kari <Varada.Kari@sandisk.com>
    Reviewed-by: Alex Elder <elder@linaro.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c40612ad30e2381d46627e888fd7d945c1cb5b7e
Author: Peter Rosin <peda@axentia.se>
Date:   Thu Feb 18 14:07:52 2016 +0100

    hwmon: (ads1015) Handle negative conversion values correctly
    
    commit acc146943957d7418a6846f06e029b2c5e87e0d5 upstream.
    
    Make the divisor signed as DIV_ROUND_CLOSEST is undefined for negative
    dividends when the divisor is unsigned.
    
    Signed-off-by: Peter Rosin <peda@axentia.se>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 150df7a072bf5e3915201e0f617fecc337183096
Author: Mike Marciniszyn <mike.marciniszyn@intel.com>
Date:   Thu Jan 7 16:44:10 2016 -0500

    IB/qib: fix mcast detach when qp not attached
    
    commit 09dc9cd6528f5b52bcbd3292a6312e762c85260f upstream.
    
    The code produces the following trace:
    
    [1750924.419007] general protection fault: 0000 [#3] SMP
    [1750924.420364] Modules linked in: nfnetlink autofs4 rpcsec_gss_krb5 nfsv4
    dcdbas rfcomm bnep bluetooth nfsd auth_rpcgss nfs_acl dm_multipath nfs lockd
    scsi_dh sunrpc fscache radeon ttm drm_kms_helper drm serio_raw parport_pc
    ppdev i2c_algo_bit lpc_ich ipmi_si ib_mthca ib_qib dca lp parport ib_ipoib
    mac_hid ib_cm i3000_edac ib_sa ib_uverbs edac_core ib_umad ib_mad ib_core
    ib_addr tg3 ptp dm_mirror dm_region_hash dm_log psmouse pps_core
    [1750924.420364] CPU: 1 PID: 8401 Comm: python Tainted: G D
    3.13.0-39-generic #66-Ubuntu
    [1750924.420364] Hardware name: Dell Computer Corporation PowerEdge
    860/0XM089, BIOS A04 07/24/2007
    [1750924.420364] task: ffff8800366a9800 ti: ffff88007af1c000 task.ti:
    ffff88007af1c000
    [1750924.420364] RIP: 0010:[<ffffffffa0131d51>] [<ffffffffa0131d51>]
    qib_mcast_qp_free+0x11/0x50 [ib_qib]
    [1750924.420364] RSP: 0018:ffff88007af1dd70  EFLAGS: 00010246
    [1750924.420364] RAX: 0000000000000001 RBX: ffff88007b822688 RCX:
    000000000000000f
    [1750924.420364] RDX: ffff88007b822688 RSI: ffff8800366c15a0 RDI:
    6764697200000000
    [1750924.420364] RBP: ffff88007af1dd78 R08: 0000000000000001 R09:
    0000000000000000
    [1750924.420364] R10: 0000000000000011 R11: 0000000000000246 R12:
    ffff88007baa1d98
    [1750924.420364] R13: ffff88003ecab000 R14: ffff88007b822660 R15:
    0000000000000000
    [1750924.420364] FS:  00007ffff7fd8740(0000) GS:ffff88007fc80000(0000)
    knlGS:0000000000000000
    [1750924.420364] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [1750924.420364] CR2: 00007ffff597c750 CR3: 000000006860b000 CR4:
    00000000000007e0
    [1750924.420364] Stack:
    [1750924.420364]  ffff88007b822688 ffff88007af1ddf0 ffffffffa0132429
    000000007af1de20
    [1750924.420364]  ffff88007baa1dc8 ffff88007baa0000 ffff88007af1de70
    ffffffffa00cb313
    [1750924.420364]  00007fffffffde88 0000000000000000 0000000000000008
    ffff88003ecab000
    [1750924.420364] Call Trace:
    [1750924.420364]  [<ffffffffa0132429>] qib_multicast_detach+0x1e9/0x350
    [ib_qib]
    [1750924.568035]  [<ffffffffa00cb313>] ? ib_uverbs_modify_qp+0x323/0x3d0
    [ib_uverbs]
    [1750924.568035]  [<ffffffffa0092d61>] ib_detach_mcast+0x31/0x50 [ib_core]
    [1750924.568035]  [<ffffffffa00cc213>] ib_uverbs_detach_mcast+0x93/0x170
    [ib_uverbs]
    [1750924.568035]  [<ffffffffa00c61f6>] ib_uverbs_write+0xc6/0x2c0 [ib_uverbs]
    [1750924.568035]  [<ffffffff81312e68>] ? apparmor_file_permission+0x18/0x20
    [1750924.568035]  [<ffffffff812d4cd3>] ? security_file_permission+0x23/0xa0
    [1750924.568035]  [<ffffffff811bd214>] vfs_write+0xb4/0x1f0
    [1750924.568035]  [<ffffffff811bdc49>] SyS_write+0x49/0xa0
    [1750924.568035]  [<ffffffff8172f7ed>] system_call_fastpath+0x1a/0x1f
    [1750924.568035] Code: 66 2e 0f 1f 84 00 00 00 00 00 31 c0 5d c3 66 2e 0f 1f
    84 00 00 00 00 00 66 90 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 8b 7f 10
    <f0> ff 8f 40 01 00 00 74 0e 48 89 df e8 8e f8 06 e1 5b 5d c3 0f
    [1750924.568035] RIP  [<ffffffffa0131d51>] qib_mcast_qp_free+0x11/0x50
    [ib_qib]
    [1750924.568035]  RSP <ffff88007af1dd70>
    [1750924.650439] ---[ end trace 73d5d4b3f8ad4851 ]
    
    The fix is to note the qib_mcast_qp that was found.   If none is found, then
    return EINVAL indicating the error.
    
    Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
    Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
    Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
    Signed-off-by: Doug Ledford <dledford@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 759ff5dccf67b3617eecd9dd85ec74f2dac37d09
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Feb 19 18:05:10 2016 -0500

    drm/radeon/pm: adjust display configuration after powerstate
    
    commit 39d4275058baf53e89203407bf3841ff2c74fa32 upstream.
    
    set_power_state defaults to no displays, so we need to update
    the display configuration after setting up the powerstate on the
    first call. In most cases this is not an issue since ends up
    getting called multiple times at any given modeset and the proper
    order is achieved in the display changed handling at the top of
    the function.
    
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 84a0ab7203b29d5d37671692c25b8d1458da4d71
Author: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date:   Mon Feb 15 19:41:47 2016 +0100

    drm/radeon: use post-decrement in error handling
    
    commit bc3f5d8c4ca01555820617eb3b6c0857e4df710d upstream.
    
    We need to use post-decrement to get the pci_map_page undone also for
    i==0, and to avoid some very unpleasant behaviour if pci_map_page
    failed already at i==0.
    
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 71b8d0d34b7881dfaf4ca80fc710e149af8842d1
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Tue Feb 16 14:25:00 2016 +0100

    drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command
    
    commit 34855706c30d52b0a744da44348b5d1cc39fbe51 upstream.
    
    This avoids integer overflows on 32bit machines when calculating
    reloc_info size, as reported by Alan Cox.
    
    Cc: gnomes@lxorguk.ukuu.org.uk
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 554b014005ab84bb9f1ac8edc4492c6ae5e176f7
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed Jan 13 16:35:20 2016 +0200

    drm/i915/dp: fall back to 18 bpp when sink capability is unknown
    
    commit 5efd407674068dede403551bea3b0b134c32513a upstream.
    
    Per DP spec, the source device should fall back to 18 bpp, VESA range
    RGB when the sink capability is unknown. Fix the color depth
    clamping. 18 bpp color depth should ensure full color range in automatic
    mode.
    
    The clamping has been HDMI specific since its introduction in
    
    commit 996a2239f93b03c5972923f04b097f65565c5bed
    Author: Daniel Vetter <daniel.vetter@ffwll.ch>
    Date:   Fri Apr 19 11:24:34 2013 +0200
    
        drm/i915: Disable high-bpc on pre-1.4 EDID screens
    
    Reported-and-tested-by: Dihan Wickremasuriya <nayomal@gmail.com>
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105331
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/1452695720-7076-1-git-send-email-jani.nikula@intel.com
    (cherry picked from commit 013dd9e038723bbd2aa67be51847384b75be8253)
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 40df18b49e7fe4ec9ab93f68c33661ee291149bd
Author: Nicolai Hähnle <nicolai.haehnle@amd.com>
Date:   Fri Feb 5 14:35:53 2016 -0500

    drm/radeon: hold reference to fences in radeon_sa_bo_new
    
    commit f6ff4f67cdf8455d0a4226eeeaf5af17c37d05eb upstream.
    
    An arbitrary amount of time can pass between spin_unlock and
    radeon_fence_wait_any, so we need to ensure that nobody frees the
    fences from under us.
    
    Based on the analogous fix for amdgpu.
    
    Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e2f0c800e65090d8532040c4307a32fdf0c87343
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Dec 17 12:52:17 2015 -0500

    drm/radeon: clean up fujitsu quirks
    
    commit 0eb1c3d4084eeb6fb3a703f88d6ce1521f8fcdd1 upstream.
    
    Combine the two quirks.
    
    bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=109481
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2369804a6758b44651fb2aa0bded155f0035aff7
Author: Rob Clark <robdclark@gmail.com>
Date:   Wed Oct 15 15:00:47 2014 -0400

    drm/vmwgfx: respect 'nomodeset'
    
    commit 96c5d076f0a5e2023ecdb44d8261f87641ee71e0 upstream.
    
    Signed-off-by: Rob Clark <robdclark@gmail.com>
    Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>.
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a6827009cb013e8cffb430e960f656d6c6b9d60e
Author: Dmitry V. Levin <ldv@altlinux.org>
Date:   Sun Dec 27 02:13:27 2015 +0300

    sparc64: fix incorrect sign extension in sys_sparc64_personality
    
    commit 525fd5a94e1be0776fa652df5c687697db508c91 upstream.
    
    The value returned by sys_personality has type "long int".
    It is saved to a variable of type "int", which is not a problem
    yet because the type of task_struct->pesonality is "unsigned int".
    The problem is the sign extension from "int" to "long int"
    that happens on return from sys_sparc64_personality.
    
    For example, a userspace call personality((unsigned) -EINVAL) will
    result to any subsequent personality call, including absolutely
    harmless read-only personality(0xffffffff) call, failing with
    errno set to EINVAL.
    
    Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit afe13fe42a288adbd6e3a0eff1933a1ae4774440
Author: Borislav Petkov <bp@suse.de>
Date:   Fri Nov 27 10:38:38 2015 +0100

    EDAC: Robustify workqueues destruction
    
    commit fcd5c4dd8201595d4c598c9cca5e54760277d687 upstream.
    
    EDAC workqueue destruction is really fragile. We cancel delayed work
    but if it is still running and requeues itself, we still go ahead and
    destroy the workqueue and the queued work explodes when workqueue core
    attempts to run it.
    
    Make the destruction more robust by switching op_state to offline so
    that requeuing stops. Cancel any pending work *synchronously* too.
    
      EDAC i7core: Driver loaded.
      general protection fault: 0000 [#1] SMP
      CPU 12
      Modules linked in:
      Supported: Yes
      Pid: 0, comm: kworker/0:1 Tainted: G          IE   3.0.101-0-default #1 HP ProLiant DL380 G7
      RIP: 0010:[<ffffffff8107dcd7>]  [<ffffffff8107dcd7>] __queue_work+0x17/0x3f0
      < ... regs ...>
      Process kworker/0:1 (pid: 0, threadinfo ffff88019def6000, task ffff88019def4600)
      Stack:
       ...
      Call Trace:
       call_timer_fn
       run_timer_softirq
       __do_softirq
       call_softirq
       do_softirq
       irq_exit
       smp_apic_timer_interrupt
       apic_timer_interrupt
       intel_idle
       cpuidle_idle_call
       cpu_idle
      Code: ...
      RIP  __queue_work
       RSP <...>
    
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9ab73ebfeafc5451c343263118aaf84ad8f256cf
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Mon Jan 4 02:21:55 2016 +0100

    mmc: mmci: fix an ages old detection error
    
    commit 0bcb7efdff63564e80fe84dd36a9fbdfbf6697a4 upstream.
    
    commit 4956e10903fd ("ARM: 6244/1: mmci: add variant data and default
    MCICLOCK support") added variant data for ARM, U300 and Ux500 variants.
    The Nomadik NHK8815/8820 variant was erroneously labeled as a U300
    variant, and when the proper Nomadik variant was later introduced in
    commit 34fd421349ff ("ARM: 7378/1: mmci: add support for the Nomadik MMCI
    variant") this was not fixes. Let's say this fixes the latter commit as
    there was no proper Nomadik support until then.
    
    Fixes: 34fd421349ff ("ARM: 7378/1: mmci: add support for the Nomadik...")
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f26c5a2c6c3f003c95edcaf090ceeab35ab1e246
Author: Adrian Hunter <adrian.hunter@intel.com>
Date:   Thu Nov 26 14:00:50 2015 +0200

    mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off()
    
    commit 5c671c410c8704800f4f1673b6f572137e7e6ddd upstream.
    
    sdhci has a legacy facility to prevent runtime suspend if the
    bus power is on.  This is needed in cases where the power to
    the card is dependent on the bus power.  It is controlled by
    a pair of functions: sdhci_runtime_pm_bus_on() and
    sdhci_runtime_pm_bus_off().  These functions use a boolean
    variable 'bus_on' to ensure changes are always paired.
    There is an additional check for 'runtime_suspended' which is
    the problem.  In fact, its use is ill-conceived as the only
    requirement for the logic is that 'on' and 'off' are paired,
    which is actually broken by the check, for example if the bus
    power is turned on during runtime resume.  So remove  the check.
    
    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit bb83e03e5dcaf3352bec1e91ea25a11ed3a2bcea
Author: Richard Cochran <richardcochran@gmail.com>
Date:   Tue Dec 22 22:19:58 2015 +0100

    posix-clock: Fix return code on the poll method's error path
    
    commit 1b9f23727abb92c5e58f139e7d180befcaa06fe0 upstream.
    
    The posix_clock_poll function is supposed to return a bit mask of
    POLLxxx values.  However, in case the hardware has disappeared (due to
    hot plugging for example) this code returns -ENODEV in a futile
    attempt to throw an error at the file descriptor level.  The kernel's
    file_operations interface does not accept such error codes from the
    poll method.  Instead, this function aught to return POLLERR.
    
    The value -ENODEV does, in fact, contain the POLLERR bit (and almost
    all the other POLLxxx bits as well), but only by chance.  This patch
    fixes code to return a proper bit mask.
    
    Credit goes to Markus Elfring for pointing out the suspicious
    signed/unsigned mismatch.
    
    Reported-by: Markus Elfring <elfring@users.sourceforge.net>
    igned-off-by: Richard Cochran <richardcochran@gmail.com>
    Cc: John Stultz <john.stultz@linaro.org>
    Cc: Julia Lawall <julia.lawall@lip6.fr>
    Link: http://lkml.kernel.org/r/1450819198-17420-1-git-send-email-richardcochran@gmail.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit da7dbf91fceb737d8437055cd4ba4da57f971623
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Fri Jan 8 19:07:55 2016 -0500

    dm snapshot: fix hung bios when copy error occurs
    
    commit 385277bfb57faac44e92497104ba542cdd82d5fe upstream.
    
    When there is an error copying a chunk dm-snapshot can incorrectly hold
    associated bios indefinitely, resulting in hung IO.
    
    The function copy_callback sets pe->error if there was error copying the
    chunk, and then calls complete_exception.  complete_exception calls
    pending_complete on error, otherwise it calls commit_exception with
    commit_callback (and commit_callback calls complete_exception).
    
    The persistent exception store (dm-snap-persistent.c) assumes that calls
    to prepare_exception and commit_exception are paired.
    persistent_prepare_exception increases ps->pending_count and
    persistent_commit_exception decreases it.
    
    If there is a copy error, persistent_prepare_exception is called but
    persistent_commit_exception is not.  This results in the variable
    ps->pending_count never returning to zero and that causes some pending
    exceptions (and their associated bios) to be held forever.
    
    Fix this by unconditionally calling commit_exception regardless of
    whether the copy was successful.  A new "valid" parameter is added to
    commit_exception -- when the copy fails this parameter is set to zero so
    that the chunk that failed to copy (and all following chunks) is not
    recorded in the snapshot store.  Also, remove commit_callback now that
    it is merely a wrapper around pending_complete.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9f1f8ac7059105958dc5c870940477b647637c29
Author: Mike Snitzer <snitzer@redhat.com>
Date:   Mon Dec 14 09:26:01 2015 -0500

    dm space map metadata: remove unused variable in brb_pop()
    
    commit 512167788a6fe9481a33a3cce5f80b684631a1bb upstream.
    
    Remove the unused struct block_op pointer that was inadvertantly
    introduced, via cut-and-paste of previous brb_op() code, as part of
    commit 50dd842ad.
    
    (Cc'ing stable@ because commit 50dd842ad did)
    
    Fixes: 50dd842ad ("dm space map metadata: fix ref counting bug when bootstrapping a new space map")
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 3924f7f0661ea53d22f5b2c085e21cf3c307537a
Author: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Date:   Wed Feb 3 17:33:48 2016 -0200

    tda1004x: only update the frontend properties if locked
    
    commit e8beb02343e7582980c6705816cd957cf4f74c7a upstream.
    
    The tda1004x was updating the properties cache before locking.
    If the device is not locked, the data at the registers are just
    random values with no real meaning.
    
    This caused the driver to fail with libdvbv5, as such library
    calls GET_PROPERTY from time to time, in order to return the
    DVB stats.
    
    Tested with a saa7134 card 78:
    	ASUSTeK P7131 Dual, vendor PCI ID: 1043:4862
    
    Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 15d2e31eca2d4700a0e21d52df081afd65834653
Author: Antonio Ospite <ao2@ao2.it>
Date:   Fri Oct 2 17:33:13 2015 -0300

    gspca: ov534/topro: prevent a division by 0
    
    commit dcc7fdbec53a960588f2c40232db2c6466c09917 upstream.
    
    v4l2-compliance sends a zeroed struct v4l2_streamparm in
    v4l2-test-formats.cpp::testParmType(), and this results in a division by
    0 in some gspca subdrivers:
    
      divide error: 0000 [#1] SMP
      Modules linked in: gspca_ov534 gspca_main ...
      CPU: 0 PID: 17201 Comm: v4l2-compliance Not tainted 4.3.0-rc2-ao2 #1
      Hardware name: System manufacturer System Product Name/M2N-E SLI, BIOS
        ASUS M2N-E SLI ACPI BIOS Revision 1301 09/16/2010
      task: ffff8800818306c0 ti: ffff880095c4c000 task.ti: ffff880095c4c000
      RIP: 0010:[<ffffffffa079bd62>]  [<ffffffffa079bd62>] sd_set_streamparm+0x12/0x60 [gspca_ov534]
      RSP: 0018:ffff880095c4fce8  EFLAGS: 00010296
      RAX: 0000000000000000 RBX: ffff8800c9522000 RCX: ffffffffa077a140
      RDX: 0000000000000000 RSI: ffff880095e0c100 RDI: ffff8800c9522000
      RBP: ffff880095e0c100 R08: ffffffffa077a100 R09: 00000000000000cc
      R10: ffff880067ec7740 R11: 0000000000000016 R12: ffffffffa07bb400
      R13: 0000000000000000 R14: ffff880081b6a800 R15: 0000000000000000
      FS:  00007fda0de78740(0000) GS:ffff88012fc00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000014630f8 CR3: 00000000cf349000 CR4: 00000000000006f0
      Stack:
       ffffffffa07a6431 ffff8800c9522000 ffffffffa077656e 00000000c0cc5616
       ffff8800c9522000 ffffffffa07a5e20 ffff880095e0c100 0000000000000000
       ffff880067ec7740 ffffffffa077a140 ffff880067ec7740 0000000000000016
      Call Trace:
       [<ffffffffa07a6431>] ? v4l_s_parm+0x21/0x50 [videodev]
       [<ffffffffa077656e>] ? vidioc_s_parm+0x4e/0x60 [gspca_main]
       [<ffffffffa07a5e20>] ? __video_do_ioctl+0x280/0x2f0 [videodev]
       [<ffffffffa07a5ba0>] ? video_ioctl2+0x20/0x20 [videodev]
       [<ffffffffa07a59b9>] ? video_usercopy+0x319/0x4e0 [videodev]
       [<ffffffff81182dc1>] ? page_add_new_anon_rmap+0x71/0xa0
       [<ffffffff811afb92>] ? mem_cgroup_commit_charge+0x52/0x90
       [<ffffffff81179b18>] ? handle_mm_fault+0xc18/0x1680
       [<ffffffffa07a15cc>] ? v4l2_ioctl+0xac/0xd0 [videodev]
       [<ffffffff811c846f>] ? do_vfs_ioctl+0x28f/0x480
       [<ffffffff811c86d4>] ? SyS_ioctl+0x74/0x80
       [<ffffffff8154a8b6>] ? entry_SYSCALL_64_fastpath+0x16/0x75
      Code: c7 93 d9 79 a0 5b 5d e9 f1 f3 9a e0 0f 1f 00 66 2e 0f 1f 84 00
        00 00 00 00 66 66 66 66 90 53 31 d2 48 89 fb 48 83 ec 08 8b 46 10 <f7>
        76 0c 80 bf ac 0c 00 00 00 88 87 4e 0e 00 00 74 09 80 bf 4f
      RIP  [<ffffffffa079bd62>] sd_set_streamparm+0x12/0x60 [gspca_ov534]
       RSP <ffff880095c4fce8>
      ---[ end trace 279710c2c6c72080 ]---
    
    Following what the doc says about a zeroed timeperframe (see
    http://www.linuxtv.org/downloads/v4l-dvb-apis/vidioc-g-parm.html):
    
      ...
      To reset manually applications can just set this field to zero.
    
    fix the issue by resetting the frame rate to a default value in case of
    an unusable timeperframe.
    
    The fix is done in the subdrivers instead of gspca.c because only the
    subdrivers have notion of a default frame rate to reset the camera to.
    
    Signed-off-by: Antonio Ospite <ao2@ao2.it>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f6220a7af83a2c7025a096ba0ef16601d7ee186d
Author: Malcolm Priestley <tvboxspy@gmail.com>
Date:   Mon Aug 31 06:13:45 2015 -0300

    media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode
    
    commit c9d57de6103e343f2d4e04ea8d9e417e10a24da7 upstream.
    
    When in FE_TUNE_MODE_ONESHOT the frontend must report
    the actual capabilities so user can take appropriate
    action.
    
    With frontends that can't do auto inversion this is done
    by dvb-core automatically so CAN_INVERSION_AUTO is valid.
    
    However, when in FE_TUNE_MODE_ONESHOT this is not true.
    
    So only set FE_CAN_INVERSION_AUTO in modes other than
    FE_TUNE_MODE_ONESHOT
    
    Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b818d63ccdbe8b849511892c8b4abd149b448d2d
Author: Vegard Nossum <vegard.nossum@oracle.com>
Date:   Wed Dec 16 21:59:56 2015 +0100

    uml: fix hostfs mknod()
    
    commit 9f2dfda2f2f1c6181c3732c16b85c59ab2d195e0 upstream.
    
    An inverted return value check in hostfs_mknod() caused the function
    to return success after handling it as an error (and cleaning up).
    
    It resulted in the following segfault when trying to bind() a named
    unix socket:
    
      Pid: 198, comm: a.out Not tainted 4.4.0-rc4
      RIP: 0033:[<0000000061077df6>]
      RSP: 00000000daae5d60  EFLAGS: 00010202
      RAX: 0000000000000000 RBX: 000000006092a460 RCX: 00000000dfc54208
      RDX: 0000000061073ef1 RSI: 0000000000000070 RDI: 00000000e027d600
      RBP: 00000000daae5de0 R08: 00000000da980ac0 R09: 0000000000000000
      R10: 0000000000000003 R11: 00007fb1ae08f72a R12: 0000000000000000
      R13: 000000006092a460 R14: 00000000daaa97c0 R15: 00000000daaa9a88
      Kernel panic - not syncing: Kernel mode fault at addr 0x40, ip 0x61077df6
      CPU: 0 PID: 198 Comm: a.out Not tainted 4.4.0-rc4 #1
      Stack:
       e027d620 dfc54208 0000006f da981398
       61bee000 0000c1ed daae5de0 0000006e
       e027d620 dfcd4208 00000005 6092a460
      Call Trace:
       [<60dedc67>] SyS_bind+0xf7/0x110
       [<600587be>] handle_syscall+0x7e/0x80
       [<60066ad7>] userspace+0x3e7/0x4e0
       [<6006321f>] ? save_registers+0x1f/0x40
       [<6006c88e>] ? arch_prctl+0x1be/0x1f0
       [<60054985>] fork_handler+0x85/0x90
    
    Let's also get rid of the "cosmic ray protection" while we're at it.
    
    Fixes: e9193059b1b3 "hostfs: fix races in dentry_name() and inode_name()"
    Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
    Cc: Jeff Dike <jdike@addtoit.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c8ed7e3ffb97fe30b10dad8d2279af599fd32cc5
Author: Vegard Nossum <vegard.nossum@oracle.com>
Date:   Fri Dec 18 21:28:53 2015 +0100

    uml: flush stdout before forking
    
    commit 0754fb298f2f2719f0393491d010d46cfb25d043 upstream.
    
    I was seeing some really weird behaviour where piping UML's output
    somewhere would cause output to get duplicated:
    
      $ ./vmlinux | head -n 40
      Checking that ptrace can change system call numbers...Core dump limits :
              soft - 0
              hard - NONE
      OK
      Checking syscall emulation patch for ptrace...Core dump limits :
              soft - 0
              hard - NONE
      OK
      Checking advanced syscall emulation patch for ptrace...Core dump limits :
              soft - 0
              hard - NONE
      OK
      Core dump limits :
              soft - 0
              hard - NONE
    
    This is because these tests do a fork() which duplicates the non-empty
    stdout buffer, then glibc flushes the duplicated buffer as each child
    exits.
    
    A simple workaround is to flush before forking.
    
    Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 052db2fea6ed96b1bcb837316f9a62c3214c068d
Author: Stefan Haberland <stefan.haberland@de.ibm.com>
Date:   Tue Dec 15 10:45:05 2015 +0100

    s390/dasd: fix refcount for PAV reassignment
    
    commit 9d862ababb609439c5d6987f6d3ddd09e703aa0b upstream.
    
    Add refcount to the DASD device when a summary unit check worker is
    scheduled. This prevents that the device is set offline with worker
    in place.
    
    Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 4c3ada65b234aff99a0380ffd32842b7ee478888
Author: Stefan Haberland <stefan.haberland@de.ibm.com>
Date:   Tue Dec 15 10:16:43 2015 +0100

    s390/dasd: prevent incorrect length error under z/VM after PAV changes
    
    commit 020bf042e5b397479c1174081b935d0ff15d1a64 upstream.
    
    The channel checks the specified length and the provided amount of
    data for CCWs and provides an incorrect length error if the size does
    not match. Under z/VM with simulation activated the length may get
    changed. Having the suppress length indication bit set is stated as
    good CCW coding practice and avoids errors under z/VM.
    
    Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6f751109450760d466d678ea4971e54b0bb63273
Author: Filipe Manana <fdmanana@suse.com>
Date:   Thu Dec 31 18:16:29 2015 +0000

    Btrfs: fix number of transaction units required to create symlink
    
    commit 9269d12b2d57d9e3d13036bb750762d1110d425c upstream.
    
    We weren't accounting for the insertion of an inline extent item for the
    symlink inode nor that we need to update the parent inode item (through
    the call to btrfs_add_nondir()). So fix this by including two more
    transaction units.
    
    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6aa9b83f7f4370a314753b30ba2010472963b66a
Author: Filipe Manana <fdmanana@suse.com>
Date:   Thu Dec 31 18:07:59 2015 +0000

    Btrfs: send, don't BUG_ON() when an empty symlink is found
    
    commit a879719b8c90e15c9e7fa7266d5e3c0ca962f9df upstream.
    
    When a symlink is successfully created it always has an inline extent
    containing the source path. However if an error happens when creating
    the symlink, we can leave in the subvolume's tree a symlink inode without
    any such inline extent item - this happens if after btrfs_symlink() calls
    btrfs_end_transaction() and before it calls the inode eviction handler
    (through the final iput() call), the transaction gets committed and a
    crash happens before the eviction handler gets called, or if a snapshot
    of the subvolume is made before the eviction handler gets called. Sadly
    we can't just avoid this by making btrfs_symlink() call
    btrfs_end_transaction() after it calls the eviction handler, because the
    later can commit the current transaction before it removes any items from
    the subvolume tree (if it encounters ENOSPC errors while reserving space
    for removing all the items).
    
    So make send fail more gracefully, with an -EIO error, and print a
    message to dmesg/syslog informing that there's an empty symlink inode,
    so that the user can delete the empty symlink or do something else
    about it.
    
    Reported-by: Stephen R. van den Berg <srb@cuci.nl>
    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 84d075f30de97089689b0775e122b21b3d3821e9
Author: Josef Bacik <jbacik@fb.com>
Date:   Thu Oct 22 15:05:09 2015 -0400

    Btrfs: igrab inode in writepage
    
    commit be7bd730841e69fe8f70120098596f648cd1f3ff upstream.
    
    We hit this panic on a few of our boxes this week where we have an
    ordered_extent with an NULL inode.  We do an igrab() of the inode in writepages,
    but weren't doing it in writepage which can be called directly from the VM on
    dirty pages.  If the inode has been unlinked then we could have I_FREEING set
    which means igrab() would return NULL and we get this panic.  Fix this by trying
    to igrab in btrfs_writepage, and if it returns NULL then just redirty the page
    and return AOP_WRITEPAGE_ACTIVATE; so the VM knows it wasn't successful.  Thanks,
    
    Signed-off-by: Josef Bacik <jbacik@fb.com>
    Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9ec709846fe9fe45a5d128a7e00f2aaa4e597a7f
Author: Anand Jain <anand.jain@oracle.com>
Date:   Wed Oct 7 17:23:23 2015 +0800

    Btrfs: add missing brelse when superblock checksum fails
    
    commit b2acdddfad13c38a1e8b927d83c3cf321f63601a upstream.
    
    Looks like oversight, call brelse() when checksum fails. Further down the
    code, in the non error path, we do call brelse() and so we don't see
    brelse() in the goto error paths.
    
    Signed-off-by: Anand Jain <anand.jain@oracle.com>
    Reviewed-by: David Sterba <dsterba@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 40c0155d68140a36d52cc7f94cce5fa1f289509f
Author: Russell King <rmk+kernel@arm.linux.org.uk>
Date:   Fri Dec 11 12:09:03 2015 +0000

    scripts: recordmcount: break hardlinks
    
    commit dd39a26538e37f6c6131e829a4a510787e43c783 upstream.
    
    recordmcount edits the file in-place, which can cause problems when
    using ccache in hardlink mode.  Arrange for recordmcount to break a
    hardlinked object.
    
    Link: http://lkml.kernel.org/r/E1a7MVT-0000et-62@rmk-PC.arm.linux.org.uk
    
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 107626c1d8e73311be1815837b16a2aa0195fdfe
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Fri Dec 11 09:16:38 2015 -0800

    ses: fix additional element traversal bug
    
    commit 5e1033561da1152c57b97ee84371dba2b3d64c25 upstream.
    
    KASAN found that our additional element processing scripts drop off
    the end of the VPD page into unallocated space.  The reason is that
    not every element has additional information but our traversal
    routines think they do, leading to them expecting far more additional
    information than is present.  Fix this by adding a gate to the
    traversal routine so that it only processes elements that are expected
    to have additional information (list is in SES-2 section 6.1.13.1:
    Additional Element Status diagnostic page overview)
    
    Reported-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Tested-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 1d4d5a272c06bf2d9cf4cb797b68c8080ee7f972
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Tue Dec 8 09:00:31 2015 -0800

    ses: Fix problems with simple enclosures
    
    commit 3417c1b5cb1fdc10261dbed42b05cc93166a78fd upstream.
    
    Simple enclosure implementations (mostly USB) are allowed to return only
    page 8 to every diagnostic query.  That really confuses our
    implementation because we assume the return is the page we asked for and
    end up doing incorrect offsets based on bogus information leading to
    accesses outside of allocated ranges.  Fix that by checking the page
    code of the return and giving an error if it isn't the one we asked for.
    This should fix reported bugs with USB storage by simply refusing to
    attach to enclosures that behave like this.  It's also good defensive
    practise now that we're starting to see more USB enclosures.
    
    Reported-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Reviewed-by: Tomas Henzl <thenzl@redhat.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 3fdf3c8935794c9a2c9cd6d98bcf1f79eea348d4
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Dec 10 10:37:51 2015 +0100

    rfkill: copy the name into the rfkill struct
    
    commit b7bb110008607a915298bf0f47d25886ecb94477 upstream.
    
    Some users of rfkill, like NFC and cfg80211, use a dynamic name when
    allocating rfkill, in those cases dev_name(). Therefore, the pointer
    passed to rfkill_alloc() might not be valid forever, I specifically
    found the case that the rfkill name was quite obviously an invalid
    pointer (or at least garbage) when the wiphy had been renamed.
    
    Fix this by making a copy of the rfkill name in rfkill_alloc().
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2b7dac5f1c240e7432948f5e64440ec8e9dec90e
Author: Kirill A. Shutemov <kirill@shutemov.name>
Date:   Mon Nov 30 04:17:31 2015 +0200

    vgaarb: fix signal handling in vga_get()
    
    commit 9f5bd30818c42c6c36a51f93b4df75a2ea2bd85e upstream.
    
    There are few defects in vga_get() related to signal hadning:
    
      - we shouldn't check for pending signals for TASK_UNINTERRUPTIBLE
        case;
    
      - if we found pending signal we must remove ourself from wait queue
        and change task state back to running;
    
      - -ERESTARTSYS is more appropriate, I guess.
    
    Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
    Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c96f4852b59b919f747a5fba9320a12f23971e8c
Author: Joe Thornber <ejt@redhat.com>
Date:   Thu Dec 10 14:37:53 2015 +0000

    dm btree: fix bufio buffer leaks in dm_btree_del() error path
    
    commit ed8b45a3679eb49069b094c0711b30833f27c734 upstream.
    
    If dm_btree_del()'s call to push_frame() fails, e.g. due to
    btree_node_validator finding invalid metadata, the dm_btree_del() error
    path must unlock all frames (which have active dm-bufio buffers) that
    were pushed onto the del_stack.
    
    Otherwise, dm_bufio_client_destroy() will BUG_ON() because dm-bufio
    buffers have leaked, e.g.:
      device-mapper: bufio: leaked buffer 3, hold count 1, list 0
    
    Signed-off-by: Joe Thornber <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 70728885b1a6c1dce9f2b848de84fdacd3a6c0e9
Author: Joe Thornber <ejt@redhat.com>
Date:   Wed Dec 9 16:38:12 2015 +0000

    dm space map metadata: fix ref counting bug when bootstrapping a new space map
    
    commit 50dd842ad83b43bed71790efb31cfb2f6c05c9c1 upstream.
    
    When applying block operations (BOPs) do not remove them from the
    uncommitted BOP ring-buffer until after they've been applied -- in case
    we recurse.
    
    Also, perform BOP_INC operation, in dm_sm_metadata_create() and
    sm_metadata_extend(), in terms of the uncommitted BOP ring-buffer rather
    than using direct calls to sm_ll_inc().
    
    Signed-off-by: Joe Thornber <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b25005563a798dacdb700cc5231f8420ac0cafdd
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Thu Nov 26 12:00:59 2015 -0500

    sata_sil: disable trim
    
    commit d98f1cd0a3b70ea91f1dfda3ac36c3b2e1a4d5e2 upstream.
    
    When I connect an Intel SSD to SATA SIL controller (PCI ID 1095:3114), any
    TRIM command results in I/O errors being reported in the log. There is
    other similar error reported with TRIM and the SIL controller:
    https://bugs.centos.org/view.php?id=5880
    
    Apparently the controller doesn't support TRIM commands. This patch
    disables TRIM support on the SATA SIL controller.
    
    ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
    ata7.00: BMDMA2 stat 0x50001
    ata7.00: failed command: DATA SET MANAGEMENT
    ata7.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 512 out
             res 51/04:01:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)
    ata7.00: status: { DRDY ERR }
    ata7.00: error: { ABRT }
    ata7.00: device reported invalid CHS sector 0
    sd 8:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    sd 8:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] [descriptor]
    sd 8:0:0:0: [sdb] tag#0 Add. Sense: Unaligned write command
    sd 8:0:0:0: [sdb] tag#0 CDB: Write same(16) 93 08 00 00 00 00 00 21 95 88 00 20 00 00 00 00
    blk_update_request: I/O error, dev sdb, sector 2200968
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f01def7badd549af9c00ee3d9be3c63cb69cfcc0
Author: Sasha Levin <sasha.levin@oracle.com>
Date:   Mon Nov 30 20:34:20 2015 -0500

    sched/core: Remove false-positive warning from wake_up_process()
    
    commit 119d6f6a3be8b424b200dcee56e74484d5445f7e upstream.
    
    Because wakeups can (fundamentally) be late, a task might not be in
    the expected state. Therefore testing against a task's state is racy,
    and can yield false positives.
    
    Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: oleg@redhat.com
    Fixes: 9067ac85d533 ("wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task")
    Link: http://lkml.kernel.org/r/1448933660-23082-1-git-send-email-sasha.levin@oracle.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d42cb3972c5227f7434844521135948dd7b6ddf9
Author: Xunlei Pang <xlpang@redhat.com>
Date:   Wed Dec 2 19:52:59 2015 +0800

    sched/core: Clear the root_domain cpumasks in init_rootdomain()
    
    commit 8295c69925ad53ec32ca54ac9fc194ff21bc40e2 upstream.
    
    root_domain::rto_mask allocated through alloc_cpumask_var()
    contains garbage data, this may cause problems. For instance,
    When doing pull_rt_task(), it may do useless iterations if
    rto_mask retains some extra garbage bits. Worse still, this
    violates the isolated domain rule for clustered scheduling
    using cpuset, because the tasks(with all the cpus allowed)
    belongs to one root domain can be pulled away into another
    root domain.
    
    The patch cleans the garbage by using zalloc_cpumask_var()
    instead of alloc_cpumask_var() for root_domain::rto_mask
    allocation, thereby addressing the issues.
    
    Do the same thing for root_domain's other cpumask memembers:
    dlo_mask, span, and online.
    
    Signed-off-by: Xunlei Pang <xlpang@redhat.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/1449057179-29321-1-git-send-email-xlpang@redhat.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9b2239e264e282b4cc802f8abe529c61d48fad1d
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Nov 17 14:25:21 2015 +0100

    mac80211: mesh: fix call_rcu() usage
    
    commit c2e703a55245bfff3db53b1f7cbe59f1ee8a4339 upstream.
    
    When using call_rcu(), the called function may be delayed quite
    significantly, and without a matching rcu_barrier() there's no
    way to be sure it has finished.
    Therefore, global state that could be gone/freed/reused should
    never be touched in the callback.
    
    Fix this in mesh by moving the atomic_dec() into the caller;
    that's not really a problem since we already unlinked the path
    and it will be destroyed anyway.
    
    This fixes a crash Jouni observed when running certain tests in
    a certain order, in which the mesh interface was torn down, the
    memory reused for a function pointer (work struct) and running
    that then crashed since the pointer had been decremented by 1,
    resulting in an invalid instruction byte stream.
    
    Fixes: eb2b9311fd00 ("mac80211: mesh path table implementation")
    Reported-by: Jouni Malinen <j@w1.fi>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8c4cb2a75a22b5720342899496123c4c78939640
Author: Suman Anna <s-anna@ti.com>
Date:   Wed Sep 16 19:29:17 2015 -0500

    virtio: fix memory leak of virtio ida cache layers
    
    commit c13f99b7e945dad5273a8b7ee230f4d1f22d3354 upstream.
    
    The virtio core uses a static ida named virtio_index_ida for
    assigning index numbers to virtio devices during registration.
    The ida core may allocate some internal idr cache layers and
    an ida bitmap upon any ida allocation, and all these layers are
    truely freed only upon the ida destruction. The virtio_index_ida
    is not destroyed at present, leading to a memory leak when using
    the virtio core as a module and atleast one virtio device is
    registered and unregistered.
    
    Fix this by invoking ida_destroy() in the virtio core module
    exit.
    
    Signed-off-by: Suman Anna <s-anna@ti.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0913ffd1940f89cadd3f10279e56f47b4d42b283
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Mon Nov 23 10:35:36 2015 -0500

    ring-buffer: Update read stamp with first real commit on page
    
    commit b81f472a208d3e2b4392faa6d17037a89442f4ce upstream.
    
    Do not update the read stamp after swapping out the reader page from the
    write buffer. If the reader page is swapped out of the buffer before an
    event is written to it, then the read_stamp may get an out of date
    timestamp, as the page timestamp is updated on the first commit to that
    page.
    
    rb_get_reader_page() only returns a page if it has an event on it, otherwise
    it will return NULL. At that point, check if the page being returned has
    events and has not been read yet. Then at that point update the read_stamp
    to match the time stamp of the reader page.
    
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b0bd8e379bc2df1f200a70f97f26d9d1952bd1ba
Author: Jan Engelhardt <jengelh@inai.de>
Date:   Mon Nov 23 17:46:32 2015 +0100

    target: fix COMPARE_AND_WRITE non zero SGL offset data corruption
    
    commit d94e5a61357a04938ce14d6033b4d33a3c5fd780 upstream.
    
    target_core_sbc's compare_and_write functionality suffers from taking
    data at the wrong memory location when writing a CAW request to disk
    when a SGL offset is non-zero.
    
    This can happen with loopback and vhost-scsi fabric drivers when
    SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC is used to map existing user-space
    SGL memory into COMPARE_AND_WRITE READ/WRITE payload buffers.
    
    Given the following sample LIO subtopology,
    
    % targetcli ls /loopback/
    o- loopback ................................. [1 Target]
      o- naa.6001405ebb8df14a ....... [naa.60014059143ed2b3]
        o- luns ................................... [2 LUNs]
          o- lun0 ................ [iblock/ram0 (/dev/ram0)]
          o- lun1 ................ [iblock/ram1 (/dev/ram1)]
    % lsscsi -g
    [3:0:1:0]    disk    LIO-ORG  IBLOCK           4.0   /dev/sdc   /dev/sg3
    [3:0:1:1]    disk    LIO-ORG  IBLOCK           4.0   /dev/sdd   /dev/sg4
    
    the following bug can be observed in Linux 4.3 and 4.4~rc1:
    
    % perl -e 'print chr$_ for 0..255,reverse 0..255' >rand
    % perl -e 'print "\0" x 512' >zero
    % cat rand >/dev/sdd
    % sg_compare_and_write -i rand -D zero --lba 0 /dev/sdd
    % sg_compare_and_write -i zero -D rand --lba 0 /dev/sdd
    Miscompare reported
    % hexdump -Cn 512 /dev/sdd
    00000000  0f 0e 0d 0c 0b 0a 09 08  07 06 05 04 03 02 01 00
    00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
    *
    00000200
    
    Rather than writing all-zeroes as instructed with the -D file, it
    corrupts the data in the sector by splicing some of the original
    bytes in. The page of the first entry of cmd->t_data_sg includes the
    CDB, and sg->offset is set to a position past the CDB. I presume that
    sg->offset is also the right choice to use for subsequent sglist
    members.
    
    Signed-off-by: Jan Engelhardt <jengelh@netitwork.de>
    Tested-by: Douglas Gilbert <dgilbert@interlog.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit efc98f01dc98e7a4169df578f109d36608c60b28
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Thu Nov 5 23:37:59 2015 -0800

    target: Fix race for SCF_COMPARE_AND_WRITE_POST checking
    
    commit 057085e522f8bf94c2e691a5b76880f68060f8ba upstream.
    
    This patch addresses a race + use after free where the first
    stage of COMPARE_AND_WRITE in compare_and_write_callback()
    is rescheduled after the backend sends the secondary WRITE,
    resulting in second stage compare_and_write_post() callback
    completing in target_complete_ok_work() before the first
    can return.
    
    Because current code depends on checking se_cmd->se_cmd_flags
    after return from se_cmd->transport_complete_callback(),
    this results in first stage having SCF_COMPARE_AND_WRITE_POST
    set, which incorrectly falls through into second stage CAW
    processing code, eventually triggering a NULL pointer
    dereference due to use after free.
    
    To address this bug, pass in a new *post_ret parameter into
    se_cmd->transport_complete_callback(), and depend upon this
    value instead of ->se_cmd_flags to determine when to return
    or fall through into ->queue_status() code for CAW.
    
    Cc: Sagi Grimberg <sagig@mellanox.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit dd0b1896da977ee503f1279175d71a73e45e3b1c
Author: Jan Kara <jack@suse.cz>
Date:   Mon Nov 23 13:09:51 2015 +0100

    vfs: Avoid softlockups with sendfile(2)
    
    commit c2489e07c0a71a56fb2c84bc0ee66cddfca7d068 upstream.
    
    The following test program from Dmitry can cause softlockups or RCU
    stalls as it copies 1GB from tmpfs into eventfd and we don't have any
    scheduling point at that path in sendfile(2) implementation:
    
            int r1 = eventfd(0, 0);
            int r2 = memfd_create("", 0);
            unsigned long n = 1<<30;
            fallocate(r2, 0, 0, n);
            sendfile(r1, r2, 0, n);
    
    Add cond_resched() into __splice_from_pipe() to fix the problem.
    
    CC: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 69aad7e01c8e883e9d2f8dc5523bd419bd02d2aa
Author: Kees Cook <keescook@chromium.org>
Date:   Thu Nov 19 17:18:54 2015 -0800

    mac: validate mac_partition is within sector
    
    commit 02e2a5bfebe99edcf9d694575a75032d53fe1b73 upstream.
    
    If md->signature == MAC_DRIVER_MAGIC and md->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 <keescook@chromium.org>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 7c721f4cc915db3556339e39c906d6877d02a90f
Author: Luca Porzio <lporzio@micron.com>
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 & 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 <bford@micron.com>
    Signed-off-by: Luca Porzio <lporzio@micron.com>
    Fixes: ce39f9d17c14 ("mmc: support packed write command for eMMC4.5 devices")
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e0aeab837c65d28dd0923ea97ad0ed876bc1e71c
Author: K. Y. Srinivasan <kys@microsoft.com>
Date:   Mon Aug 31 08:21:54 2015 -0700

    storvsc: Don't set the SRB_FLAGS_QUEUE_ACTION_ENABLE flag
    
    commit 8cf308e1225f5f93575f03cc4dbef24516fa81c9 upstream.
    
    Don't set the SRB_FLAGS_QUEUE_ACTION_ENABLE flag since we are not specifying
    tags.  Without this, the qlogic driver doesn't work properly with storvsc.
    
    Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
    Signed-off-by: James Bottomley <JBottomley@Odin.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8f5e11b31e179c491ac58e2826599deec35cf8f9
Author: sumit.saxena@avagotech.com <sumit.saxena@avagotech.com>
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 <sumit.saxena@avagotech.com>
    Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
    Reviewed-by: Tomas Henzl <thenzl@redhat.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d55c6e414cfb5560487345f43b5ce0175e37a327
Author: sumit.saxena@avagotech.com <sumit.saxena@avagotech.com>
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 <sumit.saxena@avagotech.com>
    Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
    Reviewed-by: Tomas Henzl <thenzl@redhat.com>
    Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 4692154f1564b47b931365aa267098c696597ec2
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Mon Sep 28 18:57:04 2015 +0300

    dmaengine: dw: convert to __ffs()
    
    commit 39416677b95bf1ab8bbfa229ec7e511c96ad5d0c upstream.
    
    We replace __fls() by __ffs() since we have to find a *minimum* data width that
    satisfies both source and destination.
    
    While here, rename dwc_fast_fls() to dwc_fast_ffs() which it really is.
    
    Fixes: 4c2d56c574db (dw_dmac: introduce dwc_fast_fls())
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Vinod Koul <vinod.koul@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d91f018713155fb7fb9abbdb7d996dcb901ec607
Author: Valentin Rothberg <valentinrothberg@gmail.com>
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 <valentinrothberg@gmail.com>
    Signed-off-by: Sebastian Reichel <sre@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0b607563f72ff448d2915eb0a14e74a8fa549df0
Author: Dan Carpenter <dan.carpenter@oracle.com>
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 & (1 << 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 <dan.carpenter@oracle.com>
    Acked-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 005fe763adf0fafaaee89748070d96578d751198
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
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 => NSM rpc client created,
    	nsm->sm_monitored bit set.
    2. nsm_mointor(host-Y) called => nsm->sm_monitored already set,
    	we just exit. Thus in namespace B ln->nsm_clnt == NULL.
    3. host X destroyed => nsm->sm_count decremented to 1
    4. host Y destroyed => nsm_unmonitor() => nsm_mon_unmon() => NULL-ptr
    	dereference of *ln->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 <aryabinin@virtuozzo.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit dffd45183e02ec8ad819c963af031fb64d7d4ead
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Nov 23 16:43:29 2015 -0500

    drm/radeon: make rv770_set_sw_state failures non-fatal
    
    commit 4e7697ed79d0c0d5f869c87a6b3ce3d5cd1a07d6 upstream.
    
    On some cards it takes a relatively long time for the change
    to take place.  Make a timeout non-fatal.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=76130
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0ea3c0a5ae0b286ccb86212350258caae8a7f0eb
Author: Roman Volkov <rvolkov@v1ros.org>
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 <linux@arm.linux.org.uk>
    Acked-by: Alexey Charkov <alchark@gmail.com>
    Signed-off-by: Roman Volkov <rvolkov@v1ros.org>
    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 77e16d341c043b6da844895b4d4e0834061fdf50
Author: Roman Volkov <rvolkov@v1ros.org>
Date:   Fri Jan 1 16:38:11 2016 +0300

    dts: vt8500: Add SDHC node to DTS file for WM8650
    
    commit 0f090bf14e51e7eefb71d9d1c545807f8b627986 upstream.
    
    Since WM8650 has the same 'WMT' SDHC controller as WM8505, and the driver
    is already in the kernel, this node enables the controller support for
    WM8650
    
    Signed-off-by: Roman Volkov <rvolkov@v1ros.org>
    Reviewed-by: Alexey Charkov <alchark@gmail.com>
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 5df68eedfb0e3cfa8c23c8b0b28bf032881313e4
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Sun Dec 13 18:12:30 2015 +0100

    genirq: Prevent chip buslock deadlock
    
    commit abc7e40c81d113ef4bacb556f0a77ca63ac81d85 upstream.
    
    If a interrupt chip utilizes chip->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 <fredrik.markstrom@gmail.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 281eea0a8603241edc3fe38c1ab4fa0a92ebec2b
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Thu Jun 11 14:46:41 2015 +0200

    sched, rt: Convert switched_{from, to}_rt() / prio_changed_rt() to balance callbacks
    
    commit fd7a4bed183523275279c9addbf42fce550c2e90 upstream.
    
    Remove the direct {push,pull} balancing operations from
    switched_{from,to}_rt() / prio_changed_rt() and use the balance
    callback queue.
    
    Again, err on the side of too many reschedules; since too few is a
    hard bug while too many is just annoying.
    
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: ktkhai@parallels.com
    Cc: rostedt@goodmis.org
    Cc: juri.lelli@gmail.com
    Cc: pang.xunlei@linaro.org
    Cc: oleg@redhat.com
    Cc: wanpeng.li@linux.intel.com
    Cc: umgwanakikbuti@gmail.com
    Link: http://lkml.kernel.org/r/20150611124742.766832367@infradead.org
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Byungchul Park <byungchul.park@lge.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2f61a9e78fc7a18a55cba55a812337c50bb99f24
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Thu Jun 11 14:46:40 2015 +0200

    sched,rt: Remove return value from pull_rt_task()
    
    commit 8046d6806247088de5725eaf8a2580b29e50ac5a upstream.
    
    In order to be able to use pull_rt_task() from a callback, we need to
    do away with the return value.
    
    Since the return value indicates if we should reschedule, do this
    inside the function. Since not all callers currently do this, this can
    increase the number of reschedules due rt balancing.
    
    Too many reschedules is not a correctness issues, too few are.
    
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: ktkhai@parallels.com
    Cc: rostedt@goodmis.org
    Cc: juri.lelli@gmail.com
    Cc: pang.xunlei@linaro.org
    Cc: oleg@redhat.com
    Cc: wanpeng.li@linux.intel.com
    Cc: umgwanakikbuti@gmail.com
    Link: http://lkml.kernel.org/r/20150611124742.679002000@infradead.org
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Byungchul Park <byungchul.park@lge.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f4b877aeaabbc0d7ed778ca170fd58272a4a10ee
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Thu Jun 11 14:46:39 2015 +0200

    sched: Allow balance callbacks for check_class_changed()
    
    commit 4c9a4bc89a9cca8128bce67d6bc8870d6b7ee0b2 upstream.
    
    In order to remove dropping rq->lock from the
    switched_{to,from}()/prio_changed() sched_class methods, run the
    balance callbacks after it.
    
    We need to remove dropping rq->lock because its buggy,
    suppose using sched_setattr()/sched_setscheduler() to change a running
    task from FIFO to OTHER.
    
    By the time we get to switched_from_rt() the task is already enqueued
    on the cfs runqueues. If switched_from_rt() does pull_rt_task() and
    drops rq->lock, load-balancing can come in and move our task @p to
    another rq.
    
    The subsequent switched_to_fair() still assumes @p is on @rq and bad
    things will happen.
    
    By using balance callbacks we delay the load-balancing operations
    {rt,dl}x{push,pull} until we've done all the important work and the
    task is fully set up.
    
    Furthermore, the balance callbacks do not know about @p, therefore
    they cannot get confused like this.
    
    Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: ktkhai@parallels.com
    Cc: rostedt@goodmis.org
    Cc: juri.lelli@gmail.com
    Cc: pang.xunlei@linaro.org
    Cc: oleg@redhat.com
    Cc: wanpeng.li@linux.intel.com
    Link: http://lkml.kernel.org/r/20150611124742.615343911@infradead.org
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Byungchul Park <byungchul.park@lge.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 69836a46b1c986665c514106b0137984cacb18dc
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Thu Jun 11 14:46:37 2015 +0200

    sched: Replace post_schedule with a balance callback list
    
    commit e3fca9e7cbfb72694a21c886fcdf9f059cfded9c upstream.
    
    Generalize the post_schedule() stuff into a balance callback list.
    This allows us to more easily use it outside of schedule() and cross
    sched_class.
    
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: ktkhai@parallels.com
    Cc: rostedt@goodmis.org
    Cc: juri.lelli@gmail.com
    Cc: pang.xunlei@linaro.org
    Cc: oleg@redhat.com
    Cc: wanpeng.li@linux.intel.com
    Cc: umgwanakikbuti@gmail.com
    Link: http://lkml.kernel.org/r/20150611124742.424032725@infradead.org
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Byungchul Park <byungchul.park@lge.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ee36ee687fa390924b88ce40bf1789a8abb340bd
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Fri Jan 17 15:09:39 2014 +0100

    sched: Clean up idle task SMP logic
    
    commit 6c3b4d44ba2838f00614a5a2d777d4401e0bfd71 upstream.
    
    The idle post_schedule flag is just a vile waste of time, furthermore
    it appears unneeded, move the idle_enter_fair() call into
    pick_next_task_idle().
    
    Signed-off-by: Peter Zijlstra <peterz@infradead.org>
    Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
    Cc: Vincent Guittot <vincent.guittot@linaro.org>
    Cc: alex.shi@linaro.org
    Cc: mingo@kernel.org
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Link: http://lkml.kernel.org/n/tip-aljykihtxJt3mkokxi0qZurb@git.kernel.org
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Cc: Byungchul Park <byungchul.park@lge.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ceb385a9e8e4b0a317c742dccb6abbff7512fd6d
Author: Manish Chopra <Manish.Chopra@qlogic.com>
Date:   Thu Jun 25 15:19:24 2015 +0300

    bnx2x: Don't notify about scratchpad parities
    
    commit ad6afbe9578d1fa26680faf78c846bd8c00d1d6e upstream.
    
    The scratchpad is a shared block between all functions of a given device.
    Due to HW limitations, we can't properly close its parity notifications
    to all functions on legal flows.
    E.g., it's possible that while taking a register dump from one function
    a parity error would be triggered on other functions.
    
    Today driver doesn't consider this parity as a 'real' parity unless its
    being accompanied by additional indications [which would happen in a real
    parity scenario]; But it does print notifications for such events in the
    system logs.
    
    This eliminates such prints - in case of real parities driver would have
    additional indications; But if this is the only signal user will not even
    see a parity being logged in the system.
    
    Signed-off-by: Manish Chopra <Manish.Chopra@qlogic.com>
    Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
    Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Patrick Schaaf <netdev@bof.de>
    Tested-by: Patrick Schaaf <netdev@bof.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 4c7eb9bc24f5e3a7d6ba10a44c66bd739418307b
Author: Olga Kornievskaia <aglo@umich.edu>
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()  --> 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, &state->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->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 <aglo@umich.edu>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ce3b7a01b74f45afffce2556d92a41003b169339
Author: Christophe Leroy <christophe.leroy@c-s.fr>
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 <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <string.h>
    #include <fcntl.h>
    #include <sys/socket.h>
    #include <sys/stat.h>
    #include <sys/types.h>
    #include <linux/if_alg.h>
    
    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*)&sa, sizeof(sa));
    
    	for (n = 1; n < 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, &st);
    		size = st.st_size;
    		sendfile(sko, fd, &offset, size);
    		size = read(sko, buf, sizeof(buf));
    		for (i = 0; i < 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 <christophe.leroy@c-s.fr>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Cc: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit aec2e8966c788ccb1d7beed3401adfb470676877
Author: Hariprasad S <hariprasad@chelsio.com>
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 <swise@opengridcomputing.com>
    Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
    Signed-off-by: Doug Ledford <dledford@redhat.com>
    [a pox on developers and maintainers who do not cc: stable for bug fixes like this - gregkh]
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 11d0b15c0958797c7d3ead74b22807752286039f
Author: Bjørn Mork <bjorn@mork.no>
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(>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 <tschaefer@t-online.de>
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0f98dcc17a3588a2c18a5510b4226c40e01aaafc
Author: Andrey Skvortsov <andrej.skvortzov@gmail.com>
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(>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 <andrej.skvortzov@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 7ea7824d6f33ec0b2bf5fe230ab231282fdef6a2
Author: Ken Lin <ken.lin@advantech.com.tw>
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 <ken.lin@advantech.com.tw>
    Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0255cfabc796feb07444dc0b04780a9b9f3d3d70
Author: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
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 <uttenthaler@ems-wuensche.com>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ac1c97af50cea184619281620520e76bee15cfdf
Author: Joe Thornber <ejt@redhat.com>
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 <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 22481d15ed990d6c00be6dc0097cfc93279bfec9
Author: Zheng Liu <wenqing.lz@taobao.com>
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 <wenqing.lz@taobao.com>
    Tested-by: Joshua Schmid <jschmid@suse.com>
    Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
    Cc: Kent Overstreet <kmo@daterainc.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 172690beba9309e5a9369f4b383cef6884cbc07c
Author: Al Viro <viro@ZenIV.linux.org.uk>
Date:   Sun Nov 29 17:20:59 2015 -0800

    bcache: fix a leak in bch_cached_dev_run()
    
    commit 4d4d8573a8451acc9f01cbea24b7e55f04a252fe upstream.
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Tested-by: Joshua Schmid <jschmid@suse.com>
    Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
    Cc: Kent Overstreet <kmo@daterainc.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit fd84aab963018f879e2300c4f1b0378874a1e84a
Author: Egbert Eich <eich@suse.de>
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 <benh@kernel.crashing.org>
    Signed-off-by: Egbert Eich <eich@suse.de>
    [pulled from SuSE tree by me - airlied]
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b22889fed9e127b5d8bf2293148f5638ad5a25a4
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
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 <kda@linux-powerpc.org>
    Fixes: 97e1c18e8d17b ("tracing: Kernel Tracepoints")
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 57008ec9cf578186ac15564d7f68d3870c600c7d
Author: Neil Horman <nhorman@tuxdriver.com>
Date:   Thu Feb 18 16:10:57 2016 -0500

    sctp: Fix port hash table size computation
    
    [ Upstream commit d9749fb5942f51555dc9ce1ac0dbb1806960a975 ]
    
    Dmitry Vyukov noted recently that the sctp_port_hashtable had an error in
    its size computation, observing that the current method never guaranteed
    that the hashsize (measured in number of entries) would be a power of two,
    which the input hash function for that table requires.  The root cause of
    the problem is that two values need to be computed (one, the allocation
    order of the storage requries, as passed to __get_free_pages, and two the
    number of entries for the hash table).  Both need to be ^2, but for
    different reasons, and the existing code is simply computing one order
    value, and using it as the basis for both, which is wrong (i.e. it assumes
    that ((1<<order)*PAGE_SIZE)/sizeof(bucket) is still ^2 when its not).
    
    To fix this, we change the logic slightly.  We start by computing a goal
    allocation order (which is limited by the maximum size hash table we want
    to support.  Then we attempt to allocate that size table, decreasing the
    order until a successful allocation is made.  Then, with the resultant
    successful order we compute the number of buckets that hash table supports,
    which we then round down to the nearest power of two, giving us the number
    of entries the table actually supports.
    
    I've tested this locally here, using non-debug and spinlock-debug kernels,
    and the number of entries in the hashtable consistently work out to be
    powers of two in all cases.
    
    Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    CC: Dmitry Vyukov <dvyukov@google.com>
    CC: Vladislav Yasevich <vyasevich@gmail.com>
    CC: "David S. Miller" <davem@davemloft.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ecee23698c61fb56704d1abb5f083e54a276be29
Author: Dmitry V. Levin <ldv@altlinux.org>
Date:   Fri Feb 19 04:27:48 2016 +0300

    unix_diag: fix incorrect sign extension in unix_lookup_by_ino
    
    [ Upstream commit b5f0549231ffb025337be5a625b0ff9f52b016f0 ]
    
    The value passed by unix_diag_get_exact to unix_lookup_by_ino has type
    __u32, but unix_lookup_by_ino's argument ino has type int, which is not
    a problem yet.
    However, when ino is compared with sock_i_ino return value of type
    unsigned long, ino is sign extended to signed long, and this results
    to incorrect comparison on 64-bit architectures for inode numbers
    greater than INT_MAX.
    
    This bug was found by strace test suite.
    
    Fixes: 5d3cae8bc39d ("unix_diag: Dumping exact socket core")
    Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
    Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 7b715d926d6bcd9ad1ccdf436e659aa86eebdeb5
Author: Anton Protopopov <a.s.protopopov@gmail.com>
Date:   Tue Feb 16 21:43:16 2016 -0500

    rtnl: RTM_GETNETCONF: fix wrong return value
    
    [ Upstream commit a97eb33ff225f34a8124774b3373fd244f0e83ce ]
    
    An error response from a RTM_GETNETCONF request can return the positive
    error value EINVAL in the struct nlmsgerr that can mislead userspace.
    
    Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
    Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 27b6d267f4d3652dee80ced90800904ed0df6a05
Author: Xin Long <lucien.xin@gmail.com>
Date:   Thu Feb 18 21:21:19 2016 +0800

    route: check and remove route cache when we get route
    
    [ Upstream commit deed49df7390d5239024199e249190328f1651e7 ]
    
    Since the gc of ipv4 route was removed, the route cached would has
    no chance to be removed, and even it has been timeout, it still could
    be used, cause no code to check it's expires.
    
    Fix this issue by checking  and removing route cache when we get route.
    
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 00028cc77254f4973e6af17ea84fde3b1c2802dc
Author: Guillaume Nault <g.nault@alphalink.fr>
Date:   Mon Feb 15 17:01:10 2016 +0100

    pppoe: fix reference counting in PPPoE proxy
    
    [ Upstream commit 29e73269aa4d36f92b35610c25f8b01c789b0dc8 ]
    
    Drop reference on the relay_po socket when __pppoe_xmit() succeeds.
    This is already handled correctly in the error path.
    
    Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 63b7b33c7c4ae9dc71c2eef673611039aadbe87a
Author: Eugenia Emantayev <eugenia@mellanox.com>
Date:   Wed Feb 17 17:24:23 2016 +0200

    net/mlx4_en: Choose time-stamping shift value according to HW frequency
    
    [ Upstream commit 31c128b66e5b28f468076e4f3ca3025c35342041 ]
    
    Previously, the shift value used for time-stamping was constant and didn't
    depend on the HW chip frequency. Change that to take the frequency into account
    and calculate the maximal value in cycles per wraparound of ten seconds. This
    time slot was chosen since it gives a good accuracy in time synchronization.
    
    Algorithm for shift value calculation:
     * Round up the maximal value in cycles to nearest power of two
    
     * Calculate maximal multiplier by division of all 64 bits set
       to above result
    
     * Then, invert the function clocksource_khz2mult() to get the shift from
       maximal mult value
    
    Fixes: ec693d47010e ('net/mlx4_en: Add HW timestamping (TS) support')
    Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
    Reviewed-by: Matan Barak <matanb@mellanox.com>
    Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 866a0f55010d2d2c93c06cc3be423cd37ab12531
Author: Amir Vadai <amir@vadai.me>
Date:   Wed Feb 17 17:24:22 2016 +0200

    net/mlx4_en: Count HW buffer overrun only once
    
    [ Upstream commit 281e8b2fdf8e4ef366b899453cae50e09b577ada ]
    
    RdropOvflw counts overrun of HW buffer, therefore should
    be used for rx_fifo_errors only.
    
    Currently RdropOvflw counter is mistakenly also set into
    rx_missed_errors and rx_over_errors too, which makes the
    device total dropped packets accounting to show wrong results.
    
    Fix that. Use it for rx_fifo_errors only.
    
    Fixes: c27a02cd94d6 ('mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC')
    Signed-off-by: Amir Vadai <amir@vadai.me>
    Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
    Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 82b090a896afa204ba1877f35e2897f23cafde22
Author: Bjørn Mork <bjorn@mork.no>
Date:   Fri Feb 12 16:42:14 2016 +0100

    qmi_wwan: add "4G LTE usb-modem U901"
    
    [ Upstream commit aac8d3c282e024c344c5b86dc1eab7af88bb9716 ]
    
    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(>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 <tschaefer@t-online.de>
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6126da76d00e981cca46080c464f9c309067b022
Author: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Date:   Thu Feb 11 19:37:27 2016 +0000

    af_unix: Guard against other == sk in unix_dgram_sendmsg
    
    [ Upstream commit a5527dda344fff0514b7989ef7a755729769daa1 ]
    
    The unix_dgram_sendmsg routine use the following test
    
    if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) {
    
    to determine if sk and other are in an n:1 association (either
    established via connect or by using sendto to send messages to an
    unrelated socket identified by address). This isn't correct as the
    specified address could have been bound to the sending socket itself or
    because this socket could have been connected to itself by the time of
    the unix_peer_get but disconnected before the unix_state_lock(other). In
    both cases, the if-block would be entered despite other == sk which
    might either block the sender unintentionally or lead to trying to unlock
    the same spin lock twice for a non-blocking send. Add a other != sk
    check to guard against this.
    
    Fixes: 7d267278a9ec ("unix: avoid use-after-free in ep_remove_wait_queue")
    Reported-By: Philipp Hahn <pmhahn@pmhahn.de>
    Signed-off-by: Rainer Weikusat <rweikusat@mobileactivedefense.com>
    Tested-by: Philipp Hahn <pmhahn@pmhahn.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d1c560183199c55cfe50bd176dffdc16e5f55b6b
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Feb 4 06:23:28 2016 -0800

    ipv4: fix memory leaks in ip_cmsg_send() callers
    
    [ Upstream commit 919483096bfe75dda338e98d56da91a263746a0a ]
    
    Dmitry reported memory leaks of IP options allocated in
    ip_cmsg_send() when/if this function returns an error.
    
    Callers are responsible for the freeing.
    
    Many thanks to Dmitry for the report and diagnostic.
    
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 127e53abeede72da8d8d58b67b26f931737791ff
Author: Jay Vosburgh <jay.vosburgh@canonical.com>
Date:   Tue Feb 2 13:35:56 2016 -0800

    bonding: Fix ARP monitor validation
    
    [ Upstream commit 21a75f0915dde8674708b39abfcda113911c49b1 ]
    
    The current logic in bond_arp_rcv will accept an incoming ARP for
    validation if (a) the receiving slave is either "active" (which includes
    the currently active slave, or the current ARP slave) or, (b) there is a
    currently active slave, and it has received an ARP since it became active.
    For case (b), the receiving slave isn't the currently active slave, and is
    receiving the original broadcast ARP request, not an ARP reply from the
    target.
    
    	This logic can fail if there is no currently active slave.  In
    this situation, the ARP probe logic cycles through all slaves, assigning
    each in turn as the "current_arp_slave" for one arp_interval, then setting
    that one as "active," and sending an ARP probe from that slave.  The
    current logic expects the ARP reply to arrive on the sending
    current_arp_slave, however, due to switch FDB updating delays, the reply
    may be directed to another slave.
    
    	This can arise if the bonding slaves and switch are working, but
    the ARP target is not responding.  When the ARP target recovers, a
    condition may result wherein the ARP target host replies faster than the
    switch can update its forwarding table, causing each ARP reply to be sent
    to the previous current_arp_slave.  This will never pass the logic in
    bond_arp_rcv, as neither of the above conditions (a) or (b) are met.
    
    	Some experimentation on a LAN shows ARP reply round trips in the
    200 usec range, but my available switches never update their FDB in less
    than 4000 usec.
    
    	This patch changes the logic in bond_arp_rcv to additionally
    accept an ARP reply for validation on any slave if there is a current ARP
    slave and it sent an ARP probe during the previous arp_interval.
    
    Fixes: aeea64ac717a ("bonding: don't trust arp requests unless active slave really works")
    Cc: Veaceslav Falico <vfalico@gmail.com>
    Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
    Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a5e5ae1321c6edc6a2ce7d32e28e66336d3b530a
Author: Veaceslav Falico <vfalico@redhat.com>
Date:   Thu Feb 20 12:07:57 2014 +0100

    bonding: fix bond_arp_rcv() race of curr_active_slave
    
    commit 010d3c3989706d800ae72253773fa6537cc9f74c upstream.
    
    bond->curr_active_slave can be changed between its deferences, even to
    NULL, and thus we might panic.
    
    We're always holding the rcu (rx_handler->bond_handle_frame()->bond_arp_rcv())
    so fix this by rcu_dereferencing() it and using the saved.
    
    Reported-by: Ding Tianhong <dingtianhong@huawei.com>
    Fixes: aeea64a ("bonding: don't trust arp requests unless active slave really works")
    CC: Jay Vosburgh <fubar@us.ibm.com>
    CC: Andy Gospodarek <andy@greyhouse.net>
    Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
    Acked-by: Ding Tianhong <dingtianhong@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit cccf7a00505a2fe33e23599bdedc4c3993e28a10
Author: Xin Long <lucien.xin@gmail.com>
Date:   Wed Feb 3 23:33:30 2016 +0800

    sctp: translate network order to host order when users get a hmacid
    
    [ Upstream commit 7a84bd46647ff181eb2659fdc99590e6f16e501d ]
    
    Commit ed5a377d87dc ("sctp: translate host order to network order when
    setting a hmacid") corrected the hmacid byte-order when setting a hmacid.
    but the same issue also exists on getting a hmacid.
    
    We fix it by changing hmacids to host order when users get them with
    getsockopt.
    
    Fixes: Commit ed5a377d87dc ("sctp: translate host order to network order when setting a hmacid")
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e03e0613e6333d3cd5c322f6486273b98e007882
Author: Siva Reddy Kallam <siva.kallam@broadcom.com>
Date:   Wed Feb 3 14:09:38 2016 +0530

    tg3: Fix for tg3 transmit queue 0 timed out when too many gso_segs
    
    [ Upstream commit b7d987295c74500b733a0ba07f9a9bcc4074fa83 ]
    
    tg3_tso_bug() can hit a condition where the entire tx ring is not big
    enough to segment the GSO packet. For example, if MSS is very small,
    gso_segs can exceed the tx ring size. When we hit the condition, it
    will cause tx timeout.
    
    tg3_tso_bug() is called to handle TSO and DMA hardware bugs.
    For TSO bugs, if tg3_tso_bug() cannot succeed, we have to drop the packet.
    For DMA bugs, we can still fall back to linearize the SKB and let the
    hardware transmit the TSO packet.
    
    This patch adds a function tg3_tso_bug_gso_check() to check if there
    are enough tx descriptors for GSO before calling tg3_tso_bug().
    The caller will then handle the error appropriately - drop or
    lineraize the SKB.
    
    v2: Corrected patch description to avoid confusion.
    
    Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
    Signed-off-by: Michael Chan <mchan@broadcom.com>
    Acked-by: Prashant Sreedharan <prashant@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 1ad3dfa534e42404edcca40e440b78976f8f99c3
Author: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
Date:   Wed Feb 3 09:26:57 2016 +0100

    net:Add sysctl_max_skb_frags
    
    [ Upstream commit 5f74f82ea34c0da80ea0b49192bb5ea06e063593 ]
    
    Devices may have limits on the number of fragments in an skb they support.
    Current codebase uses a constant as maximum for number of fragments one
    skb can hold and use.
    When enabling scatter/gather and running traffic with many small messages
    the codebase uses the maximum number of fragments and may thereby violate
    the max for certain devices.
    The patch introduces a global variable as max number of fragments.
    
    Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
    Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>
    Acked-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a8837e30e3eece2c8c02345035c14b32f695bfcf
Author: Eric Dumazet <edumazet@google.com>
Date:   Tue Feb 2 17:55:01 2016 -0800

    ipv6: fix a lockdep splat
    
    [ Upstream commit 44c3d0c1c0a880354e9de5d94175742e2c7c9683 ]
    
    Silence lockdep false positive about rcu_dereference() being
    used in the wrong context.
    
    First one should use rcu_dereference_protected() as we own the spinlock.
    
    Second one should be a normal assignation, as no barrier is needed.
    
    Fixes: 18367681a10bd ("ipv6 flowlabel: Convert np->ipv6_fl_list to RCU.")
    Reported-by: Dave Jones <davej@codemonkey.org.uk>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e16f537864eb9cf68683d9e107706d1b31fcaa76
Author: Hangbin Liu <liuhangbin@gmail.com>
Date:   Thu Jul 30 14:28:42 2015 +0800

    net/ipv6: add sysctl option accept_ra_min_hop_limit
    
    [ Upstream commit 8013d1d7eafb0589ca766db6b74026f76b7f5cb4 ]
    
    Commit 6fd99094de2b ("ipv6: Don't reduce hop limit for an interface")
    disabled accept hop limit from RA if it is smaller than the current hop
    limit for security stuff. But this behavior kind of break the RFC definition.
    
    RFC 4861, 6.3.4.  Processing Received Router Advertisements
       A Router Advertisement field (e.g., Cur Hop Limit, Reachable Time,
       and Retrans Timer) may contain a value denoting that it is
       unspecified.  In such cases, the parameter should be ignored and the
       host should continue using whatever value it is already using.
    
       If the received Cur Hop Limit value is non-zero, the host SHOULD set
       its CurHopLimit variable to the received value.
    
    So add sysctl option accept_ra_min_hop_limit to let user choose the minimum
    hop limit value they can accept from RA. And set default to 1 to meet RFC
    standards.
    
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Acked-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 22d310aa03b6009f252c1c53fe2adb5b0919f330
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Fri Jan 29 12:30:20 2016 +0100

    ipv6/udp: use sticky pktinfo egress ifindex on connect()
    
    [ Upstream commit 1cdda91871470f15e79375991bd2eddc6e86ddb1 ]
    
    Currently, the egress interface index specified via IPV6_PKTINFO
    is ignored by __ip6_datagram_connect(), so that RFC 3542 section 6.7
    can be subverted when the user space application calls connect()
    before sendmsg().
    Fix it by initializing properly flowi6_oif in connect() before
    performing the route lookup.
    
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 63593b05a47bd00a5dd843f836762829791bbc92
Author: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date:   Fri Jan 22 18:29:49 2016 -0200

    sctp: allow setting SCTP_SACK_IMMEDIATELY by the application
    
    [ Upstream commit 27f7ed2b11d42ab6d796e96533c2076ec220affc ]
    
    This patch extends commit b93d6471748d ("sctp: implement the sender side
    for SACK-IMMEDIATELY extension") as it didn't white list
    SCTP_SACK_IMMEDIATELY on sctp_msghdr_parse(), causing it to be
    understood as an invalid flag and returning -EINVAL to the application.
    
    Note that the actual handling of the flag is already there in
    sctp_datamsg_from_user().
    
    https://tools.ietf.org/html/rfc7053#section-7
    
    Fixes: b93d6471748d ("sctp: implement the sender side for SACK-IMMEDIATELY extension")
    Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
    Acked-by: Vlad Yasevich <vyasevich@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 977abf5d26c2697f09c72efc579a759dcc6a4808
Author: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date:   Fri Jan 22 01:39:43 2016 +0100

    pptp: fix illegal memory access caused by multiple bind()s
    
    [ Upstream commit 9a368aff9cb370298fa02feeffa861f2db497c18 ]
    
    Several times already this has been reported as kasan reports caused by
    syzkaller and trinity and people always looked at RCU races, but it is
    much more simple. :)
    
    In case we bind a pptp socket multiple times, we simply add it to
    the callid_sock list but don't remove the old binding. Thus the old
    socket stays in the bucket with unused call_id indexes and doesn't get
    cleaned up. This causes various forms of kasan reports which were hard
    to pinpoint.
    
    Simply don't allow multiple binds and correct error handling in
    pptp_bind. Also keep sk_state bits in place in pptp_connect.
    
    Fixes: 00959ade36acad ("PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)")
    Cc: Dmitry Kozlov <xeb@mail.ru>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Cc: Dave Jones <davej@codemonkey.org.uk>
    Reported-by: Dave Jones <davej@codemonkey.org.uk>
    Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 45c4c852c8ab5fb7e879892afa665dc47e55956d
Author: Eric Dumazet <edumazet@google.com>
Date:   Sun Jan 24 13:53:50 2016 -0800

    af_unix: fix struct pid memory leak
    
    [ Upstream commit fa0dc04df259ba2df3ce1920e9690c7842f8fa4b ]
    
    Dmitry reported a struct pid leak detected by a syzkaller program.
    
    Bug happens in unix_stream_recvmsg() when we break the loop when a
    signal is pending, without properly releasing scm.
    
    Fixes: b3ca9b02b007 ("net: fix multithreaded signal handling in unix recv routines")
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Rainer Weikusat <rweikusat@mobileactivedefense.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit dd5626c81b249bbef45c4c4af2753a8f2ab1f1f6
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jan 21 08:02:54 2016 -0800

    tcp: fix NULL deref in tcp_v4_send_ack()
    
    [ Upstream commit e62a123b8ef7c5dc4db2c16383d506860ad21b47 ]
    
    Neal reported crashes with this stack trace :
    
     RIP: 0010:[<ffffffff8c57231b>] tcp_v4_send_ack+0x41/0x20f
    ...
     CR2: 0000000000000018 CR3: 000000044005c000 CR4: 00000000001427e0
    ...
      [<ffffffff8c57258e>] tcp_v4_reqsk_send_ack+0xa5/0xb4
      [<ffffffff8c1a7caa>] tcp_check_req+0x2ea/0x3e0
      [<ffffffff8c19e420>] tcp_rcv_state_process+0x850/0x2500
      [<ffffffff8c1a6d21>] tcp_v4_do_rcv+0x141/0x330
      [<ffffffff8c56cdb2>] sk_backlog_rcv+0x21/0x30
      [<ffffffff8c098bbd>] tcp_recvmsg+0x75d/0xf90
      [<ffffffff8c0a8700>] inet_recvmsg+0x80/0xa0
      [<ffffffff8c17623e>] sock_aio_read+0xee/0x110
      [<ffffffff8c066fcf>] do_sync_read+0x6f/0xa0
      [<ffffffff8c0673a1>] SyS_read+0x1e1/0x290
      [<ffffffff8c5ca262>] system_call_fastpath+0x16/0x1b
    
    The problem here is the skb we provide to tcp_v4_send_ack() had to
    be parked in the backlog of a new TCP fastopen child because this child
    was owned by the user at the time an out of window packet arrived.
    
    Before queuing a packet, TCP has to set skb->dev to NULL as the device
    could disappear before packet is removed from the queue.
    
    Fix this issue by using the net pointer provided by the socket (being a
    timewait or a request socket).
    
    IPv6 is immune to the bug : tcp_v6_send_response() already gets the net
    pointer from the socket if provided.
    
    Fixes: 168a8f58059a ("tcp: TCP Fast Open Server - main code path")
    Reported-by: Neal Cardwell <ncardwell@google.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Jerry Chu <hkchu@google.com>
    Cc: Yuchung Cheng <ycheng@google.com>
    Acked-by: Neal Cardwell <ncardwell@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 5e67dbf09bb4dc9c7745e1d94d67e9e857d1ff7c
Author: Manfred Rudigier <Manfred.Rudigier@omicron.at>
Date:   Wed Jan 20 11:22:28 2016 +0100

    net: dp83640: Fix tx timestamp overflow handling.
    
    [ Upstream commit 81e8f2e930fe76b9814c71b9d87c30760b5eb705 ]
    
    PHY status frames are not reliable, the PHY may not be able to send them
    during heavy receive traffic. This overflow condition is signaled by the
    PHY in the next status frame, but the driver did not make use of it.
    Instead it always reported wrong tx timestamps to user space after an
    overflow happened because it assigned newly received tx timestamps to old
    packets in the queue.
    
    This commit fixes this issue by clearing the tx timestamp queue every time
    an overflow happens, so that no timestamps are delivered for overflow
    packets. This way time stamping will continue correctly after an overflow.
    
    Signed-off-by: Manfred Rudigier <manfred.rudigier@omicron.at>
    Acked-by: Richard Cochran <richardcochran@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 28103f2f1fb676a2b305ed6e15f83a8a84906d45
Author: Ursula Braun <ursula.braun@de.ibm.com>
Date:   Tue Jan 19 10:41:33 2016 +0100

    af_iucv: Validate socket address length in iucv_sock_bind()
    
    [ Upstream commit 52a82e23b9f2a9e1d429c5207f8575784290d008 ]
    
    Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Reviewed-by: Evgeny Cherkashin <Eugene.Crosser@ru.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6308e3add5288c1eb1b7ee2654d9a251cc487ab2
Author: Bin Liu <b-liu@ti.com>
Date:   Mon Jan 26 16:22:06 2015 -0600

    usb: musb: cppi41: correct the macro name EP_MODE_AUTOREG_*
    
    commit 0149b07a9e28b0d8bd2fc1c238ffe7d530c2673f upstream.
    
    The macro EP_MODE_AUTOREG_* should be called EP_MODE_AUTOREQ_*, as they
    are used for register AUTOREQ.
    
    Signed-off-by: Bin Liu <b-liu@ti.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit fa69c2b418d7aaae8d14810caecc9bfe3f44b4e5
Author: Corey Wright <undefined@pobox.com>
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.
    
    Fixes: caaee6234d ("ptrace: use fsuid, fsgid, effective creds for fs access checks")
    Signed-off-by: Corey Wright <undefined@pobox.com>
    Acked-by: Jann Horn <jann@thejh.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>