Skip to contentSkip to conversation

Patch "powerpc/trace/syscalls: Update syscall name matching logic" has been added to the 3.18-stable tree

DISCUSSION Naveen N. Rao 1 participant 1 message Jun 19, 2018 1 message not in the archive Stable branch

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 8 lines · [email protected] wrote:

This is a note to let you know that I've just added the patch titled

powerpc/trace/syscalls: Update syscall name matching logic

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

The filename of the patch is:
powerpc-trace-syscalls-update-syscall-name-matching-logic.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Please drop this patch from v3.18 as this depends on commit e145242ea0df6, which I don't see backported to v3.18.

Thanks,
Naveen

Quoted 55 lines

From foo@baz Sun Jun 17 13:19:44 CEST 2018
From: "Naveen N. Rao" <[email protected]>
Date: Fri, 4 May 2018 18:44:24 +0530
Subject: powerpc/trace/syscalls: Update syscall name matching logic

From: "Naveen N. Rao" <[email protected]>

[ Upstream commit 0b7758aaf6543b9a10c8671db559e9d374a3fd95 ]

On powerpc64 ABIv1, we are enabling syscall tracing for only ~20 syscalls. This is due to commit e145242ea0df6 ("syscalls/core, syscalls/x86: Clean up syscall stub naming convention") which has changed the syscall entry wrapper prefix from "SyS" to "__se_sys".

Update the logic for ABIv1 to not just skip the initial dot, but also the "__se_sys" prefix.

Fixes commit e145242ea0df6 ("syscalls/core, syscalls/x86: Clean up syscall stub naming convention")
---
 arch/powerpc/include/asm/ftrace.h |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
arch/powerpc/include/asm/ftrace.h +3 -7
@@ -65,13 +65,9 @@ struct dyn_arch_ftrace {
 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
 static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
 {
-	/*
-	 * Compare the symbol name with the system call name. Skip the .sys or .SyS
-	 * prefix from the symbol name and the sys prefix from the system call name and
-	 * just match the rest. This is only needed on ppc64 since symbol names on
-	 * 32bit do not start with a period so the generic function will work.
-	 */
-	return !strcmp(sym + 4, name + 3);
+	/* We need to skip past the initial dot, and the __se_sys alias */
+	return !strcmp(sym + 1, name) ||
+		(!strncmp(sym, ".__se_sys", 9) && !strcmp(sym + 6, name));
 }
 #endif
 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 && !__ASSEMBLY__ */

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/powerpc-trace-syscalls-update-syscall-name-matching-logic.patch