From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E4F3C2D0C8 for ; Tue, 17 Dec 2019 06:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BE0B2176D for ; Tue, 17 Dec 2019 06:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726976AbfLQGkd (ORCPT ); Tue, 17 Dec 2019 01:40:33 -0500 Received: from mout-p-101.mailbox.org ([80.241.56.151]:53806 "EHLO mout-p-101.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfLQGkc (ORCPT ); Tue, 17 Dec 2019 01:40:32 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 47cT6M2DP7zKmbN; Tue, 17 Dec 2019 07:40:27 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id AVgNK5XsT0lw; Tue, 17 Dec 2019 07:40:19 +0100 (CET) Date: Tue, 17 Dec 2019 17:39:50 +1100 From: Aleksa Sarai To: Florian Weimer Cc: Al Viro , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , David Howells , Shuah Khan , Shuah Khan , Ingo Molnar , Peter Zijlstra , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Jonathan Corbet , linux-ia64@vger.kernel.org, linux-doc@vger.kernel.org, Alexander Shishkin , Rasmus Villemoes , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, sparclinux@vger.kernel.org, linux-api@vger.kernel.org, Jiri Olsa , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, David Drysdale , linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-xtensa@linux-xtensa.org, Kees Cook , Jann Horn , linuxppc-dev@lists.ozlabs.org, dev@opencontainers.org, Andy Lutomirski , Namhyung Kim , Andrew Morton , libc-alpha@sourceware.org, linux-parisc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, netdev@vger.kernel.org, Chanho Min , Oleg Nesterov , Eric Biederman , linux-alpha@vger.kernel.org, linux-fsdevel@vger.kernel.org, bpf@vger.kernel.org, Linus Torvalds , containers@lists.linux-foundation.org Subject: Re: [PATCH v18 11/13] open: introduce openat2(2) syscall Message-ID: <20191217063950.5oqwwqz5p3bu7t2x@yavin.dot.cyphar.com> References: <20191206141338.23338-1-cyphar@cyphar.com> <20191206141338.23338-12-cyphar@cyphar.com> <20191216192158.B9F19832924A@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vzwczu2ztdefrrfu" Content-Disposition: inline In-Reply-To: <20191216192158.B9F19832924A@oldenburg2.str.redhat.com> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org --vzwczu2ztdefrrfu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-12-16, Florian Weimer wrote: > > diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h > > index 1d338357df8a..58c3a0e543c6 100644 > > --- a/include/uapi/linux/fcntl.h > > +++ b/include/uapi/linux/fcntl.h > > @@ -93,5 +93,40 @@ > > =20 > > #define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */ > > =20 > > +/* > > + * Arguments for how openat2(2) should open the target path. If @resol= ve is > > + * zero, then openat2(2) operates very similarly to openat(2). > > + * > > + * However, unlike openat(2), unknown bits in @flags result in -EINVAL= rather > > + * than being silently ignored. @mode must be zero unless one of {O_CR= EAT, > > + * O_TMPFILE} are set. > > + * > > + * @flags: O_* flags. > > + * @mode: O_CREAT/O_TMPFILE file mode. > > + * @resolve: RESOLVE_* flags. > > + */ > > +struct open_how { > > + __aligned_u64 flags; > > + __u16 mode; > > + __u16 __padding[3]; /* must be zeroed */ > > + __aligned_u64 resolve; > > +}; > > + > > +#define OPEN_HOW_SIZE_VER0 24 /* sizeof first published struct */ > > +#define OPEN_HOW_SIZE_LATEST OPEN_HOW_SIZE_VER0 > > + > > +/* how->resolve flags for openat2(2). */ > > +#define RESOLVE_NO_XDEV 0x01 /* Block mount-point crossings > > + (includes bind-mounts). */ > > +#define RESOLVE_NO_MAGICLINKS 0x02 /* Block traversal through procfs-s= tyle > > + "magic-links". */ > > +#define RESOLVE_NO_SYMLINKS 0x04 /* Block traversal through all symlin= ks > > + (implies OEXT_NO_MAGICLINKS) */ > > +#define RESOLVE_BENEATH 0x08 /* Block "lexical" trickery like > > + "..", symlinks, and absolute > > + paths which escape the dirfd. */ > > +#define RESOLVE_IN_ROOT 0x10 /* Make all jumps to "/" and ".." > > + be scoped inside the dirfd > > + (similar to chroot(2)). */ > > =20 > > #endif /* _UAPI_LINUX_FCNTL_H */ >=20 > Would it be possible to move these to a new UAPI header? >=20 > In glibc, we currently do not #include . We need some of > the AT_* constants in POSIX mode, and the header is not necessarily > namespace-clean. If there was a separate header for openat2 support, we > could use that easily, and we would only have to maintain the baseline > definitions (which never change). Sure, (assuming nobody objects) I can move it to "linux/openat2.h". --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --vzwczu2ztdefrrfu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXfh4MQAKCRCdlLljIbnQ EvJ/AP9e+RbEhnKlfXeue8RftgpgyUu8To5+ZOcmuoKfUFVefgEAmch0tDU0glq6 a0g2iw25N8tzxhAIzQpE/p2HRuzcPgo= =p/bo -----END PGP SIGNATURE----- --vzwczu2ztdefrrfu--