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]
Date:	Thu, 30 May 2013 08:03:06 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	Michal Simek <monstr@...str.eu>
Cc:	Michal Simek <michal.simek@...inx.com>,
	linux-kernel@...r.kernel.org, Wim Van Sebroeck <wim@...ana.be>,
	linux-watchdog@...r.kernel.org
Subject: Re: [PATCH 3/3] watchdog: xilinx: Add WDIOC_SETTIMEOUT ioctl function

On Thu, May 30, 2013 at 04:34:02PM +0200, Michal Simek wrote:
> On 05/30/2013 04:21 PM, Guenter Roeck wrote:
> > On Thu, May 30, 2013 at 04:15:45PM +0200, Michal Simek wrote:
> >> On 05/30/2013 04:07 PM, Guenter Roeck wrote:
> >>> On Thu, May 30, 2013 at 02:26:04PM +0200, Michal Simek wrote:
> >>>> Standard watchdog programs try to setup timeout
> >>>> via ioctl and this functionality should be implemented.
> >>>> Timeout value is hardcoded in the hardware but
> >>>> based on Documentation/watchdog/watchdog-api.txt
> >>>> can return the real timeout used in the same variable.
> >>>>
> >>>> Signed-off-by: Michal Simek <michal.simek@...inx.com>
> >>>> ---
> >>>>  drivers/watchdog/of_xilinx_wdt.c | 1 +
> >>>>  1 file changed, 1 insertion(+)
> >>>>
> >>>> diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c
> >>>> index 79f358c..a3bbe72 100644
> >>>> --- a/drivers/watchdog/of_xilinx_wdt.c
> >>>> +++ b/drivers/watchdog/of_xilinx_wdt.c
> >>>> @@ -253,6 +253,7 @@ static long xwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> >>>>  		xwdt_keepalive();
> >>>>  		return 0;
> >>>>
> >>>> +	case WDIOC_SETTIMEOUT:
> >>>>  	case WDIOC_GETTIMEOUT:
> >>>>  		if (no_timeout)
> >>>>  			return -ENOTTY;
> >>>
> >>> Watchdog programs should check ident.options before trying to set the timeout.
> >>> If they don't, there is an application bug. I don't think it is a good idea
> >>> to start hacking the kernel to work around application bugs.
> >>
> >> Based on Documentation/watchdog/watchdog-api.txt
> >>
> >> "For some drivers it is possible to modify the watchdog timeout on the
> >> fly with the SETTIMEOUT ioctl, those drivers have the WDIOF_SETTIMEOUT
> >> flag set in their option field.  The argument is an integer
> > 
> > Yes, but WDIOF_SETTIMEOUT is not set in the driver's option field.
> 
> ok. It means I should probably enable it.
> 
I am missing your point. Applications should not try to write the timeout
since WDIOF_SETTIMEOUT is not set. Any application doing it anyway is buggy
and should be fixed.

Guenter
--
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