selinux: stop passing selinux_state pointers and their offspring
A message that is not in the archive (sent off-list or not yet received): [email protected]
Paul Moore
maintainerQuoted 26 lines · Stephen Smalley
Linus observed that the pervasive passing of
selinux_statepointers introduced by me in commitaa8e712cee93("selinux: wrap global selinux state") adds overhead and complexity without providing any benefit. The original idea was to pave the way for SELinux namespaces but those have not yet been implemented and there isn't currently a concrete plan to do so. Remove the passing of theselinux_statepointers, reverting to direct use of the single globalselinux_state, and likewise remove passing of child pointers like theselinux_avc. Theselinux_policypointer remains as it is needed for atomic switching of policies.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Stephen Smalley <[email protected]>--- security/selinux/avc.c | 197 ++++----- security/selinux/hooks.c | 549 ++++++++++--------------- security/selinux/ibpkey.c | 2 +- security/selinux/ima.c | 37 +- security/selinux/include/avc.h | 29 +- security/selinux/include/avc_ss.h | 3 +- security/selinux/include/conditional.h | 4 +- security/selinux/include/ima.h | 10 +- security/selinux/include/security.h | 171 +++----- security/selinux/netif.c | 2 +- security/selinux/netlabel.c | 17 +-
Quoted 8 lines
security/selinux/netnode.c | 4 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 208 ++++------ security/selinux/ss/services.c | 346 +++++++--------- security/selinux/ss/services.h | 1 - security/selinux/status.c | 44 +- security/selinux/xfrm.c | 20 +- 18 files changed, 651 insertions(+), 995 deletions(-)
It looks like this patch was a bit too big for the mailing list; I'm trimming my reply to get this discussion on the list.
I strongly dislike merging patches that haven't hit the list, but I do recognize that this is a bit of an unusual case. Have you tried breaking this up into two (three?) patches? I imagine that should be possible, although I worry that the time required to do that would be prohibitive given the change itself.
If that doesn't work, an alternative might be to file a PR against our kernel subsystem mirror on GitHub and posting a link to the PR here. I don't want to encourage this as a general way of submitting SELinux kernel patches, but I could make an exception here.
https://github.com/SELinuxProject/selinux-kernel
Signature · 1 line
paul-moore.com
Stephen Smalley
maintainerQuoted 47 lines · Paul Moore
Quoted 26 lines · Stephen Smalley
Linus observed that the pervasive passing of
selinux_statepointers introduced by me in commitaa8e712cee93("selinux: wrap global selinux state") adds overhead and complexity without providing any benefit. The original idea was to pave the way for SELinux namespaces but those have not yet been implemented and there isn't currently a concrete plan to do so. Remove the passing of theselinux_statepointers, reverting to direct use of the single globalselinux_state, and likewise remove passing of child pointers like theselinux_avc. Theselinux_policypointer remains as it is needed for atomic switching of policies.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Stephen Smalley <[email protected]>--- security/selinux/avc.c | 197 ++++----- security/selinux/hooks.c | 549 ++++++++++--------------- security/selinux/ibpkey.c | 2 +- security/selinux/ima.c | 37 +- security/selinux/include/avc.h | 29 +- security/selinux/include/avc_ss.h | 3 +- security/selinux/include/conditional.h | 4 +- security/selinux/include/ima.h | 10 +- security/selinux/include/security.h | 171 +++----- security/selinux/netif.c | 2 +- security/selinux/netlabel.c | 17 +-Quoted 8 lines
security/selinux/netnode.c | 4 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 208 ++++------ security/selinux/ss/services.c | 346 +++++++--------- security/selinux/ss/services.h | 1 - security/selinux/status.c | 44 +- security/selinux/xfrm.c | 20 +- 18 files changed, 651 insertions(+), 995 deletions(-)It looks like this patch was a bit too big for the mailing list; I'm trimming my reply to get this discussion on the list.
I strongly dislike merging patches that haven't hit the list, but I do recognize that this is a bit of an unusual case. Have you tried breaking this up into two (three?) patches? I imagine that should be possible, although I worry that the time required to do that would be prohibitive given the change itself.
Quoted 6 lines
If that doesn't work, an alternative might be to file a PR against our kernel subsystem mirror on GitHub and posting a link to the PR here. I don't want to encourage this as a general way of submitting SELinux kernel patches, but I could make an exception here.
I'm open to suggestions but didn't see an obvious way to split it in a manner that keeps everything in a working state after each patch. checkpatch.pl didn't complain about the size - not sure if that is a change in policy. Created a PR here:
Paul Moore
maintainerQuoted 53 lines · Stephen Smalley
Quoted 52 lines · Paul Moore
Quoted 26 lines · Stephen Smalley
Linus observed that the pervasive passing of
selinux_statepointers introduced by me in commitaa8e712cee93("selinux: wrap global selinux state") adds overhead and complexity without providing any benefit. The original idea was to pave the way for SELinux namespaces but those have not yet been implemented and there isn't currently a concrete plan to do so. Remove the passing of theselinux_statepointers, reverting to direct use of the single globalselinux_state, and likewise remove passing of child pointers like theselinux_avc. Theselinux_policypointer remains as it is needed for atomic switching of policies.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Stephen Smalley <[email protected]>--- security/selinux/avc.c | 197 ++++----- security/selinux/hooks.c | 549 ++++++++++--------------- security/selinux/ibpkey.c | 2 +- security/selinux/ima.c | 37 +- security/selinux/include/avc.h | 29 +- security/selinux/include/avc_ss.h | 3 +- security/selinux/include/conditional.h | 4 +- security/selinux/include/ima.h | 10 +- security/selinux/include/security.h | 171 +++----- security/selinux/netif.c | 2 +- security/selinux/netlabel.c | 17 +-Quoted 8 lines
security/selinux/netnode.c | 4 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 208 ++++------ security/selinux/ss/services.c | 346 +++++++--------- security/selinux/ss/services.h | 1 - security/selinux/status.c | 44 +- security/selinux/xfrm.c | 20 +- 18 files changed, 651 insertions(+), 995 deletions(-)It looks like this patch was a bit too big for the mailing list; I'm trimming my reply to get this discussion on the list.
I strongly dislike merging patches that haven't hit the list, but I do recognize that this is a bit of an unusual case. Have you tried breaking this up into two (three?) patches? I imagine that should be possible, although I worry that the time required to do that would be prohibitive given the change itself.
If that doesn't work, an alternative might be to file a PR against our kernel subsystem mirror on GitHub and posting a link to the PR here. I don't want to encourage this as a general way of submitting SELinux kernel patches, but I could make an exception here.
Quoted 6 lines
Quoted 1 line
I'm open to suggestions but didn't see an obvious way to split it in a manner that keeps everything in a working state after each patch. checkpatch.pl didn't complain about the size - not sure if that is a change in policy.
I'm not sure checkpatch.pl is the right place for that anyway as every list could have a different policy.
FWIW, many years ago I was told to keep the diffstat under a thousand lines as a general rule. While I've seen patches go over that limit and hit various @vger lists, I personally try to keep my patches under that 1k limit, and generally that isn't too hard. This really is a bit of a special case I think.
Quoted 2 lines
Created a PR here:
https://github.com/SELinuxProject/selinux-kernel/pull/64
Thanks, I'll work from that.
Signature · 1 line
paul-moore.com
Stephen Smalley
maintainerQuoted 72 lines · Paul Moore
Quoted 53 lines · Stephen Smalley
Quoted 52 lines · Paul Moore
Quoted 26 lines · Stephen Smalley
Linus observed that the pervasive passing of
selinux_statepointers introduced by me in commitaa8e712cee93("selinux: wrap global selinux state") adds overhead and complexity without providing any benefit. The original idea was to pave the way for SELinux namespaces but those have not yet been implemented and there isn't currently a concrete plan to do so. Remove the passing of theselinux_statepointers, reverting to direct use of the single globalselinux_state, and likewise remove passing of child pointers like theselinux_avc. Theselinux_policypointer remains as it is needed for atomic switching of policies.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Stephen Smalley <[email protected]>--- security/selinux/avc.c | 197 ++++----- security/selinux/hooks.c | 549 ++++++++++--------------- security/selinux/ibpkey.c | 2 +- security/selinux/ima.c | 37 +- security/selinux/include/avc.h | 29 +- security/selinux/include/avc_ss.h | 3 +- security/selinux/include/conditional.h | 4 +- security/selinux/include/ima.h | 10 +- security/selinux/include/security.h | 171 +++----- security/selinux/netif.c | 2 +- security/selinux/netlabel.c | 17 +-Quoted 8 lines
security/selinux/netnode.c | 4 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 208 ++++------ security/selinux/ss/services.c | 346 +++++++--------- security/selinux/ss/services.h | 1 - security/selinux/status.c | 44 +- security/selinux/xfrm.c | 20 +- 18 files changed, 651 insertions(+), 995 deletions(-)It looks like this patch was a bit too big for the mailing list; I'm trimming my reply to get this discussion on the list.
I strongly dislike merging patches that haven't hit the list, but I do recognize that this is a bit of an unusual case. Have you tried breaking this up into two (three?) patches? I imagine that should be possible, although I worry that the time required to do that would be prohibitive given the change itself.
If that doesn't work, an alternative might be to file a PR against our kernel subsystem mirror on GitHub and posting a link to the PR here. I don't want to encourage this as a general way of submitting SELinux kernel patches, but I could make an exception here.
Quoted 6 lines
Quoted 1 line
I'm open to suggestions but didn't see an obvious way to split it in a manner that keeps everything in a working state after each patch. checkpatch.pl didn't complain about the size - not sure if that is a change in policy.
I'm not sure checkpatch.pl is the right place for that anyway as every list could have a different policy.
FWIW, many years ago I was told to keep the diffstat under a thousand lines as a general rule. While I've seen patches go over that limit and hit various @vger lists, I personally try to keep my patches under that 1k limit, and generally that isn't too hard. This really is a bit of a special case I think.
Quoted 4 lines
Quoted 2 lines
Created a PR here:
https://github.com/SELinuxProject/selinux-kernel/pull/64Thanks, I'll work from that.
For those following along on the mailing list, the kernel test robot reported a problem with the original patch when lockdep is enabled, so I generated a v2 patch and updated the PR (same link above).
Paul Moore
maintainerQuoted 71 lines · Stephen Smalley
Quoted 70 lines · Paul Moore
Quoted 52 lines · Stephen Smalley
Quoted 51 lines · Paul Moore
Quoted 26 lines · Stephen Smalley
Linus observed that the pervasive passing of
selinux_statepointers introduced by me in commitaa8e712cee93("selinux: wrap global selinux state") adds overhead and complexity without providing any benefit. The original idea was to pave the way for SELinux namespaces but those have not yet been implemented and there isn't currently a concrete plan to do so. Remove the passing of theselinux_statepointers, reverting to direct use of the single globalselinux_state, and likewise remove passing of child pointers like theselinux_avc. Theselinux_policypointer remains as it is needed for atomic switching of policies.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Stephen Smalley <[email protected]>--- security/selinux/avc.c | 197 ++++----- security/selinux/hooks.c | 549 ++++++++++--------------- security/selinux/ibpkey.c | 2 +- security/selinux/ima.c | 37 +- security/selinux/include/avc.h | 29 +- security/selinux/include/avc_ss.h | 3 +- security/selinux/include/conditional.h | 4 +- security/selinux/include/ima.h | 10 +- security/selinux/include/security.h | 171 +++----- security/selinux/netif.c | 2 +- security/selinux/netlabel.c | 17 +-Quoted 8 lines
security/selinux/netnode.c | 4 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 208 ++++------ security/selinux/ss/services.c | 346 +++++++--------- security/selinux/ss/services.h | 1 - security/selinux/status.c | 44 +- security/selinux/xfrm.c | 20 +- 18 files changed, 651 insertions(+), 995 deletions(-)It looks like this patch was a bit too big for the mailing list; I'm trimming my reply to get this discussion on the list.
I strongly dislike merging patches that haven't hit the list, but I do recognize that this is a bit of an unusual case. Have you tried breaking this up into two (three?) patches? I imagine that should be possible, although I worry that the time required to do that would be prohibitive given the change itself.
If that doesn't work, an alternative might be to file a PR against our kernel subsystem mirror on GitHub and posting a link to the PR here. I don't want to encourage this as a general way of submitting SELinux kernel patches, but I could make an exception here.
Quoted 6 lines
Quoted 1 line
I'm open to suggestions but didn't see an obvious way to split it in a manner that keeps everything in a working state after each patch. checkpatch.pl didn't complain about the size - not sure if that is a change in policy.
I'm not sure checkpatch.pl is the right place for that anyway as every list could have a different policy.
FWIW, many years ago I was told to keep the diffstat under a thousand lines as a general rule. While I've seen patches go over that limit and hit various @vger lists, I personally try to keep my patches under that 1k limit, and generally that isn't too hard. This really is a bit of a special case I think.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Created a PR here:
https://github.com/SELinuxProject/selinux-kernel/pull/64Thanks, I'll work from that.
For those following along on the mailing list, the kernel test robot reported a problem with the original patch when lockdep is enabled, so I generated a v2 patch and updated the PR (same link above).
That's interesting. Does that mean that your original patch made it to the mailing list but somehow didn't make it to the lore archive? I just (re)checked and there is no record of your patch in the archive or the patchwork instance.
How did the kernel test robot get the patch to test? Does it know to go fetch GH PR URLs?
Signature · 1 line
paul-moore.com
Stephen Smalley
maintainerQuoted 83 lines · Paul Moore
Quoted 71 lines · Stephen Smalley
Quoted 70 lines · Paul Moore
Quoted 52 lines · Stephen Smalley
Quoted 51 lines · Paul Moore
Quoted 26 lines · Stephen Smalley
Linus observed that the pervasive passing of
selinux_statepointers introduced by me in commitaa8e712cee93("selinux: wrap global selinux state") adds overhead and complexity without providing any benefit. The original idea was to pave the way for SELinux namespaces but those have not yet been implemented and there isn't currently a concrete plan to do so. Remove the passing of theselinux_statepointers, reverting to direct use of the single globalselinux_state, and likewise remove passing of child pointers like theselinux_avc. Theselinux_policypointer remains as it is needed for atomic switching of policies.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Stephen Smalley <[email protected]>--- security/selinux/avc.c | 197 ++++----- security/selinux/hooks.c | 549 ++++++++++--------------- security/selinux/ibpkey.c | 2 +- security/selinux/ima.c | 37 +- security/selinux/include/avc.h | 29 +- security/selinux/include/avc_ss.h | 3 +- security/selinux/include/conditional.h | 4 +- security/selinux/include/ima.h | 10 +- security/selinux/include/security.h | 171 +++----- security/selinux/netif.c | 2 +- security/selinux/netlabel.c | 17 +-Quoted 8 lines
security/selinux/netnode.c | 4 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 208 ++++------ security/selinux/ss/services.c | 346 +++++++--------- security/selinux/ss/services.h | 1 - security/selinux/status.c | 44 +- security/selinux/xfrm.c | 20 +- 18 files changed, 651 insertions(+), 995 deletions(-)It looks like this patch was a bit too big for the mailing list; I'm trimming my reply to get this discussion on the list.
I strongly dislike merging patches that haven't hit the list, but I do recognize that this is a bit of an unusual case. Have you tried breaking this up into two (three?) patches? I imagine that should be possible, although I worry that the time required to do that would be prohibitive given the change itself.
If that doesn't work, an alternative might be to file a PR against our kernel subsystem mirror on GitHub and posting a link to the PR here. I don't want to encourage this as a general way of submitting SELinux kernel patches, but I could make an exception here.
Quoted 6 lines
Quoted 1 line
I'm open to suggestions but didn't see an obvious way to split it in a manner that keeps everything in a working state after each patch. checkpatch.pl didn't complain about the size - not sure if that is a change in policy.
I'm not sure checkpatch.pl is the right place for that anyway as every list could have a different policy.
FWIW, many years ago I was told to keep the diffstat under a thousand lines as a general rule. While I've seen patches go over that limit and hit various @vger lists, I personally try to keep my patches under that 1k limit, and generally that isn't too hard. This really is a bit of a special case I think.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Created a PR here:
https://github.com/SELinuxProject/selinux-kernel/pull/64Thanks, I'll work from that.
For those following along on the mailing list, the kernel test robot reported a problem with the original patch when lockdep is enabled, so I generated a v2 patch and updated the PR (same link above).
Quoted 7 lines
That's interesting. Does that mean that your original patch made it to the mailing list but somehow didn't make it to the lore archive? I just (re)checked and there is no record of your patch in the archive or the patchwork instance.
How did the kernel test robot get the patch to test? Does it know to go fetch GH PR URLs?
The email from the robot referenced the PR so it appears to be watching for PRs to certain GH repositories and automatically testing them.
Paul Moore
maintainerQuoted 88 lines · Stephen Smalley
Quoted 87 lines · Paul Moore
Quoted 71 lines · Stephen Smalley
Quoted 70 lines · Paul Moore
Quoted 52 lines · Stephen Smalley
Quoted 51 lines · Paul Moore
Quoted 26 lines · Stephen Smalley
Linus observed that the pervasive passing of
selinux_statepointers introduced by me in commitaa8e712cee93("selinux: wrap global selinux state") adds overhead and complexity without providing any benefit. The original idea was to pave the way for SELinux namespaces but those have not yet been implemented and there isn't currently a concrete plan to do so. Remove the passing of theselinux_statepointers, reverting to direct use of the single globalselinux_state, and likewise remove passing of child pointers like theselinux_avc. Theselinux_policypointer remains as it is needed for atomic switching of policies.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Stephen Smalley <[email protected]>--- security/selinux/avc.c | 197 ++++----- security/selinux/hooks.c | 549 ++++++++++--------------- security/selinux/ibpkey.c | 2 +- security/selinux/ima.c | 37 +- security/selinux/include/avc.h | 29 +- security/selinux/include/avc_ss.h | 3 +- security/selinux/include/conditional.h | 4 +- security/selinux/include/ima.h | 10 +- security/selinux/include/security.h | 171 +++----- security/selinux/netif.c | 2 +- security/selinux/netlabel.c | 17 +-Quoted 8 lines
security/selinux/netnode.c | 4 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 208 ++++------ security/selinux/ss/services.c | 346 +++++++--------- security/selinux/ss/services.h | 1 - security/selinux/status.c | 44 +- security/selinux/xfrm.c | 20 +- 18 files changed, 651 insertions(+), 995 deletions(-)It looks like this patch was a bit too big for the mailing list; I'm trimming my reply to get this discussion on the list.
I strongly dislike merging patches that haven't hit the list, but I do recognize that this is a bit of an unusual case. Have you tried breaking this up into two (three?) patches? I imagine that should be possible, although I worry that the time required to do that would be prohibitive given the change itself.
If that doesn't work, an alternative might be to file a PR against our kernel subsystem mirror on GitHub and posting a link to the PR here. I don't want to encourage this as a general way of submitting SELinux kernel patches, but I could make an exception here.
Quoted 6 lines
Quoted 1 line
I'm open to suggestions but didn't see an obvious way to split it in a manner that keeps everything in a working state after each patch. checkpatch.pl didn't complain about the size - not sure if that is a change in policy.
I'm not sure checkpatch.pl is the right place for that anyway as every list could have a different policy.
FWIW, many years ago I was told to keep the diffstat under a thousand lines as a general rule. While I've seen patches go over that limit and hit various @vger lists, I personally try to keep my patches under that 1k limit, and generally that isn't too hard. This really is a bit of a special case I think.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Created a PR here:
https://github.com/SELinuxProject/selinux-kernel/pull/64Thanks, I'll work from that.
For those following along on the mailing list, the kernel test robot reported a problem with the original patch when lockdep is enabled, so I generated a v2 patch and updated the PR (same link above).
That's interesting. Does that mean that your original patch made it to the mailing list but somehow didn't make it to the lore archive? I just (re)checked and there is no record of your patch in the archive or the patchwork instance.
Quoted 6 lines
Quoted 2 lines
How did the kernel test robot get the patch to test? Does it know to go fetch GH PR URLs?
The email from the robot referenced the PR so it appears to be watching for PRs to certain GH repositories and automatically testing them.
Huh, interesting. Thanks.
Signature · 1 line
paul-moore.com