<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/xtensa/include/asm/uaccess.h, branch linux-5.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-03-04T18:50:14Z</updated>
<entry>
<title>get rid of legacy 'get_ds()' function</title>
<updated>2019-03-04T18:50:14Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2019-03-04T18:39:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=736706bee3298208343a76096370e4f6a5c55915'/>
<id>urn:sha1:736706bee3298208343a76096370e4f6a5c55915</id>
<content type='text'>
Every in-kernel use of this function defined it to KERNEL_DS (either as
an actual define, or as an inline function).  It's an entirely
historical artifact, and long long long ago used to actually read the
segment selector valueof '%ds' on x86.

Which in the kernel is always KERNEL_DS.

Inspired by a patch from Jann Horn that just did this for a very small
subset of users (the ones in fs/), along with Al who suggested a script.
I then just took it to the logical extreme and removed all the remaining
gunk.

Roughly scripted with

   git grep -l '(get_ds())' -- :^tools/ | xargs sed -i 's/(get_ds())/(KERNEL_DS)/'
   git grep -lw 'get_ds' -- :^tools/ | xargs sed -i '/^#define get_ds()/d'

plus manual fixups to remove a few unusual usage patterns, the couple of
inline function cases and to fix up a comment that had become stale.

The 'get_ds()' function remains in an x86 kvm selftest, since in user
space it actually does something relevant.

Inspired-by: Jann Horn &lt;jannh@google.com&gt;
Inspired-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>Remove 'type' argument from access_ok() function</title>
<updated>2019-01-04T02:57:57Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2019-01-04T02:57:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=96d4f267e40f9509e8a66e2b39e8b95655617693'/>
<id>urn:sha1:96d4f267e40f9509e8a66e2b39e8b95655617693</id>
<content type='text'>
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
of the user address range verification function since we got rid of the
old racy i386-only code to walk page tables by hand.

It existed because the original 80386 would not honor the write protect
bit when in kernel mode, so you had to do COW by hand before doing any
user access.  But we haven't supported that in a long time, and these
days the 'type' argument is a purely historical artifact.

A discussion about extending 'user_access_begin()' to do the range
checking resulted this patch, because there is no way we're going to
move the old VERIFY_xyz interface to that model.  And it's best done at
the end of the merge window when I've done most of my merges, so let's
just get this done once and for all.

This patch was mostly done with a sed-script, with manual fix-ups for
the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.

There were a couple of notable cases:

 - csky still had the old "verify_area()" name as an alias.

 - the iter_iov code had magical hardcoded knowledge of the actual
   values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
   really used it)

 - microblaze used the type argument for a debug printout

but other than those oddities this should be a total no-op patch.

I tried to fix up all architectures, did fairly extensive grepping for
access_ok() uses, and the changes are trivial, but I may have missed
something.  Any missed conversion should be trivially fixable, though.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>xtensa: don't use l32r opcode directly</title>
<updated>2018-12-05T20:53:07Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2018-12-05T20:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=037602705109ec2ab96340bea93ad87daa3ac046'/>
<id>urn:sha1:037602705109ec2ab96340bea93ad87daa3ac046</id>
<content type='text'>
xtensa assembler is capable of representing register loads with either
movi + addmi, l32r or const16, depending on the core configuration.
Don't use '.literal' and 'l32r' directly in the code, use 'movi' and let
the assembler relax them.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: use generic strncpy_from_user with KASAN</title>
<updated>2017-12-17T23:34:57Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2017-12-17T22:43:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=57358ba9564a0520f870dc14a0f91e7dacc18236'/>
<id>urn:sha1:57358ba9564a0520f870dc14a0f91e7dacc18236</id>
<content type='text'>
This enables KASAN check of the destination buffer.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>xtensa: use __memset in __xtensa_clear_user</title>
<updated>2017-12-17T06:37:13Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2017-12-05T05:20:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e0baa01438d3fa3979f94f98be19ca3df88e0b7c'/>
<id>urn:sha1:e0baa01438d3fa3979f94f98be19ca3df88e0b7c</id>
<content type='text'>
memset on xtensa is capable of accessing user memory, but KASAN checks
if memset function is actually used for that and reports it as an error:

 ==================================================================
 BUG: KASAN: user-memory-access in padzero+0x4d/0x58
 Write of size 519 at addr 0049ddf9 by task init/1

 Call Trace:
  [&lt;b0189978&gt;] kasan_report+0x160/0x238
  [&lt;b0188818&gt;] check_memory_region+0xf8/0x100
  [&lt;b018891c&gt;] memset+0x20/0x34
  [&lt;b0238b71&gt;] padzero+0x4d/0x58
 ==================================================================

Use __memset in __xtensa_clear_user to avoid that.

Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
</entry>
<entry>
<title>get rid of unused __strncpy_from_user() instances</title>
<updated>2017-05-16T03:40:28Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2017-04-07T21:54:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=10503bf9435f304b7a74ebfdb8571dec001d751c'/>
<id>urn:sha1:10503bf9435f304b7a74ebfdb8571dec001d751c</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>kill strlen_user()</title>
<updated>2017-05-16T03:40:22Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2017-04-07T21:20:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82985258390e85289940d3663344197344e071f2'/>
<id>urn:sha1:82985258390e85289940d3663344197344e071f2</id>
<content type='text'>
no callers, no consistent semantics, no sane way to use it...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>xtensa: fix prefetch in the raw_copy_to_user</title>
<updated>2017-04-04T20:53:13Z</updated>
<author>
<name>Max Filippov</name>
</author>
<published>2017-04-04T20:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7d4914db8fda6d38d92b1b8a740bafbd6c6d89a1'/>
<id>urn:sha1:7d4914db8fda6d38d92b1b8a740bafbd6c6d89a1</id>
<content type='text'>
'from' is the input buffer, it should be prefetched with prefetch, not
prefetchw.

Tested-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
Signed-off-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>xtensa: get rid of zeroing, use RAW_COPY_USER</title>
<updated>2017-03-28T22:24:07Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2017-03-22T17:02:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a0e75adecc8da026a5befb2c5828d08c999373c'/>
<id>urn:sha1:3a0e75adecc8da026a5befb2c5828d08c999373c</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>xtensa: switch to generic extable.h</title>
<updated>2017-03-28T22:24:07Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2016-12-25T19:34:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0b46a94e84c1323d54f8b82eacd3143400fb9521'/>
<id>urn:sha1:0b46a94e84c1323d54f8b82eacd3143400fb9521</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
