Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1678653imm; Sat, 13 Oct 2018 01:21:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV61G+t4V0VY0jusw0e/PVcuDsdCvx1UDAMJj5qsC0WCU7rihqVijc33GYcatqOwMBmo/nRyu X-Received: by 2002:a63:2d43:: with SMTP id t64-v6mr8677242pgt.128.1539418860255; Sat, 13 Oct 2018 01:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539418860; cv=none; d=google.com; s=arc-20160816; b=LeTtkpq5tok7RRy3mpCDkyWvwhhEl5M1eoq7bW6lmqXt0umJPk4eQqZiJiU4tYwxWv NMtbYVX9Z+YFgFR3fNWdFfXExWgA9d2EJPQBJndlGn8EcmrQ/YYHYOgNrBwRjEuIY8UF KkD4GnfTaYSoKivnY6+vqqU5iCDE4fBOd12qlG9Ljlddi0LBjKi4SVxKTNyU0NQaRC5f AVatsXsJGebz1zDkwrp8jtD8Mg6zLsD0Au2/BU5RxlTUR4TvEZHIF0F4nql59An4Eg8F Bmbq2KrD78/6jPkFOZkSnSBTX8EVUN2oswZNDwbgtxBYTMFtpJ/r/NR//WVwkDK+cejy rObw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=r6o0RXMuoHQQ7dleDTyOlAjtqp0vFF0A1UV8Vpn+NzE=; b=kFDvoxvhdk67GKxWsCl79F69jceuDWlLK6+1QMvyJ+n+B/SnFcl+o2ZqPJMZfYJzEV 3JwNHktsf3bNeTZ24GpXVKddkRNrcualjHO462luKgVG6x+W++zrPNb2VagRdGxJiAS8 IlcolX5bzkfnQv+LFhVPrt4NMRbl61xSkggLEjRxledHPtH4cjqth5szIyAMaHd8/tbk EmU+rWBmU1I0KW+6qL2AC7ecPscyVTyw+rkFGxFiRzaxz+HOlmehobb73YYJd6f4xb+V 0MvY62NG8G0p5CADEMeIRZdaSnXj6x5o4NjyFeHFLv2+118u23NhyR8jajTrSxeJKC75 /usQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12-v6si2668225pld.166.2018.10.13.01.20.45; Sat, 13 Oct 2018 01:21:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbeJMP4c (ORCPT + 99 others); Sat, 13 Oct 2018 11:56:32 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:31562 "EHLO mx2.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbeJMP4c (ORCPT ); Sat, 13 Oct 2018 11:56:32 -0400 Received: from smtp1.mailbox.org (unknown [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 7B726A105D; Sat, 13 Oct 2018 10:20:15 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id FG5uUfxWPzkC; Sat, 13 Oct 2018 10:20:14 +0200 (CEST) Date: Sat, 13 Oct 2018 19:20:03 +1100 From: Aleksa Sarai To: Al Viro Cc: Eric Biederman , Christian Brauner , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , Andy Lutomirski , David Howells , Jann Horn , Tycho Andersen , David Drysdale , dev@opencontainers.org, containers@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH v3 1/3] namei: implement O_BENEATH-style AT_* flags Message-ID: <20181013082003.5fvgx3g4i2vx2cdt@ryuk> References: <20181009070230.12884-1-cyphar@cyphar.com> <20181009070230.12884-2-cyphar@cyphar.com> <20181013073319.GS32577@ZenIV.linux.org.uk> <20181013080511.GT32577@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zghhtdmiqqb2lfl5" Content-Disposition: inline In-Reply-To: <20181013080511.GT32577@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zghhtdmiqqb2lfl5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-10-13, Al Viro wrote: > > Pardon me, but... huh? The reason for your two calls of dirfd_path_ini= t() is, > > AFAICS, the combination of absolute pathname with both LOOKUP_XDEV and > > LOOKUP_BENEATH at the same time. That combination is treated as if the= pathname > > had been relative. Note that LOOKUP_BENEATH alone is ignored for absol= ute ones > > (and with a good reason - it's a no-op on path_init() level in that cas= e). > >=20 > > What the hell? It complicates your code and doesn't seem to provide an= y benefits > > whatsoever -- you could bloody well have passed the relative pathname t= o start with. > >=20 > > IDGI... Without that kludge it becomes simply "do as we currently do f= or absolute > > pathnames, call dirfd_path_init() for relative ones". And I would argu= e that > > taking LOOKUP_BENEATH handling out of dirfd_path_init() into path_init(= ) (relative) > > case would be a good idea. > >=20 > > As it is, the logics is very hard to follow. >=20 > ... and it fails on LOOKUP_BENEATH anyway. Egads... So that's for your > LOOKUP_CHROOT ;-/ IMO that's awful, especially with the way you've sprea= d those > LOOKUP_CHROOT cases between these two. Yeah, the ->root setting in dirfd_path_init() is ugly. :/ > Why not simply have O_THISROOT pick root by dirfd and call file_open_roo= t()? Wouldn't this require replicating the dirfd_path_init()-like code inside all of the path_*at() callers which use path_init()? Or is there another common place we could put it? > And if something wants it for stat(), etc. just have them use it combined= with > O_PATH and pass the result to ...at()... This works for stat and quite a few other things (which is why I only added openat(2) support for the moment), but I think we'd eventually need something like this for renameat2(2) as well as a few other choice *at(2) syscalls. Though I also think that more AT_EMPTY_PATH support would removed the need for _most_ *at(2) implementations to use this. --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --zghhtdmiqqb2lfl5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEXzbGxhtUYBJKdfWmnhiqJn3bjbQFAlvBqrMACgkQnhiqJn3b jbR1Nw//cNe++vgwSqmvqDGh3gUr0fD2hCd5QWqwG3u0eE0cBu7GsJFA3t5IhfIL zFh5UkBJA9qHI51z0+G3ULPv/CnOYz2cON0yx4s3o7eRybt77E0LNUZA+wPU8840 YY36BE0OD0EmlDQASdyq4zOmwqdiJzOmhDRQbcnYwgANjaP5etZfX1MBurJ9ssdT cIe1JZQqnXEpkekNlnrxNF6pLWeVH7YtiFasZAFwh+2i9YcLrzdTQwG7RAlBd6u2 95k69Ag4cGMvl7lcxsZjJ0/vjW4CKK/NtF1kzF9cXTvbIIMazNImYTMa9CqmAZOZ vMshesoPcEcCmljW9yf2AGkM3fmMQ6w6i5gbhmJZP6kvU48/P0fVBnUoL3PEwTC1 J+EiAjPEIoeTRBcPRbNpUaCr+JDs/HtoY7JIHWnmzcRmLuvVu2ss/2tme6B/WqSI ljnJt5SvaMPd712fk4HEdJ27SlXfzcIpaHHVW2ZrUYFrj2JvDr3t3oP5laLPzsYa xQ8yT5r0VHSkqLhkm8E2YZduJhZ9FKn+fsxykLcCltXv/yLD1XG6g0yAGp399ibQ Hajh+QRAzRvghKhlemLuYb2f3MQj/2pemjAzcHjr0TKLV+kgFOPI33CXpMCnST2F vgN/b12cFexN4OLtrp0JRjQYnIMHLuiUVCezpor0pYJIvE/wPug= =f2Dg -----END PGP SIGNATURE----- --zghhtdmiqqb2lfl5--