<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/strnlen_user.c, branch v3.18.37</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.37</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.37'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-06-09T18:31:43Z</updated>
<entry>
<title>lib: Fix strnlen_user() to not touch memory after specified maximum</title>
<updated>2015-06-09T18:31:43Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2015-06-02T15:10:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bfad74288efce9d33b26ea2a694406d4e0727a20'/>
<id>urn:sha1:bfad74288efce9d33b26ea2a694406d4e0727a20</id>
<content type='text'>
[ Upstream commit f18c34e483ff6b1d9866472221e4015b3a4698e4 ]

If the specified maximum length of the string is a multiple of unsigned
long, we would load one long behind the specified maximum.  If that
happens to be in a next page, we can hit a page fault although we were
not expected to.

Fix the off-by-one bug in the test whether we are at the end of the
specified range.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>lib: Fix generic strnlen_user for 32-bit big-endian machines</title>
<updated>2012-05-28T03:59:46Z</updated>
<author>
<name>Paul Mackerras</name>
<email>paulus@samba.org</email>
</author>
<published>2012-05-28T02:59:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=69ea6405980f217557b6a58f70ff60d8d88519a5'/>
<id>urn:sha1:69ea6405980f217557b6a58f70ff60d8d88519a5</id>
<content type='text'>
The aligned_byte_mask() definition is wrong for 32-bit big-endian
machines: the "7-(n)" part of the definition assumes a long is 8
bytes.  This fixes it by using BITS_PER_LONG - 8 instead of 8*7.
Tested on 32-bit and 64-bit PowerPC.

Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: add generic strnlen_user() function</title>
<updated>2012-05-26T18:33:53Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-05-26T18:06:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a08c5356a3aaf638c41897ae4169de18db89595e'/>
<id>urn:sha1:a08c5356a3aaf638c41897ae4169de18db89595e</id>
<content type='text'>
This adds a new generic optimized strnlen_user() function that uses the
&lt;asm/word-at-a-time.h&gt; infrastructure to portably do efficient string
handling.

In many ways, strnlen is much simpler than strncpy, and in particular we
can always pre-align the words we load from memory.  That means that all
the worries about alignment etc are a non-issue, so this one can easily
be used on any architecture.  You obviously do have to do the
appropriate word-at-a-time.h macros.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
