OpenCloudOS-Kernel/fs/fuse
Jann Horn 11108fbe0d fuse: Initialize beyond-EOF page contents before setting uptodate
[ Upstream commit 3c0da3d163eb32f1f91891efaade027fa9b245b9 ]

Fix CVE: CVE-2024-44947

fuse_notify_store(), unlike fuse_do_readpage(), does not enable page
zeroing (because it can be used to change partial page contents).

So fuse_notify_store() must be more careful to fully initialize page
contents (including parts of the page that are beyond end-of-file)
before marking the page uptodate.

The current code can leave beyond-EOF page contents uninitialized, which
makes these uninitialized page contents visible to userspace via mmap().

This is an information leak, but only affects systems which do not
enable init-on-alloc (via CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y or the
corresponding kernel command line parameter).

Link: https://bugs.chromium.org/p/project-zero/issues/detail?id=2574
Cc: stable@kernel.org
Fixes: a1d75f2582 ("fuse: add store request")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Haisu Wang <haisuwang@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-28 14:52:34 +08:00
..
Kconfig virtio-fs: add virtiofs filesystem 2019-09-18 20:17:50 +02:00
Makefile virtio-fs: Change module name to virtiofs.ko 2019-10-14 10:20:33 +02:00
acl.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
control.c tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
cuse.c tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
dev.c fuse: Initialize beyond-EOF page contents before setting uptodate 2024-11-28 14:52:34 +08:00
dir.c tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
file.c tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
fuse_i.h tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
inode.c tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
readdir.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
virtio_fs.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
xattr.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00