<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/xtensa/include/asm/uaccess.h, branch linux-5.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-11-17T13:09:28Z</updated>
<entry>
<title>xtensa: uaccess: Add missing __user to strncpy_from_user() prototype</title>
<updated>2020-11-17T13:09:28Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2020-08-31T21:09:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc293f2106903ab9c24e9cea18c276e32c394c33'/>
<id>urn:sha1:dc293f2106903ab9c24e9cea18c276e32c394c33</id>
<content type='text'>
When adding __user annotations in commit 2adf5352a34a, the
strncpy_from_user() function declaration for the
CONFIG_GENERIC_STRNCPY_FROM_USER case was missed. Fix it.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Message-Id: &lt;20200831210937.17938-1-laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>uaccess: remove segment_eq</title>
<updated>2020-08-12T17:57:58Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2020-08-12T01:33:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=428e2976a5bf7e7f5554286d7a5a33b8147b106a'/>
<id>urn:sha1:428e2976a5bf7e7f5554286d7a5a33b8147b106a</id>
<content type='text'>
segment_eq is only used to implement uaccess_kernel.  Just open code
uaccess_kernel in the arch uaccess headers and remove one layer of
indirection.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Acked-by: Greentime Hu &lt;green.hu@gmail.com&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Nick Hu &lt;nickhu@andestech.com&gt;
Cc: Vincent Chen &lt;deanbo422@gmail.com&gt;
Cc: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;
Cc: Palmer Dabbelt &lt;palmer@dabbelt.com&gt;
Link: http://lkml.kernel.org/r/20200710135706.537715-5-hch@lst.de
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>xtensa: add missing __user annotations to asm/uaccess.h</title>
<updated>2020-05-22T23:09:00Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2020-05-22T18:40:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2adf5352a34ac65a776d709607939bc82cf9819e'/>
<id>urn:sha1:2adf5352a34ac65a776d709607939bc82cf9819e</id>
<content type='text'>
clear_user, strncpy_user, strnlen_user and their helpers operate on user
pointers, but don't have their arguments marked as __user.
Add __user annotation to userspace pointers of those functions.
Fix open-coded access check in the strnlen_user while at it.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: fix error paths in __get_user_{check,size}</title>
<updated>2020-05-22T23:09:00Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2020-05-22T22:52:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9afcc71b4f85ee9c9604c9b8349bac0eed44aa63'/>
<id>urn:sha1:9afcc71b4f85ee9c9604c9b8349bac0eed44aa63</id>
<content type='text'>
Error paths in __get_user_check and __get_user_size directly assing 0 to
the result. It causes the following sparse warnings:

  sparse: warning: Using plain integer as NULL pointer

Convert 0 to the type pointed to by the user pointer before assigning it.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: fix type conversion in __get_user_size</title>
<updated>2020-05-22T21:33:52Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2020-05-22T20:20:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c22f9075044057f130f6b73a0638a2eb78f459ad'/>
<id>urn:sha1:c22f9075044057f130f6b73a0638a2eb78f459ad</id>
<content type='text'>
8-byte access in __get_user_size converts pointer to temporary variable
to the type of original user pointer and then dereferences it, resulting
in the following sparse warning:

  sparse: warning: dereference of noderef expression

Instead dereference the original user pointer under the __typeof__ and
add indirection outside.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: add missing __user annotations to __{get,put}_user_check</title>
<updated>2020-05-22T21:32:13Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2020-05-22T17:54:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ac4a615bdb10ee7df8818ff107f974322e4c190'/>
<id>urn:sha1:3ac4a615bdb10ee7df8818ff107f974322e4c190</id>
<content type='text'>
__get_user_check and __put_user_check use temporary pointer but don't
mark it as __user, resulting in sparse warnings:

  sparse: warning: incorrect type in initializer (different address spaces)
  sparse:    expected long *__pu_addr
  sparse:    got long [noderef] &lt;asn:1&gt; *ret

  sparse: warning: incorrect type in argument 1 (different address spaces)
  sparse:    expected void [noderef] &lt;asn:1&gt; *to
  sparse:    got long *__pu_addr

Add __user annotation to temporary pointer in __get_user_check and
__put_user_check.

Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Reported-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: use "m" constraint instead of "a" in uaccess.h assembly</title>
<updated>2019-11-26T19:33:38Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2019-10-15T21:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cbc6e28703c44a321e9d8a8894ec11bc6e7e473d'/>
<id>urn:sha1:cbc6e28703c44a321e9d8a8894ec11bc6e7e473d</id>
<content type='text'>
Use "m" constraint instead of "r" for the address, as "m" allows
compiler to access adjacent locations using base + offset, while "r"
requires updating the base register every time.
Use %[mem] * 0 + v to replace offset part of %[mem] expansion with v.
It is impossible to change address alignment through the offset part on
xtensa, so just ignore offset in alignment checks.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: fix type conversion in __get_user_[no]check</title>
<updated>2019-10-14T21:14:21Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2019-10-11T03:55:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c9c63f3c7a9081e4768291514991d3208ae8a697'/>
<id>urn:sha1:c9c63f3c7a9081e4768291514991d3208ae8a697</id>
<content type='text'>
__get_user_[no]check uses temporary buffer of type long to store result
of __get_user_size and do sign extension on it when necessary. This
doesn't work correctly for 64-bit data. Fix it by moving temporary
buffer/sign extension logic to __get_user_asm.

Don't do assignment of __get_user_bad result to (x) as it may not always
be integer-compatible now and issue warning even when it's going to be
optimized. Instead do (x) = 0; and call __get_user_bad separately.

Zero initialize __x in __get_user_asm and use '+' constraint for its
assembly argument, so that its value is preserved in error cases. This
may add at most 1 cycle to the fast path, but saves an instruction and
two padding bytes in the fixup section for each use of this macro and
works for both misaligned store and store exception.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: clean up assembly arguments in uaccess macros</title>
<updated>2019-10-14T19:58:06Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2019-10-10T02:41:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c0437642966fd32b827034af6f00eecd80b89325'/>
<id>urn:sha1:c0437642966fd32b827034af6f00eecd80b89325</id>
<content type='text'>
Numeric assembly arguments are hard to understand and assembly code that
uses them is hard to modify. Use named arguments in __check_align_*,
__get_user_asm and __put_user_asm. Modify macro parameter names so that
they don't affect argument names. Use '+' constraint for the [err]
argument instead of having it as both input and output.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: fix {get,put}_user() for 64bit values</title>
<updated>2019-10-14T18:39:50Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-09T19:21:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6595d144decec396bf2e2efee27e50634a4b627f'/>
<id>urn:sha1:6595d144decec396bf2e2efee27e50634a4b627f</id>
<content type='text'>
First of all, on short copies __copy_{to,from}_user() return the amount
of bytes left uncopied, *not* -EFAULT.  get_user() and put_user() are
expected to return -EFAULT on failure.

Another problem is get_user(v32, (__u64 __user *)p); that should
fetch 64bit value and the assign it to v32, truncating it in process.
Current code, OTOH, reads 8 bytes of data and stores them at the
address of v32, stomping on the 4 bytes that follow v32 itself.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
</feed>
