forked from pool/grub2
Accepting request 1115856 from home:favogt:businessasusual
- Add patch to fix reading files from btrfs with "implicit" holes: * 0001-fs-btrfs-Zero-file-data-not-backed-by-extents.patch OBS-URL: https://build.opensuse.org/request/show/1115856 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=467
This commit is contained in:
parent
c4e530ea83
commit
a64c498922
33
0001-fs-btrfs-Zero-file-data-not-backed-by-extents.patch
Normal file
33
0001-fs-btrfs-Zero-file-data-not-backed-by-extents.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From f903b9a9adb64e733e581771d2a24efae7fbe529 Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Vogt <fvogt@suse.de>
|
||||
Date: Thu, 5 Oct 2023 11:02:25 +0200
|
||||
Subject: [PATCH] fs/btrfs: Zero file data not backed by extents
|
||||
|
||||
Implicit holes in file data need to be zeroed explicitly, instead of
|
||||
just leaving the data in the buffer uninitialized.
|
||||
|
||||
This led to kernels randomly failing to boot in "fun" ways when loaded
|
||||
from btrfs with the no_holes feature enabled, because large blocks of
|
||||
zeros in the kernel file contained random data instead.
|
||||
|
||||
Signed-off-by: Fabian Vogt <fvogt@suse.de>
|
||||
---
|
||||
grub-core/fs/btrfs.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
|
||||
index 19bff4610..ba0c58352 100644
|
||||
--- a/grub-core/fs/btrfs.c
|
||||
+++ b/grub-core/fs/btrfs.c
|
||||
@@ -1603,6 +1603,8 @@ grub_btrfs_extent_read (struct grub_btrfs_data *data,
|
||||
csize = grub_le_to_cpu64 (key_out.offset) - pos;
|
||||
if (csize > len)
|
||||
csize = len;
|
||||
+
|
||||
+ grub_memset (buf, 0, csize);
|
||||
buf += csize;
|
||||
pos += csize;
|
||||
len -= csize;
|
||||
--
|
||||
2.42.0
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 5 09:49:54 UTC 2023 - Fabian Vogt <fvogt@suse.com>
|
||||
|
||||
- Add patch to fix reading files from btrfs with "implicit" holes:
|
||||
* 0001-fs-btrfs-Zero-file-data-not-backed-by-extents.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 2 14:30:49 UTC 2023 - Gary Ching-Pang Lin <glin@suse.com>
|
||||
|
||||
|
@ -380,6 +380,7 @@ Patch187: 0003-cryptodisk-wipe-out-the-cached-keys-from-protectors.patch
|
||||
Patch188: 0004-diskfilter-look-up-cryptodisk-devices-first.patch
|
||||
Patch189: grub2-mkconfig-riscv64.patch
|
||||
Patch190: arm64-Use-proper-memory-type-for-kernel-allocation.patch
|
||||
Patch191: 0001-fs-btrfs-Zero-file-data-not-backed-by-extents.patch
|
||||
|
||||
Requires: gettext-runtime
|
||||
%if 0%{?suse_version} >= 1140
|
||||
|
Loading…
x
Reference in New Issue
Block a user