Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp157101ybl; Thu, 23 Jan 2020 20:35:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzK6mzcrZMjxh+jvcCU906Up8MgttjOouaNZVVv6hRPbzlkOrh0tAwRdcDyX9KmvF40LDxp X-Received: by 2002:a9d:7757:: with SMTP id t23mr1407050otl.315.1579840546568; Thu, 23 Jan 2020 20:35:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579840546; cv=none; d=google.com; s=arc-20160816; b=MjUfF6XGst9J+biwug0PmWOV8Xyg9pMTIGhBxgi1FpCRPQx6AICAynL5GVLrA6nfSv JDg3NMDcMKgzcDPUXplgYvXNGITGY+y5axXTYkhMDBkoCda1Xo/CGYK0smoxmnkTK80s mNpSHLZr4jDbLxHMbRxZAOS0hcfV8/U5iDWVnOK2VvCM+vd4vIqgUaz59HmG4/uplHP8 GRRotAcq6xJWyyqcdEftKQq3YnRTx6F0tg7x7vlVKQS79T4KkfN4bwYFTPcUYfv6frI2 VUp5JOyUH4vQLloSVnDjqvHS79xnIzpChBRg/4iPVqYuuA1XT9Bmoqk2MYOesabW7yEj 2LcA== 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 :dkim-signature; bh=1QT66f3hlreOPX2bf7pwGe3m7tRfefwkIVT0vLuhLa0=; b=siYTrG5oOJL4v1755Oy0vlyNzJaKm/IBoG0D1YCp8MIrk3tLtbHy/jmQ84Od6CXdVq x6JVIhF6IawCUCM7w2bsYiFQFbwk/uWXD76zlviYkiWseldKk8x/2IvaCoAyRSe8QSNJ L8O42kD/j7h70BiM3EIwI2lDCc6WjPHx3NI6fSUV0brKxQivaHck2G+6b2BIvaCJw+lz S2dS9AVXxjKdqJ01LlxAbTu+t07J8H2Zm0m5OBO3gSheN8boiI+Q4n0Evf2GloQp/s2P 31Yc2b2RXZsih763k2TdFzuF3VDGJl2APnE4uEMXzLjvxCfITZjRvgnUCltbgVk/EMV5 vbHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RJRx1Uro; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si2187157otk.91.2020.01.23.20.35.35; Thu, 23 Jan 2020 20:35:46 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=RJRx1Uro; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730523AbgAXE34 (ORCPT + 99 others); Thu, 23 Jan 2020 23:29:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:50666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729316AbgAXE3z (ORCPT ); Thu, 23 Jan 2020 23:29:55 -0500 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC6392072C; Fri, 24 Jan 2020 04:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579840195; bh=w7bUGOmBcf8WYfmLHNz1iZda5pKwrIDULz8xqJEmZmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RJRx1UroRpNjDxxEZ8+qL1gktnq773hIx31h2M0OdBjHhtDUVdOlVsijub/9qOrJC l16OFpelVLUsiwddVu0rQyNDShAvyriuZEyJnfg6kkHmDYhN8CJDcx/BAP2oLrP6OW tgAwolhEK7ImbCOQj5cJpnHZjDPPM3BpUgQxIjes= Date: Thu, 23 Jan 2020 20:29:53 -0800 From: Eric Biggers To: Al Viro Cc: OGAWA Hirofumi , Pali =?iso-8859-1?Q?Roh=E1r?= , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Theodore Y. Ts'o" , Namjae Jeon , Gabriel Krisman Bertazi , Linus Torvalds Subject: Re: oopsably broken case-insensitive support in ext4 and f2fs (Re: vfat: Broken case-insensitive support for UTF-8) Message-ID: <20200124042953.GA832@sol.localdomain> References: <20200119221455.bac7dc55g56q2l4r@pali> <87sgkan57p.fsf@mail.parknet.co.jp> <20200120073040.GZ8904@ZenIV.linux.org.uk> <20200120074558.GA8904@ZenIV.linux.org.uk> <20200120080721.GB8904@ZenIV.linux.org.uk> <20200120193558.GD8904@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200120193558.GD8904@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2020 at 07:35:58PM +0000, Al Viro wrote: > On Mon, Jan 20, 2020 at 08:07:21AM +0000, Al Viro wrote: > > > > > I hadn't checked ->d_compare() instances for a while; somebody needs to > > > > do that again, by the look of it. The above definitely is broken; > > > > no idea how many other instaces had grown such bugs... > > > > > > f2fs one also has the same bug. Anyway, I'm going down right now, will > > > check the rest tomorrow morning... > > > > We _probably_ can get away with just checking that inode for NULL and > > buggering off if it is (->d_seq mismatch is guaranteed in that case), > > but I suspect that we might need READ_ONCE() on both dereferences. > > I hate memory barriers... > > FWIW, other instances seem to be OK; HFS+ one might or might not be > OK in the face of concurrent rename (wrong result in that case is > no problem; oops would be), but it doesn't play silly buggers with > pointer-chasing. > > ext4 and f2fs do, and ->d_compare() is broken in both of them. Thanks Al. I sent out fixes for this: ext4: https://lore.kernel.org/r/20200124041234.159740-1-ebiggers@kernel.org f2fs: https://lore.kernel.org/r/20200124041549.159983-1-ebiggers@kernel.org Note that ->d_hash() was broken too. In fact, that was much easier to reproduce. - Eric