linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: manual merge of the userns tree with the tip tree
Date: Wed, 16 Dec 2020 12:02:21 +1100	[thread overview]
Message-ID: <20201216120221.3cd7bfce@canb.auug.org.au> (raw)
In-Reply-To: <20201211182453.2522566c@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 2462 bytes --]

Hi all,

On Fri, 11 Dec 2020 18:24:53 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the userns tree got a conflict in:
> 
>   kernel/events/core.c
> 
> between commit:
> 
>   78af4dc949da ("perf: Break deadlock involving exec_update_mutex")
> 
> from the tip tree and commit:
> 
>   f7cfd871ae0c ("exec: Transform exec_update_mutex into a rw_semaphore")
> 
> from the userns 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.
> 
> diff --cc kernel/events/core.c
> index 19ae6c931c52,55b2330b556c..000000000000
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@@ -11958,24 -11864,6 +11958,24 @@@ SYSCALL_DEFINE5(perf_event_open
>   		goto err_context;
>   	}
>   
>  +	if (task) {
> - 		err = mutex_lock_interruptible(&task->signal->exec_update_mutex);
> ++		err = down_read_interruptible(&task->signal->exec_update_lock);
>  +		if (err)
>  +			goto err_file;
>  +
>  +		/*
>  +		 * Preserve ptrace permission check for backwards compatibility.
>  +		 *
> - 		 * We must hold exec_update_mutex across this and any potential
> ++		 * We must hold exec_update_lock across this and any potential
>  +		 * perf_install_in_context() call for this new event to
>  +		 * serialize against exec() altering our credentials (and the
>  +		 * perf_event_exit_task() that could imply).
>  +		 */
>  +		err = -EACCES;
>  +		if (!perfmon_capable() && !ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS))
>  +			goto err_cred;
>  +	}
>  +
>   	if (move_group) {
>   		gctx = __perf_event_ctx_lock_double(group_leader, ctx);
>   
> @@@ -12151,10 -12039,7 +12151,10 @@@ err_locked
>   	if (move_group)
>   		perf_event_ctx_unlock(group_leader, gctx);
>   	mutex_unlock(&ctx->mutex);
>  -/* err_file: */
>  +err_cred:
>  +	if (task)
> - 		mutex_unlock(&task->signal->exec_update_mutex);
> ++		up_read(&task->signal->exec_update_lock);
>  +err_file:
>   	fput(event_file);
>   err_context:
>   	perf_unpin_context(ctx);

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

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-12-16  1:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11  7:24 linux-next: manual merge of the userns tree with the tip tree Stephen Rothwell
2020-12-16  1:02 ` Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-09  6:49 Stephen Rothwell
2018-10-15  4:11 Stephen Rothwell
2018-10-15  4:34 ` Stephen Rothwell
2018-10-15  5:49   ` Eric W. Biederman
2018-09-24  3:34 Stephen Rothwell
2015-06-04 10:49 Stephen Rothwell
2012-05-21  7:30 Stephen Rothwell
2012-05-21 23:02 ` Eric W. Biederman

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=20201216120221.3cd7bfce@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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).