From: Greg KH <gregkh@linuxfoundation.org>
To: Shivani Agarwal <shivani.agarwal@broadcom.com>
Cc: stable@vger.kernel.org, axboe@kernel.dk,
martin.petersen@oracle.com, linux-block@vger.kernel.org,
ajay.kaher@broadcom.com, alexey.makhalov@broadcom.com,
vasavi.sirnapalli@broadcom.com, Christoph Hellwig <hch@lst.de>,
Kanchan Joshi <joshi.k@samsung.com>,
Chaitanya Kulkarni <kch@nvidia.com>,
Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH v4.19-v5.10] block: initialize integrity buffer to zero before writing it to media
Date: Thu, 5 Sep 2024 09:39:47 +0200 [thread overview]
Message-ID: <2024090540-afloat-unroll-d9fd@gregkh> (raw)
In-Reply-To: <20240902092459.5147-1-shivani.agarwal@broadcom.com>
On Mon, Sep 02, 2024 at 02:24:59AM -0700, Shivani Agarwal wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> [ 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@lst.de>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
> Link: https://lore.kernel.org/r/20240613084839.1044015-2-hch@lst.de
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> Signed-off-by: Shivani Agarwal <shivani.agarwal@broadcom.com>
> ---
> block/bio-integrity.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2024-09-05 7:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 9:24 [PATCH v4.19-v5.10] block: initialize integrity buffer to zero before writing it to media Shivani Agarwal
2024-09-05 7:39 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024090540-afloat-unroll-d9fd@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=ajay.kaher@broadcom.com \
--cc=alexey.makhalov@broadcom.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=joshi.k@samsung.com \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sashal@kernel.org \
--cc=shivani.agarwal@broadcom.com \
--cc=stable@vger.kernel.org \
--cc=vasavi.sirnapalli@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox