[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d8ac82ab63a64583f753878dd03e3503c68ffbe.camel@omp.ru>
Date: Tue, 11 Jun 2024 14:23:48 +0000
From: Roman Smirnov <r.smirnov@....ru>
To: "axboe@...nel.dk" <axboe@...nel.dk>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-block@...r.kernel.org"
<linux-block@...r.kernel.org>
CC: Karina Yankevich <k.yankevich@....ru>, "lvc-patches@...uxtesting.org"
<lvc-patches@...uxtesting.org>, Sergey Shtylyov <s.shtylyov@....ru>
Subject: [bug report] block: integer overflow in __bvec_gap_to_prev()
Hello.
There is a case of integer overflow in __bvec_gap_to_prev():
((bprv->bv_offset + bprv->bv_len) & lim->virt_boundary_mask);
bio_vec can cross multiple pages:
https://lore.kernel.org/lkml/20190215111324.30129-1-ming.lei@redhat.com/t/
So, in case bio has one bio_vec bv_len can have a maximum value of UINT_MAX.
The check happens in bio_full(). In the case when bv_len is equal to
UINT_MAX and bv_offset is greater than zero, an overflow may occur.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Powered by blists - more mailing lists