[PATCH v2 02/14] powerpc: Remove direct call to personality syscall handler

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE1527d

2 messages, 2 authors, 2022-08-01 · open the first message on its own page

[PATCH v2 02/14] powerpc: Remove direct call to personality syscall handler

From: Rohan McLure <hidden>
Date: 2022-07-25 06:26:08

Syscall handlers should not be invoked internally by their symbol names,
as these symbols defined by the architecture-defined SYSCALL_DEFINE
macro. Fortunately, in the case of ppc64_personality, its call to
sys_personality can be replaced with an invocation to the
equivalent ksys_personality inline helper in <linux/syscalls.h>.

Signed-off-by: Rohan McLure <redacted>
---
V1 -> V2: Use inline helper to deduplicate bodies in compat/regular
implementations.
---
 arch/powerpc/kernel/syscalls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index ca20083dd0ae..22755502afc0 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -89,7 +89,7 @@ static inline long do_ppc64_personality(unsigned long personality)
 	if (personality(current->personality) == PER_LINUX32
 	    && personality(personality) == PER_LINUX)
 		personality = (personality & ~PER_MASK) | PER_LINUX32;
-	ret = sys_personality(personality);
+	ret = ksys_personality(personality);
 	if (personality(ret) == PER_LINUX32)
 		ret = (ret & ~PER_MASK) | PER_LINUX;
 	return ret;
-- 
2.34.1

Re: [PATCH v2 02/14] powerpc: Remove direct call to personality syscall handler

From: Andrew Donnellan <hidden>
Date: 2022-08-01 10:01:34

On Mon, 2022-07-25 at 16:25 +1000, Rohan McLure wrote:
Syscall handlers should not be invoked internally by their symbol
names,
as these symbols defined by the architecture-defined SYSCALL_DEFINE
macro. Fortunately, in the case of ppc64_personality, its call to
sys_personality can be replaced with an invocation to the
equivalent ksys_personality inline helper in <linux/syscalls.h>.

Signed-off-by: Rohan McLure <redacted>
Reviewed-by: Andrew Donnellan <redacted>
quoted hunk
---
V1 -> V2: Use inline helper to deduplicate bodies in compat/regular
implementations.
---
 arch/powerpc/kernel/syscalls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/syscalls.c
b/arch/powerpc/kernel/syscalls.c
index ca20083dd0ae..22755502afc0 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -89,7 +89,7 @@ static inline long do_ppc64_personality(unsigned
long personality)
        if (personality(current->personality) == PER_LINUX32
            && personality(personality) == PER_LINUX)
                personality = (personality & ~PER_MASK) |
PER_LINUX32;
-       ret = sys_personality(personality);
+       ret = ksys_personality(personality);
        if (personality(ret) == PER_LINUX32)
                ret = (ret & ~PER_MASK) | PER_LINUX;
        return ret;

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help