Re: [PATCH v4 2/2] KEYS: Reject keyring creation with overridden credentials
From: Guicai Ma
Date: Fri Nov 27 2026 - 21:11:24 EST
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@xxxxxxxxxx>
Tested-by: Guicai Ma <maguicai@xxxxxxxxxx>