linux-stable/fs/exfat
Sungjong Seo 9326a62299 exfat: use updated exfat_chain directly during renaming
commit 204e6ceaa1 upstream.

In order for a file to access its own directory entry set,
exfat_inode_info(ei) has two copied values. One is ei->dir, which is
a snapshot of exfat_chain of the parent directory, and the other is
ei->entry, which is the offset of the start of the directory entry set
in the parent directory.

Since the parent directory can be updated after the snapshot point,
it should be used only for accessing one's own directory entry set.

However, as of now, during renaming, it could try to traverse or to
allocate clusters via snapshot values, it does not make sense.

This potential problem has been revealed when exfat_update_parent_info()
was removed by commit d8dad2588a ("exfat: fix referencing wrong parent
directory information after renaming"). However, I don't think it's good
idea to bring exfat_update_parent_info() back.

Instead, let's use the updated exfat_chain of parent directory diectly.

Fixes: d8dad2588a ("exfat: fix referencing wrong parent directory information after renaming")
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
Tested-by: Wang Yugui <wangyugui@e16-tech.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-29 17:28:16 +02:00
..
Kconfig exfat: Improve wording of EXFAT_DEFAULT_IOCHARSET config option 2020-06-09 16:48:39 +09:00
Makefile exfat: add Kconfig and Makefile 2020-03-05 21:00:40 -05:00
balloc.c exfat: check if cluster num is valid 2022-06-06 08:48:54 +02:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-07 14:27:13 +09:00
dir.c exfat: remove argument 'sector' from exfat_get_dentry() 2022-01-10 11:00:03 +09:00
exfat_fs.h exfat: check if cluster num is valid 2022-06-06 08:48:54 +02:00
exfat_raw.h exfat: fix shift-out-of-bounds in exfat_fill_super() 2021-02-22 09:55:13 +09:00
fatent.c exfat: check if cluster num is valid 2022-06-06 08:48:54 +02:00
file.c exfat: do not clear VolumeDirty in writeback 2022-04-01 10:51:03 +09:00
inode.c fs: Convert __set_page_dirty_buffers to block_dirty_folio 2022-03-16 13:37:04 -04:00
misc.c exfat: fix missing REQ_SYNC in exfat_update_bhs() 2022-01-10 11:00:04 +09:00
namei.c exfat: use updated exfat_chain directly during renaming 2022-07-29 17:28:16 +02:00
nls.c exfat: remove argument 'sector' from exfat_get_dentry() 2022-01-10 11:00:03 +09:00
super.c Description for this pull request: 2022-04-01 14:20:24 -07:00