Skip to contentSkip to conversation

Finding the right target branch for patches that span IMA and SeLinux

RFC Tushar Sugandhi 4 participants 10 messages Oct 29, 2020 – Nov 3, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Mimi/Stephen/Paul,

As you are already aware, we have several patch-sets in review for IMA infrastructure for measurement of critical kernel data and it's usage.

[1] infrastructure for measurement of critical data patch-set:

https://patchwork.kernel.org/project/linux-integrity/list/?series=354437

[2] Using [1] to measure SeLinux data:

    https://patchwork.kernel.org/patch/11801585/

[3] Using [1] to measure dm-crypt data:

https://patchwork.kernel.org/project/linux-integrity/list/?series=366903

[4] Using [1] to measure kernel_version:

    https://patchwork.kernel.org/patch/11854625/

[5] built-in IMA policy rule to handle critical data before a custom IMA policy is loaded:
{Patch is not yet sent for public review}

Mimi has suggested that patch-set [1] should include a demonstrative example use of the functionality in the same series. And that example should be SeLinux (patch-set [2]).

However, SeLinux patch-set [2] depends on the functionality in SeLinux branch [7], which is not yet merged in Integrity branch [6]. Therefore SeLinux patch-set [2] does not apply on the Integrity branch at this time.

Further, SeLinux patch-set [2] also depends on the new code for critical data infrastructure (patch-set [1] and [5]) which is all IMA code. Patch-set [1] and [5], even though all IMA code, applies cleanly on SeLinux branch - along with patch-set [2].

For the above reason, the new series we are going to post, which combines [1], [2], and [5], needs to be based on SeLinux branch.

Since [1] and [5] contains IMA code - we wanted to confirm with the maintainers if there are any concerns to base the series on SeLinux branch.

Thanks,
Tushar

[6] Integrity Repo/Branch:
Repo: https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
Branch: linux-integrity

[7] SeLinux Branch:
Repo: https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git
Branch: next

maintainer
#1 lore raw
Quoted 48 lines · Tushar Sugandhi

Hello Mimi/Stephen/Paul,

As you are already aware, we have several patch-sets in review for IMA infrastructure for measurement of critical kernel data and it's usage.

[1] infrastructure for measurement of critical data patch-set:

https://patchwork.kernel.org/project/linux-integrity/list/?series=354437

[2] Using [1] to measure SeLinux data:

     https://patchwork.kernel.org/patch/11801585/

[3] Using [1] to measure dm-crypt data:

https://patchwork.kernel.org/project/linux-integrity/list/?series=366903

[4] Using [1] to measure kernel_version:

     https://patchwork.kernel.org/patch/11854625/

[5] built-in IMA policy rule to handle critical data before a custom IMA policy is loaded:
{Patch is not yet sent for public review}

Mimi has suggested that patch-set [1] should include a demonstrative example use of the functionality in the same series. And that example should be SeLinux (patch-set [2]).

However, SeLinux patch-set [2] depends on the functionality in SeLinux branch [7], which is not yet merged in Integrity branch [6]. Therefore SeLinux patch-set [2] does not apply on the Integrity branch at this time.

Further, SeLinux patch-set [2] also depends on the new code for critical data infrastructure (patch-set [1] and [5]) which is all IMA code. Patch-set [1] and [5], even though all IMA code, applies cleanly on SeLinux branch - along with patch-set [2].

For the above reason, the new series we are going to post, which combines [1], [2], and [5], needs to be based on SeLinux branch.

Since [1] and [5] contains IMA code - we wanted to confirm with the maintainers if there are any concerns to base the series on SeLinux branch.

Thanks,
Tushar

Quoted 8 lines

[6] Integrity Repo/Branch:
Repo:
https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
Branch: linux-integrity

[7] SeLinux Branch:
Repo: https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git
Branch: next

Unless this patch set is specifically dependent on the two patches in the SELinux tree beyond v5.10.0-rc1, please base it on v5.10.0-rc1.

thanks,

Mimi

#2 lore raw
Quoted 3 lines

Unless this patch set is specifically dependent on the two patches in the SELinux tree beyond v5.10.0-rc1, please base it on v5.10.0-rc1.

Thanks Mimi. We don't have dependencies on those two patches in SELinux tree.

We'll base our changes on v5.10.0-rc1 in SELinux tree.

Thanks for the quick response.

~Tushar

Quoted 4 lines

thanks,

Mimi

maintainer
#3 lore raw
Quoted 9 lines · Tushar Sugandhi
Quoted 2 lines

