From nobody Thu Feb 17 15:53:52 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C37DB19CB6F7; Thu, 17 Feb 2022 15:53:53 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jzzrx241Wz3w3K; Thu, 17 Feb 2022 15:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645113233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TKsF7Ej1BEE4wKYnoioysiwGBHIbhC6oDgvTuluRodk=; b=Z8yQ5hkqU7Lhi7+BtVamx6AdX6BFXb+CFzg/Hb+bXg5EnzPM3yYFbWU+1Z2IXTsMhOB0iJ p8DmJPhP13y+H0UU2oqptODlHbWp+GZ78eUMyRMXif3fP2oBWIycq2Lr2Efjy8bo+FSvpY jmpq0LAguKzpcopLzWunDMlQIM+CeavI5FfCzbgIlQXB3y/SKjy/c4JSyzh872kPd+TxTX scHyF3jhVHFLO7/bN03lO31VQazSOif0baeZTdXjLY6gTCVBUUYUqna8UzEpuGz9yzHXO+ Vmew+hdIQzjG3FSngujB3tgFabamCRfPUM/GP9xdJBHUvd1d7nj67JN31FveEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C812A47DF; Thu, 17 Feb 2022 15:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21HFrqCA022280; Thu, 17 Feb 2022 15:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21HFrqjV022279; Thu, 17 Feb 2022 15:53:52 GMT (envelope-from git) Date: Thu, 17 Feb 2022 15:53:52 GMT Message-Id: <202202171553.21HFrqjV022279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: b5cae0d5ed3e - stable/13 - linux(4): implement PR_SET_NO_NEW_PRIVS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b5cae0d5ed3e9f91404c67828c9736b255e6b7bf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645113233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TKsF7Ej1BEE4wKYnoioysiwGBHIbhC6oDgvTuluRodk=; b=aAEQJaOBHHHzuLiAQul85PVpAc0UpPnnZm02dEVrgUtCHcnjjs1QpT/GsCoebIu4kon4PI 0jrDRsZtO8oFbM/syMimDjIOJRC8OURXY0Jv5MY4bwgGOt275wnZQ6mGO5bqHkYD+ssMMY eG1W/KgwP38MB8KRhxvzCHpawgdg3mYB//9S3fNmA89d4YSslrY+5XCc2knNphfVk5a9GF kdbzm0A2vt15rEIcsbrb/UZuyQM0yIX5b9P6/irWiJJf8PXBpy2BgbQTGMMpiU8gvwpyte qQHk2ZWfuDpdwOobOr9Uud/6fLYvqR0whjjlrueW++x7GkiLNAQOnuw1XgoTXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645113233; a=rsa-sha256; cv=none; b=Q/KMUNGNhhwy/udK670/amlTko27EYXB5dzj55bq/ImusBo0Yways+8wd0uckVZYsDnQx1 SEgMLjYIxAhRUPKwCmv2c5XerPeOaGfnLA90vwef4fOXpjdVr6eAqD/Wed/4aqOlIKXlc0 //IOokBiyH14zeYLOt43bz2KFsweHT/1hlxGxK9IbCcOdhxd6HsP3jL0rhvIiVJqSdAHbr DxIB/aNWXeWK3I6QBb3dyihiMJChgQHYWg2t9XjeomWn74pAdoUskU3m/6RH1BJxxKPuJP ZrCVbX6FGCvq+R4NFSCLuyly8f7WjhbK1uUHhomrtmMLUA2gMcVQwrcs+5i3EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=b5cae0d5ed3e9f91404c67828c9736b255e6b7bf commit b5cae0d5ed3e9f91404c67828c9736b255e6b7bf Author: Edward Tomasz Napierala AuthorDate: 2021-07-03 07:41:59 +0000 Commit: Edward Tomasz Napierala CommitDate: 2022-02-14 00:08:55 +0000 linux(4): implement PR_SET_NO_NEW_PRIVS This makes prctl(2) support PR_SET_NO_NEW_PRIVS, by mapping it to the native PROC_NO_NEW_PRIVS_CTL procctl(2). Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30973 (cherry picked from commit 2f514e6f13de41aa9ad5f563ed0decc66e91f99c) --- sys/compat/linux/linux_misc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index fc846df6689f..fb529f140d3e 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1921,7 +1921,7 @@ linux_capset(struct thread *td, struct linux_capset_args *uap) int linux_prctl(struct thread *td, struct linux_prctl_args *args) { - int error = 0, max_size; + int error = 0, max_size, arg; struct proc *p = td->td_proc; char comm[LINUX_MAX_COMM_LEN]; int pdeath_signal, trace_state; @@ -2052,8 +2052,10 @@ linux_prctl(struct thread *td, struct linux_prctl_args *args) error = EINVAL; break; case LINUX_PR_SET_NO_NEW_PRIVS: - linux_msg(td, "unsupported prctl PR_SET_NO_NEW_PRIVS"); - error = EINVAL; + arg = args->arg2 == 1 ? + PROC_NO_NEW_PRIVS_ENABLE : PROC_NO_NEW_PRIVS_DISABLE; + error = kern_procctl(td, P_PID, p->p_pid, + PROC_NO_NEW_PRIVS_CTL, &arg); break; case LINUX_PR_SET_PTRACER: linux_msg(td, "unsupported prctl PR_SET_PTRACER");