* [PATCH] parisc: Revise __get_user() to probe user read access
@ 2025-07-21 20:21 John David Anglin
0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2025-07-21 20:21 UTC (permalink / raw)
To: linux-parisc; +Cc: Helge Deller, James E.J. Bottomley
[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]
Resend for patchworks.
parisc: Revise __get_user() to probe user read access
This change adds __probe_user_internal() define to probe user read access.
Signed-off-by: John David Anglin <dave.anglin@bell.net>
---
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 88d0ae5769dd..6fabf38eae64 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -42,9 +42,25 @@
__gu_err; \
})
-#define __get_user(val, ptr) \
-({ \
- __get_user_internal(SR_USER, val, ptr); \
+#define __probe_user_internal(sr, error, ptr) \
+({ \
+ __asm__("\tproberi (%%sr%1,%2),3,%0\n" \
+ "\tcmpiclr,= 1,%0,%0\n" \
+ "\tldi -14,%0\n" \
+ : "=r"(error) \
+ : "i"(sr), "r"(ptr)); \
+ \
+ error; \
+})
+
+#define __get_user(val, ptr) \
+({ \
+ register long __gu_err; \
+ \
+ __gu_err = __get_user_internal(SR_USER, val, ptr); \
+ if (likely(!__gu_err)) \
+ __probe_user_internal(SR_USER, __gu_err, ptr); \
+ __gu_err; \
})
#define __get_user_asm(sr, val, ldx, ptr) \
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-21 20:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21 20:21 [PATCH] parisc: Revise __get_user() to probe user read access John David Anglin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox