From: Eric Biggers <ebiggers@kernel.org>
To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: linux-fscrypt@vger.kernel.org,
Nathan Huckleberry <nhuck@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 1/3] blk-mq: release crypto keyslot before reporting I/O complete
Date: Wed, 8 Mar 2023 10:21:48 -0800 [thread overview]
Message-ID: <ZAjSPAs5DJSm0ls8@sol.localdomain> (raw)
In-Reply-To: <20230303071959.144604-2-ebiggers@kernel.org>
On Thu, Mar 02, 2023 at 11:19:57PM -0800, Eric Biggers wrote:
> +void __blk_crypto_free_request(struct request *rq)
> +{
> mempool_free(rq->crypt_ctx, bio_crypt_ctx_pool);
> - blk_crypto_rq_set_defaults(rq);
> + rq->crypt_ctx = NULL;
> +
> + /* The keyslot, if one was needed, should have been released earlier. */
> + if (WARN_ON_ONCE(rq->crypt_keyslot))
> + __blk_crypto_rq_put_keyslot(rq);
> }
I received a report that this WARN_ON_ONCE can be hit.
To fix this, attempt_merge() will need to release the keyslot too.
- Eric
next prev parent reply other threads:[~2023-03-08 18:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 7:19 [PATCH 0/3] Fix blk-crypto keyslot race condition Eric Biggers
2023-03-03 7:19 ` [PATCH 1/3] blk-mq: release crypto keyslot before reporting I/O complete Eric Biggers
2023-03-03 19:29 ` Nathan Huckleberry
2023-03-08 18:21 ` Eric Biggers [this message]
2023-03-03 7:19 ` [PATCH 2/3] blk-crypto: make blk_crypto_evict_key() more robust Eric Biggers
2023-03-03 19:45 ` Nathan Huckleberry
2023-03-03 19:50 ` Eric Biggers
2023-03-03 20:30 ` Nathan Huckleberry
2023-03-03 7:19 ` [PATCH 3/3] blk-crypto: remove blk_crypto_insert_cloned_request() Eric Biggers
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=ZAjSPAs5DJSm0ls8@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=nhuck@google.com \
--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 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.