+++ /dev/null
-From acaa532687cdc3a03757defafece9c27aa667546 Mon Sep 17 00:00:00 2001
-From: Constantine Sapuntzakis <costa@purestorage.com>
-Date: Mon, 14 Sep 2020 10:10:14 -0600
-Subject: ext4: fix superblock checksum calculation race
-
-From: Constantine Sapuntzakis <costa@purestorage.com>
-
-commit acaa532687cdc3a03757defafece9c27aa667546 upstream.
-
-The race condition could cause the persisted superblock checksum
-to not match the contents of the superblock, causing the
-superblock to be considered corrupt.
-
-An example of the race follows. A first thread is interrupted in the
-middle of a checksum calculation. Then, another thread changes the
-superblock, calculates a new checksum, and sets it. Then, the first
-thread resumes and sets the checksum based on the older superblock.
-
-To fix, serialize the superblock checksum calculation using the buffer
-header lock. While a spinlock is sufficient, the buffer header is
-already there and there is precedent for locking it (e.g. in
-ext4_commit_super).
-
-Tested the patch by booting up a kernel with the patch, creating
-a filesystem and some files (including some orphans), and then
-unmounting and remounting the file system.
-
-Cc: stable@kernel.org
-Signed-off-by: Constantine Sapuntzakis <costa@purestorage.com>
-Reviewed-by: Jan Kara <jack@suse.cz>
-Suggested-by: Jan Kara <jack@suse.cz>
-Link: https://lore.kernel.org/r/20200914161014.22275-1-costa@purestorage.com
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- fs/ext4/super.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -200,7 +200,18 @@ void ext4_superblock_csum_set(struct sup
- if (!ext4_has_metadata_csum(sb))
- return;
-
-+ /*
-+ * Locking the superblock prevents the scenario
-+ * where:
-+ * 1) a first thread pauses during checksum calculation.
-+ * 2) a second thread updates the superblock, recalculates
-+ * the checksum, and updates s_checksum
-+ * 3) the first thread resumes and finishes its checksum calculation
-+ * and updates s_checksum with a potentially stale or torn value.
-+ */
-+ lock_buffer(EXT4_SB(sb)->s_sbh);
- es->s_checksum = ext4_superblock_csum(sb, es);
-+ unlock_buffer(EXT4_SB(sb)->s_sbh);
- }
-
- void *ext4_kvmalloc(size_t size, gfp_t flags)
ext4-fix-leaking-sysfs-kobject-after-failed-mount.patch
ext4-fix-error-handling-code-in-add_new_gdb.patch
ext4-fix-invalid-inode-checksum.patch
-ext4-fix-superblock-checksum-calculation-race.patch
drm-ttm-fix-eviction-valuable-range-check.patch
rtc-rx8010-don-t-modify-the-global-rtc-ops.patch
tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch
+++ /dev/null
-From acaa532687cdc3a03757defafece9c27aa667546 Mon Sep 17 00:00:00 2001
-From: Constantine Sapuntzakis <costa@purestorage.com>
-Date: Mon, 14 Sep 2020 10:10:14 -0600
-Subject: ext4: fix superblock checksum calculation race
-
-From: Constantine Sapuntzakis <costa@purestorage.com>
-
-commit acaa532687cdc3a03757defafece9c27aa667546 upstream.
-
-The race condition could cause the persisted superblock checksum
-to not match the contents of the superblock, causing the
-superblock to be considered corrupt.
-
-An example of the race follows. A first thread is interrupted in the
-middle of a checksum calculation. Then, another thread changes the
-superblock, calculates a new checksum, and sets it. Then, the first
-thread resumes and sets the checksum based on the older superblock.
-
-To fix, serialize the superblock checksum calculation using the buffer
-header lock. While a spinlock is sufficient, the buffer header is
-already there and there is precedent for locking it (e.g. in
-ext4_commit_super).
-
-Tested the patch by booting up a kernel with the patch, creating
-a filesystem and some files (including some orphans), and then
-unmounting and remounting the file system.
-
-Cc: stable@kernel.org
-Signed-off-by: Constantine Sapuntzakis <costa@purestorage.com>
-Reviewed-by: Jan Kara <jack@suse.cz>
-Suggested-by: Jan Kara <jack@suse.cz>
-Link: https://lore.kernel.org/r/20200914161014.22275-1-costa@purestorage.com
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- fs/ext4/super.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -200,7 +200,18 @@ void ext4_superblock_csum_set(struct sup
- if (!ext4_has_metadata_csum(sb))
- return;
-
-+ /*
-+ * Locking the superblock prevents the scenario
-+ * where:
-+ * 1) a first thread pauses during checksum calculation.
-+ * 2) a second thread updates the superblock, recalculates
-+ * the checksum, and updates s_checksum
-+ * 3) the first thread resumes and finishes its checksum calculation
-+ * and updates s_checksum with a potentially stale or torn value.
-+ */
-+ lock_buffer(EXT4_SB(sb)->s_sbh);
- es->s_checksum = ext4_superblock_csum(sb, es);
-+ unlock_buffer(EXT4_SB(sb)->s_sbh);
- }
-
- void *ext4_kvmalloc(size_t size, gfp_t flags)
ext4-fix-leaking-sysfs-kobject-after-failed-mount.patch
ext4-fix-error-handling-code-in-add_new_gdb.patch
ext4-fix-invalid-inode-checksum.patch
-ext4-fix-superblock-checksum-calculation-race.patch
drm-ttm-fix-eviction-valuable-range-check.patch
rtc-rx8010-don-t-modify-the-global-rtc-ops.patch
tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch
+++ /dev/null
-From acaa532687cdc3a03757defafece9c27aa667546 Mon Sep 17 00:00:00 2001
-From: Constantine Sapuntzakis <costa@purestorage.com>
-Date: Mon, 14 Sep 2020 10:10:14 -0600
-Subject: ext4: fix superblock checksum calculation race
-
-From: Constantine Sapuntzakis <costa@purestorage.com>
-
-commit acaa532687cdc3a03757defafece9c27aa667546 upstream.
-
-The race condition could cause the persisted superblock checksum
-to not match the contents of the superblock, causing the
-superblock to be considered corrupt.
-
-An example of the race follows. A first thread is interrupted in the
-middle of a checksum calculation. Then, another thread changes the
-superblock, calculates a new checksum, and sets it. Then, the first
-thread resumes and sets the checksum based on the older superblock.
-
-To fix, serialize the superblock checksum calculation using the buffer
-header lock. While a spinlock is sufficient, the buffer header is
-already there and there is precedent for locking it (e.g. in
-ext4_commit_super).
-
-Tested the patch by booting up a kernel with the patch, creating
-a filesystem and some files (including some orphans), and then
-unmounting and remounting the file system.
-
-Cc: stable@kernel.org
-Signed-off-by: Constantine Sapuntzakis <costa@purestorage.com>
-Reviewed-by: Jan Kara <jack@suse.cz>
-Suggested-by: Jan Kara <jack@suse.cz>
-Link: https://lore.kernel.org/r/20200914161014.22275-1-costa@purestorage.com
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- fs/ext4/super.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -144,7 +144,18 @@ void ext4_superblock_csum_set(struct sup
- if (!ext4_has_metadata_csum(sb))
- return;
-
-+ /*
-+ * Locking the superblock prevents the scenario
-+ * where:
-+ * 1) a first thread pauses during checksum calculation.
-+ * 2) a second thread updates the superblock, recalculates
-+ * the checksum, and updates s_checksum
-+ * 3) the first thread resumes and finishes its checksum calculation
-+ * and updates s_checksum with a potentially stale or torn value.
-+ */
-+ lock_buffer(EXT4_SB(sb)->s_sbh);
- es->s_checksum = ext4_superblock_csum(sb, es);
-+ unlock_buffer(EXT4_SB(sb)->s_sbh);
- }
-
- void *ext4_kvmalloc(size_t size, gfp_t flags)
9p-cast-to-loff_t-before-multiplying.patch
ring-buffer-return-0-on-success-from-ring_buffer_resize.patch
vringh-fix-__vringh_iov-when-riov-and-wiov-are-different.patch
-ext4-fix-superblock-checksum-calculation-race.patch
tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch
arm64-berlin-select-dw_apb_timer_of.patch
cachefiles-handle-readpage-error-correctly.patch
+++ /dev/null
-From acaa532687cdc3a03757defafece9c27aa667546 Mon Sep 17 00:00:00 2001
-From: Constantine Sapuntzakis <costa@purestorage.com>
-Date: Mon, 14 Sep 2020 10:10:14 -0600
-Subject: ext4: fix superblock checksum calculation race
-
-From: Constantine Sapuntzakis <costa@purestorage.com>
-
-commit acaa532687cdc3a03757defafece9c27aa667546 upstream.
-
-The race condition could cause the persisted superblock checksum
-to not match the contents of the superblock, causing the
-superblock to be considered corrupt.
-
-An example of the race follows. A first thread is interrupted in the
-middle of a checksum calculation. Then, another thread changes the
-superblock, calculates a new checksum, and sets it. Then, the first
-thread resumes and sets the checksum based on the older superblock.
-
-To fix, serialize the superblock checksum calculation using the buffer
-header lock. While a spinlock is sufficient, the buffer header is
-already there and there is precedent for locking it (e.g. in
-ext4_commit_super).
-
-Tested the patch by booting up a kernel with the patch, creating
-a filesystem and some files (including some orphans), and then
-unmounting and remounting the file system.
-
-Cc: stable@kernel.org
-Signed-off-by: Constantine Sapuntzakis <costa@purestorage.com>
-Reviewed-by: Jan Kara <jack@suse.cz>
-Suggested-by: Jan Kara <jack@suse.cz>
-Link: https://lore.kernel.org/r/20200914161014.22275-1-costa@purestorage.com
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- fs/ext4/super.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -175,7 +175,18 @@ void ext4_superblock_csum_set(struct sup
- if (!ext4_has_metadata_csum(sb))
- return;
-
-+ /*
-+ * Locking the superblock prevents the scenario
-+ * where:
-+ * 1) a first thread pauses during checksum calculation.
-+ * 2) a second thread updates the superblock, recalculates
-+ * the checksum, and updates s_checksum
-+ * 3) the first thread resumes and finishes its checksum calculation
-+ * and updates s_checksum with a potentially stale or torn value.
-+ */
-+ lock_buffer(EXT4_SB(sb)->s_sbh);
- es->s_checksum = ext4_superblock_csum(sb, es);
-+ unlock_buffer(EXT4_SB(sb)->s_sbh);
- }
-
- void *ext4_kvmalloc(size_t size, gfp_t flags)
9p-cast-to-loff_t-before-multiplying.patch
ring-buffer-return-0-on-success-from-ring_buffer_resize.patch
vringh-fix-__vringh_iov-when-riov-and-wiov-are-different.patch
-ext4-fix-superblock-checksum-calculation-race.patch
rtc-rx8010-don-t-modify-the-global-rtc-ops.patch
tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch
arm64-berlin-select-dw_apb_timer_of.patch
+++ /dev/null
-From acaa532687cdc3a03757defafece9c27aa667546 Mon Sep 17 00:00:00 2001
-From: Constantine Sapuntzakis <costa@purestorage.com>
-Date: Mon, 14 Sep 2020 10:10:14 -0600
-Subject: ext4: fix superblock checksum calculation race
-
-From: Constantine Sapuntzakis <costa@purestorage.com>
-
-commit acaa532687cdc3a03757defafece9c27aa667546 upstream.
-
-The race condition could cause the persisted superblock checksum
-to not match the contents of the superblock, causing the
-superblock to be considered corrupt.
-
-An example of the race follows. A first thread is interrupted in the
-middle of a checksum calculation. Then, another thread changes the
-superblock, calculates a new checksum, and sets it. Then, the first
-thread resumes and sets the checksum based on the older superblock.
-
-To fix, serialize the superblock checksum calculation using the buffer
-header lock. While a spinlock is sufficient, the buffer header is
-already there and there is precedent for locking it (e.g. in
-ext4_commit_super).
-
-Tested the patch by booting up a kernel with the patch, creating
-a filesystem and some files (including some orphans), and then
-unmounting and remounting the file system.
-
-Cc: stable@kernel.org
-Signed-off-by: Constantine Sapuntzakis <costa@purestorage.com>
-Reviewed-by: Jan Kara <jack@suse.cz>
-Suggested-by: Jan Kara <jack@suse.cz>
-Link: https://lore.kernel.org/r/20200914161014.22275-1-costa@purestorage.com
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- fs/ext4/super.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -201,7 +201,18 @@ void ext4_superblock_csum_set(struct sup
- if (!ext4_has_metadata_csum(sb))
- return;
-
-+ /*
-+ * Locking the superblock prevents the scenario
-+ * where:
-+ * 1) a first thread pauses during checksum calculation.
-+ * 2) a second thread updates the superblock, recalculates
-+ * the checksum, and updates s_checksum
-+ * 3) the first thread resumes and finishes its checksum calculation
-+ * and updates s_checksum with a potentially stale or torn value.
-+ */
-+ lock_buffer(EXT4_SB(sb)->s_sbh);
- es->s_checksum = ext4_superblock_csum(sb, es);
-+ unlock_buffer(EXT4_SB(sb)->s_sbh);
- }
-
- void *ext4_kvmalloc(size_t size, gfp_t flags)
ext4-fix-leaking-sysfs-kobject-after-failed-mount.patch
ext4-fix-error-handling-code-in-add_new_gdb.patch
ext4-fix-invalid-inode-checksum.patch
-ext4-fix-superblock-checksum-calculation-race.patch
drm-ttm-fix-eviction-valuable-range-check.patch
mmc-sdhci-of-esdhc-set-timeout-to-max-before-tuning.patch
mmc-sdhci-use-auto-cmd-auto-select-only-when-v4_mode-is-true.patch
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
-@@ -4826,9 +4826,8 @@ no_journal:
+@@ -4815,9 +4815,8 @@ no_journal:
* used to detect the metadata async write error.
*/
spin_lock_init(&sbi->s_bdev_wb_lock);
sb->s_bdev->bd_super = sb;
EXT4_SB(sb)->s_mount_state |= EXT4_ORPHAN_FS;
ext4_orphan_cleanup(sb, es);
-@@ -5721,14 +5720,6 @@ static int ext4_remount(struct super_blo
+@@ -5710,14 +5709,6 @@ static int ext4_remount(struct super_blo
}
/*
+++ /dev/null
-From acaa532687cdc3a03757defafece9c27aa667546 Mon Sep 17 00:00:00 2001
-From: Constantine Sapuntzakis <costa@purestorage.com>
-Date: Mon, 14 Sep 2020 10:10:14 -0600
-Subject: ext4: fix superblock checksum calculation race
-
-From: Constantine Sapuntzakis <costa@purestorage.com>
-
-commit acaa532687cdc3a03757defafece9c27aa667546 upstream.
-
-The race condition could cause the persisted superblock checksum
-to not match the contents of the superblock, causing the
-superblock to be considered corrupt.
-
-An example of the race follows. A first thread is interrupted in the
-middle of a checksum calculation. Then, another thread changes the
-superblock, calculates a new checksum, and sets it. Then, the first
-thread resumes and sets the checksum based on the older superblock.
-
-To fix, serialize the superblock checksum calculation using the buffer
-header lock. While a spinlock is sufficient, the buffer header is
-already there and there is precedent for locking it (e.g. in
-ext4_commit_super).
-
-Tested the patch by booting up a kernel with the patch, creating
-a filesystem and some files (including some orphans), and then
-unmounting and remounting the file system.
-
-Cc: stable@kernel.org
-Signed-off-by: Constantine Sapuntzakis <costa@purestorage.com>
-Reviewed-by: Jan Kara <jack@suse.cz>
-Suggested-by: Jan Kara <jack@suse.cz>
-Link: https://lore.kernel.org/r/20200914161014.22275-1-costa@purestorage.com
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- fs/ext4/super.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -201,7 +201,18 @@ void ext4_superblock_csum_set(struct sup
- if (!ext4_has_metadata_csum(sb))
- return;
-
-+ /*
-+ * Locking the superblock prevents the scenario
-+ * where:
-+ * 1) a first thread pauses during checksum calculation.
-+ * 2) a second thread updates the superblock, recalculates
-+ * the checksum, and updates s_checksum
-+ * 3) the first thread resumes and finishes its checksum calculation
-+ * and updates s_checksum with a potentially stale or torn value.
-+ */
-+ lock_buffer(EXT4_SB(sb)->s_sbh);
- es->s_checksum = ext4_superblock_csum(sb, es);
-+ unlock_buffer(EXT4_SB(sb)->s_sbh);
- }
-
- ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
ext4-fix-error-handling-code-in-add_new_gdb.patch
ext4-implement-swap_activate-aops-using-iomap.patch
ext4-fix-invalid-inode-checksum.patch
-ext4-fix-superblock-checksum-calculation-race.patch
ext4-clear-buffer-verified-flag-if-read-meta-block-from-disk.patch
ext4-fix-bdev-write-error-check-failed-when-mount-fs-with-ro.patch
ext4-fix-bs-ps-issue-reported-with-dioread_nolock-mount-opt.patch