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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230327-tegra-pmic-reboot-v5-4-ab090e03284d@skidata.com>
Date:   Tue, 18 Apr 2023 13:10:03 +0200
From:   Benjamin Bara <bbara93@...il.com>
To:     Wolfram Sang <wsa@...nel.org>, Lee Jones <lee@...nel.org>,
        rafael.j.wysocki@...el.com
Cc:     dmitry.osipenko@...labora.com, peterz@...radead.org,
        jonathanh@...dia.com, richard.leitner@...ux.dev,
        treding@...dia.com, linux-kernel@...r.kernel.org,
        linux-i2c@...r.kernel.org, linux-tegra@...r.kernel.org,
        Benjamin Bara <benjamin.bara@...data.com>
Subject: [PATCH v5 4/6] kernel/reboot: sys_off_notify: always return
 NOTIFY_DONE

From: Benjamin Bara <benjamin.bara@...data.com>

A failed sys_off_handler should not be able to skip other registered
handlers. Therefore, report the error but always return NOTIFY_DONE, to
indicate that atomic_notifier_call_chain() should continue.

Signed-off-by: Benjamin Bara <benjamin.bara@...data.com>
---
 kernel/reboot.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/reboot.c b/kernel/reboot.c
index 395a0ea3c7a8..689a147bc1dc 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -320,6 +320,7 @@ static int sys_off_notify(struct notifier_block *nb,
 {
 	struct sys_off_handler *handler;
 	struct sys_off_data data = {};
+	int ret;
 
 	handler = container_of(nb, struct sys_off_handler, nb);
 	data.cb_data = handler->cb_data;
@@ -327,7 +328,11 @@ static int sys_off_notify(struct notifier_block *nb,
 	data.cmd = cmd;
 	data.dev = handler->dev;
 
-	return handler->sys_off_cb(&data);
+	ret = handler->sys_off_cb(&data);
+	if (ret != NOTIFY_DONE)
+		dev_err(handler->dev, "sys_off_handler failed: %d\n", notifier_to_errno(ret));
+
+	return NOTIFY_DONE;
 }
 
 static struct sys_off_handler platform_sys_off_handler;

-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