aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/conf/init.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-05-23 19:54:55 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-05-23 19:59:39 +0300
commit6a7073e5f262db9a4578ff00b5b28e34335564ce (patch)
tree38294048ff12b2abc6fc9c2fe967eae9d7b8c3b7 /arch/riscv64/conf/init.c
parentc18ec832ed592e4c6171139a8aaadde827cb13da (diff)
downloadkmi-6a7073e5f262db9a4578ff00b5b28e34335564ce.tar.gz
kmi-6a7073e5f262db9a4578ff00b5b28e34335564ce.zip
improve id handling
+ The number of allowed threads running at the same time is limited to num_tids, but each thread's ID can be any larger than that. This should make ID reuse a lot more rare, and probably makes certain kinds of time-of-check-to-time-of-use attacks more difficult
Diffstat (limited to 'arch/riscv64/conf/init.c')
-rw-r--r--arch/riscv64/conf/init.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/riscv64/conf/init.c b/arch/riscv64/conf/init.c
index 6783283..293d5e8 100644
--- a/arch/riscv64/conf/init.c
+++ b/arch/riscv64/conf/init.c
@@ -255,13 +255,12 @@ static void *sys_req_sharedmem(long tid, unsigned long size, void **cbuf)
static char *rw_buf = 0;
static size_t rw_buf_size = 4096;
-void callback(long status, long tid, long d0, long d1, long d2, long d3)
+void callback(long pid, long tid, long d0, long d1, long d2, long d3)
{
- (void)status;
-
+ (void)tid;
if (d0 == 1) {
void *cbuf = 0;
- rw_buf = sys_req_sharedmem(tid, rw_buf_size, &cbuf);
+ rw_buf = sys_req_sharedmem(pid, rw_buf_size, &cbuf);
sys_ipc_resp((long)cbuf, rw_buf_size, 0, 0);
__builtin_unreachable();