[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YG4lG2B9Wf4t6IfA@gmail.com>
Date: Wed, 7 Apr 2021 14:33:15 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Leah Rumancik <leah.rumancik@...il.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH v2 1/2] ext4: wipe filename upon file deletion
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 <leah.rumancik@...il.com>
> ---
> 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
Powered by blists - more mailing lists