[PATCH slab/for-next 11/14] smack: specify SLAB_MAY_ACCOUNT for smack_rule cache

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Oct 22 11:48:39 UTC 2026


> smk_copy_rules() allocates rules with the gfp passed from
> security_prepare_creds(), which is GFP_KERNEL_ACCOUNT. Specify
> SLAB_MAY_ACCOUNT when the object may be charged to a memcg.
> __GFP_ACCOUNT without SLAB_MAY_ACCOUNT will not be allowed.
> 
> Path: fork() -> copy_creds() -> prepare_creds()
>   -> security_prepare_creds(GFP_KERNEL_ACCOUNT) -> smack_cred_prepare()
>   -> smk_copy_rules() -> kmem_cache_zalloc(smack_rule_cache)
> 
> Assisted-by: LLM
> Cc: Casey Schaufler <casey at schaufler-ca.com>
> Cc: Paul Moore <paul at paul-moore.com>
> Cc: James Morris <jmorris at namei.org>
> Cc: "Serge E. Hallyn" <serge at hallyn.com>
> Cc: linux-security-module at vger.kernel.org
> Signed-off-by: Harry Yoo (Meta) <harry at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261021-memalloc-prof-dont-waste-slabobj-ext-metadata-v1-0-096800aa3330@kernel.org?part=11




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