From: sashiko-bot@kernel.org
To: "Yige Jiang" <yigejiang86@gmail.com>
Cc: linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH] s390/zcrypt: Put the opened zcdn device in zcrypt_release()
Date: Thu, 03 Dec 2026 06:37:10 +0000 [thread overview]
Message-ID: <sashiko-outbox-247240@kernel.org> (raw)
In-Reply-To: <20261203032056.db46df7057fc.zcrypt-zcdn@gmail.com>
> zcrypt_open() keeps the device reference returned by
> find_zcdndev_by_devt() and stores a pointer to that device's permissions
> in filp->private_data. zcrypt_release() instead looks the device up
> again by its devt and drops two references on the result.
>
> If the original zcdn device is destroyed while the file is open, the
> lookup can find no device or a new device using the same minor. The
> original reference then leaks. In the latter case the replacement
> device also loses a reference it never handed out, which can cause
> use-after-free when it is subsequently destroyed.
>
> Recover the originally opened device from filp->private_data and put
> only that device. The global ap_perms pointer identifies files for
> which zcrypt_open() took no zcdn reference.
>
> Fixes: 00fab2350e6b ("s390/zcrypt: multiple zcrypt device nodes support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yige Jiang <yigejiang86@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203032056.db46df7057fc.zcrypt-zcdn@gmail.com?part=1
prev parent reply other threads:[~2026-12-03 6:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 6:27 [PATCH] s390/zcrypt: Put the opened zcdn device in zcrypt_release() Yige Jiang
2026-12-03 6:37 ` sashiko-bot [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=sashiko-outbox-247240@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yigejiang86@gmail.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