[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120105151012.GA25671@redhat.com>
Date: Thu, 5 Jan 2012 16:10:12 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Chris Yeoh <yeohc@....ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Howells <dhowells@...hat.com>,
linux-kernel@...r.kernel.org
Subject: cross memory attach && security check
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists