linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the integrity tree with the vfs tree
@ 2016-01-04  2:52 Stephen Rothwell
  2016-01-04  2:58 ` Stephen Rothwell
  2016-01-04  3:16 ` Al Viro
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2016-01-04  2:52 UTC (permalink / raw)
  To: Mimi Zohar, Dmitry Kasatkin, Al Viro
  Cc: linux-next, linux-kernel, Petko Manolov

Hi all,

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

  security/integrity/ima/ima_fs.c

between commit:

  3bc8f29b149e ("new helper: memdup_user_nul()")

from the vfs tree and commit:

  6427e6c71c8b ("ima: ima_write_policy() limit locking")

from the integrity tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc security/integrity/ima/ima_fs.c
index a185b6f2f390,f355231997b4..000000000000
--- a/security/integrity/ima/ima_fs.c
+++ b/security/integrity/ima/ima_fs.c
@@@ -277,13 -272,25 +272,20 @@@ static ssize_t ima_write_policy(struct 
  	if (*ppos != 0)
  		goto out;
  
 -	result = -ENOMEM;
 -	data = kmalloc(datalen + 1, GFP_KERNEL);
 -	if (!data)
 +	data = memdup_user_nul(buf, datalen);
 +	if (IS_ERR(data)) {
 +		result = PTR_ERR(data);
  		goto out;
 -
 -	*(data + datalen) = '\0';
 -
 -	result = -EFAULT;
 -	if (copy_from_user(data, buf, datalen))
 -		goto out_free;
 +	}
  
+ 	result = mutex_lock_interruptible(&ima_write_mutex);
+ 	if (result < 0)
+ 		goto out_free;
  	result = ima_parse_add_rule(data);
+ 	mutex_unlock(&ima_write_mutex);
+ 
+ out_free:
+ 	kfree(data);
  out:
  	if (result < 0)
  		valid_policy = 0;

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

end of thread, other threads:[~2016-01-04 12:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04  2:52 linux-next: manual merge of the integrity tree with the vfs tree Stephen Rothwell
2016-01-04  2:58 ` Stephen Rothwell
2016-01-04  3:16 ` Al Viro
2016-01-04  5:06   ` Mimi Zohar
2016-01-04  5:23     ` Stephen Rothwell
2016-01-04 12:32       ` Mimi Zohar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).