From owner-svn-src-all@freebsd.org Tue Apr 30 17:18:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560A71598412; Tue, 30 Apr 2019 17:18:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F061C84152; Tue, 30 Apr 2019 17:18:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9836CD59; Tue, 30 Apr 2019 17:18:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHI67O068403; Tue, 30 Apr 2019 17:18:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHI60P068400; Tue, 30 Apr 2019 17:18:06 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904301718.x3UHI60P068400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 30 Apr 2019 17:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346965 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 346965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F061C84152 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:18:07 -0000 Author: dchagin Date: Tue Apr 30 17:18:05 2019 New Revision: 346965 URL: https://svnweb.freebsd.org/changeset/base/346965 Log: Follow the FreeBSD and implement PDEATH_SIG prctl ops in the Linuxulator. It was first introduced in r163734 and missied by me in r283383. MFC after: 1 week Modified: head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_emul.h head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_emul.c Tue Apr 30 17:18:05 2019 (r346965) @@ -127,7 +127,6 @@ linux_proc_init(struct thread *td, struct thread *newt em->em_tid = p->p_pid; em->flags = 0; - em->pdeath_signal = 0; em->robust_futexes = NULL; em->child_clear_tid = NULL; em->child_set_tid = NULL; Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_emul.h Tue Apr 30 17:18:05 2019 (r346965) @@ -40,7 +40,6 @@ struct linux_emuldata { int *child_set_tid; /* in clone(): Child's TID to set on clone */ int *child_clear_tid;/* in clone(): Child's TID to clear on exit */ - int pdeath_signal; /* parent death signal */ int flags; /* thread emuldata flags */ int em_tid; /* thread id */ Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_misc.c Tue Apr 30 17:18:05 2019 (r346965) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1993,7 +1994,6 @@ linux_prctl(struct thread *td, struct linux_prctl_args int error = 0, max_size; struct proc *p = td->td_proc; char comm[LINUX_MAX_COMM_LEN]; - struct linux_emuldata *em; int pdeath_signal; #ifdef DEBUG @@ -2007,17 +2007,18 @@ linux_prctl(struct thread *td, struct linux_prctl_args case LINUX_PR_SET_PDEATHSIG: if (!LINUX_SIG_VALID(args->arg2)) return (EINVAL); - em = em_find(td); - KASSERT(em != NULL, ("prctl: emuldata not found.\n")); - em->pdeath_signal = args->arg2; - break; + pdeath_signal = linux_to_bsd_signal(args->arg2); + return (kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_CTL, + &pdeath_signal)); case LINUX_PR_GET_PDEATHSIG: - em = em_find(td); - KASSERT(em != NULL, ("prctl: emuldata not found.\n")); - pdeath_signal = em->pdeath_signal; - error = copyout(&pdeath_signal, + error = kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_STATUS, + &pdeath_signal); + if (error != 0) + return (error); + pdeath_signal = bsd_to_linux_signal(pdeath_signal); + return (copyout(&pdeath_signal, (void *)(register_t)args->arg2, - sizeof(pdeath_signal)); + sizeof(pdeath_signal))); break; case LINUX_PR_GET_KEEPCAPS: /*