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:	Sat, 18 Jun 2011 21:17:48 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Wim Van Sebroeck <wim@...ana.be>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Linux Watchdog Mailing List <linux-watchdog@...r.kernel.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCH 9/10 v2] Generic Watchdog Timer Driver

On Saturday 18 June 2011 19:27:27 Wim Van Sebroeck wrote:
> 
> watchdog: WatchDog Timer Driver Core - Part 9
> 
> Add support for extra ioctl calls by adding a
> ioctl watchdog operation. This operation will be
> called before we do our own handling of ioctl
> commands. This way we can override the internal
> ioctl command handling and we can also add
> extra ioctl commands. The ioctl watchdog operation
> should return the appropriate error codes or
> -ENOIOCTLCMD if the ioctl command should be handled
> through the internal ioctl handling of the framework.
> 
> Signed-off-by: Alan Cox <alan@...rguk.ukuu.org.uk>
> Signed-off-by: Wim Van Sebroeck <wim@...ana.be>

Hmm, I'm not sure about this one. It does make the conversion
of existing drivers easier but doesn't encourage doing a good
job there.

How about instead providing a compatibility helper module that
provides helper functions like this:

int watchdog_compat_getstatus(struct watchdog_device *wdd)
{
	int __user *tmp = compat_alloc_userspace(sizeof (int));
	int ret;

	ret = wdd->ops->ioctl(wdd, WDIOC_GETSTATUS, tmp);
	if (ret)
		return ret;

	__get_user(ret, tmp);
	return ret;
}
EXPORT_SYMBOL_GPL(watchdog_compat_getstatus);

This would let you use the common ioctl implementation for all
watchdogs without the option of an individual driver overriding
it, but a driver could still provide an ioctl method that only
gets called by the watchdog_compat_* functions.

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