Skip to contentSkip to conversation

linux-next: manual merge of the pidfd tree with the integrity tree

DISCUSSION Stephen Rothwell 1 participant 3 messages Jan 25, 2021 – Feb 23, 2021 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the pidfd tree got a conflict in:

security/integrity/ima/ima_api.c

between commit:

2b4a2474a202 ("IMA: generalize keyring specific measurement constructs")

from the integrity tree and commit:

a2d2329e30e2 ("ima: handle idmapped mounts")

from the pidfd tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 32 lines
Cheers,
Stephen Rothwell

diff --cc security/integrity/ima/ima_api.c
index 1dd70dc68ffd,ed410efb3597..000000000000
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@@ -183,17 -184,18 +184,18 @@@ err_out
   * Returns IMA_MEASURE, IMA_APPRAISE mask.
   *
   */
- int ima_get_action(struct inode *inode, const struct cred *cred, u32 secid,
- 		   int mask, enum ima_hooks func, int *pcr,
+ int ima_get_action(struct user_namespace *mnt_userns, struct inode *inode,
+ 		   const struct cred *cred, u32 secid, int mask,
+ 		   enum ima_hooks func, int *pcr,
  		   struct ima_template_desc **template_desc,
 -		   const char *keyring)
 +		   const char *func_data)
  {
  	int flags = IMA_MEASURE | IMA_AUDIT | IMA_APPRAISE | IMA_HASH;
  
  	flags &= ima_policy_flag;
  
- 	return ima_match_policy(inode, cred, secid, func, mask, flags, pcr,
- 				template_desc, func_data);
+ 	return ima_match_policy(mnt_userns, inode, cred, secid, func, mask,
 -				flags, pcr, template_desc, keyring);
++				flags, pcr, template_desc, func_data);
  }
  
  /*
#1 lore raw

Hi all,

Quoted 41 lines · On Mon, 25 Jan 2021 17:18:18 +1100 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the pidfd tree got a conflict in:

security/integrity/ima/ima_api.c

between commit:

2b4a2474a202 ("IMA: generalize keyring specific measurement constructs")

from the integrity tree and commit:

a2d2329e30e2 ("ima: handle idmapped mounts")

from the pidfd tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

security/integrity/ima/ima_api.c +3 -2
diff --cc security/integrity/ima/ima_api.c
index 1dd70dc68ffd,ed410efb3597..000000000000
@@@ -183,17 -184,18 +184,18 @@@ err_out
   * Returns IMA_MEASURE, IMA_APPRAISE mask.
   *
   */
- int ima_get_action(struct inode *inode, const struct cred *cred, u32 secid,
- 		   int mask, enum ima_hooks func, int *pcr,
+ int ima_get_action(struct user_namespace *mnt_userns, struct inode *inode,
+ 		   const struct cred *cred, u32 secid, int mask,
+ 		   enum ima_hooks func, int *pcr,
  		   struct ima_template_desc **template_desc,
 -		   const char *keyring)
 +		   const char *func_data)
  {
  	int flags = IMA_MEASURE | IMA_AUDIT | IMA_APPRAISE | IMA_HASH;
 

security/integrity/ima/ima_api.c

Quoted 10 lines
security/integrity/ima/ima_api.c +2 -2
  	flags &= ima_policy_flag;
 
- 	return ima_match_policy(inode, cred, secid, func, mask, flags, pcr,
- 				template_desc, func_data);
+ 	return ima_match_policy(mnt_userns, inode, cred, secid, func, mask,
 -				flags, pcr, template_desc, keyring);
++				flags, pcr, template_desc, func_data);
  }
 
  /*

With the merge window about to open, this is a reminder that this conflict still exists.

Signature · 2 lines
Cheers,
Stephen Rothwell
#2 lore raw

Hi all,

Quoted 52 lines · On Mon, 15 Feb 2021 08:07:17 +1100 Stephen Rothwell <[email protected]>…
Quoted 50 lines · On Mon, 25 Jan 2021 17:18:18 +1100 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the pidfd tree got a conflict in:

security/integrity/ima/ima_api.c

between commit:

2b4a2474a202 ("IMA: generalize keyring specific measurement constructs")

from the integrity tree and commit:

a2d2329e30e2 ("ima: handle idmapped mounts")

from the pidfd tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

security/integrity/ima/ima_api.c +5 -4
diff --cc security/integrity/ima/ima_api.c
index 1dd70dc68ffd,ed410efb3597..000000000000
@@@ -183,17 -184,18 +184,18 @@@ err_out
   * Returns IMA_MEASURE, IMA_APPRAISE mask.
   *
   */
- int ima_get_action(struct inode *inode, const struct cred *cred, u32 secid,
- 		   int mask, enum ima_hooks func, int *pcr,
+ int ima_get_action(struct user_namespace *mnt_userns, struct inode *inode,
+ 		   const struct cred *cred, u32 secid, int mask,
+ 		   enum ima_hooks func, int *pcr,
  		   struct ima_template_desc **template_desc,
 -		   const char *keyring)
 +		   const char *func_data)
  {
  	int flags = IMA_MEASURE | IMA_AUDIT | IMA_APPRAISE | IMA_HASH;
 
  	flags &= ima_policy_flag;
 
- 	return ima_match_policy(inode, cred, secid, func, mask, flags, pcr,
- 				template_desc, func_data);
+ 	return ima_match_policy(mnt_userns, inode, cred, secid, func, mask,
 -				flags, pcr, template_desc, keyring);
++				flags, pcr, template_desc, func_data);
  }
Quoted 4 lines
Quoted 1 line

/*

With the merge window about to open, this is a reminder that this conflict still exists.

This is now a conflict between the pidfd tree and Linus' tree.

Signature · 2 lines
Cheers,
Stephen Rothwell