<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/riscv/kernel/compat_syscall_table.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-08-23T21:16:36Z</updated>
<entry>
<title>riscv: Implement syscall wrappers</title>
<updated>2023-08-23T21:16:36Z</updated>
<author>
<name>Sami Tolvanen</name>
</author>
<published>2023-07-10T18:35:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08d0ce30e0e4fcb5f06c90fe40387b1ce9324833'/>
<id>urn:sha1:08d0ce30e0e4fcb5f06c90fe40387b1ce9324833</id>
<content type='text'>
Commit f0bddf50586d ("riscv: entry: Convert to generic entry") moved
syscall handling to C code, which exposed function pointer type
mismatches that trip fine-grained forward-edge Control-Flow Integrity
(CFI) checks as syscall handlers are all called through the same
syscall_t pointer type. To fix the type mismatches, implement pt_regs
based syscall wrappers similarly to x86 and arm64.

This patch is based on arm64 syscall wrappers added in commit
4378a7d4be30 ("arm64: implement syscall wrappers"), where the main goal
was to minimize the risk of userspace-controlled values being used
under speculation. This may be a concern for riscv in future as well.

Following other architectures, the syscall wrappers generate three
functions for each syscall; __riscv_&lt;compat_&gt;sys_&lt;name&gt; takes a pt_regs
pointer and extracts arguments from registers, __se_&lt;compat_&gt;sys_&lt;name&gt;
is a sign-extension wrapper that casts the long arguments to the
correct types for the real syscall implementation, which is named
__do_&lt;compat_&gt;sys_&lt;name&gt;.

Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Signed-off-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Link: https://lore.kernel.org/r/20230710183544.999540-9-samitolvanen@google.com
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>riscv: compat: syscall: Add compat_sys_call_table implementation</title>
<updated>2022-04-26T20:36:25Z</updated>
<author>
<name>Guo Ren</name>
</author>
<published>2022-04-05T07:13:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59c10c52f573faca862cda5ebcdd43831608eb5a'/>
<id>urn:sha1:59c10c52f573faca862cda5ebcdd43831608eb5a</id>
<content type='text'>
Implement compat sys_call_table and some system call functions:
truncate64, ftruncate64, fallocate, pread64, pwrite64,
sync_file_range, readahead, fadvise64_64 which need argument
translation.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@kernel.org&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Tested-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Link: https://lore.kernel.org/r/20220405071314.3225832-12-guoren@kernel.org
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
</feed>
