]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cred: remove unused set_security_override_from_ctx()
authorCasey Schaufler <casey@schaufler-ca.com>
Mon, 22 Dec 2025 21:01:48 +0000 (13:01 -0800)
committerPaul Moore <paul@paul-moore.com>
Wed, 7 Jan 2026 01:52:57 +0000 (20:52 -0500)
The function set_security_override_from_ctx() has no in-tree callers
since 6.14. Remove it.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[PM: subject tweak, merge fuzz]
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/cred.h
kernel/cred.c

index 343a140a6ba25a4e46b4e5c697a5ce671f212585..ed1609d78cd7b16ed1434c937176495a4f38cf6e 100644 (file)
@@ -164,7 +164,6 @@ static inline const struct cred *kernel_cred(void)
        return rcu_dereference_raw(init_task.cred);
 }
 extern int set_security_override(struct cred *, u32);
-extern int set_security_override_from_ctx(struct cred *, const char *);
 extern int set_create_files_as(struct cred *, struct inode *);
 extern int cred_fscmp(const struct cred *, const struct cred *);
 extern void __init cred_init(void);
index a6f686b30da1b2e6e32cd5372a750668b3e54cbe..12a7b1ce5131edc728c94aebc99450d46a151838 100644 (file)
@@ -620,29 +620,6 @@ int set_security_override(struct cred *new, u32 secid)
 }
 EXPORT_SYMBOL(set_security_override);
 
-/**
- * set_security_override_from_ctx - Set the security ID in a set of credentials
- * @new: The credentials to alter
- * @secctx: The LSM security context to generate the security ID from.
- *
- * Set the LSM security ID in a set of credentials so that the subjective
- * security is overridden when an alternative set of credentials is used.  The
- * security ID is specified in string form as a security context to be
- * interpreted by the LSM.
- */
-int set_security_override_from_ctx(struct cred *new, const char *secctx)
-{
-       u32 secid;
-       int ret;
-
-       ret = security_secctx_to_secid(secctx, strlen(secctx), &secid);
-       if (ret < 0)
-               return ret;
-
-       return set_security_override(new, secid);
-}
-EXPORT_SYMBOL(set_security_override_from_ctx);
-
 /**
  * set_create_files_as - Set the LSM file create context in a set of credentials
  * @new: The credentials to alter