All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, martin.petersen@oracle.com, linux-block@vger.kernel.org
Subject: Re: [PATCH] block: initialize integrity buffer to zero before writing it to media
Date: Thu, 06 Jun 2024 10:08:20 -0400	[thread overview]
Message-ID: <yq1msny6ucc.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20240606052754.3462514-1-hch@lst.de> (Christoph Hellwig's message of "Thu, 6 Jun 2024 07:27:45 +0200")


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.

> Fix this by adding the __GFP_ZERO flag to allocations for writes.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2024-06-06 14:08 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 [this message]
2024-06-06 14:10   ` Christoph Hellwig
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=yq1msny6ucc.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.