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-next>] [day] [month] [year] [list]
Date:	Thu, 10 Jul 2008 14:27:11 -0500
From:	Mark Rustad <mrustad@...il.com>
To:	openipmi-developer@...ts.sourceforge.net
Cc:	linux-kernel@...r.kernel.org, wim@...ana.be
Subject: [PATCH] IPMI: return correct value from ipmi_write

From: Mark Rustad <MRustad@...il.com>

This patch corrects the handling of write operations to the IPMI watchdog
to work as intended by returning the number of characters actually
processed. Without this patch, an "echo V >/dev/watchdog" enables the
watchdog if IPMI is providing the watchdog function.

Signed-off-by: Mark Rustad <MRustad@...il.com>
---
I have not checked all of the watchdogs to see if there are others that have
this problem, but the one I was using before using the IPMI one did work
right. It was also a big surprise how much the default watchdog timeout
varies from one to another. Let me tell you that the 10 second default
for the IPMI watchdog was a real sore spot while tracking this problem down!
This problem goes back at least as far as 2.6.20, but I generated this patch
based on 2.6.26-rc9. I have applied, compiled and tested this fix.

 drivers/char/ipmi/ipmi_watchdog.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/char/ipmi/ipmi_watchdog.c	2008-07-10 09:31:52.000000000 -0500
+++ b/drivers/char/ipmi/ipmi_watchdog.c	2008-07-10 09:33:41.000000000 -0500
@@ -755,9 +755,8 @@ static ssize_t ipmi_write(struct file *f
 		rv = ipmi_heartbeat();
 		if (rv)
 			return rv;
-		return 1;
 	}
-	return 0;
+	return len;
 }
 
 static ssize_t ipmi_read(struct file *file,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