Skip to contentSkip to conversation

powerpc: Remove direct call to personality syscall handler

PATCH Superseded Rohan McLure 2 participants 2 messages Jul 25, 2022 – Aug 1, 2022 PowerPC

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/14 powerpc: Remove direct call to personality syscall handler

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>.

---
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(-)
arch/powerpc/kernel/syscalls.c +1 -1
index ca20083dd0ae..22755502afc0 100644
@@ -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;
Signature · 1 line
2.34.1
Reviewed-by on v2 2/14
#1 lore raw
Quoted 8 lines · Rohan McLure

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>.

Quoted 23 lines

---
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(-)
arch/powerpc/kernel/syscalls.c +0 -0
index ca20083dd0ae..22755502afc0 100644
@@ -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;