Unless this patch set is specifically dependent on the two patches in the SELinux tree beyond v5.10.0-rc1, please base it on v5.10.0-rc1.

Thanks Mimi. We don't have dependencies on those two patches in SELinux tree.

We'll base our changes on v5.10.0-rc1 in SELinux tree.

Thanks for the quick response.

I'm not as fast as Mimi, but I thought it might be worthwhile to provide a bit more detail as to what I expect from SELinux kernel submissions. I believe most other maintainers operate in a similar manner, but I obviously can't speak for them.

Unless there is an exception due to a previous discussion, I ask that all SELinux kernel patches be based on either the selinux/next branch or Linus' current tree. If your patch(set) applies cleanly to either of those branches, and passes review, I'll merge it into the selinux/next branch taking care of any merge conflicts that may arise. If the merge is particularly tricky I may ask you to double check the merge afterwards, but in my experience that is rare, most merge conflicts are trivially resolved.

In the case where a patch(set) being proposed for inclusion in the SELinux tree has significant changes to another subsystem, I will ask the affected subsystem's maintainer to review the patch(set). If the other maintainers do not provide an ACK for the patch(set) I will not merge the patches. If the other maintainers do not respond at all for a few weeks, I may go ahead and merge the patch(set) anyway; that is a decision made on a case-by-base basis.

If the patch(set) introduces new functionality I will ask you to add or update an existing test in the selinux-testsuite.
* https://github.com/SELinuxProject/selinux-testsuite

If the patch(set) introduces new, or changed, functionality I may ask you to update The SELinux Notebook.
* https://github.com/SELinuxProject/selinux-notebook

Beyond the above, the general SELinux kernel tree process is documented in the README.md found in selinux/main:
* https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git/tree/README.md

Signature · 2 lines
paul moore
www.paul-moore.com
#4 lore raw

Hi Paul,

Quoted 8 lines · Paul Moore
Quoted 6 lines · Tushar Sugandhi
Quoted 2 lines

Unless this patch set is specifically dependent on the two patches in the SELinux tree beyond v5.10.0-rc1, please base it on v5.10.0-rc1.

Thanks Mimi. We don't have dependencies on those two patches in SELinux tree.

Quoted 8 lines
Quoted 3 lines

We'll base our changes on v5.10.0-rc1 in SELinux tree.

Thanks for the quick response.

I'm not as fast as Mimi, but I thought it might be worthwhile to provide a bit more detail as to what I expect from SELinux kernel submissions. I believe most other maintainers operate in a similar manner, but I obviously can't speak for them.

Thanks a lot for the detailed information Paul.
Its very helpful, and we appreciate it.

Quoted 6 lines

Unless there is an exception due to a previous discussion, I ask that all SELinux kernel patches be based on either the selinux/next branch or Linus' current tree. If your patch(set) applies cleanly to either of those branches, and passes review, I'll merge it into the selinux/next branch taking care of any merge conflicts that may arise.

We will base on SeLinux -> next branch, as you/Mimi suggested.

Quoted 4 lines

If the merge is particularly tricky I may ask you to double check the merge afterwards, but in my experience that is rare, most merge conflicts are trivially resolved.

Based on our testing so far, there aren't any merge conflicts. But if the need arises, we'll do our best to help you resolve/review them.

Quoted 7 lines

In the case where a patch(set) being proposed for inclusion in the SELinux tree has significant changes to another subsystem, I will ask the affected subsystem's maintainer to review the patch(set). If the other maintainers do not provide an ACK for the patch(set) I will not merge the patches. If the other maintainers do not respond at all for a few weeks, I may go ahead and merge the patch(set) anyway; that is a decision made on a case-by-base basis.

Mimi has been actively reviewing IMA side of the changes for this patch-set.

Quoted 5 lines

If the patch(set) introduces new functionality I will ask you to add or update an existing test in the selinux-testsuite.
* https://github.com/SELinuxProject/selinux-testsuite

Lakshmi has written an SeLinux test for this feature, and it is currently being targeted for LTP repo.
https://github.com/linux-test-project/ltp

We can work with you to also get it incorporated in selinux-testsuite. But the concern here is we may have to pull additional dependent scripts from LTP to selinux-testsuite to support our test.

Could you please take a look at Lakshmi's SeLinux test, and guide us further on this? Here is the patch.
https://patchwork.kernel.org/patch/11804587/

Quoted 4 lines

If the patch(set) introduces new, or changed, functionality I may ask you to update The SELinux Notebook.
* https://github.com/SELinuxProject/selinux-notebook

Will do. Thanks.

Quoted 4 lines

