linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the security tree with the vfs tree
@ 2015-12-31  4:24 Stephen Rothwell
  2015-12-31  4:30 ` Al Viro
  2016-01-04  1:37 ` linux-next: manual merge of the security tree with the vfs tree Mimi Zohar
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Rothwell @ 2015-12-31  4:24 UTC (permalink / raw)
  To: James Morris, Al Viro; +Cc: linux-next, linux-kernel, Petko Manolov, Mimi Zohar

Hi James,

Today's linux-next merge of the security 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:

  38d859f991f3 ("IMA: policy can now be updated multiple times")

from the security tree.

I fixed it up (hopefully, 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 71aa60b8d257,3caed6de610c..000000000000
--- a/security/integrity/ima/ima_fs.c
+++ b/security/integrity/ima/ima_fs.c
@@@ -259,21 -261,35 +261,30 @@@ static const struct file_operations ima
  static ssize_t ima_write_policy(struct file *file, const char __user *buf,
  				size_t datalen, loff_t *ppos)
  {
 -	char *data = NULL;
  	ssize_t result;
- 	char *data;
++	char *data = NULL;
+ 	int res;
+ 
+ 	res = mutex_lock_interruptible(&ima_write_mutex);
+ 	if (res)
+ 		return res;
  
  	if (datalen >= PAGE_SIZE)
  		datalen = PAGE_SIZE - 1;
  
  	/* No partial writes. */
+ 	result = -EINVAL;
  	if (*ppos != 0)
- 		return -EINVAL;
+ 		goto out;
  
 -	result = -ENOMEM;
 -	data = kmalloc(datalen + 1, GFP_KERNEL);
 -	if (!data)
 -		goto out;
 -
 -	*(data + datalen) = '\0';
 -
 -	result = -EFAULT;
 -	if (copy_from_user(data, buf, datalen))
 +	data = memdup_user_nul(buf, datalen);
- 	if (IS_ERR(data))
- 		return PTR_ERR(data);
++	if (IS_ERR(data)) {
++		result = PTR_ERR(data);
+ 		goto out;
++	}
  
  	result = ima_parse_add_rule(data);
+ out:
  	if (result < 0)
  		valid_policy = 0;
  	kfree(data);

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-31  4:24 linux-next: manual merge of the security tree with the vfs tree Stephen Rothwell
2015-12-31  4:30 ` Al Viro
2015-12-31 10:45   ` Petko Manolov
2016-01-01  4:34     ` Al Viro
2016-01-01 17:29       ` Petko Manolov
2016-01-01 17:41         ` [PATCH] ima_write_policy() optimizations; kbuild test robot
2016-01-04  1:37 ` linux-next: manual merge of the security tree with the vfs tree Mimi Zohar
2016-01-04  1:55   ` Stephen Rothwell

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).