All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] direct-io: fix use after free
@ 2016-03-09  3:52 Kent Overstreet
  2016-03-09  6:42 ` Mike Krinkin
  0 siblings, 1 reply; 2+ messages in thread
From: Kent Overstreet @ 2016-03-09  3:52 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
---
 fs/direct-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 1b2f7ffc8b..d6a9012d42 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -472,8 +472,8 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio)
 		dio->io_error = -EIO;
 
 	if (dio->is_async && dio->rw == READ && dio->should_dirty) {
-		bio_check_pages_dirty(bio);	/* transfers ownership */
 		err = bio->bi_error;
+		bio_check_pages_dirty(bio);	/* transfers ownership */
 	} else {
 		bio_for_each_segment_all(bvec, bio, i) {
 			struct page *page = bvec->bv_page;
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] direct-io: fix use after free
  2016-03-09  3:52 [PATCH] direct-io: fix use after free Kent Overstreet
@ 2016-03-09  6:42 ` Mike Krinkin
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Krinkin @ 2016-03-09  6:42 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: Alexander Viro, linux-fsdevel

Hi,

i've sent exactly the same fix a while ago in the linux-block,
here it is:

https://lkml.org/lkml/2016/1/30/146

On Tue, Mar 08, 2016 at 06:52:58PM -0900, Kent Overstreet wrote:
> Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
> ---
>  fs/direct-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index 1b2f7ffc8b..d6a9012d42 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -472,8 +472,8 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio)
>  		dio->io_error = -EIO;
>  
>  	if (dio->is_async && dio->rw == READ && dio->should_dirty) {
> -		bio_check_pages_dirty(bio);	/* transfers ownership */
>  		err = bio->bi_error;
> +		bio_check_pages_dirty(bio);	/* transfers ownership */
>  	} else {
>  		bio_for_each_segment_all(bvec, bio, i) {
>  			struct page *page = bvec->bv_page;
> -- 
> 2.7.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-09  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09  3:52 [PATCH] direct-io: fix use after free Kent Overstreet
2016-03-09  6:42 ` Mike Krinkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.