Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH] Cred: Remove unused set_security_override_from_ctx()
       [not found] <15895666-464c-4349-9fb2-f24e10aac8c7.ref@schaufler-ca.com>
@ 2025-12-22 18:02 ` Casey Schaufler
  2025-12-22 22:19   ` David Howells
  2025-12-22 21:01 ` Casey Schaufler
  2025-12-23 23:13 ` [PATCH v2] " Casey Schaufler
  2 siblings, 1 reply; 6+ messages in thread
From: Casey Schaufler @ 2025-12-22 18:02 UTC (permalink / raw)
  To: Paul Moore, David Howells, Linux kernel mailing list,
	Serge Hallyn
  Cc: max.kellermann, LSM List, Casey Schaufler

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>
---
 kernel/cred.c | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/kernel/cred.c b/kernel/cred.c
index a6f686b30da1..12a7b1ce5131 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] Cred: Remove unused set_security_override_from_ctx()
       [not found] <15895666-464c-4349-9fb2-f24e10aac8c7.ref@schaufler-ca.com>
  2025-12-22 18:02 ` [PATCH] Cred: Remove unused set_security_override_from_ctx() Casey Schaufler
@ 2025-12-22 21:01 ` Casey Schaufler
  2026-01-07  1:52   ` Paul Moore
  2025-12-23 23:13 ` [PATCH v2] " Casey Schaufler
  2 siblings, 1 reply; 6+ messages in thread
From: Casey Schaufler @ 2025-12-22 21:01 UTC (permalink / raw)
  To: Paul Moore, David Howells, Linux kernel mailing list,
	Serge Hallyn
  Cc: max.kellermann, LSM List, Casey Schaufler

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>
---
kernel/cred.c | 23 -----------------------
1 file changed, 23 deletions(-)

diff --git a/kernel/cred.c b/kernel/cred.c
index a6f686b30da1..12a7b1ce5131 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Cred: Remove unused set_security_override_from_ctx()
  2025-12-22 18:02 ` [PATCH] Cred: Remove unused set_security_override_from_ctx() Casey Schaufler
@ 2025-12-22 22:19   ` David Howells
  2025-12-22 23:32     ` Casey Schaufler
  0 siblings, 1 reply; 6+ messages in thread
From: David Howells @ 2025-12-22 22:19 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: dhowells, Paul Moore, Linux kernel mailing list, Serge Hallyn,
	max.kellermann, LSM List

Casey Schaufler <casey@schaufler-ca.com> wrote:

> The function set_security_override_from_ctx() has no in-tree callers
> since 6.14. Remove it.

It's also declared in include/linux/cred.h

David


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Cred: Remove unused set_security_override_from_ctx()
  2025-12-22 22:19   ` David Howells
@ 2025-12-22 23:32     ` Casey Schaufler
  0 siblings, 0 replies; 6+ messages in thread
From: Casey Schaufler @ 2025-12-22 23:32 UTC (permalink / raw)
  To: David Howells
  Cc: Paul Moore, Linux kernel mailing list, Serge Hallyn,
	max.kellermann, LSM List

On 12/22/2025 2:19 PM, David Howells wrote:
> Casey Schaufler <casey@schaufler-ca.com> wrote:
>
>> The function set_security_override_from_ctx() has no in-tree callers
>> since 6.14. Remove it.
> It's also declared in include/linux/cred.h
>
> David

Yup. I realized that just after I hit send. V2 coming.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] Cred: Remove unused set_security_override_from_ctx()
       [not found] <15895666-464c-4349-9fb2-f24e10aac8c7.ref@schaufler-ca.com>
  2025-12-22 18:02 ` [PATCH] Cred: Remove unused set_security_override_from_ctx() Casey Schaufler
  2025-12-22 21:01 ` Casey Schaufler
@ 2025-12-23 23:13 ` Casey Schaufler
  2 siblings, 0 replies; 6+ messages in thread
From: Casey Schaufler @ 2025-12-23 23:13 UTC (permalink / raw)
  To: Paul Moore, David Howells, Linux kernel mailing list,
	Serge Hallyn
  Cc: max.kellermann, LSM List, Casey Schaufler

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>
---
 include/linux/cred.h |  1 -
 kernel/cred.c        | 23 -----------------------
 2 files changed, 24 deletions(-)

diff --git a/include/linux/cred.h b/include/linux/cred.h
index 343a140a6ba2..ed1609d78cd7 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -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);
diff --git a/kernel/cred.c b/kernel/cred.c
index a6f686b30da1..12a7b1ce5131 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Cred: Remove unused set_security_override_from_ctx()
  2025-12-22 21:01 ` Casey Schaufler
@ 2026-01-07  1:52   ` Paul Moore
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Moore @ 2026-01-07  1:52 UTC (permalink / raw)
  To: Casey Schaufler, David Howells, Linux kernel mailing list,
	Serge Hallyn
  Cc: max.kellermann, LSM List, Casey Schaufler

On Dec 22, 2025 Casey Schaufler <casey@schaufler-ca.com> wrote:
> 
> 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>
> ---
> kernel/cred.c | 23 -----------------------
> 1 file changed, 23 deletions(-)

Merged into lsm/dev, thanks.

--
paul-moore.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-07  1:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <15895666-464c-4349-9fb2-f24e10aac8c7.ref@schaufler-ca.com>
2025-12-22 18:02 ` [PATCH] Cred: Remove unused set_security_override_from_ctx() Casey Schaufler
2025-12-22 22:19   ` David Howells
2025-12-22 23:32     ` Casey Schaufler
2025-12-22 21:01 ` Casey Schaufler
2026-01-07  1:52   ` Paul Moore
2025-12-23 23:13 ` [PATCH v2] " Casey Schaufler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox