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: <20230427133350.31064-8-oneukum@suse.com>
Date:   Thu, 27 Apr 2023 15:33:49 +0200
From:   Oliver Neukum <oneukum@...e.com>
To:     wim@...ux-watchdog.org, linux@...ck-us.net,
        linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Oliver Neukum <oneukum@...e.com>
Subject: [PATCH 7/8] usb_pcwd: WDIOC_SETTIMEOUT: prevent preemption

Delays between altering the watchdog
and giving the keepalive need to be controlled.
Do not allow preemption.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Oliver Neukum <oneukum@...e.com>
---
 drivers/watchdog/pcwd_usb.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 50ba88019ed6..09cae7a6ad07 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -459,10 +459,14 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
 		if (get_user(new_heartbeat, p))
 			return -EFAULT;
 
-		if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat))
+		preempt_disable(); /* we are on a clock now */
+		if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat)) {
+			preempt_enable();
 			return -EINVAL;
+		}
 
 		usb_pcwd_keepalive(usb_pcwd_device);
+		preempt_enable();
 	}
 		fallthrough;
 
-- 
2.40.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