Ubuntuの中の人が以下のようなパッチを投稿した。
まあ、ようするにprctl(PR_SET_NAME)つかうとtask->commにエスケープシーケンス送り込む事ができて
それを利用して adminをだます事が出来るので良くないって主張だったわけです。


Subject: [PATCH v2] sanitize task->comm to avoid leaking escape codes
From: Kees Cook <kees.cook@canonical.com>

Through get_task_comm() and many direct uses of task->comm in the kernel,
it is possible for escape codes and other non-printables to leak into
dmesg, syslog, etc. In the worst case, these strings could be used to
attack administrators using vulnerable terminal emulators, and at least
cause confusion through the injection of \r characters.

This patch sanitizes task->comm to only contain printable characters
when it is set. Additionally, it redefines get_task_comm so that it is
more obvious when misused by callers (presently nothing was incorrectly
calling get_task_comm's unsafe use of strncpy).

Signed-off-by: Kees Cook
---
v2:
- don't use a helper #define, just fix the arguments and callers
- add missing ctype.h include that got lost during testing.
---
drivers/char/tty_audit.c | 2 +-
fs/exec.c | 18 ++++++++++++++----
fs/proc/array.c | 4 ++--
include/linux/sched.h | 2 +-
kernel/auditsc.c | 2 +-
kernel/capability.c | 4 ++--
kernel/fork.c | 2 +-
kernel/sys.c | 2 +-
8 files changed, 23 insertions(+), 13 deletions(-)

(省略)

void set_task_comm(struct task_struct *tsk, char *buf)
{
+ size_t i;
+
task_lock(tsk);

/*
@@ -955,7 +957,15 @@ void set_task_comm(struct task_struct *tsk, char *buf)
*/
memset(tsk->comm, 0, TASK_COMM_LEN);
wmb();
- strlcpy(tsk->comm, buf, sizeof(tsk->comm));
+
+ /* sanitize non-printable characters */
+ for (i = 0; buf[i] && i < (sizeof(tsk->comm) - 1); i++) {
+ if (!isprint(buf[i]))
+ tsk->comm[i] = '?';
+ else
+ tsk->comm[i] = buf[i];
+ }
+
task_unlock(tsk);
perf_event_comm(tsk);
}


ここで、Alan Cox登場。雄々しく答えて曰く

  「そんな腐ったターミナルエミュレータ使うな」