[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACzX3AsbrRWjFU8cirZ_Ey9O6kjAsC2HHBn1xPArx-6-cNA=nQ@mail.gmail.com>
Date: Thu, 8 Jan 2026 19:06:54 +0530
From: Anuj gupta <anuj1072538@...il.com>
To: Caleb Sander Mateos <csander@...estorage.com>
Cc: Jens Axboe <axboe@...nel.dk>, Christoph Hellwig <hch@....de>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: initialize auto integrity buffer opaque
> The auto-generated integrity buffer for writes needs to be fully
> initialized before being passed to the underlying block device,
> otherwise the uninitialized memory can be read back by userspace or
> anyone with physical access to the storage device. If protection
> information is generated, that portion of the integrity buffer will be
> initialized. The integrity buffer is also zeroed if PI generation is
> disabled via sysfs or the PI tuple size is 0. However, this misses the
> case where the PI is generated and the PI tuple size is nonzero, but the
> metadata size is larger than the PI tuple. In this case, the remainder
> ("opaque") of the metadata is left uninitialized.
> Generalize the BLK_INTEGRITY_CSUM_NONE check to cover any case when the
> metadata is larger than just the PI tuple.
> Switch the gfp_t variable to bool zero_buffer since it's only used to
> compute the zero_buffer argument to bio_integrity_alloc_buf().
>
> Signed-off-by: Caleb Sander Mateos <csander@...estorage.com>
> Fixes: c546d6f43833 ("block: only zero non-PI metadata tuples in bio_integrity_prep")
Makes sense. Thanks for posting the fix.
Reviewed-by: Anuj Gupta <anuj20.g@...sung.com>
Powered by blists - more mailing lists