Commit 85553d8c authored by Ryusuke Konishi's avatar Ryusuke Konishi Committed by Zizhi Wo
Browse files

nilfs2: fix data corruption in dsync block recovery for small block sizes

stable inclusion
from stable-v4.19.307
commit 5278c3eb6bf5896417572b52adb6be9d26e92f65
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9E2FH
CVE: CVE-2024-26697

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5278c3eb6bf5896417572b52adb6be9d26e92f65

--------------------------------

commit 67b8bcbaed4777871bb0dcc888fb02a614a98ab1 upstream.

The helper function nilfs_recovery_copy_block() of
nilfs_recovery_dsync_blocks(), which recovers data from logs created by
data sync writes during a mount after an unclean shutdown, incorrectly
calculates the on-page offset when copying repair data to the file's page
cache.  In environments where the block size is smaller than the page
size, this flaw can cause data corruption and leak uninitialized memory
bytes during the recovery process.

Fix these issues by correcting this byte offset calculation on the page.

Link: https://lkml.kernel.org/r/20240124121936.10575-1-konishi.ryusuke@gmail.com


Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Tested-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
parent fad4920f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment