Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp287874iob; Wed, 18 May 2022 02:10:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydUsH61thSJ3ht/0DgKqkbAIfCNT60zHUm0ac4AVTCDfl1jR4PRkeAWnU92IECVbXh6Tot X-Received: by 2002:a17:902:f20a:b0:161:92a0:30ff with SMTP id m10-20020a170902f20a00b0016192a030ffmr10787205plc.44.1652865023502; Wed, 18 May 2022 02:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652865023; cv=none; d=google.com; s=arc-20160816; b=xfUpz/iBCeQszOySYDW6RFN7j7+aTiTEItIj/SThYxDGSw9CnnLkmoVUI2U/vMNw62 HfJeMITMtg7OqGBe23vcAa9X1pDL3wKNo3QZH0wY1H8rTVc4JRgC8nRdoa5gk80Zc/nn A02ilGhiYSRr62DjYVYe+rkIfsL4pUHDawnneXJ0RujKzUq3XNXiAfAIszLG8JOyVJoW UKwDHV5ktTYpyKFitLKKbgizfoOqiXBbhtS5J3+6p7CWKMrZ9QUuQtr0ZjNTg3FDM3ad oX09b05M8S4vUAMUn60Obzgxb7nHyFqUFUvdn82P4PVV+ldaBbNd3gBOdEDuDbHFxPen jWrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=78QKorE5u+svpwXHIAIEDwWldZxmwsbY2t3NfKDaoiY=; b=fHxhX8oBfUpxYWuEDnsthXhqKrCEJbghKht2n1QZ1PdhLdUbsSxmCG0xBSWMH8mCUq 7B50kdh9IZN1d7XVjnLhu6AVgNWbGeC0ER+THokAt5F2R3R5KPM+4q6k5RJ3rc6cjH4S avR/szA7nMUsOy2La3gcgoRkGEwoI5YZubK/CMt8dq6mUaRoNShHcg+aaN5dPpnzSOBm xWihxJgEu3Qku17KHhORbcvmQm81Eurvp6imSbtFhtYgxprrju4GDRTMFAhoZY7feUpV XGeREEEVMO7E7ObVEyrL7bo7SWUWTf+jshcF4pzDftcU3QBmYI+QDGakt3K3Y7+WdKbL GQ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="wXUuu/MQ"; dkim=neutral (no key) header.i=@suse.cz; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e6-20020a63d946000000b003c64eaa98bdsi1854691pgj.499.2022.05.18.02.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 02:10:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="wXUuu/MQ"; dkim=neutral (no key) header.i=@suse.cz; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CA7B113CA02; Wed, 18 May 2022 02:10:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233846AbiERJKH (ORCPT + 99 others); Wed, 18 May 2022 05:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233816AbiERJKG (ORCPT ); Wed, 18 May 2022 05:10:06 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773BA13FB1; Wed, 18 May 2022 02:10:04 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 27AA81F9AC; Wed, 18 May 2022 09:10:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1652865003; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=78QKorE5u+svpwXHIAIEDwWldZxmwsbY2t3NfKDaoiY=; b=wXUuu/MQ0BmIvelPVc2w7EXINzFwhYAYChTD2cp1zh+M3hBoEX6BqX24Y3SY/iLWh2fJ7D 3jgPgr8vByeX3hwga/zZB4PXc1lFbR0GGVoLHWuIvMP9IigVN3dlAN49FCCSmbMZ+TjdXj sIy5Gc61rpxjMZSuY+PGlQMYrIgRYik= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1652865003; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=78QKorE5u+svpwXHIAIEDwWldZxmwsbY2t3NfKDaoiY=; b=vDA5kQEzRjjZ1GgU65u7mCyyv0ifSeKPsZ0ac7Fm71VrgCT0a1SpSwxiRIMV86HhecpI8l 4uTt5Djg1mQ5raAw== Received: from quack3.suse.cz (unknown [10.163.43.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 19B332C141; Wed, 18 May 2022 09:10:03 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 53132A062F; Wed, 18 May 2022 11:09:56 +0200 (CEST) Date: Wed, 18 May 2022 11:09:56 +0200 From: Jan Kara To: Theodore Ts'o Cc: Jan Kara , linux-ext4@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/2] ext4: Verify dir block before splitting it Message-ID: <20220518090956.ttowg7yweyqbshmp@quack3.lan> References: <20220428180355.15209-1-jack@suse.cz> <20220428183143.5439-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 17-05-22 19:40:11, Theodore Ts'o wrote: > On Thu, Apr 28, 2022 at 08:31:37PM +0200, Jan Kara wrote: > > Before splitting a directory block verify its directory entries are sane > > so that the splitting code does not access memory it should not. > > This commit fails to build due to an undefined variable. It's fixed > with this hunk in the next patch, which needs to be brought back into > this commit: > > diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c > index 5951e9bb348e..7286472e9558 100644 > --- a/fs/ext4/namei.c > +++ b/fs/ext4/namei.c > @@ -1278,7 +1278,7 @@ static int dx_make_map(struct inode *dir, struct buffer_head *bh, > count++; > cond_resched(); > } > - de = ext4_next_entry(de, blocksize); > + de = ext4_next_entry(de, dir->i_sb->s_blocksize); > } > return count; > } > > I was thinking about folding in this change and apply the patch with > that change --- and I may yet do that --- but it looks like there's a > bigger problem with this patch series, which is that it's causing a > crash when running ext4/052 due to what appears to be a smashed stack. > More about that in the reply to patch 2/2 of this series.... Yup, I'll fix that. Thanks for catching this. Honza -- Jan Kara SUSE Labs, CR