All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] security: Remove unused field from security_hook_list
@ 2018-04-12  2:25 Sargun Dhillon
  2018-04-12 14:18 ` Tetsuo Handa
  0 siblings, 1 reply; 3+ messages in thread
From: Sargun Dhillon @ 2018-04-12  2:25 UTC (permalink / raw)
  To: linux-security-module

It appears like char * lsm on struct security_hook_list is unused. Even
since its inception: https://patchwork.kernel.org/patch/9525051/
it hasn't been read, only written to. This removes that.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
---
 include/linux/lsm_hooks.h | 1 -
 security/security.c       | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index ac491137b10a..ea07e9cdfee0 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -1966,7 +1966,6 @@ struct security_hook_list {
 	struct hlist_node		list;
 	struct hlist_head		*head;
 	union security_list_options	hook;
-	char				*lsm;
 } __randomize_layout;
 
 /*
diff --git a/security/security.c b/security/security.c
index dd246a38b3f0..b0a34961d0a3 100644
--- a/security/security.c
+++ b/security/security.c
@@ -161,10 +161,8 @@ void __init security_add_hooks(struct security_hook_list *hooks, int count,
 {
 	int i;
 
-	for (i = 0; i < count; i++) {
-		hooks[i].lsm = lsm;
+	for (i = 0; i < count; i++)
 		hlist_add_tail_rcu(&hooks[i].list, hooks[i].head);
-	}
 	if (lsm_append(lsm, &lsm_names) < 0)
 		panic("%s - Cannot get early memory.\n", __func__);
 }
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info@ http://vger.kernel.org/majordomo-info.html

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

* [PATCH] security: Remove unused field from security_hook_list
  2018-04-12  2:25 [PATCH] security: Remove unused field from security_hook_list Sargun Dhillon
@ 2018-04-12 14:18 ` Tetsuo Handa
  2018-04-12 15:29   ` Casey Schaufler
  0 siblings, 1 reply; 3+ messages in thread
From: Tetsuo Handa @ 2018-04-12 14:18 UTC (permalink / raw)
  To: linux-security-module

Sargun Dhillon wrote:
> It appears like char * lsm on struct security_hook_list is unused. Even
> since its inception: https://patchwork.kernel.org/patch/9525051/
> it hasn't been read, only written to. This removes that.

It was preserved based on an assumption that complete stacking is accepted in
near future, but still not available. Maybe we can delete this field for now?
http://kernsec.org/pipermail/linux-security-module-archive/2017-March/000104.html
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH] security: Remove unused field from security_hook_list
  2018-04-12 14:18 ` Tetsuo Handa
@ 2018-04-12 15:29   ` Casey Schaufler
  0 siblings, 0 replies; 3+ messages in thread
From: Casey Schaufler @ 2018-04-12 15:29 UTC (permalink / raw)
  To: linux-security-module

On 4/12/2018 7:18 AM, Tetsuo Handa wrote:
> Sargun Dhillon wrote:
>> It appears like char * lsm on struct security_hook_list is unused. Even
>> since its inception: https://patchwork.kernel.org/patch/9525051/
>> it hasn't been read, only written to. This removes that.

tl;dr - I hope to use it in 4.18

I have been trying to get my patch for Smack that creates a
subdirectory in /proc/.../attr/ in for some time. That
patch uses the lsm field in security_hook_list. While the
Smack directory is very important for stacking, I want it
regardless as reusing the SELinux attribute files was a mistake.

> It was preserved based on an assumption that complete stacking is accepted in
> near future, but still not available. Maybe we can delete this field for now?

Yes, we can. There would be a merge conflict should I get my way
on the Smack subdirectory.

James, I *still* want /proc/.../attr/smack regardless of the rest
of stacking. I want to start fixing the Smack user space. This is
required, by stacking, but strongly desired in any case.

> http://kernsec.org/pipermail/linux-security-module-archive/2017-March/000104.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-04-12 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12  2:25 [PATCH] security: Remove unused field from security_hook_list Sargun Dhillon
2018-04-12 14:18 ` Tetsuo Handa
2018-04-12 15:29   ` Casey Schaufler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.