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

From: Stephen Rothwell
Date: Wed Jan 27 2021 - 00:07:20 EST


Hi all,

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

security/integrity/ima/ima_policy.c

between commit:

a2d2329e30e2 ("ima: handle idmapped mounts")

from the pidfd tree and commit:

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

from the integrity 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.

--
Cheers,
Stephen Rothwell

diff --cc security/integrity/ima/ima_policy.c
index e14426c24a19,9b45d064a87d..000000000000
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@@ -498,11 -522,10 +523,11 @@@ static bool ima_match_rule_data(struct
*
* Returns true on rule match, false on failure.
*/
-static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode,
- const struct cred *cred, u32 secid,
- enum ima_hooks func, int mask,
+static bool ima_match_rules(struct ima_rule_entry *rule,
+ struct user_namespace *mnt_userns,
+ struct inode *inode, const struct cred *cred,
+ u32 secid, enum ima_hooks func, int mask,
- const char *keyring)
+ const char *func_data)
{
int i;

@@@ -623,11 -650,10 +653,11 @@@ static int get_subaction(struct ima_rul
* list when walking it. Reads are many orders of magnitude more numerous
* than writes so ima_match_policy() is classical RCU candidate.
*/
-int ima_match_policy(struct inode *inode, const struct cred *cred, u32 secid,
- enum ima_hooks func, int mask, int flags, int *pcr,
+int ima_match_policy(struct user_namespace *mnt_userns, struct inode *inode,
+ const struct cred *cred, u32 secid, enum ima_hooks func,
+ int mask, int flags, int *pcr,
struct ima_template_desc **template_desc,
- const char *keyring)
+ const char *func_data)
{
struct ima_rule_entry *entry;
int action = 0, actmask = flags | (flags << 1);
@@@ -641,8 -667,8 +671,8 @@@
if (!(entry->action & actmask))
continue;

- if (!ima_match_rules(entry, inode, cred, secid, func, mask,
- func_data))
+ if (!ima_match_rules(entry, mnt_userns, inode, cred, secid,
- func, mask, keyring))
++ func, mask, func_data))
continue;

action |= entry->flags & IMA_ACTION_FLAGS;

Attachment: pgpvR1oQ2VPOS.pgp
Description: OpenPGP digital signature