From nobody Wed Oct 09 00:37:21 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 4XNYr13ptdz5YbF5; Wed, 09 Oct 2024 00:37:21 +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 4XNYr139wCz4l8k; Wed, 9 Oct 2024 00:37:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728434241; 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=pjDUHN1hPepfmC6nGV6Yr1falyF6fFpt2IEPfapMARY=; b=tnrl9f7YpR9HUod62XmVexShiWwM+uu4uoxYGR6vWOGCWhAWbqtp/LA1vPnjIsNQLix8Xj vyYjdd93MJI/69zz0a/qHKkLDP8BkbdN/KNebpqJdTQOxPLYnOCQWspaLChbB6gYi2qc0g ygfd8THmszMgJ2nbIMlvKjAhNUwhVOI5/CcMcdQjCRXh0cQ1p+t6/xMs4boTs6A0FCgc/1 lmtylYri50GhEfd75WBIHMzt0o/qXESFO68KO8qjSCTjUJDayLlzk/Xo+s8rsou06rCl7X +IYANVLtEL0VK4U8mEwiZuRR10kBRfkAX180C/acYWrLLb52UuKaDBJ//K8beg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728434241; 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=pjDUHN1hPepfmC6nGV6Yr1falyF6fFpt2IEPfapMARY=; b=u5t57d9yY5zB7QoWswefeRdH7oFdPtpqR4WC2E0bA3KkkSKJpldQhfsNM5atdzXJIQW4uL 7bSr9p241wR29Z7z7ehU15z4UZ71MqvWYSYZqjp8keWKNUbbnbzTOaHKLmZSoAUpdvwtel XA3ERTm0oPCeQnNyy6vgu86pOc2n1SEIQ8wfnLZncu5Zjjj5vlpvce0kj83mrDEoaNFzHX WlE/sQYpDFaZo0TYx+ZmiOk5tO9uFcobauZmVy3P2FLRg/eThuy+7O9tY+9f0NHh2pd+vr CtFPxEJYmO8gxKr6v+YtBOdlGfaey2Pptl6PRL/ZmFjvyYse6d+b2M58jMFA2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728434241; a=rsa-sha256; cv=none; b=EG2kcJEOoaVMCN+O/YWXNG+NXjTh/C7lEM3x4tyz4YjX9606ZAe4hVDEpJleTRLg5Y88Yj dEB3co4wui0SHjmJQjeT8+I2ioBmkVoA9dTsdbABw/KlK+Jh5EYGV2PgdrwJC+uIGiBaU0 aGA2su3jL0ZsiA2EtXCPCtIii7y4GZrq8odCVOx12aNha2FwmUDZOXiYGbZEDpMseXx2Ay Mqb76yhhTgX+anVkRbiSWZaj/yOajCNKxcfvIyHw5KG2BJfIGPICXNwUTThoeggASbrFK9 fUr+CEFQaFle+7BMSH/E3GYJ6h/whbDGqpnTGxHT4D/r6rkXfaKnBCLK8eB1BA== 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 4XNYr127XYzsbh; Wed, 9 Oct 2024 00:37:21 +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 4990bLKZ034234; Wed, 9 Oct 2024 00:37:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4990bLJ1034231; Wed, 9 Oct 2024 00:37:21 GMT (envelope-from git) Date: Wed, 9 Oct 2024 00:37:21 GMT Message-Id: <202410090037.4990bLJ1034231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 91a9e4e01dab - main - 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/main X-Git-Reftype: branch X-Git-Commit: 91a9e4e01dab7a740b8e3b7c39c59a537e71e5d2 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=91a9e4e01dab7a740b8e3b7c39c59a537e71e5d2 commit 91a9e4e01dab7a740b8e3b7c39c59a537e71e5d2 Author: Ed Maste AuthorDate: 2024-10-03 11:54:44 +0000 Commit: Ed Maste CommitDate: 2024-10-09 00:36:50 +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 --- 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;