<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/arch/x86/kernel/head_64.S, branch ng-7.1.2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=ng-7.1.2</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=ng-7.1.2'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2016-08-26T18:54:24+00:00</updated>
<entry>
<title>Linux 3.10.98 (accumulative patch)</title>
<updated>2016-08-26T18:54:24+00:00</updated>
<author>
<name>Stefan Guendhoer</name>
<email>stefan@guendhoer.com</email>
</author>
<published>2016-03-05T13:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=dc5cd1f644c11c39dbbc54c0e30d00fe0bfd0fc0'/>
<id>urn:sha1:dc5cd1f644c11c39dbbc54c0e30d00fe0bfd0fc0</id>
<content type='text'>
commit 90915bdf5d75f981251d78f45dce37d39e679ac1
Author: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Date:   Thu Feb 25 11:58:19 2016 -0800

    Linux 3.10.98

commit dd6f1f0d444d8c9fe4307c1527987e474819d5d7
Author: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Date:   Wed Feb 3 16:55:26 2016 +1030

    module: wrapper for symbol name.

    commit 2e7bac536106236104e9e339531ff0fcdb7b8147 upstream.

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

    Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 40ea6e6f67636529f3ed27d4e2f7589f3ae869c7
Author: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
Date:   Tue Mar 31 11:01:47 2015 -0700

    ip6mr: call del_timer_sync() in ip6mr_free_table()

    commit 7ba0c47c34a1ea5bc7a24ca67309996cce0569b5 upstream.

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

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

commit a895706740ceaac0c7f99ddc48e05c40cb21c361
Author: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Date:   Sat Dec 19 20:07:38 2015 +0000

    futex: Drop refcount if requeue_pi() acquired the rtmutex

    commit fb75a4282d0d9a3c7c44d940582c2d226cf3acfb upstream.

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

    Add the missing free_pi_state() call.

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

commit 4800af91229e06e9d8517a6961f5b5d304b7e9bf
Author: Andy Lutomirski &lt;luto@kernel.org&gt;
Date:   Fri May 22 16:15:47 2015 -0700

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

    commit 425be5679fd292a3c36cb1fe423086708a99f11a upstream.

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

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

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

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

    Before, on x86_64:

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

    After:

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

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

commit 08fc7d3fdfef75fdf2d44f848cef1f3e1babb8bf
Author: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Date:   Tue Jan 26 12:24:25 2016 +0300

    intel_scu_ipcutil: underflow in scu_reg_access()

    commit b1d353ad3d5835b16724653b33c05124e1b5acf1 upstream.

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

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

commit c750edf63ce45ff34155723b73828527c1d96353
Author: Konstantin Khlebnikov &lt;koct9i@gmail.com&gt;
Date:   Fri Feb 5 15:37:01 2016 -0800

    radix-tree: fix oops after radix_tree_iter_retry

    commit 732042821cfa106b3c20b9780e4c60fee9d68900 upstream.

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

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

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

commit a202017766a111064dc0a99ee38d85886816b27a
Author: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Date:   Tue Feb 2 16:57:52 2016 -0800

    radix-tree: fix race in gang lookup

    commit 46437f9a554fbe3e110580ca08ab703b59f2f95a upstream.

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

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

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

commit a28c4bb3990dd3f65279ec02c6fa1762044325da
Author: Martijn Coenen &lt;maco@google.com&gt;
Date:   Fri Jan 15 16:57:49 2016 -0800

    memcg: only free spare array when readers are done

    commit 6611d8d76132f86faa501de9451a89bf23fb2371 upstream.

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

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

    Fixed by only freeing after synchronize_rcu().

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

commit d5b8e6bb2595ed5ae550e44939016fb9d022fabf
Author: Sergey Senozhatsky &lt;sergey.senozhatsky.work@gmail.com&gt;
Date:   Thu Jan 14 15:16:53 2016 -0800

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

    commit 72214a24a7677d4c7501eecc9517ed681b5f2db2 upstream.

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

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

    Fix by calling print as a function.

    Tested on python 2.7.11, 3.5.1

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

commit 2942425f64895dead4dfe46462e00c9871c2bc12
Author: Laura Abbott &lt;labbott@fedoraproject.org&gt;
Date:   Thu Jan 14 15:16:50 2016 -0800

    dma-debug: switch check from _text to _stext

    commit ea535e418c01837d07b6c94e817540f50bfdadb0 upstream.

    In include/asm-generic/sections.h:

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

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

    Came out of https://lkml.kernel.org/g/&lt;567B1176.4000106@redhat.com&gt;

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

commit ac6cef6cfa6230d989e24325ea04280a5b1fc5e7
Author: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Date:   Thu Jan 14 15:16:47 2016 -0800

    m32r: fix m32104ut_defconfig build fail

    commit 601f1db653217f205ffa5fb33514b4e1711e56d1 upstream.

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

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

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

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

commit e399e769b8f894dac701dc257be093221330cbd2
Author: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Date:   Tue Jan 26 17:50:12 2016 +0200

    xhci: Fix list corruption in urb dequeue at host removal

    commit 5c82171167adb8e4ac77b91a42cd49fb211a81a0 upstream.

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

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

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

commit f8f1013f5c6180cf6f812e6d3f823680a6a77cc7
Author: Andrew Banman &lt;abanman@sgi.com&gt;
Date:   Tue Dec 29 14:54:25 2015 -0800

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

    commit 5f0f2887f4de9508dcf438deab28f1de8070c271 upstream.

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

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

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

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

commit 1631f17998c51d57182370b84f582729b94bfdf6
Author: CQ Tang &lt;cq.tang@intel.com&gt;
Date:   Wed Jan 13 21:15:03 2016 +0000

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

    commit fda3bec12d0979aae3f02ee645913d66fbc8a26e upstream.

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

    Signed-off-by: CQ Tang &lt;cq.tang@intel.com&gt;
    Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit af5d9b4be5c19097a8e3bbb28eb15fb1b4e1b188
Author: Aurélien Francillon &lt;aurelien@francillon.net&gt;
Date:   Sat Jan 2 20:39:54 2016 -0800

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

    commit dd0d0d4de582a6a61c032332c91f4f4cb2bab569 upstream.

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

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

commit 209bde19c95ace3386a66e521dc518e7fd9b26c9
Author: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Date:   Mon Jan 11 17:35:38 2016 -0800

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

    commit 6544a1df11c48c8413071aac3316792e4678fbfb upstream.

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

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

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

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

commit 220e1e03fbf0f1e21860ebae237ec39a40732777
Author: Takashi Iwai &lt;tiwai@suse.de&gt;
Date:   Fri Nov 6 11:26:01 2015 -0800

    Input: elantech - add Fujitsu Lifebook U745 to force crc_enabled

    commit 60603950f836ef4e88daddf61a273b91e671db2d upstream.

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

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

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

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

    commit d96b339f453997f2f08c52da3f41423be48c978f upstream.

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

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

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

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

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

    fuse: break infinite loop in fuse_fill_write_pages()

    commit 3ca8138f014a913f98e6ef40e939868e1e9ea876 upstream.

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

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

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

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

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

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

commit fa4aa48526e852a550613acffc81cacc5233848e
Author: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Date:   Mon Feb 8 09:14:37 2016 +0100

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

    commit 5070fb14a0154f075c8b418e5bc58a620ae85a45 upstream.

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

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

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

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

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

    Tested on the ARM Versatile.

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

