From: Oleg Nesterov <oleg@redhat.com>
To: Chris Yeoh <yeohc@au1.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
linux-kernel@vger.kernel.org
Subject: cross memory attach && security check
Date: Thu, 5 Jan 2012 16:10:12 +0100 [thread overview]
Message-ID: <20120105151012.GA25671@redhat.com> (raw)
Hello,
Just noticed the new file in mm/ ;) A couple of questions.
process_vm_rw_core() does
task_lock(task);
if (__ptrace_may_access(task, PTRACE_MODE_ATTACH)) {
task_unlock(task);
rc = -EPERM;
goto put_task_struct;
}
mm = task->mm;
this is racy, task_lock() can't help. And I don't think you should
use it directly.
execve() does exec_mmap() first, this switches to the new ->mm.
After that install_exec_creds() changes task->cred. The window
is not that small.
I guess you need ->cred_guard_mutex, please look at mm_for_maps().
Another question, process_vm_rw_pages() does get_user_pages() without
FOLL_FORCE. Is this on purpose? This limits the usage of the new
syscalls.
Hmm. And could you please explain the change in rw_copy_check_uvector()?
Why process_vm_rw() does
rw_copy_check_uvector(READ, rvec, check_access => 0) ?
Oleg.
next reply other threads:[~2012-01-05 15:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 15:10 Oleg Nesterov [this message]
2012-01-09 7:11 ` cross memory attach && security check Christopher Yeoh
2012-01-09 14:53 ` Oleg Nesterov
2012-01-10 13:14 ` Oleg Nesterov
2012-01-11 1:17 ` Christopher Yeoh
2012-01-11 15:49 ` Oleg Nesterov
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=20120105151012.GA25671@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yeohc@au1.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.