From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B688CC433E1 for ; Thu, 11 Jun 2020 15:02:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98D0420792 for ; Thu, 11 Jun 2020 15:02:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728410AbgFKPCK (ORCPT ); Thu, 11 Jun 2020 11:02:10 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:47766 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728059AbgFKPCK (ORCPT ); Thu, 11 Jun 2020 11:02:10 -0400 Received: from callcc.thunk.org (pool-100-0-195-244.bstnma.fios.verizon.net [100.0.195.244]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 05BF1oeZ025687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jun 2020 11:01:51 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 8C5C84200DD; Thu, 11 Jun 2020 11:01:50 -0400 (EDT) Date: Thu, 11 Jun 2020 11:01:50 -0400 From: "Theodore Y. Ts'o" To: Andreas Dilger Cc: Eric Biggers , linux-ext4@vger.kernel.org, Daniel Rosenberg , stable@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Al Viro , linux-fsdevel@vger.kernel.org, Gabriel Krisman Bertazi Subject: Re: [PATCH v2] ext4: avoid utf8_strncasecmp() with unstable name Message-ID: <20200611150150.GO1347934@mit.edu> References: <20200601200543.59417-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jun 01, 2020 at 02:49:51PM -0600, Andreas Dilger wrote: > On Jun 1, 2020, at 2:05 PM, Eric Biggers wrote: > > > > From: Eric Biggers > > > > If the dentry name passed to ->d_compare() fits in dentry::d_iname, then > > it may be concurrently modified by a rename. This can cause undefined > > behavior (possibly out-of-bounds memory accesses or crashes) in > > utf8_strncasecmp(), since fs/unicode/ isn't written to handle strings > > that may be concurrently modified. > > > > Fix this by first copying the filename to a stack buffer if needed. > > This way we get a stable snapshot of the filename. > > > > Fixes: b886ee3e778e ("ext4: Support case-insensitive file name lookups") > > Cc: # v5.2+ > > Cc: Al Viro > > Cc: Daniel Rosenberg > > Cc: Gabriel Krisman Bertazi > > Signed-off-by: Eric Biggers > > LGTM. > > Reviewed-by: Andreas Dilger Thanks, applied. - Ted