Beyond the above, the general SELinux kernel tree process is documented in the README.md found in selinux/main:
* https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git/tree/README.md

Thanks for the pointer.
We'll go through the documentation.
~Tushar

maintainer
#5 lore raw
Quoted 22 lines · Tushar Sugandhi

Hi Paul,

Quoted 8 lines · Paul Moore
Quoted 6 lines · Tushar Sugandhi
Quoted 2 lines

Unless this patch set is specifically dependent on the two patches in the SELinux tree beyond v5.10.0-rc1, please base it on v5.10.0-rc1.

Thanks Mimi. We don't have dependencies on those two patches in SELinux tree.

Quoted 8 lines
Quoted 3 lines

We'll base our changes on v5.10.0-rc1 in SELinux tree.

Thanks for the quick response.

I'm not as fast as Mimi, but I thought it might be worthwhile to provide a bit more detail as to what I expect from SELinux kernel submissions. I believe most other maintainers operate in a similar manner, but I obviously can't speak for them.

Thanks a lot for the detailed information Paul.
Its very helpful, and we appreciate it.

Quoted 1 line
Quoted 6 lines
Quoted 5 lines

Unless there is an exception due to a previous discussion, I ask that all SELinux kernel patches be based on either the selinux/next branch or Linus' current tree. If your patch(set) applies cleanly to either of those branches, and passes review, I'll merge it into the selinux/next branch taking care of any merge conflicts that may arise.

We will base on SeLinux -> next branch, as you/Mimi suggested.

Unless there was a compelling reason for basing it on the SELinux branch, I asked that you base the changes on v5.10.0-rc1 (or later), which has nothing to do with the SELinux branch. Once this patch set is reviewed and ready to be upstreamed, a topic branch will be created
containing at least the IMA patches. The decision as to how the the
SELinux patch will be upstreamed will be made at that point. That discussion will be between Paul and me.

thanks,

Mimi

#6 lore raw
Quoted 30 lines · Mimi Zohar
Quoted 22 lines · Tushar Sugandhi

Hi Paul,

Quoted 8 lines · Paul Moore
Quoted 6 lines · Tushar Sugandhi
Quoted 2 lines

Unless this patch set is specifically dependent on the two patches in the SELinux tree beyond v5.10.0-rc1, please base it on v5.10.0-rc1.

Thanks Mimi. We don't have dependencies on those two patches in SELinux tree.

Quoted 8 lines
Quoted 3 lines

We'll base our changes on v5.10.0-rc1 in SELinux tree.

Thanks for the quick response.

I'm not as fast as Mimi, but I thought it might be worthwhile to provide a bit more detail as to what I expect from SELinux kernel submissions. I believe most other maintainers operate in a similar manner, but I obviously can't speak for them.

Thanks a lot for the detailed information Paul.
Its very helpful, and we appreciate it.

Quoted 1 line
Quoted 6 lines
Quoted 5 lines

Unless there is an exception due to a previous discussion, I ask that all SELinux kernel patches be based on either the selinux/next branch or Linus' current tree. If your patch(set) applies cleanly to either of those branches, and passes review, I'll merge it into the selinux/next branch taking care of any merge conflicts that may arise.

We will base on SeLinux -> next branch, as you/Mimi suggested.

Quoted 8 lines

Unless there was a compelling reason for basing it on the SELinux branch, I asked that you base the changes on v5.10.0-rc1 (or later), which has nothing to do with the SELinux branch. Once this patch set is reviewed and ready to be upstreamed, a topic branch will be created
containing at least the IMA patches. The decision as to how the the
SELinux patch will be upstreamed will be made at that point. That discussion will be between Paul and me.

Sincere apologies Mimi.
We misunderstood your feedback when you mentioned -
"Unless this patch set is specifically dependent on the two patches in the SELinux tree beyond v5.10.0-rc1, please base it on v5.10.0-rc1."

We believed you were recommending selinux repo as there were exactly two patches present in the selinux/next branch after the tag v5.10-rc1.

Anyways - we tried applying the patches to -
repo: https://github.com/torvalds/linux
branch: master
tag: v5.10-rc1

and they get applied cleanly and are working fine.

We will wait for feedback on the v5 patch from you/Paul/Stephen, address those, and then base v6 of the series to tarvolds/master branch on v5.10-rc1 (or later).

Does it sound ok?

Here is the v5 of the series we published yesterday.
https://patchwork.kernel.org/project/linux-integrity/list/?series=375103

Thanks,
Tushar

Quoted 4 lines

thanks,

Mimi

maintainer
#7 lore raw
In reply to Tushar Sugandhi
Quoted 1 line · Tushar Sugandhi

