Thread (4 messages) 4 messages, 3 authors, 2021-08-23

Re: slab-out-of-bounds access in bio_integrity_alloc()

flat view

From: Bart Van Assche <bvanassche@acm.org>
Date: 2021-08-22 03:01:05

On 8/20/21 8:06 PM, Jens Axboe wrote:
quoted hunk ↗ jump to hunk
On 8/20/21 4:58 PM, Bart Van Assche wrote:
quoted
Hi,

It's been a while since I ran blktests. If I run it against Jens' for-next
branch (39916d4054e7 ("Merge branch 'for-5.15/io_uring' into for-next")) a
slab-out-of-bounds access complaint appears. Is anyone already looking into
this?
Does this help?
diff --git a/block/bio.c b/block/bio.c
index ae9085b97deb..94a0c01465a8 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -282,8 +282,9 @@ void bio_init(struct bio *bio, struct bio_vec *table,
 	atomic_set(&bio->__bi_remaining, 1);
 	atomic_set(&bio->__bi_cnt, 1);
 
-	bio->bi_io_vec = table;
 	bio->bi_max_vecs = max_vecs;
+	bio->bi_io_vec = table;
+	bio->bi_pool = NULL;
 }
 EXPORT_SYMBOL(bio_init);
Hi Jens,

That patch makes the KASAN complaint disappear. Thanks!

Bart.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help