Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp921003pxf; Wed, 7 Apr 2021 15:06:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9MOu/u/3F+ozhAazXyoSD9ilTWIlwlW658uVPZs92xJboB+JyWQ1QMpIRrDJLAuZPQwYt X-Received: by 2002:a17:90b:310e:: with SMTP id gc14mr5463013pjb.198.1617833202878; Wed, 07 Apr 2021 15:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617833202; cv=none; d=google.com; s=arc-20160816; b=VojKTrZJ2M+V1dTN944ZoB+Wf2R3TswfOhlBlPThO7LMXsC1HEt3ditQBzP7XbVLFL K38iqbPV+bW4K7dIiEseZR6vMQgeLbUEZxWLWJQW/JhH/5a0kuE7/9ySmgWquH3I8dCR 7ArxWVsIq/NFYk2L/lCOV/zX3EjddrMAi3V/gVE+pVAS1YwhLkb5K6yzo0plvukZ3bq/ woey5XTNgt4thLF8Na0qeLoVcj7djQ/npilg3i/ztZgY//8X5HWy407TQ97SNASnrwds iGWGJN8+sM07kbhMbV/6StTM/yGqUCyvVpJCXAj0AfoTJEzxm6tMYzuYbsU8zrAEFgPr tatw== 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; bh=DfSuW2J/XybpABCJdcFuxLR2SW3jXzQVIByO+pWB0Kg=; b=U86Bg9Iro4UmY2oy/I3Pnqs7248PaAyeuH4hDxuye7LC+Js+RnNxz2UP2JSYT9OLhw wytxn/RMZNVtpZ5ASAtDE9/GDjnwvP18InYoIt7DnPJKLdIjU5y9c0ImdHXauxIz2DQC rvLH01RID5TNLB2MnWNW6Vp4srUyhoAKtTlg/EQQV8jZVUL2eyIvqppymJCmmqsiGX+7 5lyvi6BxWHDeVzhE8i4+5yJ6k50AyovEeLfIK615d+McPY0c/hShGuknwr9tV4RcWo52 uvyTlvNZ9swW1RRth+8IjZMdlv73KX0bII2zB4xs0D3rsFx0zjfOcqzbwKVGZN4a315s NPOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnJh4tac; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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. [23.128.96.18]) by mx.google.com with ESMTP id n4si3479218pgs.427.2021.04.07.15.06.04; Wed, 07 Apr 2021 15:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnJh4tac; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 S229911AbhDGVdb (ORCPT + 99 others); Wed, 7 Apr 2021 17:33:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:45426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbhDGVd2 (ORCPT ); Wed, 7 Apr 2021 17:33:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 37951610D0; Wed, 7 Apr 2021 21:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617831197; bh=VI6iD780zCgN/ZDvvpg1jRnEHaJYUZSN/nf/L3j9r6c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pnJh4tacE7Gy/+Hv6bu5QOOE9PpZWMGE3odqTaYyl2mWsEYLi8vYvJKHoL1waA4Iy 8ekdEifzEXc7wT9Ioeo40uESRyA+V+2gjqOsiQ1oh+u0ulm2ht9CWuYC6mtunLaxDV UEkdhAKHgXi20X1xjLdz5WwERCsTv2b3ahVJ6+PnmkFi6zXZ3Ryn9pKR20ra18t64S abxUXWlnCz33EFXvcxc5sMGNAWEWlRuZnl0b4GySdnI+OOWSajCbgOCj9LX7w/uYpf L2ILCzcIvKk6lCw1jEjZDC0ZmC+A07TMz/qLvZxjFvN5oxSYu544UNUPS/blVOo0EM 6o0Gzsz1hQ2TQ== Date: Wed, 7 Apr 2021 14:33:15 -0700 From: Eric Biggers To: Leah Rumancik Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH v2 1/2] ext4: wipe filename upon file deletion Message-ID: References: <20210407154202.1527941-1-leah.rumancik@gmail.com> <20210407154202.1527941-2-leah.rumancik@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407154202.1527941-2-leah.rumancik@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Apr 07, 2021 at 03:42:01PM +0000, Leah Rumancik wrote: > Zero out filename and file type fields when file is deleted. Why? Also what about when a dir_entry is moved? Wouldn't you want to make sure that any copies don't get left around? > > Signed-off-by: Leah Rumancik > --- > fs/ext4/namei.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c > index 883e2a7cd4ab..0147c86de99e 100644 > --- a/fs/ext4/namei.c > +++ b/fs/ext4/namei.c > @@ -2492,6 +2492,10 @@ int ext4_generic_delete_entry(struct inode *dir, > else > de->inode = 0; > inode_inc_iversion(dir); > + > + memset(de_del->name, 0, de_del->name_len); > + memset(&de_del->file_type, 0, sizeof(__u8)); The second line could be written as simply 'de_del->file_type = 0'. Also why zero these two fields in particular and not the whole dir_entry? - Eric