<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib, branch v4.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-09-25T20:32:46Z</updated>
<entry>
<title>radix tree: fix sibling entry handling in radix_tree_descend()</title>
<updated>2016-09-25T20:32:46Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-09-25T20:32:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d2c0d36d6826ddc3114801c599619d3f2932f0a'/>
<id>urn:sha1:8d2c0d36d6826ddc3114801c599619d3f2932f0a</id>
<content type='text'>
The fixes to the radix tree test suite show that the multi-order case is
broken.  The basic reason is that the radix tree code uses tagged
pointers with the "internal" bit in the low bits, and calculating the
pointer indices was supposed to mask off those bits.  But gcc will
notice that we then use the index to re-create the pointer, and will
avoid doing the arithmetic and use the tagged pointer directly.

This cleans the code up, using the existing is_sibling_entry() helper to
validate the sibling pointer range (instead of open-coding it), and
using entry_to_node() to mask off the low tag bit from the pointer.  And
once you do that, you might as well just use the now cleaned-up pointer
directly.

[ Side note: the multi-order code isn't actually ever used in the kernel
  right now, and the only reason I didn't just delete all that code is
  that Kirill Shutemov piped up and said:

    "Well, my ext4-with-huge-pages patchset[1] uses multi-order entries.
     It also converts shmem-with-huge-pages and hugetlb to them.

     I'm okay with converting it to other mechanism, but I need
     something.  (I looked into Konstantin's RFC patchset[2].  It looks
     okay, but I don't feel myself qualified to review it as I don't
     know much about radix-tree internals.)"

  [1] http://lkml.kernel.org/r/20160915115523.29737-1-kirill.shutemov@linux.intel.com
  [2] http://lkml.kernel.org/r/147230727479.9957.1087787722571077339.stgit@zurg ]

Reported-by: Matthew Wilcox &lt;mawilcox@microsoft.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Ross Zwisler &lt;ross.zwisler@linux.intel.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Konstantin Khlebnikov &lt;koct9i@gmail.com&gt;
Cc: Cedric Blancher &lt;cedric.blancher@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text</title>
<updated>2016-09-23T05:30:04Z</updated>
<author>
<name>Vivien Didelot</name>
<email>vivien.didelot@savoirfairelinux.com</email>
</author>
<published>2016-09-22T20:55:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=96b03ab86d843524ec4aed7fe0ceef412c684c68'/>
<id>urn:sha1:96b03ab86d843524ec4aed7fe0ceef412c684c68</id>
<content type='text'>
Fix the indefinitiley -&gt; indefinitely typo in Kconfig.debug.

Signed-off-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20160922205513.17821-1-vivien.didelot@savoirfairelinux.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>fix iov_iter_fault_in_readable()</title>
<updated>2016-09-17T21:05:30Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2016-09-15T23:11:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4690f1e1cdabb4d61207b6787b1605a0dc0aeab'/>
<id>urn:sha1:d4690f1e1cdabb4d61207b6787b1605a0dc0aeab</id>
<content type='text'>
... by turning it into what used to be multipages counterpart

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/test_hash.c: fix warning in preprocessor symbol evaluation</title>
<updated>2016-09-02T00:52:01Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2016-09-01T23:14:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6173ba42bbdba05fd4f3021c0beda0506271507'/>
<id>urn:sha1:e6173ba42bbdba05fd4f3021c0beda0506271507</id>
<content type='text'>
Some versions of gcc don't like tests for the value of an undefined
preprocessor symbol, even in the #else branch of an #ifndef:

    lib/test_hash.c:224:7: warning: "HAVE_ARCH__HASH_32" is not defined [-Wundef]
     #elif HAVE_ARCH__HASH_32 != 1
	   ^
    lib/test_hash.c:229:7: warning: "HAVE_ARCH_HASH_32" is not defined [-Wundef]
     #elif HAVE_ARCH_HASH_32 != 1
	   ^
    lib/test_hash.c:234:7: warning: "HAVE_ARCH_HASH_64" is not defined [-Wundef]
     #elif HAVE_ARCH_HASH_64 != 1
	   ^

Seen with gcc 4.9, not seen with 4.1.2.

Change the logic to only check the value inside an #ifdef to fix this.

Fixes: 468a9428521e7d00 ("&lt;linux/hash.h&gt;: Add support for architecture-specific functions")
Link: http://lkml.kernel.org/r/20160829214952.1334674-4-arnd@arndb.de
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: George Spelvin &lt;linux@sciencehorizons.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/test_hash.c: fix warning in two-dimensional array init</title>
<updated>2016-09-02T00:52:01Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2016-09-01T23:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ed76b7a131f41c91b0c725d472f9b969d75ce888'/>
<id>urn:sha1:ed76b7a131f41c91b0c725d472f9b969d75ce888</id>
<content type='text'>
  lib/test_hash.c: In function 'test_hash_init':
  lib/test_hash.c:146:2: warning: missing braces around initializer [-Wmissing-braces]

Fixes: 468a9428521e7d00 ("&lt;linux/hash.h&gt;: Add support for architecture-specific functions")
Link: http://lkml.kernel.org/r/20160829214952.1334674-3-arnd@arndb.de
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: George Spelvin &lt;linux@sciencehorizons.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS</title>
<updated>2016-08-30T17:10:21Z</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@redhat.com</email>
</author>
<published>2016-08-30T13:04:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d025d271e55f3de21f0aaaf54b42d20404d2b23'/>
<id>urn:sha1:0d025d271e55f3de21f0aaaf54b42d20404d2b23</id>
<content type='text'>
There are three usercopy warnings which are currently being silenced for
gcc 4.6 and newer:

1) "copy_from_user() buffer size is too small" compile warning/error

   This is a static warning which happens when object size and copy size
   are both const, and copy size &gt; object size.  I didn't see any false
   positives for this one.  So the function warning attribute seems to
   be working fine here.

   Note this scenario is always a bug and so I think it should be
   changed to *always* be an error, regardless of
   CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.

