Re: [PATCH] sched: share task comm length value to userspace

From: Andrew Morton
Date: Fri Sep 09 2011 - 19:50:20 EST


On Fri, 9 Sep 2011 16:41:30 -0700
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> if (prctl(PR_GET_NAME, (unsigned long)comm2, 0, 0, 0) < 0) {

Actually, if we were ever to increase sizeof(task_struct.comm),
existing code which does

char comm[16];
prctl(PR_GET_NAME, comm, ...)

will get its stack scribbled on.

So we _could_ increase it, but we'd need to retain the old 16-char
interfaces and add new prctl() modes. And if we did that, we'd design
them in such a way that userspace wouldn't need to assume a fixed
size..

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/