Thread (3 messages) 3 messages, 2 authors, 2011-07-18

Re: [RESEND] Cross Memory Attach v3

From: Christopher Yeoh <hidden>
Date: 2011-07-18 15:05:20

On Fri, 15 Jul 2011 15:37:43 -0700
Andrew Morton [off-list ref] wrote:
On Fri, 8 Jul 2011 18:06:07 +0930
Christopher Yeoh [off-list ref] wrote:
quoted
+static ssize_t process_vm_rw(pid_t pid, const struct iovec *lvec,
+			     unsigned long liovcnt,
+			     const struct iovec *rvec,
+			     unsigned long riovcnt,
+			     unsigned long flags, int vm_write)
+{

...

+	if (!mm || (task->flags & PF_KTHREAD)) {
Can a PF_KTHREAD thread have a non-zero ->mm?
quoted
+		task_unlock(task);
+		rc = -EINVAL;
+		goto put_task_struct;
+	}
According to get_task_mm it can:

/**
 * get_task_mm - acquire a reference to the task's mm
 *
 * Returns %NULL if the task has no mm.  Checks PF_KTHREAD (meaning
 * this kernel workthread has transiently adopted a user mm with use_mm,
 * to do its AIO) is not set and if so returns a reference to it, after
 * bumping up the use count.  User must release the mm via mmput()
 * after use.  Typically used by /proc and ptrace.
 */
anyway, grumble.

Please resend, cc'ing linux-kernel.
Am doing the CC resends in a separate email...

Chris
-- 
cyeoh@au.ibm.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help