2) "copy_from_user() buffer size is not provably correct" compile warning

   This is another static warning which happens when I enable
   __compiletime_object_size() for new compilers (and
   CONFIG_DEBUG_STRICT_USER_COPY_CHECKS).  It happens when object size
   is const, but copy size is *not*.  In this case there's no way to
   compare the two at build time, so it gives the warning.  (Note the
   warning is a byproduct of the fact that gcc has no way of knowing
   whether the overflow function will be called, so the call isn't dead
   code and the warning attribute is activated.)

   So this warning seems to only indicate "this is an unusual pattern,
   maybe you should check it out" rather than "this is a bug".

   I get 102(!) of these warnings with allyesconfig and the
   __compiletime_object_size() gcc check removed.  I don't know if there
   are any real bugs hiding in there, but from looking at a small
   sample, I didn't see any.  According to Kees, it does sometimes find
   real bugs.  But the false positive rate seems high.

3) "Buffer overflow detected" runtime warning

   This is a runtime warning where object size is const, and copy size &gt;
   object size.

All three warnings (both static and runtime) were completely disabled
for gcc 4.6 with the following commit:

  2fb0815c9ee6 ("gcc4: disable __compiletime_object_size for GCC 4.6+")

That commit mistakenly assumed that the false positives were caused by a
gcc bug in __compiletime_object_size().  But in fact,
__compiletime_object_size() seems to be working fine.  The false
positives were instead triggered by #2 above.  (Though I don't have an
explanation for why the warnings supposedly only started showing up in
gcc 4.6.)

So remove warning #2 to get rid of all the false positives, and re-enable
warnings #1 and #3 by reverting the above commit.

Furthermore, since #1 is a real bug which is detected at compile time,
upgrade it to always be an error.

Having done all that, CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is no longer
needed.

Signed-off-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: "H . Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Byungchul Park &lt;byungchul.park@lge.com&gt;
Cc: Nilay Vaish &lt;nilayvaish@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rhashtable: fix a memory leak in alloc_bucket_locks()</title>
<updated>2016-08-27T04:59:53Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2016-08-26T15:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9dbeea7f08f3784b152d9fb3b86beb34aad77c72'/>
<id>urn:sha1:9dbeea7f08f3784b152d9fb3b86beb34aad77c72</id>
<content type='text'>
If vmalloc() was successful, do not attempt a kmalloc_array()

