Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1011747ybj; Thu, 7 May 2020 12:39:18 -0700 (PDT) X-Google-Smtp-Source: APiQypL7ZblnK9q+ldyxXuBpG5V/Jhl3wL4xTvlA/sLC/hp75YCdskO85QB4hbslGXXwWNs60bjo X-Received: by 2002:a17:906:3e44:: with SMTP id t4mr13801895eji.337.1588880358123; Thu, 07 May 2020 12:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588880358; cv=none; d=google.com; s=arc-20160816; b=y3lFCedtA6nsFckaZ9JgbF8upzKL6HVhB6bl/ehlZi9tWjgPwaDLRXbS04y7IElmuV MM3Tit5dw3oAh5AY81PjxfxbZcdt/VkMOEMwJ78882dfE07A7xBFYtLEm/4/VmlxHnuO d0PoFznWoF5QkiWR8/cQjyurx7TNWKswVM6jC9CUASaLWLOt1beSdTIQng5YLpKWJpXO SybnR6Ebygzh8/TC4Edn4GU5Pr9JeikDw28TTUsqNMUIjNeS78abMohwdQWwzZOUcdVX 7zwOluWWv4eUByYod2K3iguSzTlmthoDZWbLmEL5G7OAHs/74odzqEX2JdEhZ80Mg4H7 cvCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UyG8OozIxiOiC27YQbFrcbQkhcYePtOvkzbwNkfelCs=; b=PZQStu2D/h9wKG53WcAMCWqNemi8j0mxzmaaiE/YhTjYbUEw9gEkvTL+ez6tgRhbEs TN1Uo22UxoT0qCDULIYRYmuMyPKJBdcvktb4He4yEVRZ/6ys/WZ49eSatZlocN3XQWk+ GiCgWOpGf7WETTpGJ5Dw5SDC9gsM9BAApMHibkGzDgPSk2NWWqjzeHXt+T6nhXXihH02 YFKPmIvrz7hKW9yeNY2XzKjCKGef+UnF5wf+E3cN1T8wL3vKgrxNFRhzl8qmyIqMZZUX zHnGfUuRI7ve1rfo5pr5wKjor7X3l3ErngnzvDJ8o1BHTuJpvkZheFRHzQIkI1uoSLWe W9cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si1398630ejy.301.2020.05.07.12.38.55; Thu, 07 May 2020 12:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728491AbgEGThG (ORCPT + 99 others); Thu, 7 May 2020 15:37:06 -0400 Received: from nibbler.cm4all.net ([82.165.145.151]:38229 "EHLO nibbler.cm4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726367AbgEGThF (ORCPT ); Thu, 7 May 2020 15:37:05 -0400 Received: from localhost (localhost [127.0.0.1]) by nibbler.cm4all.net (Postfix) with ESMTP id 5587CC0225 for ; Thu, 7 May 2020 21:37:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at nibbler.cm4all.net Received: from nibbler.cm4all.net ([127.0.0.1]) by localhost (nibbler.cm4all.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pA_hx1ukHJxH for ; Thu, 7 May 2020 21:37:04 +0200 (CEST) Received: from zero.intern.cm-ag (zero.intern.cm-ag [172.30.16.10]) by nibbler.cm4all.net (Postfix) with SMTP id 34E3BC023F for ; Thu, 7 May 2020 21:37:04 +0200 (CEST) Received: (qmail 6409 invoked from network); 7 May 2020 22:53:21 +0200 Received: from unknown (HELO rabbit.intern.cm-ag) (172.30.3.1) by zero.intern.cm-ag with SMTP; 7 May 2020 22:53:21 +0200 Received: by rabbit.intern.cm-ag (Postfix, from userid 1023) id 052D9461450; Thu, 7 May 2020 21:37:04 +0200 (CEST) Date: Thu, 7 May 2020 21:37:03 +0200 From: Max Kellermann To: Al Viro Cc: Jens Axboe , Max Kellermann , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] fs/io_uring: fix O_PATH fds in openat, openat2, statx Message-ID: <20200507193703.GA16367@rabbit.intern.cm-ag> References: <20200507185725.15840-1-mk@cm4all.com> <20200507190131.GF23230@ZenIV.linux.org.uk> <4cac0e53-656c-50f0-3766-ae3cc6c0310a@kernel.dk> <20200507192903.GG23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200507192903.GG23230@ZenIV.linux.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/05/07 21:29, Al Viro wrote: > Again, resolving the descriptor more than once in course of syscall > is almost always a serious bug; .. and that is what Linux currently does for those three operation, and yes, it's buggy. The generic preparation code looks up the fd, but later in the implementation, only the numeric fd is used. My patch removes this duplication, by removing the first lookup. Max