Thread (7 messages) 7 messages, 4 authors, 2009-11-10

Re: [PATCH v4] Added PR_SET_PROCTITLE_AREA option for prctl()

flat view

From: KOSAKI Motohiro <hidden>
Date: 2009-11-03 14:08:46
Also in: lkml

Possibly related (same subject, not in this thread)

quoted
+		case PR_SET_PROCTITLE_AREA: {
+			struct mm_struct *mm = current->mm;
+			unsigned long addr = arg2;
+			unsigned long len = arg3;
+			unsigned long end = arg2 + arg3;
+
+			if (len > PAGE_SIZE)
+				return -EINVAL;
+
+			if (addr >= end)
+				return -EINVAL;
+
+			if (!access_ok(VERIFY_READ, addr, len))
+				return -EFAULT;
+
+			mutex_lock(&mm->arg_lock);
+			mm->arg_start = addr;
Is this safe? You're assigning a user-space pointer to kernel space...
Don't we need copy_from_user()?
mm->arg_start, arg_end are defined so.
Please see current implementation. 

quoted
+			mm->arg_end = addr + len;
Since you already have 'end', no need to caculate this again. :)
Good catch :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help