Fixes: 4cf0b354d92e ("rhashtable: avoid large lock-array allocations")
Reported-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Florian Westphal &lt;fw@strlen.de&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Tested-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2016-08-18T00:26:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-08-18T00:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=184ca823481c99dadd7d946e5afd4bb921eab30d'/>
<id>urn:sha1:184ca823481c99dadd7d946e5afd4bb921eab30d</id>
<content type='text'>
Pull networking fixes from David Miller:

 1) Buffers powersave frame test is reversed in cfg80211, fix from Felix
    Fietkau.

 2) Remove bogus WARN_ON in openvswitch, from Jarno Rajahalme.

 3) Fix some tg3 ethtool logic bugs, and one that would cause no
    interrupts to be generated when rx-coalescing is set to 0.  From
    Satish Baddipadige and Siva Reddy Kallam.

 4) QLCNIC mailbox corruption and napi budget handling fix from Manish
    Chopra.

 5) Fix fib_trie logic when walking the trie during /proc/net/route
    output than can access a stale node pointer.  From David Forster.

 6) Several sctp_diag fixes from Phil Sutter.

 7) PAUSE frame handling fixes in mlxsw driver from Ido Schimmel.

 8) Checksum fixup fixes in bpf from Daniel Borkmann.

 9) Memork leaks in nfnetlink, from Liping Zhang.

10) Use after free in rxrpc, from David Howells.

11) Use after free in new skb_array code of macvtap driver, from Jason
    Wang.

12) Calipso resource leak, from Colin Ian King.

13) mediatek bug fixes (missing stats sync init, etc.) from Sean Wang.

14) Fix bpf non-linear packet write helpers, from Daniel Borkmann.

15) Fix lockdep splats in macsec, from Sabrina Dubroca.

16) hv_netvsc bug fixes from Vitaly Kuznetsov, mostly to do with VF
    handling.

17) Various tc-action bug fixes, from CONG Wang.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (116 commits)
  net_sched: allow flushing tc police actions
  net_sched: unify the init logic for act_police
  net_sched: convert tcf_exts from list to pointer array
  net_sched: move tc offload macros to pkt_cls.h
  net_sched: fix a typo in tc_for_each_action()
  net_sched: remove an unnecessary list_del()
  net_sched: remove the leftover cleanup_a()
  mlxsw: spectrum: Allow packets to be trapped from any PG
  mlxsw: spectrum: Unmap 802.1Q FID before destroying it
  mlxsw: spectrum: Add missing rollbacks in error path
  mlxsw: reg: Fix missing op field fill-up
  mlxsw: spectrum: Trap loop-backed packets
  mlxsw: spectrum: Add missing packet traps
  mlxsw: spectrum: Mark port as active before registering it
  mlxsw: spectrum: Create PVID vPort before registering netdevice
  mlxsw: spectrum: Remove redundant errors from the code
  mlxsw: spectrum: Don't return upon error in removal path
  i40e: check for and deal with non-contiguous TCs
  ixgbe: Re-enable ability to toggle VLAN filtering
  ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
  ...
</content>
</entry>
<entry>
<title>rhashtable: fix shift by 64 when shrinking</title>
<updated>2016-08-15T18:10:09Z</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@oracle.com</email>
</author>
<published>2016-08-12T18:10:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12311959ecf8a3a64676c01b62ce67a0c5f0fd49'/>
<id>urn:sha1:12311959ecf8a3a64676c01b62ce67a0c5f0fd49</id>
<content type='text'>
I got this:

    ================================================================================
    UBSAN: Undefined behaviour in ./include/linux/log2.h:63:13
    shift exponent 64 is too large for 64-bit type 'long unsigned int'
    CPU: 1 PID: 721 Comm: kworker/1:1 Not tainted 4.8.0-rc1+ #87
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
    Workqueue: events rht_deferred_worker
     0000000000000000 ffff88011661f8d8 ffffffff82344f50 0000000041b58ab3
     ffffffff84f98000 ffffffff82344ea4 ffff88011661f900 ffff88011661f8b0
     0000000000000001 ffff88011661f6b8 dffffc0000000000 ffffffff867f7640
    Call Trace:
     [&lt;ffffffff82344f50&gt;] dump_stack+0xac/0xfc
     [&lt;ffffffff82344ea4&gt;] ? _atomic_dec_and_lock+0xc4/0xc4
     [&lt;ffffffff8242f5b8&gt;] ubsan_epilogue+0xd/0x8a
     [&lt;ffffffff82430c41&gt;] __ubsan_handle_shift_out_of_bounds+0x255/0x29a
     [&lt;ffffffff824309ec&gt;] ? __ubsan_handle_out_of_bounds+0x180/0x180
     [&lt;ffffffff84003436&gt;] ? nl80211_req_set_reg+0x256/0x2f0
     [&lt;ffffffff812112ba&gt;] ? print_context_stack+0x8a/0x160
     [&lt;ffffffff81200031&gt;] ? amd_pmu_reset+0x341/0x380
     [&lt;ffffffff823af808&gt;] rht_deferred_worker+0x1618/0x1790
     [&lt;ffffffff823af808&gt;] ? rht_deferred_worker+0x1618/0x1790
     [&lt;ffffffff823ae1f0&gt;] ? rhashtable_jhash2+0x370/0x370
     [&lt;ffffffff8134c12d&gt;] ? process_one_work+0x6fd/0x1970
     [&lt;ffffffff8134c1cf&gt;] process_one_work+0x79f/0x1970
     [&lt;ffffffff8134c12d&gt;] ? process_one_work+0x6fd/0x1970
     [&lt;ffffffff8134ba30&gt;] ? try_to_grab_pending+0x4c0/0x4c0
     [&lt;ffffffff8134d564&gt;] ? worker_thread+0x1c4/0x1340
     [&lt;ffffffff8134d8ff&gt;] worker_thread+0x55f/0x1340
     [&lt;ffffffff845e904f&gt;] ? __schedule+0x4df/0x1d40
     [&lt;ffffffff8134d3a0&gt;] ? process_one_work+0x1970/0x1970
     [&lt;ffffffff8134d3a0&gt;] ? process_one_work+0x1970/0x1970
     [&lt;ffffffff813642f7&gt;] kthread+0x237/0x390
     [&lt;ffffffff813640c0&gt;] ? __kthread_parkme+0x280/0x280
     [&lt;ffffffff845f8c93&gt;] ? _raw_spin_unlock_irq+0x33/0x50
     [&lt;ffffffff845f95df&gt;] ret_from_fork+0x1f/0x40
     [&lt;ffffffff813640c0&gt;] ? __kthread_parkme+0x280/0x280
    ================================================================================

