Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp990194ybj; Thu, 7 May 2020 12:08:54 -0700 (PDT) X-Google-Smtp-Source: APiQypJptwFopHW5iAELcvf+Sv7/A86yWtDDLwpavicBvr7t08e5iPf/N6p6Cx/TNfM5K0OE+qmW X-Received: by 2002:a17:906:328c:: with SMTP id 12mr12729739ejw.69.1588878534692; Thu, 07 May 2020 12:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588878534; cv=none; d=google.com; s=arc-20160816; b=bq1mlb9EJaGBTg5VdVsXhHDZVQvUIObPdg4/epsmeWvt5o5OPsOZmI2gXSoJrcDPOe eRLcJgnRcR3gYRdezC6B+veJDIKffqAa9N0b13vkLRO25HjkfPhTK3zsXL2/Iad41GYj Td8iZoJTspUL9vsPUXXJVYtc93py9uhkvBMeQ2XBPObG1PNzplRW6rn2nTz14SPIzO3L eQlLOiculbrOgh67sazHnv+geawRiY91qeyWQEJ00u5h+Wn1X/xT+M3omGGzPX8lfqgF ZcLTDsHpSgx/ku/rHfdFZcuwew4UJGByoHIkTFTUXnwjEPghX5Y8+xe3j7OAXhH/uh/N 7oWg== 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=cmqUdi4jqRukmYWM94MbcYly62RBPPeuqRco8jv9/qk=; b=IJWSAlq40BAsvkwvgOkZ06ess8Cp60bnrmR6aLtxKn+MkXgyPWLpe7dbiaOyCLm0ZJ iMjUh5yLITOfdIPmSHJRBdJKFbC4J/K5bcOjiQ7w4ca1uc5njSGgSRlEUUtzaw76PFdF hK93hiHI8UYPir/GJh0Z9PPpiuS8/nQEw4aX93RXhMq87XNmaFPTKFu2DWWFHkORfrJJ uX/DgFbB88SptWqR1Tw8oq2YlsdNwRU5yojnD6cwurTNQygP+0B/UiSyO7CnnGsOLre8 j6DTWHBkPgIgID93xvQfBBXfOObZJJaJL8V4ndsSF/PMtCgw8bQgDvc0PkakCh55hMDw KIrg== 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 x15si3888499edl.247.2020.05.07.12.08.31; Thu, 07 May 2020 12:08:54 -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 S1727937AbgEGTFF (ORCPT + 99 others); Thu, 7 May 2020 15:05:05 -0400 Received: from nibbler.cm4all.net ([82.165.145.151]:59720 "EHLO nibbler.cm4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbgEGTFF (ORCPT ); Thu, 7 May 2020 15:05:05 -0400 Received: from localhost (localhost [127.0.0.1]) by nibbler.cm4all.net (Postfix) with ESMTP id CC33DC023F for ; Thu, 7 May 2020 21:05:03 +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 zecgH1h8mQWc for ; Thu, 7 May 2020 21:05:03 +0200 (CEST) Received: from zero.intern.cm-ag (zero.intern.cm-ag [172.30.16.10]) by nibbler.cm4all.net (Postfix) with SMTP id AB18CC0215 for ; Thu, 7 May 2020 21:05:03 +0200 (CEST) Received: (qmail 2978 invoked from network); 7 May 2020 22:21:20 +0200 Received: from unknown (HELO rabbit.intern.cm-ag) (172.30.3.1) by zero.intern.cm-ag with SMTP; 7 May 2020 22:21:20 +0200 Received: by rabbit.intern.cm-ag (Postfix, from userid 1023) id 752A4461450; Thu, 7 May 2020 21:05:03 +0200 (CEST) Date: Thu, 7 May 2020 21:05:03 +0200 From: Max Kellermann To: Al Viro Cc: Max Kellermann , axboe@kernel.dk, 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: <20200507190503.GA15998@rabbit.intern.cm-ag> References: <20200507185725.15840-1-mk@cm4all.com> <20200507190131.GF23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200507190131.GF23230@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:01, Al Viro wrote: > On Thu, May 07, 2020 at 08:57:25PM +0200, Max Kellermann wrote: > > If an operation's flag `needs_file` is set, the function > > io_req_set_file() calls io_file_get() to obtain a `struct file*`. > > > > This fails for `O_PATH` file descriptors, because those have no > > `struct file*` > > O_PATH descriptors most certainly *do* have that. What the hell > are you talking about? Oh, then my patch description (and my understanding of the root problem) is wrong. In my debugging session, io_file_get() on that fd returned NULL, so I assumed O_PATH doesn't have that, but maybe there are other reasons. In any case, with a "real" fd, io_uring openat() succeeds, and my patch makes the problem with O_PATH go away. I guess I need to learn more about what happens inside io_file_get(). Max