linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
	Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Petko Manolov <petkan@mip-labs.com>,
	James Morris <jmorris@namei.org>
Subject: Re: linux-next: manual merge of the integrity tree with the vfs tree
Date: Mon, 4 Jan 2016 13:58:40 +1100	[thread overview]
Message-ID: <20160104135840.388f3fbc@canb.auug.org.au> (raw)
In-Reply-To: <20160104135221.0e5515ac@canb.auug.org.au>

[Just cc'ing the security tree maintainer, since this will soon be in
his tree and is related to a conflict between that tree and the vfs
tree.]

On Mon, 4 Jan 2016 13:52:21 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> 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;

  reply	other threads:[~2016-01-04  2:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160104135840.388f3fbc@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=petkan@mip-labs.com \
    --cc=viro@ZenIV.linux.org.uk \
    --cc=zohar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).