Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp725627pxb; Wed, 1 Sep 2021 08:41:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXp0hPBpsyXLcgjx/Rk0p1AdSLKrAFwzfK9hUASiuKtUu41naBFt4H8txlDj4pL4e8lkk8 X-Received: by 2002:a92:c109:: with SMTP id p9mr87053ile.115.1630510880527; Wed, 01 Sep 2021 08:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630510880; cv=none; d=google.com; s=arc-20160816; b=bGe3uADktr7hP+VgsDmzPBTuSkQYgCTAnrSnG3JJviNmLwqU4OJJD/9mWDFDJQzg1o /JuZ+mwsS+xEABmuk2xp8M+P5wzsSfBDN/YlwjPCXrjtx/0LJYQtiMuR/FA1LyUxopog g2BBMieikecYWwr0SJ85T85mkzx6D2Rs2DYsqo27QAOUxXv/aZgEAnfbmWy236L74+E6 XjVamGnSY/BKwAizJeYX96hE7tJzdndZCqT+c3L3JXFU4Tde5rRXbSkUoq0TIFIgiu59 98sNPdxDPrFUyc0vkvFuEDgvTsAXivRSpSZ/RL7rzA5DWbHGv+dtsHqtAWJN43vi2Tlk 5thA== 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=BeYA4wg9kdLzS/4T9HjyABPSbBaYt8O5lvZyS4fpkmE=; b=JcHUosDthLcqD3hLv7gC5/y7lpEKFWQ3hQKCxdt6tJrTzN6AGvzEPc4N33eK8Le3HY r6tuxsDhs7ZntwhW0mmNld4Zx2si0T1LpPHHaiVBW3gaPyl1FscYXvmIKyLcjMT841vg Q5nxBFhXQ9Wulz5FfCGlbBNxSwYKO2pB++D0oZhOmQ+03Myo18tC92+U0NYuW6FHTygJ s1NlbrtAke6CrvmcRJq8mW0yNnuI0ZCCo7c/pBig7nsH1iS+FAIaKYggipScvPZC/ktT qVhgPyJgKB6jxB7VTK/XZMsXhWhQLETA6XxR70+fzyoOubDEZutePuxT880hJkKsxdBl HWXA== 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 b3si266856iot.102.2021.09.01.08.41.07; Wed, 01 Sep 2021 08:41:20 -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 S1343768AbhIAPki (ORCPT + 99 others); Wed, 1 Sep 2021 11:40:38 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:39610 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244612AbhIAPkh (ORCPT ); Wed, 1 Sep 2021 11:40:37 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLSGg-000H8s-IX; Wed, 01 Sep 2021 15:35:14 +0000 Date: Wed, 1 Sep 2021 15:35:14 +0000 From: Al Viro To: Dmitry Kadashev Cc: Jens Axboe , Christoph Hellwig , Stephen Brennan , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] namei: get rid of unused filename_parentat() Message-ID: References: <20210901150040.3875227-1-dkadashev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01, 2021 at 03:30:56PM +0000, Al Viro wrote: > On Wed, Sep 01, 2021 at 10:00:40PM +0700, Dmitry Kadashev wrote: > > After the switch of kern_path_locked() to __filename_parentat() (to > > address use after free bug) nothing is using filename_parentat(). Also, > > filename_parentat() is inherently buggy: the "last" output arg > > always point to freed memory. > > > > Drop filename_parentat() and rename __filename_parentat() to > > filename_parentat(). > > I'd rather fold that into previous patch. > > And it might be better to fold filename_create() into its 2 callers > and rename __filename_create() as well. > > Let me poke around a bit... BTW, if you look at the only caller of filename_lookup() outside of fs/namei.c, you'll see this: f->refcnt++; /* filename_lookup() drops our ref. */ ret = filename_lookup(param->dirfd, f, flags, _path, NULL); IOW, that thing would be better off with calling the current __filename_lookup(). Might be better to rename filename_lookup to something different, turn __filename_lookup() into filename_lookup() and use _that_ in fs/fs_parser.c...