[PATCH v4 2/2] KEYS: Reject keyring creation with overridden credentials
Jarkko Sakkinen
jarkko at kernel.org
Sat Nov 28 10:23:11 UTC 2026
On Fri, Nov 27, 2026 at 09:11:08PM -0500, Guicai Ma wrote:
> On Fri, Nov 27, 2026 at 02:14:32PM +0200, Jarkko Sakkinen wrote:
> > If the current task is running with overridden credentials calling
> > commit_creds() is forbidden and triggers a BUG_ON().
> >
> > Reject keyring creation with -EPERM when credentials are overridden.
>
> Tested on the same arm64/KVM KASAN/lockdep setup on top of patch 1/2.
> Under override_creds(), lookup_user_key() with KEY_LOOKUP_CREATE now
> returns -EPERM for KEY_SPEC_{SESSION,PROCESS,THREAD,USER}_KEYRING
> without hitting commit_creds().
>
> Reviewed-by: Guicai Ma <maguicai at kylinos.cn>
> Tested-by: Guicai Ma <maguicai at kylinos.cn>
Thanks a bunch!
Br, Jarkko
More information about the Linux-security-module-archive
mailing list