From: Tom Rini Date: Tue, 25 Aug 2020 08:16:27 -0400 Subject: [PATCH] virtio_blk: set log2blksz correctly In-Reply-To: <20200819090732.155299-1-takahiro.akashi@linaro.org> References: <20200819090732.155299-1-takahiro.akashi@linaro.org> Message-ID: <20200825121627.GW20605@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Aug 19, 2020 at 06:07:32PM +0900, AKASHI Takahiro wrote: > 'log2blksz' in blk_desc structure must always be initialized, otherwise > it will cause a lot of weird failures in file operations. > > For example, fs_set_blk_dev[_with_part]() examines a block device against > every file system with its probe function. In particular, ext4 file > system's ext4_probe() will calls fs_devread() to fetch a super block. > If log2blksz is 0, the actual 'read' size, i.e. block_len >> log2blksz, is > much bigger than a buffer's size, and it can end up with memory corruption. > > Signed-off-by: AKASHI Takahiro > Fixes: f4802209e59d ("virtio: Add block driver support") > Reviewed-by: Bin Meng Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: