From nobody Thu Oct 17 16:29:47 2024 X-Original-To: dev-commits-src-all@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 4XTtbH5bLHz5ZBGx; Thu, 17 Oct 2024 16:29:47 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XTtbH58dRz44kL; Thu, 17 Oct 2024 16:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729182587; 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=hstkhZYBINmJL/Q50HYn9Gfp68Y26VD6QRyBvqBL2p0=; b=A+1FjlZoD9JKc2I2RSMv2tqu/hqpT5SZyTy5nnCnoJMqHFZLUFJ9YBBpLSKyIPg27tPBHD hu7EEmDth0+WGHZwD8926GHGx7UbHjiKeh1iWbCfxFDbEvGC6bxPQ/IOtZhctH9kgb5c3+ chbWz1Tas4RbkFaqSTq/keobiojeHMNLGlQt0JS9AWX8LX/Q6rC12uzHfJizlL0D8x2zNr Fj48tFT56+6tYCgT9viw6VoL4dUHGswhvWp2qM02WavVvNPnB1jEk0lWY22E6z6Gxh2gpk 9E0HNVLpVJQ3jDcxSb0rw8xQa6Ob19YvLbtYRR4RYXwX8qU8ewLAM7XEKuexDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729182587; 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=hstkhZYBINmJL/Q50HYn9Gfp68Y26VD6QRyBvqBL2p0=; b=Z5zjts9KKeq7JEEj0Z3ah5rg8bbdT2wa6mtb5HSJyarkksN+p3MrXBY12XQsVdQxktcLLB /PF8EjcnnWiqp5woYNNNML8eSww9kGMQSttCiAcQ+wS4bLhkEhU32mHvoGmS4Uo5gzMhAn ua4sHsF/+4nQsIESqkZH6BBVpBcXxQdzLKHmx6bg4w7FUfoPZp4rCRu6FbBxaGPO3+wnN6 Sx+QWu4hNldqtH+ki6a93g3C7t26F2JPLQuB8WBsmsEVpiunZGphTM4DJCrsCOMh0T35dM eQ/Abfm41eimJFubfJIs2JC0mV8ZC4b19ktFwks0tpeY5RISnom5vV6150wu0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729182587; a=rsa-sha256; cv=none; b=TBRTYlSykG3ewgjyOdUA7I6/UDcV4NUqyNEfeO0szJ4Y4x2Kk2iOQnm7g+kqVDiNC9LulT hBOptw/RxbNEk4SCoCEv/SCsDuxKUx8JYXMRaUqkl+c0t608AxbiKPgMlNz7GBELIqRAzu 9x4Bb51judvxmCVGFr8zNZOSkPE8RRtZnsGWOGHTHGWj4tC3W0Q6HyfNAlzCneCyLnLkEs lKvvQgAH/5wLOantTKoqeGBi1+veXInefnsSB9mOUOaCKxfUHJF+5rW5tzajtltlcK4t0t IRbIWQno3Vu5nbyl7ZkcY+xuaXgTzvE5QHP9FnTNY3Ck0CqZoyCnwg3aOo9NaA== 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 4XTtbH4f5PzxLg; Thu, 17 Oct 2024 16:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49HGTl5H017301; Thu, 17 Oct 2024 16:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49HGTl09017298; Thu, 17 Oct 2024 16:29:47 GMT (envelope-from git) Date: Thu, 17 Oct 2024 16:29:47 GMT Message-Id: <202410171629.49HGTl09017298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ae3d7e27abc9 - stable/14 - sctp: propagate cap rights on sctp_peeloff List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ae3d7e27abc98d7325d506a55af6a3ea2e028738 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ae3d7e27abc98d7325d506a55af6a3ea2e028738 commit ae3d7e27abc98d7325d506a55af6a3ea2e028738 Author: Ed Maste AuthorDate: 2024-10-03 11:54:44 +0000 Commit: Ed Maste CommitDate: 2024-10-17 16:29:21 +0000 sctp: propagate cap rights on sctp_peeloff PR: 201052 Reviewed by: oshogbo, tuexen Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46884 (cherry picked from commit 91a9e4e01dab7a740b8e3b7c39c59a537e71e5d2) --- sys/netinet/sctp_syscalls.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netinet/sctp_syscalls.c b/sys/netinet/sctp_syscalls.c index d67e260b6f99..9d85576e2592 100644 --- a/sys/netinet/sctp_syscalls.c +++ b/sys/netinet/sctp_syscalls.c @@ -141,13 +141,14 @@ sys_sctp_peeloff(struct thread *td, struct sctp_peeloff_args *uap) { struct file *headfp, *nfp = NULL; struct socket *head, *so; + struct filecaps fcaps; cap_rights_t rights; u_int fflag; int error, fd; AUDIT_ARG_FD(uap->sd); - error = getsock(td, uap->sd, cap_rights_init_one(&rights, CAP_PEELOFF), - &headfp); + error = getsock_cap(td, uap->sd, + cap_rights_init_one(&rights, CAP_PEELOFF), &headfp, &fcaps); if (error != 0) goto done2; fflag = atomic_load_int(&headfp->f_flag); @@ -165,7 +166,7 @@ sys_sctp_peeloff(struct thread *td, struct sctp_peeloff_args *uap) * but that is ok. */ - error = falloc(td, &nfp, &fd, 0); + error = falloc_caps(td, &nfp, &fd, 0, &fcaps); if (error != 0) goto done; td->td_retval[0] = fd;