lkml.org 
[lkml]   [2004]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: One more get_task_comm()

Removing assumption of command length as 16 completely

--- arch/mips/kernel/sysirix.c.saved Wed Nov 17 13:18:50 2004
+++ arch/mips/kernel/sysirix.c Wed Nov 17 14:09:12 2004
@@ -282,9 +282,9 @@
int pid = (int) regs->regs[base + 5];
char *buf = (char *) regs->regs[base + 6];
struct task_struct *p;
- char comm[16];
+ char tcomm[sizeof(current->comm)];

- retval = verify_area(VERIFY_WRITE, buf, 16);
+ retval = verify_area(VERIFY_WRITE, buf, sizeof(tcomm));
if (retval)
break;
read_lock(&tasklist_lock);
@@ -294,11 +294,11 @@
retval = -ESRCH;
break;
}
- memcpy(comm, p->comm, 16);
+ get_task_comm(tcomm, p);
read_unlock(&tasklist_lock);

/* XXX Need to check sizes. */
- copy_to_user(buf, p->comm, 16);
+ copy_to_user(buf, tcomm, sizeof(tcomm));
retval = 0;
break;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.114 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site