From: Oleg Nesterov <oleg@redhat.com>
To: David Howells <dhowells@redhat.com>
Cc: roland@redhat.com, jmorris@namei.org, chrisw@sous-sol.org,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, eparis@redhat.com,
sds@tycho.nsa.gov, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 1/2] CRED: Rename cred_exec_mutex to reflect that it's a guard against ptrace
Date: Sat, 9 May 2009 20:59:06 +0200 [thread overview]
Message-ID: <20090509185906.GB10396@redhat.com> (raw)
In-Reply-To: <20090508125522.8488.13637.stgit@warthog.procyon.org.uk>
Sorry for delay,
On 05/08, David Howells wrote:
>
> @@ -185,10 +185,11 @@ int ptrace_attach(struct task_struct *task)
> if (same_thread_group(task, current))
> goto out;
>
> - /* Protect exec's credential calculations against our interference;
> - * SUID, SGID and LSM creds get determined differently under ptrace.
> + /* Protect the target's credential calculations against our
> + * interference; SUID, SGID and LSM creds get determined differently
> + * under ptrace.
> */
> - retval = mutex_lock_interruptible(&task->cred_exec_mutex);
> + retval = mutex_lock_interruptible(&task->cred_guard_mutex);
> if (retval < 0)
> goto out;
>
> @@ -232,7 +233,7 @@ repeat:
> bad:
> write_unlock_irqrestore(&tasklist_lock, flags);
> task_unlock(task);
> - mutex_unlock(&task->cred_exec_mutex);
> + mutex_unlock(&task->cred_guard_mutex);
This rename is obviously fine, but conflicts with
ptrace-do-not-use-task_lock-for-attach.patch in -mm tree:
-bad:
- write_unlock_irqrestore(&tasklist_lock, flags);
- task_unlock(task);
+unlock_tasklist:
+ write_unlock_irq(&tasklist_lock);
+unlock_creds:
mutex_unlock(&task->cred_exec_mutex);
out:
return retval;
Hmm. Ingo's "rename ptrace_may_access => ptrace_access_check" conflicts
with my patch too.
Andrew, Roland, I guess I should re-send
ptrace-ptrace_attach-check-pf_kthread-exit_state-instead-of-mm.patch
ptrace-cleanup-check-set-of-pt_ptraced-during-attach.patch
ptrace-do-not-use-task_lock-for-attach.patch
patches?
Oleg.
next prev parent reply other threads:[~2009-05-09 19:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 12:55 [PATCH 1/2] CRED: Rename cred_exec_mutex to reflect that it's a guard against ptrace David Howells
2009-05-08 12:55 ` [PATCH 2/2] CRED: Guard the setprocattr security hook " David Howells
2009-05-10 22:37 ` James Morris
2009-05-09 18:59 ` Oleg Nesterov [this message]
2009-05-10 23:29 ` [PATCH 1/2] CRED: Rename cred_exec_mutex to reflect that it's a guard " Roland McGrath
2009-05-11 11:33 ` Ingo Molnar
2009-05-10 22:37 ` James Morris
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=20090509185906.GB10396@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=chrisw@sous-sol.org \
--cc=dhowells@redhat.com \
--cc=eparis@redhat.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
--cc=sds@tycho.nsa.gov \
/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