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:	Fri, 12 Apr 2013 12:51:23 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Kent Overstreet <koverstreet@...gle.com>
Cc:	linux-kernel@...r.kernel.org, linux-aio@...ck.org,
	akpm@...ux-foundation.org, Zach Brown <zab@...hat.com>,
	Felipe Balbi <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Mark Fasheh <mfasheh@...e.com>,
	Joel Becker <jlbec@...lplan.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Jens Axboe <axboe@...nel.dk>,
	Asai Thambi S P <asamymuthupa@...ron.com>,
	Selvan Mani <smani@...ron.com>,
	Sam Bradshaw <sbradshaw@...ron.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Benjamin LaHaise <bcrl@...ck.org>,
	"Theodore Ts'o" <tytso@....edu>
Subject: Re: [PATCH 10/33] aio: do fget() after aio_get_req()

Kent Overstreet <koverstreet@...gle.com> writes:

> aio_get_req() will fail if we have the maximum number of requests
> outstanding, which depending on the application may not be uncommon.  So
> avoid doing an unnecessary fget().


> diff --git a/fs/aio.c b/fs/aio.c
> index 2637555..4f23d43 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -587,6 +587,8 @@ static inline void really_put_req(struct kioctx *ctx, struct kiocb *req)
>  {
>  	assert_spin_locked(&ctx->ctx_lock);
>  
> +	if (req->ki_filp)
> +		fput(req->ki_filp);
>  	if (req->ki_eventfd != NULL)
>  		eventfd_ctx_put(req->ki_eventfd);
>  	if (req->ki_dtor)
[snip]
> @@ -618,8 +617,6 @@ static void __aio_put_req(struct kioctx *ctx, struct kiocb *req)
>  	req->ki_cancel = NULL;
>  	req->ki_retry = NULL;
>  
> -	fput(req->ki_filp);
> -	req->ki_filp = NULL;
>  	really_put_req(ctx, req);
>  }

So you've removed the setting of req->ki_filp to NULL here, and I think
it's okay.  The only function called after that which could possibly be
tripped up is req->ki_dtor.  That function has no business looking at
ki_filp, I think (and the only in-tree user does not look at it).

Acked-by: Jeff Moyer <jmoyer@...hat.com>
--
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