roundup_pow_of_two() is undefined when called with an argument of 0, so
let's avoid the call and just fall back to ht-&gt;p.min_size (which should
never be smaller than HASH_MIN_SIZE).

Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rhashtable: avoid large lock-array allocations</title>
<updated>2016-08-15T04:12:57Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2016-08-12T10:03:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4cf0b354d92ee2c642532ee39e330f8f580fd985'/>
<id>urn:sha1:4cf0b354d92ee2c642532ee39e330f8f580fd985</id>
<content type='text'>
Sander reports following splat after netfilter nat bysrc table got
converted to rhashtable:

swapper/0: page allocation failure: order:3, mode:0x2084020(GFP_ATOMIC|__GFP_COMP)
 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.8.0-rc1 [..]
 [&lt;ffffffff811633ed&gt;] warn_alloc_failed+0xdd/0x140
 [&lt;ffffffff811638b1&gt;] __alloc_pages_nodemask+0x3e1/0xcf0
 [&lt;ffffffff811a72ed&gt;] alloc_pages_current+0x8d/0x110
 [&lt;ffffffff8117cb7f&gt;] kmalloc_order+0x1f/0x70
 [&lt;ffffffff811aec19&gt;] __kmalloc+0x129/0x140
 [&lt;ffffffff8146d561&gt;] bucket_table_alloc+0xc1/0x1d0
 [&lt;ffffffff8146da1d&gt;] rhashtable_insert_rehash+0x5d/0xe0
 [&lt;ffffffff819fcfff&gt;] nf_nat_setup_info+0x2ef/0x400

The failure happens when allocating the spinlock array.
Even with GFP_KERNEL its unlikely for such a large allocation
to succeed.

Thomas Graf pointed me at inet_ehash_locks_alloc(), so in addition
to adding NOWARN for atomic allocations this also makes the bucket-array
sizing more conservative.

In commit 095dc8e0c3686 ("tcp: fix/cleanup inet_ehash_locks_alloc()"),
Eric Dumazet says: "Budget 2 cache lines per cpu worth of 'spinlocks'".
IOW, consider size needed by a single spinlock when determining
number of locks per cpu.  So with 64 byte per cacheline and 4 byte per
spinlock this gives 32 locks per cpu.

Resulting size of the lock-array (sizeof(spinlock) == 4):

cpus:    1   2   4   8   16   32   64
old:    1k  1k  4k  8k  16k  16k  16k
new:   128 256 512  1k   2k   4k   8k

8k allocation should have decent chance of success even
with GFP_ATOMIC, and should not fail with GFP_KERNEL.

With 72-byte spinlock (LOCKDEP):
cpus :   1   2
old:    9k 18k
new:   ~2k ~4k

Reported-by: Sander Eikelenboom &lt;linux@eikelenboom.it&gt;
Suggested-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