On 2020-10-30 1:37 p.m., Paul Moore wrote:

...

Quoted 8 lines
Quoted 3 lines

If the patch(set) introduces new functionality I will ask you to add or update an existing test in the selinux-testsuite.
* https://github.com/SELinuxProject/selinux-testsuite

Lakshmi has written an SeLinux test for this feature, and it is currently being targeted for LTP repo.
https://github.com/linux-test-project/ltp

Quoted 7 lines

We can work with you to also get it incorporated in selinux-testsuite. But the concern here is we may have to pull additional dependent scripts from LTP to selinux-testsuite to support our test.

Could you please take a look at Lakshmi's SeLinux test, and guide us further on this? Here is the patch.
https://patchwork.kernel.org/patch/11804587/

As I'm looking at the test(s) above, I'm thinking that this may not be something that needs to be in the selinux-testsuite. While SELinux is obviously an important part of the test, the test is more IMA focused (which is probably the way it should be).

As a bit of background, the selinux-testsuite is intended to serve as a relatively easy and quick to run test that can be used by developers to quickly test their patches; while it aims for good coverage, it does not try to be a comprehensive regression test suite. Not only would that be duplicating other efforts such as the LTP, it would go against the goal of making the test suite quick and easy to use.

Quoted 4 lines
Quoted 3 lines

If the patch(set) introduces new, or changed, functionality I may ask you to update The SELinux Notebook.
* https://github.com/SELinuxProject/selinux-notebook

Quoted 8 lines

Will do. Thanks.

Quoted 4 lines

Beyond the above, the general SELinux kernel tree process is documented in the README.md found in selinux/main:
* https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git/tree/README.md

Thanks for the pointer.
We'll go through the documentation.

Can you and Lakshmi help me better understand the state of the SELinux/IMA patches? I see that you included Lakshmi's SELinux/IMA patch in your last patchset, and it appears to have included feedback from Stephen's last review. Is it your intent to continue to submit the SELinux/IMA patch as part of a larger patchset, or do you plan to split that back out into a standalone patch?

Signature · 2 lines
paul moore
www.paul-moore.com
maintainer
#8 lore raw
Quoted 8 lines · Paul Moore

On Sat, Oct 31, 2020 at 11:08 PM Tushar Sugandhi

Can you and Lakshmi help me better understand the state of the SELinux/IMA patches? I see that you included Lakshmi's SELinux/IMA patch in your last patchset, and it appears to have included feedback from Stephen's last review. Is it your intent to continue to submit the SELinux/IMA patch as part of a larger patchset, or do you plan to split that back out into a standalone patch?

Paul, I've asked Tushar and Lakshmi to first define "critical data" and then include at least one example of measuring "critical data" to simplify review. As the SELinux patch is the first example, there is a dependency on the rest of the patch set.

thanks,

Mimi

#9 lore raw
In reply to Paul Moore

On 11/2/20 7:11 PM, Paul Moore wrote:

Hi Paul,

Quoted 18 lines
Quoted 1 line · Tushar Sugandhi

On 2020-10-30 1:37 p.m., Paul Moore wrote:

...

Quoted 12 lines
Quoted 3 lines

If the patch(set) introduces new functionality I will ask you to add or update an existing test in the selinux-testsuite.
* https://github.com/SELinuxProject/selinux-testsuite

Lakshmi has written an SeLinux test for this feature, and it is currently being targeted for LTP repo.
https://github.com/linux-test-project/ltp

We can work with you to also get it incorporated in selinux-testsuite. But the concern here is we may have to pull additional dependent scripts from LTP to selinux-testsuite to support our test.

Quoted 8 lines
Quoted 3 lines

Could you please take a look at Lakshmi's SeLinux test, and guide us further on this? Here is the patch.
https://patchwork.kernel.org/patch/11804587/

As I'm looking at the test(s) above, I'm thinking that this may not be something that needs to be in the selinux-testsuite. While SELinux is obviously an important part of the test, the test is more IMA focused (which is probably the way it should be).

Yes, as you mentioned, the test is more IMA focused. It is to validate the measurement done by IMA against the current state of the configuration and policy of SELinux. Therefore we would like to keep it in LTP.

Quoted 8 lines

As a bit of background, the selinux-testsuite is intended to serve as a relatively easy and quick to run test that can be used by developers to quickly test their patches; while it aims for good coverage, it does not try to be a comprehensive regression test suite. Not only would that be duplicating other efforts such as the LTP, it would go against the goal of making the test suite quick and easy to use.

thanks,
-lakshmi