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: <20211108101157.15189-34-bp@alien8.de>
Date:   Mon,  8 Nov 2021 11:11:48 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     linux-mips@...r.kernel.org
Subject: [PATCH v0 33/42] mips: Check notifier registration return value

From: Borislav Petkov <bp@...e.de>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: linux-mips@...r.kernel.org
---
 arch/mips/kernel/relocate.c     | 6 ++++--
 arch/mips/sgi-ip22/ip22-reset.c | 4 +++-
 arch/mips/sgi-ip32/ip32-reset.c | 4 +++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/relocate.c b/arch/mips/kernel/relocate.c
index 56b51de2dc51..d577654242da 100644
--- a/arch/mips/kernel/relocate.c
+++ b/arch/mips/kernel/relocate.c
@@ -459,8 +459,10 @@ static struct notifier_block kernel_location_notifier = {
 
 static int __init register_kernel_offset_dumper(void)
 {
-	atomic_notifier_chain_register(&panic_notifier_list,
-				       &kernel_location_notifier);
+	if (atomic_notifier_chain_register(&panic_notifier_list,
+					   &kernel_location_notifier))
+		pr_warn("Kernel location notifier already registered\n");
+
 	return 0;
 }
 __initcall(register_kernel_offset_dumper);
diff --git a/arch/mips/sgi-ip22/ip22-reset.c b/arch/mips/sgi-ip22/ip22-reset.c
index 9028dbbb45dd..841fd31cac03 100644
--- a/arch/mips/sgi-ip22/ip22-reset.c
+++ b/arch/mips/sgi-ip22/ip22-reset.c
@@ -196,7 +196,9 @@ static int __init reboot_setup(void)
 	}
 
 	timer_setup(&blink_timer, blink_timeout, 0);
-	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
+
+	if (atomic_notifier_chain_register(&panic_notifier_list, &panic_block))
+		pr_warn("Panic notifier already registered\n");
 
 	return 0;
 }
diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c
index 18d1c115cd53..bdad9213f81b 100644
--- a/arch/mips/sgi-ip32/ip32-reset.c
+++ b/arch/mips/sgi-ip32/ip32-reset.c
@@ -145,7 +145,9 @@ static __init int ip32_reboot_setup(void)
 	pm_power_off = ip32_machine_halt;
 
 	timer_setup(&blink_timer, blink_timeout, 0);
-	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
+
+	if (atomic_notifier_chain_register(&panic_notifier_list, &panic_block))
+		pr_warn("Panic notifier already registered\n");
 
 	return 0;
 }
-- 
2.29.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