commit 57cd1f0a2031e82ac1cc13e56f12b7d979ee5403
Author: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Date:   Wed Feb 10 09:25:17 2016 +0100

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

    commit e972c37459c813190461dabfeaac228e00aae259 upstream.

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

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

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

commit e2889463b33d8b7f4bfe4d7d824dd3d621f2e3ef
Author: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
Date:   Thu Dec 24 10:25:33 2015 -0600

    udf: Check output buffer length when converting name to CS0

    commit bb00c898ad1ce40c4bb422a8207ae562e9aea7ae upstream.

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

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

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

    Signed-off-by: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
    Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit f548c900b08de916732524992aaccb83cfe65312
Author: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
Date:   Thu Dec 24 10:25:32 2015 -0600

    udf: Prevent buffer overrun with multi-byte characters

    commit ad402b265ecf6fa22d04043b41444cdfcdf4f52d upstream.

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

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

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

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

    Signed-off-by: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
    Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 6b3a508f58f55ce1271c422d71e07f94f6ce7de5
Author: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Date:   Fri Dec 11 15:54:16 2015 +0100

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

    commit b0918d9f476a8434b055e362b83fa4fd1d462c3f upstream.

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

    [JK: Updated changelog, limit, style]

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

commit 45a74b1ce8a11efc82d49100648f7c5dc753cbb8
Author: Andrew Elble &lt;aweits@rit.edu&gt;
Date:   Wed Dec 2 09:20:57 2015 -0500

    nfs: Fix race in __update_open_stateid()

    commit 361cad3c89070aeb37560860ea8bfc092d545adc upstream.

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

    1964379 -&gt; #1 open (for write) reply seqid=1
    1964393 -&gt; #2 open (for read) reply seqid=2

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

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

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

       next step would be update_open_stateflags(), pending so_lock

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

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

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

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

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

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

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

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

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

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

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

    cifs: fix erroneous return value

    commit 4b550af519854421dfec9f7732cdddeb057134b2 upstream.

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

    Signed-off-by: Anton Protopopov &lt;a.s.protopopov@gmail.com&gt;
    Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2388eb1b0645f815b193165b17c0ab0f161ec17e
Author: Yong Li &lt;sdliyong@gmail.com&gt;
Date:   Wed Jan 6 09:09:43 2016 +0800

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

    commit 97a249e98a72d6b79fb7350a8dd56b147e9d5bdb upstream.

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

    With this change, name is reported correctly

    Signed-off-by: Yong Li &lt;sdliyong@gmail.com&gt;
    Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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

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

    commit d590faf9e8f8509a0a0aa79c38e87fcc6b913248 upstream.

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

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

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

commit 3effd3faeaa18907ba672f4545d0ba4602a2eb8b
Author: Michael Hennerich &lt;michael.hennerich@analog.com&gt;
Date:   Tue Oct 13 18:15:37 2015 +0200

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

    commit 03fe472ef33b7f31fbd11d300dbb3fdab9c00fd4 upstream.

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

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

commit aac11e32617a7de35937748d1f33aae33be0dff0
Author: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
Date:   Sat Oct 17 21:44:38 2015 +0300

    iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock

    commit 01bb70ae0b98d266fa3e860482c7ce22fa482a6e upstream.

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

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

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

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

    iio:ad7793: Fix ad7785 product ID

    commit 785171fd6cd7dcd7ada5a733b6a2d44ec566c3a0 upstream.

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

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

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

commit 8a3f8369fb82b6c2dd8bed82e219b8a49abade2d
Author: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Date:   Wed Feb 10 08:03:26 2016 -0800

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

    commit 90a88d6ef88edcfc4f644dddc7eef4ea41bccf8b upstream.

    This softlockup is currently happening:

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

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

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

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

commit 50ec3624a2eadcf6d06fa32a8d89324639066c53
Author: Hannes Reinecke &lt;hare@suse.de&gt;
Date:   Fri Jan 22 15:42:41 2016 +0100

    scsi_dh_rdac: always retry MODE SELECT on command lock violation

    commit d2d06d4fe0f2cc2df9b17fefec96e6e1a1271d91 upstream.

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

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

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

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

    commit 461c7fa126794157484dca48e88effa4963e3af3 upstream.

    Reduced testcase:

        #include &lt;fcntl.h&gt;
        #include &lt;unistd.h&gt;
        #include &lt;sys/mman.h&gt;
        #include &lt;numaif.h&gt;

        #define SIZE 0x2000

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

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

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

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

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

commit 3d1df27856ea8b9455e4a59dd22eee9afa40ead9
Author: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Date:   Wed Jan 20 11:26:01 2016 -0500

    SCSI: fix crashes in sd and sr runtime PM

    commit 13b4389143413a1f18127c07f72c74cad5b563e8 upstream.

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

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

    This fixes &lt;https://bugs.debian.org/801925&gt;.

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

commit bac26cabd29db3237c288d054054a1dfbea835f6
Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Date:   Tue Jan 19 16:15:27 2016 -0800

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

    commit 26a99c19f810b2593410899a5b304b21b47428a6 upstream.

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

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

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

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

commit 2bfa7bba55afcfbd887de08f936c3186ca2fae82
Author: Ken Xue &lt;ken.xue@amd.com&gt;
Date:   Tue Dec 1 14:45:46 2015 +0800

    SCSI: Fix NULL pointer dereference in runtime PM

    commit 4fd41a8552afc01054d9d9fc7f1a63c324867d27 upstream.

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

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

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

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

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

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

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

    Fix a memory leak in scsi_host_dev_release()

    commit b49493f99690c8eaacfbc635bafaad629ea2c036 upstream.

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

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

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

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

commit 481c34209a7e52a9f74ce60e539b9c00036e66b3
Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Date:   Thu Nov 5 14:11:59 2015 -0800

    iscsi-target: Fix rx_login_comp hang after login failure

    commit ca82c2bded29b38d36140bfa1e76a7bbfcade390 upstream.

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

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

    Note this bug is a regression introduced by:

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

          iscsi-target: Fix iscsit_start_kthreads failure OOPs

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

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

commit f7d615b9cc7bcfaf064d715770b061b995b44bce
Author: Peter Oberparleiter &lt;oberpar@linux.vnet.ibm.com&gt;
Date:   Tue Oct 27 10:49:54 2015 +0100

    scsi_sysfs: Fix queue_ramp_up_period return code

    commit 863e02d0e173bb9d8cea6861be22820b25c076cc upstream.

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

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

commit 2544cce12c7bd18e880b09c21b1a2d944a3423eb
Author: Christoph Hellwig &lt;hch@lst.de&gt;
Date:   Mon Oct 19 16:35:46 2015 +0200

    scsi: restart list search after unlock in scsi_remove_target

    commit 40998193560dab6c3ce8d25f4fa58a23e252ef38 upstream.

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

    commit bc3f02a795d3b4faa99d37390174be2a75d091bd
    Author: Dan Williams &lt;djbw@fb.com&gt;
    Date:   Tue Aug 28 22:12:10 2012 -0700

        [SCSI] scsi_remove_target: fix softlockup regression on hot remove

    Which was itself trying to fix a reported soft lockup issue

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

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

    commit f2495e228fce9f9cec84367547813cbb0d6db15a
    Author: James Bottomley &lt;JBottomley@Parallels.com&gt;
    Date:   Tue Jan 21 07:01:41 2014 -0800

        [SCSI] dual scan thread bug fix

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

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

