linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cross memory attach && security check
@ 2012-01-05 15:10 Oleg Nesterov
  2012-01-09  7:11 ` Christopher Yeoh
  0 siblings, 1 reply; 6+ messages in thread
From: Oleg Nesterov @ 2012-01-05 15:10 UTC (permalink / raw)
  To: Chris Yeoh; +Cc: Andrew Morton, David Howells, linux-kernel

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-11 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-05 15:10 cross memory attach && security check Oleg Nesterov
2012-01-09  7:11 ` 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

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).