[PATCH v4 2/2] KEYS: Reject keyring creation with overridden credentials

Guicai Ma maguicai at kylinos.cn
Sat Nov 28 02:11:08 UTC 2026


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>



More information about the Linux-security-module-archive mailing list