commit 00707985578715324f32a0d71dbf6221bc4a2fc7
Author: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Date:   Wed Jan 13 08:10:31 2016 -0800

    klist: fix starting point removed bug in klist iterators

    commit 00cd29b799e3449f0c68b1cc77cd4a5f95b42d17 upstream.

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

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

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

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

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

commit 710636bc7a255376fe26c768377afa8aee030d86
Author: Arnd Bergmann &lt;arnd@arndb.de&gt;
Date:   Fri Feb 12 22:26:42 2016 +0100

    tracing: Fix freak link error caused by branch tracer

    commit b33c8ff4431a343561e2319f17c14286f2aa52e2 upstream.

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

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

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

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

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

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

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

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

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

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

commit c3b066b6e4d524dd27f23a4417ac2c3633b13327
Author: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Date:   Mon Nov 16 17:25:16 2015 -0500

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

    commit 32abc2ede536aae52978d6c0a8944eb1df14f460 upstream.

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

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

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

commit 414f6fbc84b58e3f1724f9056efb0c730d040ba6
Author: Jann Horn &lt;jann@thejh.net&gt;
Date:   Wed Jan 20 15:00:04 2016 -0800

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

    commit caaee6234d05a58c5b4d05e7bf766131b810a657 upstream.

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

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

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

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

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

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

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

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

commit 05c5582559ac40ab12a4624681d41f2771239c8e
Author: Peter Zijlstra &lt;peterz@infradead.org&gt;
Date:   Mon Nov 2 10:50:51 2015 +0100

    perf: Fix inherited events vs. tracepoint filters

    commit b71b437eedaed985062492565d9d421d975ae845 upstream.

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

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

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

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

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

    commit 0c0fe3b0fa45082cd752553fdb3a4b42503a118e upstream.

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

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

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

             Task A                       Task B

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

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

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

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

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

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

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

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

    ext4: fix potential integer overflow

    commit 46901760b46064964b41015d00c140c83aa05bcf upstream.

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

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

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

    AIO: properly check iovec sizes

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

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

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

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

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

    commit 1f55c718c290616889c04946864a13ef30f64929 upstream.

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

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

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

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

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

    commit 2831c89f42dcde440cfdccb9fee9f42d54bbc1ef upstream.

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

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

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

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

    staging/speakup: Use tty_ldisc_ref() for paste kworker

    commit f4f9edcf9b5289ed96113e79fa65a7bf27ecb096 upstream.

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

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

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

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

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

    commit ee9159ddce14bc1dec9435ae4e3bd3153e783706 upstream.

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

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

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

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

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

    ALSA: seq: Fix double port list deletion

    commit 13d5e5d4725c64ec06040d636832e78453f477b7 upstream.

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

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

    BugLink: http://lkml.kernel.org/r/CACT4Y+bay9qsrz6dQu31EcGaH9XwfW7o3oBzSQUG9fMszoh=Sg@mail.gmail.com
    Fixes: 7f0973e973cd ('ALSA: seq: Fix lockdep warnings due to 'double mutex locks)
    Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
    Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Linux 3.10.94</title>
<updated>2016-08-26T18:47:10+00:00</updated>
<author>
<name>Stefan Guendhoer</name>
<email>stefan@guendhoer.com</email>
</author>
<published>2016-01-13T04:17:44+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=c159c85a46937d2c2650e4376849f1670c6c2da6'/>
<id>urn:sha1:c159c85a46937d2c2650e4376849f1670c6c2da6</id>
<content type='text'>
commit 03ed106ff4c200d01f3c72f71fa9c5b18da07d9b
Author: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Date:   Wed Dec 9 13:43:21 2015 -0500

    Linux 3.10.94

commit 82dbfa50b0ee671e40779541a6ceef0850d19c84
Author: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Date:   Sun Nov 15 22:39:08 2015 +0100

    ALSA: usb-audio: work around CH345 input SysEx corruption

    commit a91e627e3f0ed820b11d86cdc04df38f65f33a70 upstream.

    One of the many faults of the QinHeng CH345 USB MIDI interface chip is
    that it does not handle received SysEx messages correctly -- every second
    event packet has a wrong code index number, which is the one from the last
    seen message, instead of 4.  For example, the two messages "FE F0 01 02 03
    04 05 06 07 08 09 0A 0B 0C 0D 0E F7" result in the following event
    packets:

    correct:       CH345:
    0F FE 00 00    0F FE 00 00
    04 F0 01 02    04 F0 01 02
    04 03 04 05    0F 03 04 05
    04 06 07 08    04 06 07 08
    04 09 0A 0B    0F 09 0A 0B
    04 0C 0D 0E    04 0C 0D 0E
    05 F7 00 00    05 F7 00 00

    A class-compliant driver must interpret an event packet with CIN 15 as
    having a single data byte, so the other two bytes would be ignored.  The
    message received by the host would then be missing two bytes out of six;
    in this example, "F0 01 02 03 06 07 08 09 0C 0D 0E F7".

    These corrupted SysEx event packages contain only data bytes, while the
    CH345 uses event packets with a correct CIN value only for messages with
    a status byte, so it is possible to distinguish between these two cases by
    checking for the presence of this status byte.

    (Other bugs in the CH345's input handling, such as the corruption resulting
    from running status, cannot be worked around.)

    Signed-off-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
    Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 88ab73208769677b3935d747a43aab1213d15d39
Author: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Date:   Sun Nov 15 22:38:29 2015 +0100

    ALSA: usb-audio: prevent CH345 multiport output SysEx corruption

    commit 1ca8b201309d842642f221db7f02f71c0af5be2d upstream.

    The CH345 USB MIDI chip has two output ports.  However, they are
    multiplexed through one pin, and the number of ports cannot be reduced
    even for hardware that implements only one connector, so for those
    devices, data sent to either port ends up on the same hardware output.
    This becomes a problem when both ports are used at the same time, as
    longer MIDI commands (such as SysEx messages) are likely to be
    interrupted by messages from the other port, and thus to get lost.

    It would not be possible for the driver to detect how many ports the
    device actually has, except that in practice, _all_ devices built with
    the CH345 have only one port.  So we can just ignore the device's
    descriptors, and hardcode one output port.

    Signed-off-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
    Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 5d39c9b60cfd2381737cdeb5a74bd79d4b27e84c
Author: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Date:   Sun Nov 15 22:37:44 2015 +0100

    ALSA: usb-audio: add packet size quirk for the Medeli DD305

    commit 98d362becb6621bebdda7ed0eac7ad7ec6c37898 upstream.

    Signed-off-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
    Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 53009ce204642c3191d6f4d773d28c80f0c27971
Author: Bjørn Mork &lt;bjorn@mork.no&gt;
Date:   Wed Nov 18 21:12:33 2015 +0100

    USB: option: add XS Stick W100-2 from 4G Systems

    commit 638148e20c7f8f6e95017fdc13bce8549a6925e0 upstream.

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

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

    Now all important things are there:

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

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

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

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

