linux/fs/ubifs
Matthew Wilcox (Oracle) 142d87c958 ubifs: Set page uptodate in the correct place
[ Upstream commit 723012cab7 ]

Page cache reads are lockless, so setting the freshly allocated page
uptodate before we've overwritten it with the data it's supposed to have
in it will allow a simultaneous reader to see old data.  Move the call
to SetPageUptodate into ubifs_write_end(), which is after we copied the
new data into the page.

Fixes: 1e51764a3c ("UBIFS: add new flash file system")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:19:27 +02:00
..
auth.c
budget.c ubifs: Reserve one leb for each journal head while doing budget 2023-03-11 13:55:20 +01:00
commit.c
compress.c
crypto.c ubifs: Fix UBIFS ro fail due to truncate in the encrypted directory 2022-09-21 11:32:38 +02:00
debug.c treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
debug.h
dir.c ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path 2024-01-31 16:17:02 -08:00
file.c ubifs: Set page uptodate in the correct place 2024-04-03 15:19:27 +02:00
find.c
gc.c ubifs: read-only if LEB may always be taken in ubifs_garbage_collect 2021-12-23 22:30:38 +01:00
io.c ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock() 2022-01-10 22:58:27 +01:00
ioctl.c ubifs: setflags: Make dirtied_ino_d 8 bytes aligned 2022-01-10 22:18:42 +01:00
journal.c Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
Kconfig
key.h
log.c
lprops.c
lpt_commit.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
lpt.c
Makefile ubifs: Export filesystem error counters 2021-12-23 20:23:42 +01:00
master.c
misc.c
misc.h
orphan.c
recovery.c
replay.c ubifs: Fix spelling mistakes 2021-12-23 20:23:40 +01:00
sb.c
scan.c
shrinker.c
super.c ubifs: Fix memory leak in alloc_wbufs() 2023-03-11 13:55:20 +01:00
sysfs.c ubifs: Fix memory leak in ubifs_sysfs_init() 2023-03-11 13:55:19 +01:00
tnc_commit.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
tnc_misc.c
tnc.c ubifs: fix possible dereference after free 2024-01-01 12:39:06 +00:00
ubifs-media.h
ubifs.h ubifs: Fix build errors as symbol undefined 2023-03-11 13:55:19 +01:00
xattr.c ubifs: Fix AA deadlock when setting xattr for encrypted file 2022-09-21 11:32:58 +02:00