lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <158835734479.8414.1154640678275011655.tip-bot2@tip-bot2>
Date:   Fri, 01 May 2020 18:22:24 -0000
From:   "tip-bot2 for Konstantin Khlebnikov" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Steven Rostedt (VMware)" <rostedt@...dmis.org>,
        x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: x86/urgent] ftrace/x86: Fix trace event registration for
 syscalls without arguments

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     fdc63ff0e49c588884992b4b2656345a5e878b32
Gitweb:        https://git.kernel.org/tip/fdc63ff0e49c588884992b4b2656345a5e878b32
Author:        Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
AuthorDate:    Wed, 08 Apr 2020 21:13:10 +03:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Fri, 01 May 2020 19:15:40 +02:00

ftrace/x86: Fix trace event registration for syscalls without arguments

The refactoring of SYSCALL_DEFINE0() macros removed the ABI stubs and
simply defines __abi_sys_$NAME as alias of __do_sys_$NAME.

As a result kallsyms_lookup() returns "__do_sys_$NAME" which does not match
with the declared trace event name.

See also commit 1c758a2202a6 ("tracing/x86: Update syscall trace events to
handle new prefixed syscall func names").

Add __do_sys_ to the valid prefixes which are checked in
arch_syscall_match_sym_name().

Fixes: d2b5de495ee9 ("x86/entry: Refactor SYSCALL_DEFINE0 macros")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
Link: https://lkml.kernel.org/r/158636958997.7900.16485049455470033557.stgit@buzz

---
 arch/x86/include/asm/ftrace.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 85be2f5..70b96ca 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -61,11 +61,12 @@ 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
-	 * "__x64_sys", "__ia32_sys" or simple "sys" prefix.
+	 * "__x64_sys", "__ia32_sys", "__do_sys" or simple "sys" prefix.
 	 */
 	return !strcmp(sym + 3, name + 3) ||
 		(!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
-		(!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3));
+		(!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3)) ||
+		(!strncmp(sym, "__do_sys", 8) && !strcmp(sym + 8, name + 3));
 }
 
 #ifndef COMPILE_OFFSETS

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