commit b2dbbdda6605358caeed741f51101395991dda5f
Author: Aleksander Morgado &lt;aleksander@aleksander.es&gt;
Date:   Wed Nov 11 19:51:40 2015 +0100

    USB: serial: option: add support for Novatel MiFi USB620L

    commit e07af133c3e2716db25e3e1e1d9f10c2088e9c1a upstream.

    Also known as Verizon U620L.

    The device is modeswitched from 1410:9020 to 1410:9022 by selecting the
    4th USB configuration:

     $ sudo usb_modeswitch –v 0x1410 –p 0x9020 –u 4

    This configuration provides a ECM interface as well as TTYs ('Enterprise
    Mode' according to the U620 Linux integration guide).

    Signed-off-by: Aleksander Morgado &lt;aleksander@aleksander.es&gt;
    Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9a960144742c6b57a17e8fd0df982b9ea28ae3c9
Author: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Date:   Fri Oct 23 09:53:50 2015 +0200

    usb: musb: core: fix order of arguments to ulpi write callback

    commit 705e63d2b29c8bbf091119084544d353bda70393 upstream.

    There is a bit of a mess in the order of arguments to the ulpi write
    callback. There is

    	int ulpi_write(struct ulpi *ulpi, u8 addr, u8 val)

    in drivers/usb/common/ulpi.c;

    	struct usb_phy_io_ops {
    		...
    		int (*write)(struct usb_phy *x, u32 val, u32 reg);
    	}

    in include/linux/usb/phy.h.

    The callback registered by the musb driver has to comply to the latter,
    but up to now had "offset" first which effectively made the function
    broken for correct users. So flip the order and while at it also
    switch to the parameter names of struct usb_phy_io_ops's write.

    Fixes: ffb865b1e460 ("usb: musb: add ulpi access operations")
    Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
    Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 2391fbf63585c3befa63a4780f470cf59539a6f7
Author: Jiri Slaby &lt;jslaby@suse.cz&gt;
Date:   Mon Nov 2 10:27:00 2015 +0100

    usblp: do not set TASK_INTERRUPTIBLE before lock

    commit 19cd80a214821f4b558560ebd76bfb2c38b4f3d8 upstream.

    It is not permitted to set task state before lock. usblp_wwait sets
    the state to TASK_INTERRUPTIBLE and calls mutex_lock_interruptible.
    Upon return from that function, the state will be TASK_RUNNING again.

    This is clearly a bug and a warning is generated with LOCKDEP too:
    WARNING: CPU: 1 PID: 5109 at kernel/sched/core.c:7404 __might_sleep+0x7d/0x90()
    do not call blocking ops when !TASK_RUNNING; state=1 set at [&lt;ffffffffa0c588d0&gt;] usblp_wwait+0xa0/0x310 [usblp]
    Modules linked in: ...
    CPU: 1 PID: 5109 Comm: captmon Tainted: G        W       4.2.5-0.gef2823b-default #1
    Hardware name: LENOVO 23252SG/23252SG, BIOS G2ET33WW (1.13 ) 07/24/2012
     ffffffff81a4edce ffff880236ec7ba8 ffffffff81716651 0000000000000000
     ffff880236ec7bf8 ffff880236ec7be8 ffffffff8106e146 0000000000000282
     ffffffff81a50119 000000000000028b 0000000000000000 ffff8802dab7c508
    Call Trace:
    ...
     [&lt;ffffffff8106e1c6&gt;] warn_slowpath_fmt+0x46/0x50
     [&lt;ffffffff8109a8bd&gt;] __might_sleep+0x7d/0x90
     [&lt;ffffffff8171b20f&gt;] mutex_lock_interruptible_nested+0x2f/0x4b0
     [&lt;ffffffffa0c588fc&gt;] usblp_wwait+0xcc/0x310 [usblp]
     [&lt;ffffffffa0c58bb2&gt;] usblp_write+0x72/0x350 [usblp]
     [&lt;ffffffff8121ed98&gt;] __vfs_write+0x28/0xf0
    ...

    Commit 7f477358e2384c54b190cc3b6ce28277050a041b (usblp: Implement the
    ENOSPC convention) moved the set prior locking. So move it back after
    the lock.

    Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
    Fixes: 7f477358e2 ("usblp: Implement the ENOSPC convention")
    Acked-By: Pete Zaitcev &lt;zaitcev@yahoo.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit b2a5b5964748a5a25a28652f4ea4223a534a4c86
Author: Robin Murphy &lt;robin.murphy@arm.com&gt;
Date:   Thu Oct 22 15:41:52 2015 +0100

    arm64: Fix compat register mappings

    commit 5accd17d0eb523350c9ef754d655e379c9bb93b3 upstream.

    For reasons not entirely apparent, but now enshrined in history, the
    architectural mapping of AArch32 banked registers to AArch64 registers
    actually orders SP_&lt;mode&gt; and LR_&lt;mode&gt; backwards compared to the
    intuitive r13/r14 order, for all modes except FIQ.

    Fix the compat_&lt;reg&gt;_&lt;mode&gt; macros accordingly, in the hope of avoiding
    subtle bugs with KVM and AArch32 guests.

    Signed-off-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
    Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
    Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 3b792c868153a9911e46ec3069b7b94e7cc5c6c6
Author: Mirza Krak &lt;mirza.krak@hostmobility.com&gt;
Date:   Tue Nov 10 14:59:34 2015 +0100

    can: sja1000: clear interrupts on start

    commit 7cecd9ab80f43972c056dc068338f7bcc407b71c upstream.

    According to SJA1000 data sheet error-warning (EI) interrupt is not
    cleared by setting the controller in to reset-mode.

    Then if we have the following case:
    - system is suspended (echo mem &gt; /sys/power/state) and SJA1000 is left
      in operating state
    - A bus error condition occurs which activates EI interrupt, system is
      still suspended which means EI interrupt will be not be handled nor
      cleared.

    If the above two events occur, on resume there is no way to return the
    SJA1000 to operating state, except to cycle power to it.

    By simply reading the IR register on start we will clear any previous
    conditions that could be present.

    Signed-off-by: Mirza Krak &lt;mirza.krak@hostmobility.com&gt;
    Reported-by: Christian Magnusson &lt;Christian.Magnusson@semcon.com&gt;
    Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit c45820774f2d7f3196c7ad371b026c2b6e93c9a7
Author: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Date:   Mon Sep 7 12:05:41 2015 +0200

    Bluetooth: hidp: fix device disconnect on idle timeout

    commit 660f0fc07d21114549c1862e67e78b1cf0c90c29 upstream.

    The HIDP specs define an idle-timeout which automatically disconnects a
    device. This has always been implemented in the HIDP layer and forced a
    synchronous shutdown of the hidp-scheduler. This works just fine, but
    lacks a forced disconnect on the underlying l2cap channels. This has been
    broken since:

        commit 5205185d461d5902325e457ca80bd421127b7308
        Author: David Herrmann &lt;dh.herrmann@gmail.com&gt;
        Date:   Sat Apr 6 20:28:47 2013 +0200

            Bluetooth: hidp: remove old session-management

    The old session-management always forced an l2cap error on the ctrl/intr
    channels when shutting down. The new session-management skips this, as we
    don't want to enforce channel policy on the caller. In other words, if
    user-space removes an HIDP device, the underlying channels (which are
    *owned* and *referenced* by user-space) are still left active. User-space
    needs to call shutdown(2) or close(2) to release them.

    Unfortunately, this does not work with idle-timeouts. There is no way to
    signal user-space that the HIDP layer has been stopped. The API simply
    does not support any event-passing except for poll(2). Hence, we restore
    old behavior and force EUNATCH on the sockets if the HIDP layer is
    disconnected due to idle-timeouts (behavior of explicit disconnects
    remains unmodified). User-space can still call

        getsockopt(..., SO_ERROR, ...)

    ..to retrieve the EUNATCH error and clear sk_err. Hence, the channels can
    still be re-used (which nobody does so far, though). Therefore, the API
    still supports the new behavior, but with this patch it's also compatible
    to the old implicit channel shutdown.

    Reported-by: Mark Haun &lt;haunma@keteu.org&gt;
    Reported-by: Luiz Augusto von Dentz &lt;luiz.dentz@gmail.com&gt;
    Signed-off-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
    Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 9babe681a7554368197bc33b33eaea6ec3112f51
Author: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Date:   Sun Oct 18 22:14:48 2015 -0500

    staging: rtl8712: Add device ID for Sitecom WLA2100

    commit 1e6e63283691a2a9048a35d9c6c59cf0abd342e4 upstream.

    This adds the USB ID for the Sitecom WLA2100. The Windows 10 inf file
    was checked to verify that the addition is correct.

    Reported-by: Frans van de Wiel &lt;fvdw@fvdw.eu&gt;
    Signed-off-by: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
    Cc: Frans van de Wiel &lt;fvdw@fvdw.eu&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 95563ce161961fbdf5df6d2b2df0d8ee5cf660c9
Author: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Date:   Mon Sep 21 19:19:53 2015 +0300

    mwifiex: fix mwifiex_rdeeprom_read()

    commit 1f9c6e1bc1ba5f8a10fcd6e99d170954d7c6d382 upstream.

    There were several bugs here.

    1)  The done label was in the wrong place so we didn't copy any
        information out when there was no command given.

    2)  We were using PAGE_SIZE as the size of the buffer instead of
        "PAGE_SIZE - pos".

    3)  snprintf() returns the number of characters that would have been
        printed if there were enough space.  If there was not enough space
        (and we had fixed the memory corruption bug #2) then it would result
        in an information leak when we do simple_read_from_buffer().  I've
        changed it to use scnprintf() instead.

    I also removed the initialization at the start of the function, because
    I thought it made the code a little more clear.

    Fixes: 5e6e3a92b9a4 ('wireless: mwifiex: initial commit for Marvell mwifiex driver')
    Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
    Acked-by: Amitkumar Karwar &lt;akarwar@marvell.com&gt;
    Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit dde9eef8c909fac6f2bac664598a1b8553bbb003
Author: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Date:   Fri Sep 25 18:09:35 2015 +0200

    net: mvneta: Fix CPU_MAP registers initialisation

    commit 2502d0ef272da7058ef303b849a2c8dc324c2e2e upstream.

    The CPU_MAP register is duplicated for each CPUs at different addresses,
    each instance being at a different address.

    However, the code so far was using CONFIG_NR_CPUS to initialise the CPU_MAP
    registers for each registers, while the SoCs embed at most 4 CPUs.

    This is especially an issue with multi_v7_defconfig, where CONFIG_NR_CPUS
    is currently set to 16, resulting in writes to registers that are not
    CPU_MAP.

    Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP network unit")
    Signed-off-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
    Signed-off-by: Gregory CLEMENT &lt;gregory.clement@free-electrons.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit ad9550e54d1bb06eb91100e0b8129b77015943b7
Author: Johannes Berg &lt;johannes.berg@intel.com&gt;
Date:   Fri Aug 28 10:52:53 2015 +0200

    mac80211: fix driver RSSI event calculations

    commit 8ec6d97871f37e4743678ea4a455bd59580aa0f4 upstream.

    The ifmgd-&gt;ave_beacon_signal value cannot be taken as is for
    comparisons, it must be divided by since it's represented
    like that for better accuracy of the EWMA calculations. This
    would lead to invalid driver RSSI events. Fix the used value.

    Fixes: 615f7b9bb1f8 ("mac80211: add driver RSSI threshold events")
    Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 8fa88fa8503eba326e6ddf47e3ec1f71d6997dc0
Author: Andrew Cooper &lt;andrew.cooper3@citrix.com&gt;
Date:   Wed Jun 3 10:31:14 2015 +0100

    x86/cpu: Fix SMAP check in PVOPS environments

    commit 581b7f158fe0383b492acd1ce3fb4e99d4e57808 upstream.

    There appears to be no formal statement of what pv_irq_ops.save_fl() is
    supposed to return precisely.  Native returns the full flags, while lguest and
    Xen only return the Interrupt Flag, and both have comments by the
    implementations stating that only the Interrupt Flag is looked at.  This may
    have been true when initially implemented, but no longer is.

    To make matters worse, the Xen PVOP leaves the upper bits undefined, making
    the BUG_ON() undefined behaviour.  Experimentally, this now trips for 32bit PV
    guests on Broadwell hardware.  The BUG_ON() is consistent for an individual
    build, but not consistent for all builds.  It has also been a sitting timebomb
    since SMAP support was introduced.

    Use native_save_fl() instead, which will obtain an accurate view of the AC
    flag.

    Signed-off-by: Andrew Cooper &lt;andrew.cooper3@citrix.com&gt;
    Reviewed-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
    Tested-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
    Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
    Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
    Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
    Cc: &lt;lguest@lists.ozlabs.org&gt;
    Cc: Xen-devel &lt;xen-devel@lists.xen.org&gt;
    Link: http://lkml.kernel.org/r/1433323874-6927-1-git-send-email-andrew.cooper3@citrix.com
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 8f14777b580d064a80f0adac4c2596d24a196205
Author: Borislav Petkov &lt;bp@suse.de&gt;
Date:   Thu Nov 5 16:57:56 2015 +0100

    x86/cpu: Call verify_cpu() after having entered long mode too

    commit 04633df0c43d710e5f696b06539c100898678235 upstream.

    When we get loaded by a 64-bit bootloader, kernel entry point is
    startup_64 in head_64.S. We don't trust any and all bootloaders because
    some will fiddle with CPU configuration so we go ahead and massage each
    CPU into sanity again.

    For example, some dell BIOSes have this XD disable feature which set
    IA32_MISC_ENABLE[34] and disable NX. This might be some dumb workaround
    for other OSes but Linux sure doesn't need it.

    A similar thing is present in the Surface 3 firmware - see
    https://bugzilla.kernel.org/show_bug.cgi?id=106051 - which sets this bit
    only on the BSP:

      # rdmsr -a 0x1a0
      400850089
      850089
      850089
      850089

    I know, right?!

    There's not even an off switch in there.

    So fix all those cases by sanitizing the 64-bit entry point too. For
    that, make verify_cpu() callable in 64-bit mode also.

    Requested-and-debugged-by: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
    Reported-and-tested-by: Bastien Nocera &lt;bugzilla@hadess.net&gt;
    Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
    Cc: Matt Fleming &lt;matt@codeblueprint.co.uk&gt;
    Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
    Link: http://lkml.kernel.org/r/1446739076-21303-1-git-send-email-bp@alien8.de
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 308b1b04336a71008b9b9d143506625d4c653751
Author: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
Date:   Fri Nov 6 14:18:36 2015 +0100

    x86/setup: Fix low identity map for &gt;= 2GB kernel range

    commit 68accac392d859d24adcf1be3a90e41f978bd54c upstream.

    The commit f5f3497cad8c extended the low identity mapping. However, if
    the kernel uses more than 2 GB (VMSPLIT_2G_OPT or VMSPLIT_1G memory
    split), the normal memory mapping is overwritten by the low identity
    mapping causing a crash. To avoid overwritting, limit the low identity
    map to cover only memory before kernel range (PAGE_OFFSET).

    Fixes: f5f3497cad8c "x86/setup: Extend low identity map to cover whole kernel range
    Signed-off-by: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
    Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
    Cc: Borislav Petkov &lt;bp@alien8.de&gt;
    Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
    Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
    Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Link: http://lkml.kernel.org/r/1446815916-22105-1-git-send-email-krzysiek@podlesie.net
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit fa4fbf71380d21a54e25b66e77b9700184c0ef91
Author: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Date:   Wed Oct 14 13:30:45 2015 +0200

    x86/setup: Extend low identity map to cover whole kernel range

    commit f5f3497cad8c8416a74b9aaceb127908755d020a upstream.

    On 32-bit systems, the initial_page_table is reused by
    efi_call_phys_prolog as an identity map to call
    SetVirtualAddressMap.  efi_call_phys_prolog takes care of
    converting the current CPU's GDT to a physical address too.

    For PAE kernels the identity mapping is achieved by aliasing the
    first PDPE for the kernel memory mapping into the first PDPE
    of initial_page_table.  This makes the EFI stub's trick "just work".

    However, for non-PAE kernels there is no guarantee that the identity
    mapping in the initial_page_table extends as far as the GDT; in this
    case, accesses to the GDT will cause a page fault (which quickly becomes
    a triple fault).  Fix this by copying the kernel mappings from
    swapper_pg_dir to initial_page_table twice, both at PAGE_OFFSET and at
    identity mapping.

    For some reason, this is only reproducible with QEMU's dynamic translation
    mode, and not for example with KVM.  However, even under KVM one can clearly
    see that the page table is bogus:

        $ qemu-system-i386 -pflash OVMF.fd -M q35 vmlinuz0 -s -S -daemonize
        $ gdb
        (gdb) target remote localhost:1234
        (gdb) hb *0x02858f6f
        Hardware assisted breakpoint 1 at 0x2858f6f
        (gdb) c
        Continuing.

        Breakpoint 1, 0x02858f6f in ?? ()
        (gdb) monitor info registers
        ...
        GDT=     0724e000 000000ff
        IDT=     fffbb000 000007ff
        CR0=0005003b CR2=ff896000 CR3=032b7000 CR4=00000690
        ...

    The page directory is sane:

        (gdb) x/4wx 0x32b7000
        0x32b7000:	0x03398063	0x03399063	0x0339a063	0x0339b063
        (gdb) x/4wx 0x3398000
        0x3398000:	0x00000163	0x00001163	0x00002163	0x00003163
        (gdb) x/4wx 0x3399000
        0x3399000:	0x00400003	0x00401003	0x00402003	0x00403003

    but our particular page directory entry is empty:

        (gdb) x/1wx 0x32b7000 + (0x724e000 &gt;&gt; 22) * 4
        0x32b7070:	0x00000000

    [ It appears that you can skate past this issue if you don't receive
      any interrupts while the bogus GDT pointer is loaded, or if you avoid
      reloading the segment registers in general.

      Andy Lutomirski provides some additional insight:

       "AFAICT it's entirely permissible for the GDTR and/or LDT
        descriptor to point to unmapped memory.  Any attempt to use them
        (segment loads, interrupts, IRET, etc) will try to access that memory
        as if the access came from CPL 0 and, if the access fails, will
        generate a valid page fault with CR2 pointing into the GDT or
        LDT."

      Up until commit 23a0d4e8fa6d ("efi: Disable interrupts around EFI
      calls, not in the epilog/prolog calls") interrupts were disabled
      around the prolog and epilog calls, and the functional GDT was
      re-installed before interrupts were re-enabled.

      Which explains why no one has hit this issue until now. ]

    Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
    Reported-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
    Cc: &lt;stable@vger.kernel.org&gt;
    Cc: Borislav Petkov &lt;bp@alien8.de&gt;
    Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
    Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
    Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
    Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
    Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
    [ Updated changelog. ]
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 8d4b96524384f8962c64c2ae061326682916dc48
Author: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Date:   Sat Oct 3 13:03:47 2015 -0700

    ARM: orion: Fix DSA platform device after mvmdio conversion

    commit d836ace65ee98d7079bc3c5afdbcc0e27dca20a3 upstream.

    DSA expects the host_dev pointer to be the device structure associated
    with the MDIO bus controller driver. First commit breaking that was
    c3a07134e6aa ("mv643xx_eth: convert to use the Marvell Orion MDIO
    driver"), and then, it got completely under the radar for a while.

    Reported-by: Frans van de Wiel &lt;fvdw@fvdw.eu&gt;
    Fixes: c3a07134e6aa ("mv643xx_eth: convert to use the Marvell Orion MDIO driver")
    Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
    Signed-off-by: Gregory CLEMENT &lt;gregory.clement@free-electrons.com&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 1aac1dc9886764cfa1226273e4d4709284872442
Author: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Date:   Fri Aug 28 09:42:09 2015 +0100

    ARM: 8427/1: dma-mapping: add support for offset parameter in dma_mmap()

    commit 7e31210349e9e03a9a4dff31ab5f2bc83e8e84f5 upstream.

    IOMMU-based dma_mmap() implementation lacked proper support for offset
    parameter used in mmap call (it always assumed that mapping starts from
    offset zero). This patch adds support for offset parameter to IOMMU-based
    implementation.

    Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
    Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 98cc6d31fa7dde7beb1bccc51ad5c858d9ae5b04
Author: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Date:   Fri Aug 28 09:41:39 2015 +0100

    ARM: 8426/1: dma-mapping: add missing range check in dma_mmap()

    commit 371f0f085f629fc0f66695f572373ca4445a67ad upstream.

    dma_mmap() function in IOMMU-based dma-mapping implementation lacked
    a check for valid range of mmap parameters (offset and buffer size), what
    might have caused access beyond the allocated buffer. This patch fixes
    this issue.

    Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
    Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit c79f626810b7d20aca9cd935d8cfc3272ba7a054
Author: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Date:   Tue Sep 8 10:53:40 2015 -0400

    RDS: verify the underlying transport exists before creating a connection

    [ Upstream commit 74e98eb085889b0d2d4908f59f6e00026063014f ]

    There was no verification that an underlying transport exists when creating
    a connection, this would cause dereferencing a NULL ptr.

    It might happen on sockets that weren't properly bound before attempting to
    send a message, which will cause a NULL ptr deref:

    [135546.047719] kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN
    [135546.051270] Modules linked in:
    [135546.051781] CPU: 4 PID: 15650 Comm: trinity-c4 Not tainted 4.2.0-next-20150902-sasha-00041-gbaa1222-dirty #2527
    [135546.053217] task: ffff8800835bc000 ti: ffff8800bc708000 task.ti: ffff8800bc708000
    [135546.054291] RIP: __rds_conn_create (net/rds/connection.c:194)
    [135546.055666] RSP: 0018:ffff8800bc70fab0  EFLAGS: 00010202
    [135546.056457] RAX: dffffc0000000000 RBX: 0000000000000f2c RCX: ffff8800835bc000
    [135546.057494] RDX: 0000000000000007 RSI: ffff8800835bccd8 RDI: 0000000000000038
    [135546.058530] RBP: ffff8800bc70fb18 R08: 0000000000000001 R09: 0000000000000000
    [135546.059556] R10: ffffed014d7a3a23 R11: ffffed014d7a3a21 R12: 0000000000000000
    [135546.060614] R13: 0000000000000001 R14: ffff8801ec3d0000 R15: 0000000000000000
    [135546.061668] FS:  00007faad4ffb700(0000) GS:ffff880252000000(0000) knlGS:0000000000000000
    [135546.062836] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [135546.063682] CR2: 000000000000846a CR3: 000000009d137000 CR4: 00000000000006a0
    [135546.064723] Stack:
    [135546.065048]  ffffffffafe2055c ffffffffafe23fc1 ffffed00493097bf ffff8801ec3d0008
    [135546.066247]  0000000000000000 00000000000000d0 0000000000000000 ac194a24c0586342
    [135546.067438]  1ffff100178e1f78 ffff880320581b00 ffff8800bc70fdd0 ffff880320581b00
    [135546.068629] Call Trace:
    [135546.069028] ? __rds_conn_create (include/linux/rcupdate.h:856 net/rds/connection.c:134)
    [135546.069989] ? rds_message_copy_from_user (net/rds/message.c:298)
    [135546.071021] rds_conn_create_outgoing (net/rds/connection.c:278)
    [135546.071981] rds_sendmsg (net/rds/send.c:1058)
    [135546.072858] ? perf_trace_lock (include/trace/events/lock.h:38)
    [135546.073744] ? lockdep_init (kernel/locking/lockdep.c:3298)
    [135546.074577] ? rds_send_drop_to (net/rds/send.c:976)
    [135546.075508] ? __might_fault (./arch/x86/include/asm/current.h:14 mm/memory.c:3795)
    [135546.076349] ? __might_fault (mm/memory.c:3795)
    [135546.077179] ? rds_send_drop_to (net/rds/send.c:976)
    [135546.078114] sock_sendmsg (net/socket.c:611 net/socket.c:620)
    [135546.078856] SYSC_sendto (net/socket.c:1657)
    [135546.079596] ? SYSC_connect (net/socket.c:1628)
    [135546.080510] ? trace_dump_stack (kernel/trace/trace.c:1926)
    [135546.081397] ? ring_buffer_unlock_commit (kernel/trace/ring_buffer.c:2479 kernel/trace/ring_buffer.c:2558 kernel/trace/ring_buffer.c:2674)
    [135546.082390] ? trace_buffer_unlock_commit (kernel/trace/trace.c:1749)
    [135546.083410] ? trace_event_raw_event_sys_enter (include/trace/events/syscalls.h:16)
    [135546.084481] ? do_audit_syscall_entry (include/trace/events/syscalls.h:16)
    [135546.085438] ? trace_buffer_unlock_commit (kernel/trace/trace.c:1749)
    [135546.085515] rds_ib_laddr_check(): addr 36.74.25.172 ret -99 node type -1

    Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
    Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit bd81712486bd1af8086984b5191d055908d867ec
Author: Jason Wang &lt;jasowang@redhat.com&gt;
Date:   Wed Aug 5 10:34:04 2015 +0800

    virtio-net: drop NETIF_F_FRAGLIST

    [ Upstream commit 48900cb6af4282fa0fb6ff4d72a81aa3dadb5c39 ]

    virtio declares support for NETIF_F_FRAGLIST, but assumes
    that there are at most MAX_SKB_FRAGS + 2 fragments which isn't
    always true with a fraglist.

    A longer fraglist in the skb will make the call to skb_to_sgvec overflow
    the sg array, leading to memory corruption.

    Drop NETIF_F_FRAGLIST so we only get what we can handle.

    Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
    Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
    Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 0be0e5758dbdf3f61378b5d17d00363f92e93bae
Author: Eric Dumazet &lt;edumazet@google.com&gt;
Date:   Mon Nov 9 17:51:23 2015 -0800

    net: fix a race in dst_release()

    [ Upstream commit d69bbf88c8d0b367cf3e3a052f6daadf630ee566 ]

    Only cpu seeing dst refcount going to 0 can safely
    dereference dst-&gt;flags.

    Otherwise an other cpu might already have freed the dst.

    Fixes: 27b75c95f10d ("net: avoid RCU for NOCACHE dst")
    Reported-by: Greg Thelen &lt;gthelen@google.com&gt;
    Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 0861d012ecff07b74a8c6ecfda04bb1737831e09
Author: Eric Dumazet &lt;edumazet@google.com&gt;
Date:   Mon Nov 2 07:50:07 2015 -0800

    net: avoid NULL deref in inet_ctl_sock_destroy()

    [ Upstream commit 8fa677d2706d325d71dab91bf6e6512c05214e37 ]

    Under low memory conditions, tcp_sk_init() and icmp_sk_init()
    can both iterate on all possible cpus and call inet_ctl_sock_destroy(),
    with eventual NULL pointer.

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

commit 25e462d9e34f8bb0cdaab78093c61373048d13a3
Author: Ani Sinha &lt;ani@arista.com&gt;
Date:   Fri Oct 30 16:54:31 2015 -0700

    ipmr: fix possible race resulting from improper usage of IP_INC_STATS_BH() in preemptible context.

    [ Upstream commit 44f49dd8b5a606870a1f21101522a0f9c4414784 ]

    Fixes the following kernel BUG :

    BUG: using __this_cpu_add() in preemptible [00000000] code: bash/2758
    caller is __this_cpu_preempt_check+0x13/0x15
    CPU: 0 PID: 2758 Comm: bash Tainted: P           O   3.18.19 #2
     ffffffff8170eaca ffff880110d1b788 ffffffff81482b2a 0000000000000000
     0000000000000000 ffff880110d1b7b8 ffffffff812010ae ffff880007cab800
     ffff88001a060800 ffff88013a899108 ffff880108b84240 ffff880110d1b7c8
    Call Trace:
    [&lt;ffffffff81482b2a&gt;] dump_stack+0x52/0x80
    [&lt;ffffffff812010ae&gt;] check_preemption_disabled+0xce/0xe1
    [&lt;ffffffff812010d4&gt;] __this_cpu_preempt_check+0x13/0x15
    [&lt;ffffffff81419d60&gt;] ipmr_queue_xmit+0x647/0x70c
    [&lt;ffffffff8141a154&gt;] ip_mr_forward+0x32f/0x34e
    [&lt;ffffffff8141af76&gt;] ip_mroute_setsockopt+0xe03/0x108c
    [&lt;ffffffff810553fc&gt;] ? get_parent_ip+0x11/0x42
    [&lt;ffffffff810e6974&gt;] ? pollwake+0x4d/0x51
    [&lt;ffffffff81058ac0&gt;] ? default_wake_function+0x0/0xf
    [&lt;ffffffff810553fc&gt;] ? get_parent_ip+0x11/0x42
    [&lt;ffffffff810613d9&gt;] ? __wake_up_common+0x45/0x77
    [&lt;ffffffff81486ea9&gt;] ? _raw_spin_unlock_irqrestore+0x1d/0x32
    [&lt;ffffffff810618bc&gt;] ? __wake_up_sync_key+0x4a/0x53
    [&lt;ffffffff8139a519&gt;] ? sock_def_readable+0x71/0x75
    [&lt;ffffffff813dd226&gt;] do_ip_setsockopt+0x9d/0xb55
    [&lt;ffffffff81429818&gt;] ? unix_seqpacket_sendmsg+0x3f/0x41
    [&lt;ffffffff813963fe&gt;] ? sock_sendmsg+0x6d/0x86
    [&lt;ffffffff813959d4&gt;] ? sockfd_lookup_light+0x12/0x5d
    [&lt;ffffffff8139650a&gt;] ? SyS_sendto+0xf3/0x11b
    [&lt;ffffffff810d5738&gt;] ? new_sync_read+0x82/0xaa
    [&lt;ffffffff813ddd19&gt;] compat_ip_setsockopt+0x3b/0x99
    [&lt;ffffffff813fb24a&gt;] compat_raw_setsockopt+0x11/0x32
    [&lt;ffffffff81399052&gt;] compat_sock_common_setsockopt+0x18/0x1f
    [&lt;ffffffff813c4d05&gt;] compat_SyS_setsockopt+0x1a9/0x1cf
    [&lt;ffffffff813c4149&gt;] compat_SyS_socketcall+0x180/0x1e3
    [&lt;ffffffff81488ea1&gt;] cstar_dispatch+0x7/0x1e

    Signed-off-by: Ani Sinha &lt;ani@arista.com&gt;
    Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 34805d167c315860130d55448e9a45b51cc18fb2
Author: Phil Reid &lt;preid@electromag.com.au&gt;
Date:   Fri Oct 30 16:43:55 2015 +0800

    stmmac: Correctly report PTP capabilities.

    [ Upstream commit e6dbe1eb2db0d7a14991c06278dd3030c45fb825 ]

    priv-&gt;hwts_*_en indicate if timestamping is enabled/disabled at run
    time. But  priv-&gt;dma_cap.time_stamp  and priv-&gt;dma_cap.atime_stamp
    indicates HW is support for PTPv1/PTPv2.

    Signed-off-by: Phil Reid &lt;preid@electromag.com.au&gt;
    Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 669cd5ea954101b516a1632995e8e12f2898da17
Author: Carol L Soto &lt;clsoto@linux.vnet.ibm.com&gt;
Date:   Tue Oct 27 17:36:20 2015 +0200

    net/mlx4: Copy/set only sizeof struct mlx4_eqe bytes

    [ Upstream commit c02b05011fadf8e409e41910217ca689f2fc9d91 ]

    When doing memcpy/memset of EQEs, we should use sizeof struct
    mlx4_eqe as the base size and not caps.eqe_size which could be bigger.

    If caps.eqe_size is bigger than the struct mlx4_eqe then we corrupt
    data in the master context.

    When using a 64 byte stride, the memcpy copied over 63 bytes to the
    slave_eq structure.  This resulted in copying over the entire eqe of
    interest, including its ownership bit -- and also 31 bytes of garbage
    into the next WQE in the slave EQ -- which did NOT include the ownership
    bit (and therefore had no impact).

    However, once the stride is increased to 128, we are overwriting the
    ownership bits of *three* eqes in the slave_eq struct.  This results
    in an incorrect ownership bit for those eqes, which causes the eq to
    seem to be full. The issue therefore surfaced only once 128-byte EQEs
    started being used in SRIOV and (overarchitectures that have 128/256
    byte cache-lines such as PPC) - e.g after commit 77507aa249ae
    "net/mlx4_core: Enable CQE/EQE stride support".

    Fixes: 08ff32352d6f ('mlx4: 64-byte CQE/EQE support')
    Signed-off-by: Carol L Soto &lt;clsoto@linux.vnet.ibm.com&gt;
    Signed-off-by: Jack Morgenstein &lt;jackm@dev.mellanox.co.il&gt;
    Signed-off-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit 074043fdd071a4d5c4cd25fa7aaaff5c6eedd1dd
Author: Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
Date:   Mon Oct 26 12:46:37 2015 -0400

    RDS-TCP: Recover correctly from pskb_pull()/pksb_trim() failure in rds_tcp_data_recv

    [ Upstream commit 8ce675ff39b9958d1c10f86cf58e357efaafc856 ]

    Either of pskb_pull() or pskb_trim() may fail under low memory conditions.
    If rds_tcp_data_recv() ignores such failures, the application will
    receive corrupted data because the skb has not been correctly
    carved to the RDS datagram size.

    Avoid this by handling pskb_pull/pskb_trim failure in the same
    manner as the skb_clone failure: bail out of rds_tcp_data_recv(), and
    retry via the deferred call to rds_send_worker() that gets set up on
    ENOMEM from rds_tcp_read_sock()

    Signed-off-by: Sowmini Varadhan &lt;sowmini.varadhan@oracle.com&gt;
    Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@oracle.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit e42f6b5c7bcf22062a389d40cbf2a723aab4d2df
Author: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Date:   Thu Oct 22 16:57:10 2015 +0200

    ppp: fix pppoe_dev deletion condition in pppoe_release()

    [ Upstream commit 1acea4f6ce1b1c0941438aca75dd2e5c6b09db60 ]

    We can't rely on PPPOX_ZOMBIE to decide whether to clear po-&gt;pppoe_dev.
    PPPOX_ZOMBIE can be set by pppoe_disc_rcv() even when po-&gt;pppoe_dev is
    NULL. So we have no guarantee that (sk-&gt;sk_state &amp; PPPOX_ZOMBIE) implies
    (po-&gt;pppoe_dev != NULL).
    Since we're releasing a PPPoE socket, we want to release the pppoe_dev
    if it exists and reset sk_state to PPPOX_DEAD, no matter the previous
    value of sk_state. So we can just check for po-&gt;pppoe_dev and avoid any
    assumption on sk-&gt;sk_state.

    Fixes: 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release")
    Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

commit edbdd72399cf707f3086a8c3df35e435381fd227
Author: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Date:   Mon Oct 19 13:16:49 2015 +0300

    irda: precedence bug in irlmp_seq_hb_idx()

    [ Upstream commit 50010c20597d14667eff0fdb628309986f195230 ]

    This is decrementing the pointer, instead of the value stored in the
    pointer.  KASan detects it as an out of bounds reference.

    Reported-by: "Berry Cheng 程君(成淼)" &lt;chengmiao.cj@alibaba-inc.com&gt;
    Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
    Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>first commit</title>
<updated>2016-08-15T02:19:42+00:00</updated>
<author>
<name>Meizu OpenSource</name>
<email>patchwork@meizu.com</email>
</author>
<published>2016-08-15T02:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=d2e1446d81725c351dc73a03b397ce043fb18452'/>
<id>urn:sha1:d2e1446d81725c351dc73a03b397ce043fb18452</id>
<content type='text'>
</content>
</entry>
</feed>
