summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mooney <patrick.f.mooney@gmail.com>2015-07-06 14:33:40 +0000
committerPatrick Mooney <patrick.f.mooney@gmail.com>2015-07-06 19:00:09 +0000
commitf11c74658e3c80dcffe8244d5ae6a22c62e8f395 (patch)
tree3e9bf28b846c15ce65b010a4e3884cb51e5c2996
parentb6d4e435c4029ebfbc68b844f9cf7d5978684755 (diff)
downloadillumos-joyent-f11c74658e3c80dcffe8244d5ae6a22c62e8f395.tar.gz
OS-4474 lxbrand missing prctl(PR_SET_PDEATHSIG) support
OS-4476 lxbrand convert prctl to IKE Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
-rw-r--r--usr/src/common/brand/lx/lx_signum.c22
-rw-r--r--usr/src/common/brand/lx/lx_signum.h1
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/lx_brand.c4
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/misc.c100
-rw-r--r--usr/src/lib/brand/lx/lx_brand/sys/lx_misc.h13
-rw-r--r--usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h2
-rw-r--r--usr/src/lib/brand/lx/testing/Readme_ltp2
-rw-r--r--usr/src/lib/brand/lx/testing/ltp_skiplist2
-rw-r--r--usr/src/uts/common/brand/lx/os/lx_brand.c29
-rw-r--r--usr/src/uts/common/brand/lx/os/lx_syscall.c4
-rw-r--r--usr/src/uts/common/brand/lx/sys/lx_brand.h13
-rw-r--r--usr/src/uts/common/brand/lx/sys/lx_syscalls.h1
-rw-r--r--usr/src/uts/common/brand/lx/syscall/lx_prctl.c201
-rw-r--r--usr/src/uts/intel/Makefile.files1
14 files changed, 265 insertions, 130 deletions
diff --git a/usr/src/common/brand/lx/lx_signum.c b/usr/src/common/brand/lx/lx_signum.c
index 755600911a..9c861c282a 100644
--- a/usr/src/common/brand/lx/lx_signum.c
+++ b/usr/src/common/brand/lx/lx_signum.c
@@ -271,6 +271,28 @@ lx_stol_signo(int signo, int defsig)
return (rval);
}
+
+/*
+ * Convert a Linux signal number to an illumos signal number and return it.
+ * Error behavior is identical to lx_stol_signo.
+ */
+int
+lx_ltos_signo(int signo, int defsig)
+{
+#ifdef _KERNEL
+ VERIFY3S(defsig, >=, 0);
+#endif
+
+ if (signo < 1 || signo >= NSIG) {
+#ifndef _KERNEL
+ VERIFY3S(defsig, >=, 0);
+#endif
+ return (defsig);
+ }
+
+ return (ltos_signo[signo]);
+}
+
/*
* Convert the "status" field of a SIGCLD siginfo_t. We need to extract the
* illumos signal number and convert it to a Linux signal number while leaving
diff --git a/usr/src/common/brand/lx/lx_signum.h b/usr/src/common/brand/lx/lx_signum.h
index a7807c2b07..4db2baa5f5 100644
--- a/usr/src/common/brand/lx/lx_signum.h
+++ b/usr/src/common/brand/lx/lx_signum.h
@@ -75,6 +75,7 @@ extern const int ltos_signo[];
extern const int stol_signo[];
extern int lx_stol_signo(int, int);
+extern int lx_ltos_signo(int, int);
extern int lx_stol_status(int, int);
extern int lx_stol_sigcode(int);
diff --git a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c
index b45ae933ed..951a6f7636 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c
@@ -1071,7 +1071,7 @@ static lx_syscall_handler_t lx_handlers[] = {
NULL, /* 154: modify_ldt */
NULL, /* 155: pivot_root */
lx_sysctl, /* 156: sysctl */
- lx_prctl, /* 157: prctl */
+ NULL, /* 157: prctl */
NULL, /* 158: arch_prctl */
lx_adjtimex, /* 159: adjtimex */
NULL, /* 160: setrlimit */
@@ -1417,7 +1417,7 @@ static lx_syscall_handler_t lx_handlers[] = {
NULL, /* 169: nfsservctl */
NULL, /* 170: setresgid16 */
lx_getresgid16, /* 171: getresgid16 */
- lx_prctl, /* 172: prctl */
+ NULL, /* 172: prctl */
lx_rt_sigreturn, /* 173: rt_sigreturn */
lx_rt_sigaction, /* 174: rt_sigaction */
lx_rt_sigprocmask, /* 175: rt_sigprocmask */
diff --git a/usr/src/lib/brand/lx/lx_brand/common/misc.c b/usr/src/lib/brand/lx/lx_brand/common/misc.c
index 9e4bd0052c..f56b9e8905 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/misc.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/misc.c
@@ -603,106 +603,6 @@ lx_setgroups(uintptr_t p1, uintptr_t p2)
}
/*
- * Linux currently defines 42 options for prctl (PR_CAPBSET_READ,
- * PR_CAPBSET_DROP, etc.). Most of these are not emulated.
- */
-long
-lx_prctl(int option, uintptr_t arg2, uintptr_t arg3,
- uintptr_t arg4, uintptr_t arg5)
-{
- psinfo_t psinfo;
- size_t fnamelen = sizeof (psinfo.pr_fname);
- size_t psargslen = sizeof (psinfo.pr_psargs);
- int fd;
-
- if (option == LX_PR_GET_DUMPABLE) {
- /* Indicate that process is always dumpable */
- return (1);
- }
-
- if (option == LX_PR_GET_SECUREBITS) {
- /* Our bits are always 0 */
- return (0);
- }
-
- if (option == LX_PR_SET_SECUREBITS) {
- /* Ignore setting any bits from arg2 */
- return (0);
- }
-
- if (option == LX_PR_SET_DUMPABLE) {
- if (arg2 != 1 && arg2 != 0)
- return (-EINVAL);
- /* Lie about altering process dumpability */
- return (0);
- }
-
- if (option == LX_PR_SET_KEEPCAPS) {
- /*
- * The closest illumos analog to SET_KEEPCAPS is the PRIV_AWARE
- * flag. There are probably some cases where it's not exactly
- * the same, but this will do for a first try.
- */
- if (arg2 == 0) {
- if (setpflags(PRIV_AWARE_RESET, 1) != 0)
- return (-errno);
- } else {
- if (setpflags(PRIV_AWARE, 1) != 0)
- return (-errno);
- }
- return (0);
- }
-
- if (option != LX_PR_SET_NAME) {
- lx_unsupported("prctl option %d", option);
- return (-ENOSYS);
- }
-
- /*
- * In Linux, PR_SET_NAME sets the name of the thread, not the process.
- * Due to the historical quirks of Linux's asinine thread model, this
- * name is effectively the name of the process (as visible via ps(1))
- * if the thread is the first of its task group. The first thread is
- * therefore special, and to best mimic Linux semantics (and absent a
- * notion of per-LWP names), we do nothing (but return success) on LWPs
- * other than LWP 1.
- */
- if (thr_self() != 1)
- return (0);
-
- if (uucopy((void *)arg2, psinfo.pr_fname,
- MIN(LX_PR_SET_NAME_NAMELEN, fnamelen)) != 0)
- return (-errno);
-
- psinfo.pr_fname[fnamelen - 1] = '\0';
-
- if (uucopy((void *)arg2, psinfo.pr_psargs,
- MIN(LX_PR_SET_NAME_NAMELEN, psargslen)) != 0)
- return (-errno);
-
- psinfo.pr_psargs[psargslen - 1] = '\0';
-
- if ((fd = open("/native/proc/self/psinfo", O_WRONLY)) < 0)
- return (-errno);
-
- if (pwrite(fd, psinfo.pr_fname, fnamelen,
- (uintptr_t)psinfo.pr_fname - (uintptr_t)&psinfo) != fnamelen) {
- (void) close(fd);
- return (-EIO);
- }
-
- if (pwrite(fd, psinfo.pr_psargs, psargslen,
- (uintptr_t)psinfo.pr_psargs - (uintptr_t)&psinfo) != psargslen) {
- (void) close(fd);
- return (-EIO);
- }
-
- (void) close(fd);
-
- return (0);
-}
-
-/*
* For syslog(), as there is no kernel and nothing to log, we simply emulate a
* kernel cyclic buffer (LOG_BUF_LEN) of 0 bytes, only handling errors for bad
* input. All actions except 3 and 10 require CAP_SYS_ADMIN or CAP_SYSLOG, in
diff --git a/usr/src/lib/brand/lx/lx_brand/sys/lx_misc.h b/usr/src/lib/brand/lx/lx_brand/sys/lx_misc.h
index c92b50c72d..6f1b772228 100644
--- a/usr/src/lib/brand/lx/lx_brand/sys/lx_misc.h
+++ b/usr/src/lib/brand/lx/lx_brand/sys/lx_misc.h
@@ -103,19 +103,6 @@ extern pid_t zoneinit_pid;
#define LX_RUSAGE_THREAD 1
/*
- * Constants for prctl(). We only include the ones here that we actually
- * support; everything else will be ENOSYS.
- */
-#define LX_PR_GET_DUMPABLE 3
-#define LX_PR_SET_DUMPABLE 4
-#define LX_PR_SET_KEEPCAPS 8
-#define LX_PR_SET_NAME 15
-#define LX_PR_GET_SECUREBITS 27
-#define LX_PR_SET_SECUREBITS 28
-
-#define LX_PR_SET_NAME_NAMELEN 16
-
-/*
* Based on code from brand_misc.h, but use of that is incompatible with the
* lx brand.
*
diff --git a/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h b/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h
index 7e381ae15e..5fae6ac116 100644
--- a/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h
+++ b/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h
@@ -276,8 +276,6 @@ extern long lx_shmget(key_t, size_t, int);
extern long lx_shmat(int, void *, int);
extern long lx_shmctl(int, int, void *);
-extern long lx_prctl(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
-
extern long lx_alarm(unsigned int);
extern long lx_close(int);
extern long lx_chdir(const char *);
diff --git a/usr/src/lib/brand/lx/testing/Readme_ltp b/usr/src/lib/brand/lx/testing/Readme_ltp
index f59009e7f3..6deed56a41 100644
--- a/usr/src/lib/brand/lx/testing/Readme_ltp
+++ b/usr/src/lib/brand/lx/testing/Readme_ltp
@@ -189,8 +189,6 @@ x open01 need PRIV_SYS_CONFIG to set sticky bit on reg file
# open10 setgid on sgid subdir behavior
x open11 makes device
# ppoll01
-# prctl01 get/set deathsig
-# prctl02 more deathsig
# process_vm_readv01
# process_vm_readv02
# process_vm_readv03
diff --git a/usr/src/lib/brand/lx/testing/ltp_skiplist b/usr/src/lib/brand/lx/testing/ltp_skiplist
index 7568a28682..6cc7b30e2d 100644
--- a/usr/src/lib/brand/lx/testing/ltp_skiplist
+++ b/usr/src/lib/brand/lx/testing/ltp_skiplist
@@ -177,8 +177,6 @@ open10
perf_event_open01
perf_event_open02
ppoll01
-prctl01
-prctl02
process_vm_readv01
process_vm_readv02
process_vm_readv03
diff --git a/usr/src/uts/common/brand/lx/os/lx_brand.c b/usr/src/uts/common/brand/lx/os/lx_brand.c
index 62cc2eca42..72e3e076fa 100644
--- a/usr/src/uts/common/brand/lx/os/lx_brand.c
+++ b/usr/src/uts/common/brand/lx/os/lx_brand.c
@@ -310,8 +310,31 @@ static struct modlinkage modlinkage = {
void
lx_proc_exit(proc_t *p)
{
- VERIFY(p->p_brand == &lx_brand);
- VERIFY(p->p_brand_data != NULL);
+ lx_proc_data_t *lxpd;
+ proc_t *cp;
+
+ mutex_enter(&p->p_lock);
+ VERIFY(lxpd = ptolxproc(p));
+ if ((lxpd->l_flags & LX_PROC_CHILD_DEATHSIG) == 0) {
+ mutex_exit(&p->p_lock);
+ return;
+ }
+ mutex_exit(&p->p_lock);
+
+ /* Check for children which desire notification of parental death. */
+ mutex_enter(&pidlock);
+ for (cp = p->p_child; cp != NULL; cp = cp->p_sibling) {
+ mutex_enter(&cp->p_lock);
+ if ((lxpd = ptolxproc(cp)) == NULL) {
+ mutex_exit(&cp->p_lock);
+ continue;
+ }
+ if (lxpd->l_parent_deathsig != 0) {
+ sigtoproc(p, NULL, lxpd->l_parent_deathsig);
+ }
+ mutex_exit(&cp->p_lock);
+ }
+ mutex_exit(&pidlock);
}
void
@@ -879,7 +902,7 @@ lx_brandsys(int cmd, int64_t *rval, uintptr_t arg1, uintptr_t arg2,
(void *)&lx_brand, (void *)reg.lxbr_handler, (void *)p);
pd = p->p_brand_data;
pd->l_handler = (uintptr_t)reg.lxbr_handler;
- pd->l_flags = reg.lxbr_flags;
+ pd->l_flags = reg.lxbr_flags & LX_PROC_ALL;
return (0);
diff --git a/usr/src/uts/common/brand/lx/os/lx_syscall.c b/usr/src/uts/common/brand/lx/os/lx_syscall.c
index 3497521c5a..20e8d5a618 100644
--- a/usr/src/uts/common/brand/lx/os/lx_syscall.c
+++ b/usr/src/uts/common/brand/lx/os/lx_syscall.c
@@ -695,7 +695,7 @@ lx_sysent_t lx_sysent32[] = {
{"nfsservctl", NULL, NOSYS_KERNEL, 0}, /* 169 */
{"setresgid16", lx_setresgid16, 0, 3}, /* 170 */
{"getresgid16", NULL, 0, 3}, /* 171 */
- {"prctl", NULL, 0, 5}, /* 172 */
+ {"prctl", lx_prctl, 0, 5}, /* 172 */
{"rt_sigreturn", NULL, 0, 0}, /* 173 */
{"rt_sigaction", NULL, 0, 4}, /* 174 */
{"rt_sigprocmask", NULL, 0, 4}, /* 175 */
@@ -1051,7 +1051,7 @@ lx_sysent_t lx_sysent64[] = {
{"modify_ldt", lx_modify_ldt, 0, 3}, /* 154 */
{"pivot_root", NULL, NOSYS_KERNEL, 0}, /* 155 */
{"sysctl", NULL, 0, 1}, /* 156 */
- {"prctl", NULL, 0, 5}, /* 157 */
+ {"prctl", lx_prctl, 0, 5}, /* 157 */
{"arch_prctl", lx_arch_prctl, 0, 2}, /* 158 */
{"adjtimex", NULL, 0, 1}, /* 159 */
{"setrlimit", lx_setrlimit, 0, 2}, /* 160 */
diff --git a/usr/src/uts/common/brand/lx/sys/lx_brand.h b/usr/src/uts/common/brand/lx/sys/lx_brand.h
index 8b9b4241eb..110b451ce6 100644
--- a/usr/src/uts/common/brand/lx/sys/lx_brand.h
+++ b/usr/src/uts/common/brand/lx/sys/lx_brand.h
@@ -371,8 +371,11 @@ typedef lx_elf_data32_t lx_elf_data_t;
#endif
typedef enum lx_proc_flags {
- LX_PROC_INSTALL_MODE = 0x01,
- LX_PROC_STRICT_MODE = 0x02
+ /* flags configurable via brandsys() and members of LX_PROC_ALL */
+ LX_PROC_INSTALL_MODE = 0x01,
+ LX_PROC_STRICT_MODE = 0x02,
+ /* internal flags */
+ LX_PROC_CHILD_DEATHSIG = 0x04
} lx_proc_flags_t;
#define LX_PROC_ALL (LX_PROC_INSTALL_MODE | LX_PROC_STRICT_MODE)
@@ -398,8 +401,10 @@ typedef struct lx_proc_data {
pid_t l_ppid; /* pid of originating parent proc */
uint64_t l_ptrace; /* process being observed with ptrace */
lx_elf_data_t l_elf_data; /* ELF data for linux executable */
- int l_signal; /* signal to deliver to parent when this */
- /* thread group dies */
+ /* signal to deliver to parent when this thread group dies */
+ int l_signal;
+ /* native signal to deliver to process when parent dies */
+ int l_parent_deathsig;
lx_proc_flags_t l_flags;
lx_rlimit64_t l_fake_limits[LX_RLFAKE_NLIMITS];
diff --git a/usr/src/uts/common/brand/lx/sys/lx_syscalls.h b/usr/src/uts/common/brand/lx/sys/lx_syscalls.h
index 54933857f7..1220d06b69 100644
--- a/usr/src/uts/common/brand/lx/sys/lx_syscalls.h
+++ b/usr/src/uts/common/brand/lx/sys/lx_syscalls.h
@@ -76,6 +76,7 @@ extern long lx_open();
extern long lx_openat();
extern long lx_pipe();
extern long lx_pipe2();
+extern long lx_prctl();
extern long lx_prlimit64();
extern long lx_read();
extern long lx_recv();
diff --git a/usr/src/uts/common/brand/lx/syscall/lx_prctl.c b/usr/src/uts/common/brand/lx/syscall/lx_prctl.c
new file mode 100644
index 0000000000..eed9075f93
--- /dev/null
+++ b/usr/src/uts/common/brand/lx/syscall/lx_prctl.c
@@ -0,0 +1,201 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2015 Joyent, Inc.
+ */
+
+#include <sys/systm.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sys/priv.h>
+#include <sys/brand.h>
+#include <sys/cmn_err.h>
+#include <sys/lx_brand.h>
+#include <sys/lx_impl.h>
+#include <lx_signum.h>
+
+#define LX_PR_SET_PDEATHSIG 1
+#define LX_PR_GET_PDEATHSIG 2
+#define LX_PR_GET_DUMPABLE 3
+#define LX_PR_SET_DUMPABLE 4
+#define LX_PR_GET_UNALIGN 5
+#define LX_PR_SET_UNALIGN 6
+#define LX_PR_GET_KEEPCAPS 7
+#define LX_PR_SET_KEEPCAPS 8
+#define LX_PR_GET_FPEMU 9
+#define LX_PR_SET_FPEMU 10
+#define LX_PR_GET_FPEXC 11
+#define LX_PR_SET_FPEXC 12
+#define LX_PR_GET_TIMING 13
+#define LX_PR_SET_TIMING 14
+#define LX_PR_SET_NAME 15
+#define LX_PR_GET_NAME 16
+#define LX_PR_GET_ENDIAN 19
+#define LX_PR_SET_ENDIAN 20
+#define LX_PR_GET_SECCOMP 21
+#define LX_PR_SET_SECCOMP 22
+#define LX_PR_CAPBSET_READ 23
+#define LX_PR_CAPBSET_DROP 24
+#define LX_PR_GET_TSC 25
+#define LX_PR_SET_TSC 26
+#define LX_PR_GET_SECUREBITS 27
+#define LX_PR_SET_SECUREBITS 28
+#define LX_PR_SET_TIMERSLACK 29
+#define LX_PR_GET_TIMERSLACK 30
+#define LX_PR_TASK_PERF_EVENTS_DISABLE 31
+#define LX_PR_TASK_PERF_EVENTS_ENABLE 32
+#define LX_PR_MCE_KILL 33
+#define LX_PR_MCE_KILL_GET 34
+#define LX_PR_SET_MM 35
+#define LX_PR_SET_CHILD_SUBREAPER 36
+#define LX_PR_GET_CHILD_SUBREAPER 37
+#define LX_PR_SET_NO_NEW_PRIVS 38
+#define LX_PR_GET_NO_NEW_PRIVS 39
+#define LX_PR_GET_TID_ADDRESS 40
+#define LX_PR_SET_THP_DISABLE 41
+#define LX_PR_GET_THP_DISABLE 42
+
+#define LX_PR_SET_NAME_NAMELEN 16
+
+long
+lx_prctl(int opt, uintptr_t data)
+{
+ long err;
+ char ebuf[64];
+
+ switch (opt) {
+ case LX_PR_GET_DUMPABLE: {
+ /* Indicate that process is always dumpable */
+ return (1);
+ }
+
+ case LX_PR_SET_DUMPABLE: {
+ if (data != 0 && data != 1) {
+ return (set_errno(EINVAL));
+ }
+ /* Lie about altering process dumpability */
+ return (0);
+ }
+
+ case LX_PR_GET_SECUREBITS: {
+ /* Our bits are always 0 */
+ return (0);
+ }
+
+ case LX_PR_SET_SECUREBITS: {
+ /* Ignore setting any bits from arg2 */
+ return (0);
+ }
+
+ case LX_PR_SET_KEEPCAPS: {
+ /*
+ * The closest illumos analog to SET_KEEPCAPS is the PRIV_AWARE
+ * flag. There are probably some cases where it's not exactly
+ * the same, but this will do for a first try.
+ */
+ if (data == 0) {
+ err = setpflags(PRIV_AWARE_RESET, 1, NULL);
+ } else {
+ err = setpflags(PRIV_AWARE, 1, NULL);
+ }
+
+ if (err != 0) {
+ return (set_errno(err));
+ }
+ return (0);
+ }
+
+ case LX_PR_SET_NAME: {
+ char name[LX_PR_SET_NAME_NAMELEN];
+ proc_t *p = curproc;
+ /*
+ * In Linux, PR_SET_NAME sets the name of the thread, not the
+ * process. Due to the historical quirks of Linux's asinine
+ * thread model, this name is effectively the name of the
+ * process (as visible via ps(1)) if the thread is the first of
+ * its task group. The first thread is therefore special, and
+ * to best mimic Linux semantics (and absent a notion of
+ * per-LWP names), we do nothing (but return success) on LWPs
+ * other than LWP 1.
+ */
+ if (curthread->t_tid != 1) {
+ return (0);
+ }
+ if (copyin((void *)data, name, LX_PR_SET_NAME_NAMELEN) != 0) {
+ return (set_errno(EFAULT));
+ }
+ name[LX_PR_SET_NAME_NAMELEN - 1] = '\0';
+ mutex_enter(&p->p_lock);
+ (void) strncpy(name, p->p_user.u_comm, MAXCOMLEN);
+ (void) strncpy(name, p->p_user.u_psargs, PSARGSZ);
+ mutex_exit(&p->p_lock);
+ return (0);
+ }
+
+ case LX_PR_GET_PDEATHSIG: {
+ int sig;
+ lx_proc_data_t *lxpd;
+
+ mutex_enter(&curproc->p_lock);
+ VERIFY(lxpd = ptolxproc(curproc));
+ sig = lxpd->l_parent_deathsig;
+ mutex_exit(&curproc->p_lock);
+
+ return (sig);
+ }
+
+ case LX_PR_SET_PDEATHSIG: {
+ int sig = lx_ltos_signo((int)data, 0);
+ proc_t *pp = NULL;
+ lx_proc_data_t *lxpd;
+
+ if (sig == 0 && data != 0) {
+ return (set_errno(EINVAL));
+ }
+
+ mutex_enter(&pidlock);
+ /* Set signal on our self */
+ mutex_enter(&curproc->p_lock);
+ VERIFY(lxpd = ptolxproc(curproc));
+ lxpd->l_parent_deathsig = sig;
+ pp = curproc->p_parent;
+ mutex_exit(&curproc->p_lock);
+
+ /* Configure parent to potentially signal children on death */
+ mutex_enter(&pp->p_lock);
+ if (PROC_IS_BRANDED(pp)) {
+ VERIFY(lxpd = ptolxproc(pp));
+ /*
+ * Mark the parent as having children which wish to be
+ * signaled on death of parent.
+ */
+ lxpd->l_flags |= LX_PROC_CHILD_DEATHSIG;
+ } else {
+ /*
+ * If the parent is not a branded process, the needed
+ * hooks to facilitate this mechanism will not fire
+ * when it dies. We lie about success in this case.
+ */
+ }
+ mutex_exit(&pp->p_lock);
+ mutex_exit(&pidlock);
+ return (0);
+ }
+
+ default:
+ break;
+ }
+
+ snprintf(ebuf, 64, "prctl option %d", opt);
+ lx_unsupported(ebuf);
+ return (set_errno(EINVAL));
+}
diff --git a/usr/src/uts/intel/Makefile.files b/usr/src/uts/intel/Makefile.files
index cb1543b4ae..236e824127 100644
--- a/usr/src/uts/intel/Makefile.files
+++ b/usr/src/uts/intel/Makefile.files
@@ -309,6 +309,7 @@ LX_BRAND_OBJS = \
lx_open.o \
lx_pid.o \
lx_pipe.o \
+ lx_prctl.o \
lx_ptrace.o \
lx_rlimit.o \
lx_rw.o \