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: <20140611090914.GA12336@paralelels.com>
Date:	Wed, 11 Jun 2014 13:09:15 +0400
From:	Andrew Vagin <avagin@...allels.com>
To:	Cyrill Gorcunov <gorcunov@...il.com>
CC:	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>, <avagin@...nvz.org>,
	<xemul@...allels.com>, <vdavydov@...allels.com>,
	Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [patch 3/3] timerfd: Implement write method

On Wed, Jun 11, 2014 at 11:51:25AM +0400, Cyrill Gorcunov wrote:
> On Wed, Jun 11, 2014 at 11:27:43AM +0400, Andrew Vagin wrote:

...

> +#ifdef CONFIG_CHECKPOINT_RESTORE
> +static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> +{
> +	struct timerfd_ctx *ctx = file->private_data;
> +	int ret = 0;
> +
> +	switch (cmd) {
> +	case TFD_IOC_SET_TICKS: {
> +		u64 ticks;
> +
> +		if (get_user(ticks, (u64 __user *)arg))
> +			return -EFAULT;
> +		spin_lock_irq(&ctx->wqh.lock);
> +		ctx->ticks = ticks;
> +		if (ticks)
> +			wake_up_locked(&ctx->wqh);

Setting ticks to zero is equivalent to timerfd_read(), isn't it?
So do we need to re-arme the timer, if it's periodic?

> +		spin_unlock_irq(&ctx->wqh.lock);
> +		break;
> +	}
> +	default:
> +		ret = -ENOTTY;
> +		break;
> +	}
> +
> +V	return ret;
> +}
> +#endif
--
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