Skip to contentSkip to conversation

direct-io: fix use after free

PATCH New Kent Overstreet 2 participants 2 messages Mar 9, 2016 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 direct-io: fix use after free

---
 fs/direct-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/direct-io.c +1 -1
index 1b2f7ffc8b..d6a9012d42 100644
@@ -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;
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 direct-io: fix use after free

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

Quoted 26 lines · Kent Overstreet
---
 fs/direct-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/direct-io.c +1 -1
index 1b2f7ffc8b..d6a9012d42 100644
@@ -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;
Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html