From: Jarkko Sakkinen <jarkko@kernel.org>
To: Yuansheng Yang <0xbeac@gmail.com>
Cc: dhowells@redhat.com, paul@paul-moore.com, jmorris@namei.org,
serge@hallyn.com, keyrings@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KEYS: Protect pkey method checks against type removal
Date: Thu, 5 Nov 2026 05:28:36 +0200 [thread overview]
Message-ID: <auv35Ljgz1OA1zUZ@kernel.org> (raw)
In-Reply-To: <20261105022439.11846-1-0xbeac@gmail.com>
On Thu, Nov 05, 2026 at 10:24:39AM +0800, Yuansheng Yang wrote:
> > > if (copy_to_user(_res, &res, sizeof(res)) == 0 &&
> > > clear_user(_res->__spare, sizeof(_res->__spare)) == 0)
> > > ret = 0;
> >
> > Why up_read is not here?
>
> To avoid holding key->sem across user memory faults. After asym_query(),
> res is a local copy. Copying it out no longer needs the lock.
Hmm... OK, thank makes sense.
I'll think I'll hold for +1 version and see how this organizes and
provide feedback what might still need to be addressed.
I think the timing is good for the patch exactly because it can
land before turning this over so in that regard this is all fine.
Br, jarkko
next prev parent reply other threads:[~2026-11-05 3:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 3:29 [PATCH] " BeaCox
2026-11-03 15:17 ` Jarkko Sakkinen
2026-11-04 2:14 ` [PATCH v2] " BeaCox
2026-11-04 14:49 ` Jarkko Sakkinen
2026-11-04 23:59 ` Jarkko Sakkinen
2026-11-05 2:24 ` Yuansheng Yang
2026-11-05 3:28 ` Jarkko Sakkinen [this message]
2026-11-05 4:38 ` [PATCH v3] " Yuansheng Yang
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=auv35Ljgz1OA1zUZ@kernel.org \
--to=jarkko@kernel.org \
--cc=0xbeac@gmail.com \
--cc=dhowells@redhat.com \
--cc=jmorris@namei.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.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
all inboxes | Powered by JetHome®