summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason King <jason.king@joyent.com>2017-11-19 22:42:50 +0000
committerJason King <jason.king@joyent.com>2017-11-20 21:29:57 +0000
commit99b859c7466d1745fdbf023efbb434b0e9f38e53 (patch)
tree1fd6464b02a2fc250e6c805f3cf956547a983f29
parent2d0998ba9095083be74c87c6dd61bd2d364b00ac (diff)
downloadillumos-joyent-99b859c7466d1745fdbf023efbb434b0e9f38e53.tar.gz
OS-6463 Don't allow clearing of thread name in LX on TID 1
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Dan McDonald <danmcd@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/common/brand/lx/syscall/lx_prctl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/uts/common/brand/lx/syscall/lx_prctl.c b/usr/src/uts/common/brand/lx/syscall/lx_prctl.c
index 4aeb2b191e..4aecb6e9cc 100644
--- a/usr/src/uts/common/brand/lx/syscall/lx_prctl.c
+++ b/usr/src/uts/common/brand/lx/syscall/lx_prctl.c
@@ -191,6 +191,16 @@ lx_prctl(int opt, uintptr_t data)
}
/*
+ * We are currently choosing to not allow an empty thread
+ * name to clear p->p_user.u_comm and p->p_user.u_psargs.
+ * This is a slight divergence from linux behavior (which
+ * allows this) so that we can preserve the original command.
+ */
+ if (strlen(name) == 0) {
+ return (0);
+ }
+
+ /*
* We explicitly use t->t_name here instead of name in case
* a thread has come in between the above thread_setname()
* call and the setting of u_comm/u_psargs below. On Linux,