Re: [PATCH v4.19-v5.10] block: initialize integrity buffer to zero before writing it to media

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 02, 2024 at 02:24:59AM -0700, Shivani Agarwal wrote:
> From: Christoph Hellwig <hch@xxxxxx>
> 
> [ Upstream commit 899ee2c3829c5ac14bfc7d3c4a5846c0b709b78f ]
> 
> Metadata added by bio_integrity_prep is using plain kmalloc, which leads
> to random kernel memory being written media.  For PI metadata this is
> limited to the app tag that isn't used by kernel generated metadata,
> but for non-PI metadata the entire buffer leaks kernel memory.
> 
> Fix this by adding the __GFP_ZERO flag to allocations for writes.
> 
> Fixes: 7ba1ba12eeef ("block: Block layer data integrity support")
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
> Reviewed-by: Kanchan Joshi <joshi.k@xxxxxxxxxxx>
> Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>
> Link: https://lore.kernel.org/r/20240613084839.1044015-2-hch@xxxxxx
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> Signed-off-by: Shivani Agarwal <shivani.agarwal@xxxxxxxxxxxx>
> ---
>  block/bio-integrity.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)

Now queued up, thanks.

greg k-h




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux