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: <20121129002436.GI18574@lenny.home.zabbo.net>
Date:	Wed, 28 Nov 2012 16:24:36 -0800
From:	Zach Brown <zab@...hat.com>
To:	Kent Overstreet <koverstreet@...gle.com>
Cc:	linux-kernel@...r.kernel.org, linux-aio@...ck.org,
	linux-fsdevel@...r.kernel.org, bcrl@...ck.org, jmoyer@...hat.com,
	axboe@...nel.dk, viro@...iv.linux.org.uk
Subject: Re: [PATCH 13/25] aio: Convert read_events() to hrtimers

> -	int			i = 0;
> +	DEFINE_WAIT(wait);
> +	struct hrtimer_sleeper t;
> +	size_t i = 0;

Changing i to size_t is kind of surprising.  Is that on purpose?

> -		set_task_state(tsk, TASK_RUNNING);
> -		remove_wait_queue(&ctx->wait, &wait);
> -
>  		if (unlikely(ret <= 0))
>  			break;
>  
> @@ -879,11 +844,10 @@ static int read_events(struct kioctx *ctx,
>  		event ++;
>  		i ++;
>  	}
> -
> -	if (timeout)
> -		clear_timeout(&to);
>  out:
> -	destroy_timer_on_stack(&to.timer);
> +	hrtimer_cancel(&t.timer);
> +	destroy_hrtimer_on_stack(&t.timer);
> +	finish_wait(&ctx->wait, &wait);

I'd move the finish_wait() up to where TASK_RUNNING was set previously
so that we can't call copy_to_user() while still set to
TASK_INTERRUPTIBLE.

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