From 05e59e5fb0064c97a1c10921ecd549f2d4a58565 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 09 Oct 2024 06:14:40 +0000
Subject: [PATCH] add REDIRECT
---
kernel/arch/microblaze/include/asm/futex.h | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/arch/microblaze/include/asm/futex.h b/kernel/arch/microblaze/include/asm/futex.h
index 2572077..86131ed 100644
--- a/kernel/arch/microblaze/include/asm/futex.h
+++ b/kernel/arch/microblaze/include/asm/futex.h
@@ -34,7 +34,8 @@
{
int oldval = 0, ret;
- pagefault_disable();
+ if (!access_ok(uaddr, sizeof(u32)))
+ return -EFAULT;
switch (op) {
case FUTEX_OP_SET:
@@ -56,8 +57,6 @@
ret = -ENOSYS;
}
- pagefault_enable();
-
if (!ret)
*oval = oldval;
@@ -71,7 +70,7 @@
int ret = 0, cmp;
u32 prev;
- if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
+ if (!access_ok(uaddr, sizeof(u32)))
return -EFAULT;
__asm__ __volatile__ ("1: lwx %1, %3, r0; \
--
Gitblit v1.6.2