mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Demi Marie Obenour <demi@invisiblethingslab.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] block: increment diskseq on all media change events
Date: Tue, 20 Jun 2023 07:18:20 -0600	[thread overview]
Message-ID: <168726710016.3595534.9633662613974186996.b4-ty@kernel.dk> (raw)
In-Reply-To: <20230607170837.1559-1-demi@invisiblethingslab.com>


On Wed, 07 Jun 2023 13:08:37 -0400, Demi Marie Obenour wrote:
> Currently, associating a loop device with a different file descriptor
> does not increment its diskseq.  This allows the following race
> condition:
> 
> 1. Program X opens a loop device
> 2. Program X gets the diskseq of the loop device.
> 3. Program X associates a file with the loop device.
> 4. Program X passes the loop device major, minor, and diskseq to
>    something.
> 5. Program X exits.
> 6. Program Y detaches the file from the loop device.
> 7. Program Y attaches a different file to the loop device.
> 8. The opener finally gets around to opening the loop device and checks
>    that the diskseq is what it expects it to be.  Even though the
>    diskseq is the expected value, the result is that the opener is
>    accessing the wrong file.
> 
> [...]

Applied, thanks!

[1/1] block: increment diskseq on all media change events
      commit: b90ecc0379eb7bbe79337b0c7289390a98752646

Best regards,
-- 
Jens Axboe




      parent reply	other threads:[~2023-06-20 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 17:08 Demi Marie Obenour
2023-06-08  5:31 ` Christoph Hellwig
2023-06-20 13:18 ` Jens Axboe [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=168726710016.3595534.9633662613974186996.b4-ty@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=demi@invisiblethingslab.com \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®