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-2-zouyipeng@huawei.com>
Date:   Sat, 17 Sep 2022 09:55:21 +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 1/2] kprobes: make arch_init_kprobes 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/csky/kernel/probes/kprobes.c  | 5 -----
 arch/riscv/kernel/probes/kprobes.c | 5 -----
 arch/s390/kernel/kprobes.c         | 5 -----
 arch/x86/kernel/kprobes/core.c     | 5 -----
 kernel/kprobes.c                   | 5 +++++
 5 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/arch/csky/kernel/probes/kprobes.c b/arch/csky/kernel/probes/kprobes.c
index 3c6e5c725d81..d31b6ab5cea0 100644
--- a/arch/csky/kernel/probes/kprobes.c
+++ b/arch/csky/kernel/probes/kprobes.c
@@ -405,8 +405,3 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p)
 {
 	return 0;
 }
-
-int __init arch_init_kprobes(void)
-{
-	return 0;
-}
diff --git a/arch/riscv/kernel/probes/kprobes.c b/arch/riscv/kernel/probes/kprobes.c
index e6e950b7cf32..d4577108e5c9 100644
--- a/arch/riscv/kernel/probes/kprobes.c
+++ b/arch/riscv/kernel/probes/kprobes.c
@@ -362,8 +362,3 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p)
 {
 	return 0;
 }
-
-int __init arch_init_kprobes(void)
-{
-	return 0;
-}
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 0032bdbe8e3f..aaf9329a7cf4 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -544,11 +544,6 @@ int kprobe_exceptions_notify(struct notifier_block *self,
 }
 NOKPROBE_SYMBOL(kprobe_exceptions_notify);
 
-int __init arch_init_kprobes(void)
-{
-	return 0;
-}
-
 int arch_trampoline_kprobe(struct kprobe *p)
 {
 	return 0;
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 4c3c27b6aea3..e26b336f8b18 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -1055,11 +1055,6 @@ int __init arch_populate_kprobe_blacklist(void)
 					 (unsigned long)__entry_text_end);
 }
 
-int __init arch_init_kprobes(void)
-{
-	return 0;
-}
-
 int arch_trampoline_kprobe(struct kprobe *p)
 {
 	return 0;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index ca9d834d0b84..23f6d329b53b 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -2684,6 +2684,11 @@ void kprobe_free_init_mem(void)
 	mutex_unlock(&kprobe_mutex);
 }
 
+int __init __weak arch_init_kprobes(void)
+{
+	return 0;
+}
+
 static int __init init_kprobes(void)
 {
 	int i, err = 0;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