summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2017-11-19 22:42:50 +0000
committerJason King <jason.king@joyent.com>2017-11-20 18:02:37 +0000
commit18f58dd7ad366c8a87f5fbd1cd98c62d45aa233e (patch)
tree1fd6464b02a2fc250e6c805f3cf956547a983f29
parent2d0998ba9095083be74c87c6dd61bd2d364b00ac (diff)
downloadillumos-joyent-18f58dd7ad366c8a87f5fbd1cd98c62d45aa233e.tar.gz
OS-6463 Clearing a thread name before setting causes panicOS-6463
-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,