From nobody Wed Jun 25 09:57:02 2025 X-Original-To: dev-commits-src-main@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 4bRy0W74TWz5ypnT; Wed, 25 Jun 2025 09:57:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bRy0W3H8Sz3YLq; Wed, 25 Jun 2025 09:57:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 55P9v2PL042810; Wed, 25 Jun 2025 12:57:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55P9v2PL042810 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55P9v230042809; Wed, 25 Jun 2025 12:57:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jun 2025 12:57:02 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 350ba9672a7f - main - unix: Set O_RESOLVE_BENEATH on fds transferred between jails Message-ID: References: <202506242104.55OL4ZxO085239@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506242104.55OL4ZxO085239@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bRy0W3H8Sz3YLq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jun 24, 2025 at 09:04:35PM +0000, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=350ba9672a7f4f16e30534a603df577dfd083b3f > > commit 350ba9672a7f4f16e30534a603df577dfd083b3f > Author: Mark Johnston > AuthorDate: 2025-06-24 20:05:37 +0000 > Commit: Mark Johnston > CommitDate: 2025-06-24 21:04:24 +0000 > > unix: Set O_RESOLVE_BENEATH on fds transferred between jails > > If a pair of jails with different filesystem roots is able to exchange > SCM_RIGHTS messages (e.g., using a unix socket in a shared nullfs > mount), a process in one jail can open a directory outside of the root > of the second jail and then pass the fd to that second jail, allowing > the receiving process to escape the jail chroot. > > Address this using the new FD_RESOLVE_BENEATH flag. When externalizing > an SCM_RIGHTS message into the receiving process, automatically set this > flag on all new fds where a jail boundary is crossed. This ensures that > the receiver cannot do more than access files underneath the directory; > in particular, the received fd cannot be used to access vnodes not > accessible by the sender. > > PR: 262179 > Reviewed by: kib > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D50371 > --- > sys/amd64/conf/SYZKALLER | 5 +++++ > sys/kern/uipc_usrreq.c | 31 +++++++++++++++++++++++-------- > 2 files changed, 28 insertions(+), 8 deletions(-) > > diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER > new file mode 100644 > index 000000000000..965841313616 > --- /dev/null > +++ b/sys/amd64/conf/SYZKALLER > @@ -0,0 +1,5 @@ > +include GENERIC-KASAN > +ident SYZKALLER > + > +options COVERAGE > +options KCOV Was this config intended for the commit?