From 18f58dd7ad366c8a87f5fbd1cd98c62d45aa233e Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sun, 19 Nov 2017 22:42:50 +0000 Subject: OS-6463 Clearing a thread name before setting causes panic --- usr/src/uts/common/brand/lx/syscall/lx_prctl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 @@ -190,6 +190,16 @@ lx_prctl(int opt, uintptr_t data) return (0); } + /* + * 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() -- cgit v1.2.3