linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH] block: initialize integrity buffer to zero before writing it to media
Date: Thu, 6 Jun 2024 16:10:17 +0200	[thread overview]
Message-ID: <20240606141017.GA10730@lst.de> (raw)
In-Reply-To: <yq1msny6ucc.fsf@ca-mkp.ca.oracle.com>

On Thu, Jun 06, 2024 at 10:08:20AM -0400, Martin K. Petersen wrote:
> 
> Christoph,
> 
> > 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.
> 
> We do explicitly set the app_tag to 0 for PI so it's only non-PI
> metadata that's affected.

Ah, true.  I could switch to then just zeroing the buffer in
->generate_fn for non-PI metadata only.  That's actually the
first version I prototyped.


  reply	other threads:[~2024-06-06 14:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06  5:27 [PATCH] block: initialize integrity buffer to zero before writing it to media Christoph Hellwig
2024-06-06 14:08 ` Martin K. Petersen
2024-06-06 14:10   ` Christoph Hellwig [this message]
2024-06-07  5:40     ` Christoph Hellwig
2024-06-10 10:39       ` Kanchan Joshi
2024-06-10  2:51 ` Chaitanya Kulkarni

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=20240606141017.GA10730@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).