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] [day] [month] [year] [list]
Date:	Wed, 26 Jan 2011 22:13:59 +0100
From:	Wim Van Sebroeck <wim@...ana.be>
To:	dd diasemi <dd.diasemi@...il.com>
Cc:	linux-kernel@...r.kernel.org, linux-watchdog@...r.kernel.org
Subject: Re: [PATCHv3 7/11] WDT: Watchdog timer module of DA9052 device
	driver

Hi,

> +static long da9052_wdt_ioctl(struct file *file, unsigned int cmd,
> +				unsigned long arg)
> +{
> +	struct da9052_wdt *wdt = get_wdt_da9052();
> +	void __user *argp = (void __user *)arg;
> +	int __user *p = argp;
> +	unsigned char new_value;
> +
> +	switch (cmd) {
> +
> +	case WDIOC_GETSUPPORT:
> +		return copy_to_user(argp, &da9052_wdt_info,
> +			sizeof(da9052_wdt_info)) ? -EFAULT : 0;
> +	case WDIOC_GETSTATUS:
> +	case WDIOC_GETBOOTSTATUS:
> +		return put_user(0, p);
> +	case WDIOC_SETOPTIONS:
> +		if (get_user(new_value, p))
> +			return -EFAULT;
> +		if (new_value & DA9052_STROBING_FILTER_ENABLE)
> +			da9052_sm_set_strobing_filter(wdt, ENABLE);
> +		if (new_value & DA9052_STROBING_FILTER_DISABLE)
> +			da9052_sm_set_strobing_filter(wdt, DISABLE);
> +		if (new_value & DA9052_SET_STROBING_MODE_MANUAL)
> +			da9052_sm_set_strobing_mode(DA9052_STROBE_MANUAL);
> +		if (new_value & DA9052_SET_STROBING_MODE_AUTO)
> +			da9052_sm_set_strobing_mode(DA9052_STROBE_AUTO);
> +		return 0;

The ioctl WDIOC_SETOPTIONS call is not in line with the watchdog API.
the supported options are:
#define	WDIOS_DISABLECARD	0x0001	/* Turn off the watchdog timer */
#define	WDIOS_ENABLECARD	0x0002	/* Turn on the watchdog timer */
#define	WDIOS_TEMPPANIC		0x0004	/* Kernel panic on temperature trip */

Your options are:
#define DA9052_STROBING_FILTER_ENABLE	0x0001
#define DA9052_STROBING_FILTER_DISABLE	0x0002
#define DA9052_SET_STROBING_MODE_MANUAL	0x0004
#define DA9052_SET_STROBING_MODE_AUTO	0x0008

Please explain what you want to do.

Thanks in advance,
Wim.

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