diff options
author | Andy Fiddaman <omnios@citrus-it.co.uk> | 2017-11-19 22:42:50 +0000 |
---|---|---|
committer | Jason King <jason.king@joyent.com> | 2017-11-20 18:02:37 +0000 |
commit | 18f58dd7ad366c8a87f5fbd1cd98c62d45aa233e (patch) | |
tree | 1fd6464b02a2fc250e6c805f3cf956547a983f29 | |
parent | 2d0998ba9095083be74c87c6dd61bd2d364b00ac (diff) | |
download | illumos-joyent-OS-6463.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.c | 10 |
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, |