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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220917015522.44583-3-zouyipeng@huawei.com>
Date:   Sat, 17 Sep 2022 09:55:22 +0800
From:   Yipeng Zou <zouyipeng@...wei.com>
To:     <x86@...nel.org>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <linux-csky@...r.kernel.org>,
        <linux-riscv@...ts.infradead.org>,
        <linux-perf-users@...r.kernel.org>, <linux-s390@...r.kernel.org>,
        <guoren@...nel.org>, <paul.walmsley@...ive.com>,
        <palmer@...belt.com>, <hca@...ux.ibm.com>, <gor@...ux.ibm.com>,
        <borntraeger@...ux.ibm.com>, <dave.hansen@...ux.intel.com>,
        <hpa@...or.com>, <naveen.n.rao@...ux.ibm.com>,
        <anil.s.keshavamurthy@...el.com>, <mhiramat@...nel.org>,
        <namit@...are.com>, <catalin.marinas@....com>,
        <peterz@...radead.org>, <mark.rutland@....com>
CC:     <liaochang1@...wei.com>, <chris.zjh@...wei.com>,
        <zouyipeng@...wei.com>
Subject: [PATCH 2/2] uprobes: make arch_uprobe_exception_notify as weak

The function implementation under some arch does nothing.
We can mark it with weak attributes to improve.

Signed-off-by: Yipeng Zou <zouyipeng@...wei.com>
---
 arch/arm/probes/uprobes/core.c     | 6 ------
 arch/arm64/kernel/probes/uprobes.c | 6 ------
 arch/csky/kernel/probes/uprobes.c  | 6 ------
 arch/riscv/kernel/probes/uprobes.c | 6 ------
 kernel/events/uprobes.c            | 6 ++++++
 5 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/arch/arm/probes/uprobes/core.c b/arch/arm/probes/uprobes/core.c
index f5f790c6e5f8..535ea1b355ed 100644
--- a/arch/arm/probes/uprobes/core.c
+++ b/arch/arm/probes/uprobes/core.c
@@ -175,12 +175,6 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
 	instruction_pointer_set(regs, utask->vaddr);
 }
 
-int arch_uprobe_exception_notify(struct notifier_block *self,
-				 unsigned long val, void *data)
-{
-	return NOTIFY_DONE;
-}
-
 static int uprobe_trap_handler(struct pt_regs *regs, unsigned int instr)
 {
 	unsigned long flags;
diff --git a/arch/arm64/kernel/probes/uprobes.c b/arch/arm64/kernel/probes/uprobes.c
index d49aef2657cd..687ede3375a6 100644
--- a/arch/arm64/kernel/probes/uprobes.c
+++ b/arch/arm64/kernel/probes/uprobes.c
@@ -159,12 +159,6 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr,
 	return orig_ret_vaddr;
 }
 
-int arch_uprobe_exception_notify(struct notifier_block *self,
-				 unsigned long val, void *data)
-{
-	return NOTIFY_DONE;
-}
-
 static int uprobe_breakpoint_handler(struct pt_regs *regs,
 				     unsigned long esr)
 {
diff --git a/arch/csky/kernel/probes/uprobes.c b/arch/csky/kernel/probes/uprobes.c
index 2d31a12e46cf..67ff13d960e8 100644
--- a/arch/csky/kernel/probes/uprobes.c
+++ b/arch/csky/kernel/probes/uprobes.c
@@ -132,12 +132,6 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr,
 	return ra;
 }
 
-int arch_uprobe_exception_notify(struct notifier_block *self,
-				 unsigned long val, void *data)
-{
-	return NOTIFY_DONE;
-}
-
 int uprobe_breakpoint_handler(struct pt_regs *regs)
 {
 	if (uprobe_pre_sstep_notifier(regs))
diff --git a/arch/riscv/kernel/probes/uprobes.c b/arch/riscv/kernel/probes/uprobes.c
index c976a21cd4bd..770f16c6e00f 100644
--- a/arch/riscv/kernel/probes/uprobes.c
+++ b/arch/riscv/kernel/probes/uprobes.c
@@ -131,12 +131,6 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr,
 	return ra;
 }
 
-int arch_uprobe_exception_notify(struct notifier_block *self,
-				 unsigned long val, void *data)
-{
-	return NOTIFY_DONE;
-}
-
 bool uprobe_breakpoint_handler(struct pt_regs *regs)
 {
 	if (uprobe_pre_sstep_notifier(regs))
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index d9e357b7e17c..33e637f7a202 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -2343,6 +2343,12 @@ int uprobe_post_sstep_notifier(struct pt_regs *regs)
 	return 1;
 }
 
+int __weak arch_uprobe_exception_notify(struct notifier_block *self,
+				 unsigned long val, void *data)
+{
+	return NOTIFY_DONE;
+}
+
 static struct notifier_block uprobe_exception_nb = {
 	.notifier_call		= arch_uprobe_exception_notify,
 	.priority		= INT_MAX-1,	/* notified after kprobes, kgdb */
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