]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lsm,nfs: fix memory leak of lsm_context
authorStephen Smalley <stephen.smalley.work@gmail.com>
Thu, 20 Feb 2025 19:29:36 +0000 (14:29 -0500)
committerAnna Schumaker <anna.schumaker@oracle.com>
Tue, 25 Feb 2025 20:07:24 +0000 (15:07 -0500)
commit9084ed79ddaaaa1ec01cd304af9fb532c26252db
tree641ca5f17465cdc54df025981d040e051b6b597c
parent1f7a4f98c11fbeb18ed21f3b3a497e90a50ad2e0
lsm,nfs: fix memory leak of lsm_context

commit b530104f50e8 ("lsm: lsm_context in security_dentry_init_security")
did not preserve the lsm id for subsequent release calls, which results
in a memory leak. Fix it by saving the lsm id in the nfs4_label and
providing it on the subsequent release call.

Fixes: b530104f50e8 ("lsm: lsm_context in security_dentry_init_security")
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/nfs4proc.c
include/linux/nfs4.h