diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2024-01-23 16:47:34 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-24 15:46:19 +0000 |
commit | fa809fd07390a2983695bd63270d05690fa854b9 (patch) | |
tree | c7cb2ec991e3b29e205a723466b68cac3c4a0b4b /meta/recipes-bsp | |
parent | 0a010ac1b46651aaaf57008fb9e6db656822b2e4 (diff) | |
download | poky-fa809fd07390a2983695bd63270d05690fa854b9.tar.gz |
grub2: upgrade 2.06 -> 2.12
Drop patches that have been upstreamed. Refresh others.
This version dropped extra_deps.lst from the tarball [1] and that leads
to build failures. Restore it in do_configure for now.
[1] https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e
(From OE-Core rev: 7c8e1e48075f7f54aec9d295605c982f440be5d5)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
34 files changed, 28 insertions, 2956 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch b/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch index 6b73878cc0..05a4697a73 100644 --- a/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch +++ b/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 96d9aa55d29b24e2490d5647a9efc66940fc400f Mon Sep 17 00:00:00 2001 | 1 | From 006799e9c4babe8a8340a24501b253e759614a2d Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Wed, 13 Jan 2016 19:17:31 +0000 | 3 | Date: Wed, 13 Jan 2016 19:17:31 +0000 |
4 | Subject: [PATCH] Disable -mfpmath=sse as well when SSE is disabled | 4 | Subject: [PATCH] Disable -mfpmath=sse as well when SSE is disabled |
@@ -24,15 +24,16 @@ Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> | |||
24 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 24 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
25 | 25 | ||
26 | Upstream-Status: Pending | 26 | Upstream-Status: Pending |
27 | |||
27 | --- | 28 | --- |
28 | configure.ac | 2 +- | 29 | configure.ac | 2 +- |
29 | 1 file changed, 1 insertion(+), 1 deletion(-) | 30 | 1 file changed, 1 insertion(+), 1 deletion(-) |
30 | 31 | ||
31 | diff --git a/configure.ac b/configure.ac | 32 | diff --git a/configure.ac b/configure.ac |
32 | index 7656f24..0868ea9 100644 | 33 | index cd667a2..8263876 100644 |
33 | --- a/configure.ac | 34 | --- a/configure.ac |
34 | +++ b/configure.ac | 35 | +++ b/configure.ac |
35 | @@ -824,7 +824,7 @@ fi | 36 | @@ -846,7 +846,7 @@ fi |
36 | if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then | 37 | if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then |
37 | # Some toolchains enable these features by default, but they need | 38 | # Some toolchains enable these features by default, but they need |
38 | # registers that aren't set up properly in GRUB. | 39 | # registers that aren't set up properly in GRUB. |
@@ -40,4 +41,4 @@ index 7656f24..0868ea9 100644 | |||
40 | + TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387" | 41 | + TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387" |
41 | fi | 42 | fi |
42 | 43 | ||
43 | # GRUB doesn't use float or doubles at all. Yet some toolchains may decide | 44 | if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then |
diff --git a/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch b/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch index 2f15a91f68..cafa711731 100644 --- a/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch +++ b/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From e4c41db74b8972285cbdfe614c95c1ffd97d70e1 Mon Sep 17 00:00:00 2001 | 1 | From b47029e8e582d17c6874d2622fe1a5b834377dbb Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Fri, 26 Mar 2021 11:59:43 -0700 | 3 | Date: Fri, 26 Mar 2021 11:59:43 -0700 |
4 | Subject: [PATCH] RISC-V: Restore the typcast to 64bit type | 4 | Subject: [PATCH] RISC-V: Restore the typcast to 64bit type |
@@ -17,15 +17,16 @@ Cc: Daniel Kiper <daniel.kiper@oracle.com> | |||
17 | Cc: Chester Lin <clin@suse.com> | 17 | Cc: Chester Lin <clin@suse.com> |
18 | Cc: Nikita Ermakov <arei@altlinux.org> | 18 | Cc: Nikita Ermakov <arei@altlinux.org> |
19 | Cc: Alistair Francis <alistair.francis@wdc.com> | 19 | Cc: Alistair Francis <alistair.francis@wdc.com> |
20 | |||
20 | --- | 21 | --- |
21 | util/grub-mkimagexx.c | 2 +- | 22 | util/grub-mkimagexx.c | 2 +- |
22 | 1 file changed, 1 insertion(+), 1 deletion(-) | 23 | 1 file changed, 1 insertion(+), 1 deletion(-) |
23 | 24 | ||
24 | diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c | 25 | diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c |
25 | index 00f49ccaa..ac677d03d 100644 | 26 | index e50b295..2f09255 100644 |
26 | --- a/util/grub-mkimagexx.c | 27 | --- a/util/grub-mkimagexx.c |
27 | +++ b/util/grub-mkimagexx.c | 28 | +++ b/util/grub-mkimagexx.c |
28 | @@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, | 29 | @@ -1310,7 +1310,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, |
29 | */ | 30 | */ |
30 | 31 | ||
31 | sym_addr += addend; | 32 | sym_addr += addend; |
@@ -34,6 +35,3 @@ index 00f49ccaa..ac677d03d 100644 | |||
34 | 35 | ||
35 | switch (ELF_R_TYPE (info)) | 36 | switch (ELF_R_TYPE (info)) |
36 | { | 37 | { |
37 | -- | ||
38 | 2.31.1 | ||
39 | |||
diff --git a/meta/recipes-bsp/grub/files/0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch b/meta/recipes-bsp/grub/files/0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch deleted file mode 100644 index 98142a7b60..0000000000 --- a/meta/recipes-bsp/grub/files/0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | From eb486898dac8cbc29b2cc39f911b657c3417ae34 Mon Sep 17 00:00:00 2001 | ||
2 | From: Fangrui Song via Grub-devel <grub-devel@gnu.org> | ||
3 | Date: Thu, 26 Aug 2021 09:02:31 -0700 | ||
4 | Subject: [PATCH 1/2] configure: Remove obsoleted -malign-{jumps, loops, | ||
5 | functions} | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | The GCC warns "cc1: warning: ‘-malign-loops’ is obsolete, use ‘-falign-loops’". | ||
11 | The Clang silently ignores -malign-{jumps,loops,functions}. | ||
12 | |||
13 | The preferred -falign-* forms have been supported since GCC 3.2. So, just | ||
14 | remove -malign-{jumps,loops,functions}. | ||
15 | |||
16 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=eb486898dac8cbc29b2cc39f911b657c3417ae34] | ||
17 | Signed-off-by: Fangrui Song <maskray@google.com> | ||
18 | Acked-by: Paul Menzel <pmenzel@molgen.mpg.de> | ||
19 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
20 | --- | ||
21 | configure.ac | 9 --------- | ||
22 | 1 file changed, 9 deletions(-) | ||
23 | |||
24 | diff --git a/configure.ac b/configure.ac | ||
25 | index bee28dbeb..9a12151bd 100644 | ||
26 | --- a/configure.ac | ||
27 | +++ b/configure.ac | ||
28 | @@ -805,17 +805,8 @@ if test "x$target_cpu" = xi386; then | ||
29 | [grub_cv_cc_falign_loop=no]) | ||
30 | ]) | ||
31 | |||
32 | - AC_CACHE_CHECK([whether -malign-loops works], [grub_cv_cc_malign_loop], [ | ||
33 | - CFLAGS="$TARGET_CFLAGS -malign-loops=1 -Werror" | ||
34 | - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | ||
35 | - [grub_cv_cc_malign_loop=yes], | ||
36 | - [grub_cv_cc_malign_loop=no]) | ||
37 | - ]) | ||
38 | - | ||
39 | if test "x$grub_cv_cc_falign_loop" = xyes; then | ||
40 | TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" | ||
41 | - elif test "x$grub_cv_cc_malign_loop" = xyes; then | ||
42 | - TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" | ||
43 | fi | ||
44 | fi | ||
45 | |||
46 | -- | ||
47 | 2.37.3 | ||
48 | |||
diff --git a/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch b/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch deleted file mode 100644 index c575a31161..0000000000 --- a/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | From f1217c803cec90813eb834dde7829f4961b2a2e4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 17 Feb 2022 15:07:02 -0800 | ||
4 | Subject: [PATCH] configure.ac: Use _zicsr_zifencei extentions on riscv | ||
5 | |||
6 | From version 2.38, binutils defaults to ISA spec version 20191213. This | ||
7 | means that the csr read/write (csrr*/csrw*) instructions and fence.i | ||
8 | instruction has separated from the `I` extension, become two standalone | ||
9 | extensions: Zicsr and Zifencei. | ||
10 | |||
11 | The fix is to specify those extensions explicitely in -march. Since we | ||
12 | are now using binutils 2.38+ in OE this is ok, a more upstreamable fix for | ||
13 | grub will be to detect these extentions, however thats not easy to | ||
14 | implement | ||
15 | |||
16 | Upstream-Status: Inappropriate [OE specific] | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | configure.ac | 8 ++++---- | ||
20 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
21 | |||
22 | diff --git a/configure.ac b/configure.ac | ||
23 | index c7fc55a..072f2c9 100644 | ||
24 | --- a/configure.ac | ||
25 | +++ b/configure.ac | ||
26 | @@ -849,14 +849,14 @@ if test x"$platform" != xemu ; then | ||
27 | [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], []) | ||
28 | fi | ||
29 | if test "x$target_cpu" = xriscv32; then | ||
30 | - CFLAGS="$TARGET_CFLAGS -march=rv32imac -mabi=ilp32 -Werror" | ||
31 | + CFLAGS="$TARGET_CFLAGS -march=rv32imac_zicsr_zifencei -mabi=ilp32 -Werror" | ||
32 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | ||
33 | - [grub_cv_target_cc_soft_float="-march=rv32imac -mabi=ilp32"], []) | ||
34 | + [grub_cv_target_cc_soft_float="-march=rv32imac_zicsr_zifencei -mabi=ilp32"], []) | ||
35 | fi | ||
36 | if test "x$target_cpu" = xriscv64; then | ||
37 | - CFLAGS="$TARGET_CFLAGS -march=rv64imac -mabi=lp64 -Werror" | ||
38 | + CFLAGS="$TARGET_CFLAGS -march=rv64imac_zicsr_zifencei -mabi=lp64 -Werror" | ||
39 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | ||
40 | - [grub_cv_target_cc_soft_float="-march=rv64imac -mabi=lp64"], []) | ||
41 | + [grub_cv_target_cc_soft_float="-march=rv64imac_zicsr_zifencei -mabi=lp64"], []) | ||
42 | fi | ||
43 | if test "x$target_cpu" = xia64; then | ||
44 | CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror" | ||
45 | -- | ||
46 | 2.35.1 | ||
47 | |||
diff --git a/meta/recipes-bsp/grub/files/0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch b/meta/recipes-bsp/grub/files/0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch deleted file mode 100644 index efa00a3c6c..0000000000 --- a/meta/recipes-bsp/grub/files/0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch +++ /dev/null | |||
@@ -1,115 +0,0 @@ | |||
1 | From 1f511ae054fe42dce7aedfbfe0f234fa1e0a7a3e Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhang Boyang <zhangboyang.id@gmail.com> | ||
3 | Date: Fri, 5 Aug 2022 00:51:20 +0800 | ||
4 | Subject: [PATCH] font: Fix size overflow in grub_font_get_glyph_internal() | ||
5 | |||
6 | The length of memory allocation and file read may overflow. This patch | ||
7 | fixes the problem by using safemath macros. | ||
8 | |||
9 | There is a lot of code repetition like "(x * y + 7) / 8". It is unsafe | ||
10 | if overflow happens. This patch introduces grub_video_bitmap_calc_1bpp_bufsz(). | ||
11 | It is safe replacement for such code. It has safemath-like prototype. | ||
12 | |||
13 | This patch also introduces grub_cast(value, pointer), it casts value to | ||
14 | typeof(*pointer) then store the value to *pointer. It returns true when | ||
15 | overflow occurs or false if there is no overflow. The semantics of arguments | ||
16 | and return value are designed to be consistent with other safemath macros. | ||
17 | |||
18 | Signed-off-by: Zhang Boyang <zhangboyang.id@gmail.com> | ||
19 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
20 | |||
21 | Upstream-Status: Backport from | ||
22 | [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9c76ec09ae08155df27cd237eaea150b4f02f532] | ||
23 | |||
24 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
25 | |||
26 | --- | ||
27 | grub-core/font/font.c | 17 +++++++++++++---- | ||
28 | include/grub/bitmap.h | 18 ++++++++++++++++++ | ||
29 | include/grub/safemath.h | 2 ++ | ||
30 | 3 files changed, 33 insertions(+), 4 deletions(-) | ||
31 | |||
32 | diff --git a/grub-core/font/font.c b/grub-core/font/font.c | ||
33 | index d09bb38..876b5b6 100644 | ||
34 | --- a/grub-core/font/font.c | ||
35 | +++ b/grub-core/font/font.c | ||
36 | @@ -739,7 +739,8 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) | ||
37 | grub_int16_t xoff; | ||
38 | grub_int16_t yoff; | ||
39 | grub_int16_t dwidth; | ||
40 | - int len; | ||
41 | + grub_ssize_t len; | ||
42 | + grub_size_t sz; | ||
43 | |||
44 | if (index_entry->glyph) | ||
45 | /* Return cached glyph. */ | ||
46 | @@ -766,9 +767,17 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | - len = (width * height + 7) / 8; | ||
51 | - glyph = grub_malloc (sizeof (struct grub_font_glyph) + len); | ||
52 | - if (!glyph) | ||
53 | + /* Calculate real struct size of current glyph. */ | ||
54 | + if (grub_video_bitmap_calc_1bpp_bufsz (width, height, &len) || | ||
55 | + grub_add (sizeof (struct grub_font_glyph), len, &sz)) | ||
56 | + { | ||
57 | + remove_font (font); | ||
58 | + return 0; | ||
59 | + } | ||
60 | + | ||
61 | + /* Allocate and initialize the glyph struct. */ | ||
62 | + glyph = grub_malloc (sz); | ||
63 | + if (glyph == NULL) | ||
64 | { | ||
65 | remove_font (font); | ||
66 | return 0; | ||
67 | diff --git a/include/grub/bitmap.h b/include/grub/bitmap.h | ||
68 | index 5728f8c..0d9603f 100644 | ||
69 | --- a/include/grub/bitmap.h | ||
70 | +++ b/include/grub/bitmap.h | ||
71 | @@ -23,6 +23,7 @@ | ||
72 | #include <grub/symbol.h> | ||
73 | #include <grub/types.h> | ||
74 | #include <grub/video.h> | ||
75 | +#include <grub/safemath.h> | ||
76 | |||
77 | struct grub_video_bitmap | ||
78 | { | ||
79 | @@ -79,6 +80,23 @@ grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap) | ||
80 | return bitmap->mode_info.height; | ||
81 | } | ||
82 | |||
83 | +/* | ||
84 | + * Calculate and store the size of data buffer of 1bit bitmap in result. | ||
85 | + * Equivalent to "*result = (width * height + 7) / 8" if no overflow occurs. | ||
86 | + * Return true when overflow occurs or false if there is no overflow. | ||
87 | + * This function is intentionally implemented as a macro instead of | ||
88 | + * an inline function. Although a bit awkward, it preserves data types for | ||
89 | + * safemath macros and reduces macro side effects as much as possible. | ||
90 | + * | ||
91 | + * XXX: Will report false overflow if width * height > UINT64_MAX. | ||
92 | + */ | ||
93 | +#define grub_video_bitmap_calc_1bpp_bufsz(width, height, result) \ | ||
94 | +({ \ | ||
95 | + grub_uint64_t _bitmap_pixels; \ | ||
96 | + grub_mul ((width), (height), &_bitmap_pixels) ? 1 : \ | ||
97 | + grub_cast (_bitmap_pixels / GRUB_CHAR_BIT + !!(_bitmap_pixels % GRUB_CHAR_BIT), (result)); \ | ||
98 | +}) | ||
99 | + | ||
100 | void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap, | ||
101 | struct grub_video_mode_info *mode_info); | ||
102 | |||
103 | diff --git a/include/grub/safemath.h b/include/grub/safemath.h | ||
104 | index c17b89b..bb0f826 100644 | ||
105 | --- a/include/grub/safemath.h | ||
106 | +++ b/include/grub/safemath.h | ||
107 | @@ -30,6 +30,8 @@ | ||
108 | #define grub_sub(a, b, res) __builtin_sub_overflow(a, b, res) | ||
109 | #define grub_mul(a, b, res) __builtin_mul_overflow(a, b, res) | ||
110 | |||
111 | +#define grub_cast(a, res) grub_add ((a), 0, (res)) | ||
112 | + | ||
113 | #else | ||
114 | #error gcc 5.1 or newer or clang 3.8 or newer is required | ||
115 | #endif | ||
diff --git a/meta/recipes-bsp/grub/files/0001-fs-ext2-Ignore-checksum-seed-incompat-feature.patch b/meta/recipes-bsp/grub/files/0001-fs-ext2-Ignore-checksum-seed-incompat-feature.patch deleted file mode 100644 index a44d139375..0000000000 --- a/meta/recipes-bsp/grub/files/0001-fs-ext2-Ignore-checksum-seed-incompat-feature.patch +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | It enable the metadata_csum_seed feature by default in e2fsprogs 1.47.0 and | ||
2 | causes grub doesn't work. Backport patch to make grub support this feature. | ||
3 | |||
4 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=7fd5fef] | ||
5 | |||
6 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
7 | |||
8 | From 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 Mon Sep 17 00:00:00 2001 | ||
9 | From: Javier Martinez Canillas <javierm@redhat.com> | ||
10 | Date: Fri, 11 Jun 2021 21:36:16 +0200 | ||
11 | Subject: [PATCH] fs/ext2: Ignore checksum seed incompat feature | ||
12 | |||
13 | This incompat feature is used to denote that the filesystem stored its | ||
14 | metadata checksum seed in the superblock. This is used to allow tune2fs | ||
15 | changing the UUID on a mounted metdata_csum filesystem without having | ||
16 | to rewrite all the disk metadata. However, the GRUB doesn't use the | ||
17 | metadata checksum at all. So, it can just ignore this feature if it | ||
18 | is enabled. This is consistent with the GRUB filesystem code in general | ||
19 | which just does a best effort to access the filesystem's data. | ||
20 | |||
21 | The checksum seed incompat feature has to be removed from the ignore | ||
22 | list if the support for metadata checksum verification is added to the | ||
23 | GRUB ext2 driver later. | ||
24 | |||
25 | Suggested-by: Eric Sandeen <esandeen@redhat.com> | ||
26 | Suggested-by: Lukas Czerner <lczerner@redhat.com> | ||
27 | Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> | ||
28 | Reviewed-by: Lukas Czerner <lczerner@redhat.com> | ||
29 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
30 | --- | ||
31 | grub-core/fs/ext2.c | 10 ++++++++-- | ||
32 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
33 | |||
34 | diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c | ||
35 | index e7dd78e66..4953a1591 100644 | ||
36 | --- a/grub-core/fs/ext2.c | ||
37 | +++ b/grub-core/fs/ext2.c | ||
38 | @@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
39 | #define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 | ||
40 | #define EXT4_FEATURE_INCOMPAT_MMP 0x0100 | ||
41 | #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 | ||
42 | +#define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000 | ||
43 | #define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 | ||
44 | |||
45 | /* The set of back-incompatible features this driver DOES support. Add (OR) | ||
46 | @@ -123,10 +124,15 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
47 | * mmp: Not really back-incompatible - was added as such to | ||
48 | * avoid multiple read-write mounts. Safe to ignore for this | ||
49 | * RO driver. | ||
50 | + * checksum seed: Not really back-incompatible - was added to allow tools | ||
51 | + * such as tune2fs to change the UUID on a mounted metadata | ||
52 | + * checksummed filesystem. Safe to ignore for now since the | ||
53 | + * driver doesn't support checksum verification. However, it | ||
54 | + * has to be removed from this list if the support is added later. | ||
55 | */ | ||
56 | #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \ | ||
57 | - | EXT4_FEATURE_INCOMPAT_MMP) | ||
58 | - | ||
59 | + | EXT4_FEATURE_INCOMPAT_MMP \ | ||
60 | + | EXT4_FEATURE_INCOMPAT_CSUM_SEED) | ||
61 | |||
62 | #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U | ||
63 | |||
64 | -- | ||
65 | 2.34.1 | ||
66 | |||
diff --git a/meta/recipes-bsp/grub/files/0001-fs-fat-Don-t-error-when-mtime-is-0.patch b/meta/recipes-bsp/grub/files/0001-fs-fat-Don-t-error-when-mtime-is-0.patch deleted file mode 100644 index a5fbd58f46..0000000000 --- a/meta/recipes-bsp/grub/files/0001-fs-fat-Don-t-error-when-mtime-is-0.patch +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | From e43f3d93b28cce852c110c7a8e40d8311bcd8bb1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robbie Harwood <rharwood@redhat.com> | ||
3 | Date: Fri, 15 Jul 2022 16:13:02 -0400 | ||
4 | Subject: [PATCH] fs/fat: Don't error when mtime is 0 | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | In the wild, we occasionally see valid ESPs where some file modification | ||
10 | times are 0. For instance: | ||
11 | |||
12 | ├── [Dec 31 1979] EFI | ||
13 | │ ├── [Dec 31 1979] BOOT | ||
14 | │ │ ├── [Dec 31 1979] BOOTX64.EFI | ||
15 | │ │ └── [Dec 31 1979] fbx64.efi | ||
16 | │ └── [Jun 27 02:41] fedora | ||
17 | │ ├── [Dec 31 1979] BOOTX64.CSV | ||
18 | │ ├── [Dec 31 1979] fonts | ||
19 | │ ├── [Mar 14 03:35] fw | ||
20 | │ │ ├── [Mar 14 03:35] fwupd-359c1169-abd6-4a0d-8bce-e4d4713335c1.cap | ||
21 | │ │ ├── [Mar 14 03:34] fwupd-9d255c4b-2d88-4861-860d-7ee52ade9463.cap | ||
22 | │ │ └── [Mar 14 03:34] fwupd-b36438d8-9128-49d2-b280-487be02d948b.cap | ||
23 | │ ├── [Dec 31 1979] fwupdx64.efi | ||
24 | │ ├── [May 10 10:47] grub.cfg | ||
25 | │ ├── [Jun 3 12:38] grub.cfg.new.new | ||
26 | │ ├── [May 10 10:41] grub.cfg.old | ||
27 | │ ├── [Jun 27 02:41] grubenv | ||
28 | │ ├── [Dec 31 1979] grubx64.efi | ||
29 | │ ├── [Dec 31 1979] mmx64.efi | ||
30 | │ ├── [Dec 31 1979] shim.efi | ||
31 | │ ├── [Dec 31 1979] shimx64.efi | ||
32 | │ └── [Dec 31 1979] shimx64-fedora.efi | ||
33 | └── [Dec 31 1979] FSCK0000.REC | ||
34 | |||
35 | 5 directories, 17 files | ||
36 | |||
37 | This causes grub-probe failure, which in turn causes grub-mkconfig | ||
38 | failure. They are valid filesystems that appear intact, and the Linux | ||
39 | FAT stack is able to mount and manipulate them without complaint. | ||
40 | |||
41 | The check for mtime of 0 has been present since | ||
42 | 20def1a3c3952982395cd7c3ea7e78638527962b (fat: support file | ||
43 | modification times). | ||
44 | |||
45 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e43f3d93b28cce852c110c7a8e40d8311bcd8bb1] | ||
46 | |||
47 | Signed-off-by: Robbie Harwood <rharwood@redhat.com> | ||
48 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
49 | Signed-off-by: Ming Liu <liu.ming50@gmail.com> | ||
50 | --- | ||
51 | grub-core/fs/fat.c | 3 --- | ||
52 | 1 file changed, 3 deletions(-) | ||
53 | |||
54 | diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c | ||
55 | index 0951b2e63..c5efed724 100644 | ||
56 | --- a/grub-core/fs/fat.c | ||
57 | +++ b/grub-core/fs/fat.c | ||
58 | @@ -1027,9 +1027,6 @@ grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, | ||
59 | grub_le_to_cpu16 (ctxt.dir.w_date), | ||
60 | &info.mtime); | ||
61 | #endif | ||
62 | - if (info.mtimeset == 0) | ||
63 | - grub_error (GRUB_ERR_OUT_OF_RANGE, | ||
64 | - "invalid modification timestamp for %s", path); | ||
65 | |||
66 | if (hook (ctxt.filename, &info, hook_data)) | ||
67 | break; | ||
68 | -- | ||
69 | 2.34.1 | ||
70 | |||
diff --git a/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch b/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch index 69b04aa56f..69dec7695a 100644 --- a/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch +++ b/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 8f47ed4aaefba087b6ca76e59c9f832b6a0702bc Mon Sep 17 00:00:00 2001 | 1 | From a80592e20f6c4b928a22862f52f268ab9d9908b2 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Wed, 13 Jan 2016 19:28:00 +0000 | 3 | Date: Wed, 13 Jan 2016 19:28:00 +0000 |
4 | Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name | 4 | Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name |
@@ -20,10 +20,10 @@ Upstream-Status: Inappropriate [OE specific] | |||
20 | 2 files changed, 4 insertions(+), 4 deletions(-) | 20 | 2 files changed, 4 insertions(+), 4 deletions(-) |
21 | 21 | ||
22 | diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in | 22 | diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in |
23 | index 4532266..cba2617 100644 | 23 | index cc393be..8545cb6 100644 |
24 | --- a/util/grub.d/10_linux.in | 24 | --- a/util/grub.d/10_linux.in |
25 | +++ b/util/grub.d/10_linux.in | 25 | +++ b/util/grub.d/10_linux.in |
26 | @@ -164,12 +164,12 @@ machine=`uname -m` | 26 | @@ -166,12 +166,12 @@ machine=`uname -m` |
27 | case "x$machine" in | 27 | case "x$machine" in |
28 | xi?86 | xx86_64) | 28 | xi?86 | xx86_64) |
29 | list= | 29 | list= |
@@ -40,10 +40,10 @@ index 4532266..cba2617 100644 | |||
40 | done ;; | 40 | done ;; |
41 | esac | 41 | esac |
42 | diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in | 42 | diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in |
43 | index 96179ea..98d16ae 100644 | 43 | index 94dd8be..36cd554 100644 |
44 | --- a/util/grub.d/20_linux_xen.in | 44 | --- a/util/grub.d/20_linux_xen.in |
45 | +++ b/util/grub.d/20_linux_xen.in | 45 | +++ b/util/grub.d/20_linux_xen.in |
46 | @@ -154,7 +154,7 @@ EOF | 46 | @@ -181,7 +181,7 @@ EOF |
47 | } | 47 | } |
48 | 48 | ||
49 | linux_list= | 49 | linux_list= |
diff --git a/meta/recipes-bsp/grub/files/0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch b/meta/recipes-bsp/grub/files/0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch deleted file mode 100644 index f3f12b6f0e..0000000000 --- a/meta/recipes-bsp/grub/files/0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | From 64be669638e198bc0c7c1a344547265dfacd2470 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 23 Jan 2023 15:29:02 -0800 | ||
4 | Subject: [PATCH] risc-v: Handle R_RISCV_CALL_PLT reloc | ||
5 | |||
6 | GNU assembler starting 2.40 release always generates R_RISCV_CALL_PLT | ||
7 | reloc for call in assembler [1], similarly llvm does not make | ||
8 | distinction between R_RISCV_CALL_PLT and R_RISCV_CALL [2] | ||
9 | |||
10 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/grub-devel/2023-02/msg00143.html] | ||
11 | |||
12 | [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=70f35d72ef04cd23771875c1661c9975044a749c | ||
13 | [2] https://reviews.llvm.org/D132530 | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | grub-core/kern/riscv/dl.c | 1 + | ||
19 | 1 file changed, 1 insertion(+) | ||
20 | |||
21 | --- a/grub-core/kern/riscv/dl.c | ||
22 | +++ b/grub-core/kern/riscv/dl.c | ||
23 | @@ -188,6 +188,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t | ||
24 | break; | ||
25 | |||
26 | case R_RISCV_CALL: | ||
27 | + case R_RISCV_CALL_PLT: | ||
28 | { | ||
29 | grub_uint32_t *abs_place = place; | ||
30 | grub_ssize_t off = sym_addr - (grub_addr_t) place; | ||
31 | --- a/util/grub-mkimagexx.c | ||
32 | +++ b/util/grub-mkimagexx.c | ||
33 | @@ -1294,6 +1294,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, st | ||
34 | } | ||
35 | break; | ||
36 | case R_RISCV_CALL: | ||
37 | + case R_RISCV_CALL_PLT: | ||
38 | { | ||
39 | grub_uint32_t hi20, lo12; | ||
40 | |||
41 | @@ -1725,6 +1726,7 @@ translate_relocation_pe (struct translat | ||
42 | case R_RISCV_BRANCH: | ||
43 | case R_RISCV_JAL: | ||
44 | case R_RISCV_CALL: | ||
45 | + case R_RISCV_CALL_PLT: | ||
46 | case R_RISCV_PCREL_HI20: | ||
47 | case R_RISCV_PCREL_LO12_I: | ||
48 | case R_RISCV_PCREL_LO12_S: | ||
diff --git a/meta/recipes-bsp/grub/files/0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch b/meta/recipes-bsp/grub/files/0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch deleted file mode 100644 index 437e5b29b2..0000000000 --- a/meta/recipes-bsp/grub/files/0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | From e372dcb0d4541ee9b9682cde088ec87a7b238ca2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Fangrui Song via Grub-devel <grub-devel@gnu.org> | ||
3 | Date: Thu, 26 Aug 2021 09:02:32 -0700 | ||
4 | Subject: [PATCH 2/2] configure: Check for -falign-jumps=1 beside | ||
5 | -falign-loops=1 | ||
6 | |||
7 | The Clang does not support -falign-jumps and only recently gained support | ||
8 | for -falign-loops. The -falign-jumps=1 should be tested beside | ||
9 | -fliang-loops=1 to avoid passing unrecognized options to the Clang: | ||
10 | |||
11 | clang-14: error: optimization flag '-falign-jumps=1' is not supported [-Werror,-Wignored-optimization-argument] | ||
12 | |||
13 | The -falign-functions=1 is supported by GCC 5.1.0/Clang 3.8.0. So, just | ||
14 | add the option unconditionally. | ||
15 | |||
16 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e372dcb0d4541ee9b9682cde088ec87a7b238ca2] | ||
17 | Signed-off-by: Fangrui Song <maskray@google.com> | ||
18 | Acked-by: Paul Menzel <pmenzel@molgen.mpg.de> | ||
19 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
20 | --- | ||
21 | configure.ac | 15 ++++++++++++++- | ||
22 | 1 file changed, 14 insertions(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/configure.ac b/configure.ac | ||
25 | index 9a12151bd..eeb5d2211 100644 | ||
26 | --- a/configure.ac | ||
27 | +++ b/configure.ac | ||
28 | @@ -798,6 +798,8 @@ fi | ||
29 | |||
30 | # Force no alignment to save space on i386. | ||
31 | if test "x$target_cpu" = xi386; then | ||
32 | + TARGET_CFLAGS="$TARGET_CFLAGS -falign-functions=1" | ||
33 | + | ||
34 | AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ | ||
35 | CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror" | ||
36 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | ||
37 | @@ -806,7 +808,18 @@ if test "x$target_cpu" = xi386; then | ||
38 | ]) | ||
39 | |||
40 | if test "x$grub_cv_cc_falign_loop" = xyes; then | ||
41 | - TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" | ||
42 | + TARGET_CFLAGS="$TARGET_CFLAGS -falign-loops=1" | ||
43 | + fi | ||
44 | + | ||
45 | + AC_CACHE_CHECK([whether -falign-jumps works], [grub_cv_cc_falign_jumps], [ | ||
46 | + CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -Werror" | ||
47 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | ||
48 | + [grub_cv_cc_falign_jumps=yes], | ||
49 | + [grub_cv_cc_falign_jumps=no]) | ||
50 | + ]) | ||
51 | + | ||
52 | + if test "x$grub_cv_cc_falign_jumps" = xyes; then | ||
53 | + TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1" | ||
54 | fi | ||
55 | fi | ||
56 | |||
57 | -- | ||
58 | 2.37.3 | ||
59 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch b/meta/recipes-bsp/grub/files/CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch deleted file mode 100644 index 7f7bb1acfe..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | From e623866d9286410156e8b9d2c82d6253a1b22d08 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Tue, 6 Jul 2021 18:51:35 +1000 | ||
4 | Subject: [PATCH] video/readers/png: Drop greyscale support to fix heap | ||
5 | out-of-bounds write | ||
6 | |||
7 | A 16-bit greyscale PNG without alpha is processed in the following loop: | ||
8 | |||
9 | for (i = 0; i < (data->image_width * data->image_height); | ||
10 | i++, d1 += 4, d2 += 2) | ||
11 | { | ||
12 | d1[R3] = d2[1]; | ||
13 | d1[G3] = d2[1]; | ||
14 | d1[B3] = d2[1]; | ||
15 | } | ||
16 | |||
17 | The increment of d1 is wrong. d1 is incremented by 4 bytes per iteration, | ||
18 | but there are only 3 bytes allocated for storage. This means that image | ||
19 | data will overwrite somewhat-attacker-controlled parts of memory - 3 bytes | ||
20 | out of every 4 following the end of the image. | ||
21 | |||
22 | This has existed since greyscale support was added in 2013 in commit | ||
23 | 3ccf16dff98f (grub-core/video/readers/png.c: Support grayscale). | ||
24 | |||
25 | Saving starfield.png as a 16-bit greyscale image without alpha in the gimp | ||
26 | and attempting to load it causes grub-emu to crash - I don't think this code | ||
27 | has ever worked. | ||
28 | |||
29 | Delete all PNG greyscale support. | ||
30 | |||
31 | Fixes: CVE-2021-3695 | ||
32 | |||
33 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
34 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
35 | |||
36 | Upstream-Status: Backport | ||
37 | CVE: CVE-2021-3695 | ||
38 | |||
39 | Reference to upstream patch: | ||
40 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e623866d9286410156e8b9d2c82d6253a1b22d08 | ||
41 | |||
42 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
43 | --- | ||
44 | grub-core/video/readers/png.c | 87 +++-------------------------------- | ||
45 | 1 file changed, 7 insertions(+), 80 deletions(-) | ||
46 | |||
47 | diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c | ||
48 | index 35ae553c8..a3161e25b 100644 | ||
49 | --- a/grub-core/video/readers/png.c | ||
50 | +++ b/grub-core/video/readers/png.c | ||
51 | @@ -100,7 +100,7 @@ struct grub_png_data | ||
52 | |||
53 | unsigned image_width, image_height; | ||
54 | int bpp, is_16bit; | ||
55 | - int raw_bytes, is_gray, is_alpha, is_palette; | ||
56 | + int raw_bytes, is_alpha, is_palette; | ||
57 | int row_bytes, color_bits; | ||
58 | grub_uint8_t *image_data; | ||
59 | |||
60 | @@ -296,13 +296,13 @@ grub_png_decode_image_header (struct grub_png_data *data) | ||
61 | data->bpp = 3; | ||
62 | else | ||
63 | { | ||
64 | - data->is_gray = 1; | ||
65 | - data->bpp = 1; | ||
66 | + return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
67 | + "png: color type not supported"); | ||
68 | } | ||
69 | |||
70 | if ((color_bits != 8) && (color_bits != 16) | ||
71 | && (color_bits != 4 | ||
72 | - || !(data->is_gray || data->is_palette))) | ||
73 | + || !data->is_palette)) | ||
74 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
75 | "png: bit depth must be 8 or 16"); | ||
76 | |||
77 | @@ -331,7 +331,7 @@ grub_png_decode_image_header (struct grub_png_data *data) | ||
78 | } | ||
79 | |||
80 | #ifndef GRUB_CPU_WORDS_BIGENDIAN | ||
81 | - if (data->is_16bit || data->is_gray || data->is_palette) | ||
82 | + if (data->is_16bit || data->is_palette) | ||
83 | #endif | ||
84 | { | ||
85 | data->image_data = grub_calloc (data->image_height, data->row_bytes); | ||
86 | @@ -899,27 +899,8 @@ grub_png_convert_image (struct grub_png_data *data) | ||
87 | int shift; | ||
88 | int mask = (1 << data->color_bits) - 1; | ||
89 | unsigned j; | ||
90 | - if (data->is_gray) | ||
91 | - { | ||
92 | - /* Generic formula is | ||
93 | - (0xff * i) / ((1U << data->color_bits) - 1) | ||
94 | - but for allowed bit depth of 1, 2 and for it's | ||
95 | - equivalent to | ||
96 | - (0xff / ((1U << data->color_bits) - 1)) * i | ||
97 | - Precompute the multipliers to avoid division. | ||
98 | - */ | ||
99 | - | ||
100 | - const grub_uint8_t multipliers[5] = { 0xff, 0xff, 0x55, 0x24, 0x11 }; | ||
101 | - for (i = 0; i < (1U << data->color_bits); i++) | ||
102 | - { | ||
103 | - grub_uint8_t col = multipliers[data->color_bits] * i; | ||
104 | - palette[i][0] = col; | ||
105 | - palette[i][1] = col; | ||
106 | - palette[i][2] = col; | ||
107 | - } | ||
108 | - } | ||
109 | - else | ||
110 | - grub_memcpy (palette, data->palette, 3 << data->color_bits); | ||
111 | + | ||
112 | + grub_memcpy (palette, data->palette, 3 << data->color_bits); | ||
113 | d1c = d1; | ||
114 | d2c = d2; | ||
115 | for (j = 0; j < data->image_height; j++, d1c += data->image_width * 3, | ||
116 | @@ -957,60 +938,6 @@ grub_png_convert_image (struct grub_png_data *data) | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | - if (data->is_gray) | ||
121 | - { | ||
122 | - switch (data->bpp) | ||
123 | - { | ||
124 | - case 4: | ||
125 | - /* 16-bit gray with alpha. */ | ||
126 | - for (i = 0; i < (data->image_width * data->image_height); | ||
127 | - i++, d1 += 4, d2 += 4) | ||
128 | - { | ||
129 | - d1[R4] = d2[3]; | ||
130 | - d1[G4] = d2[3]; | ||
131 | - d1[B4] = d2[3]; | ||
132 | - d1[A4] = d2[1]; | ||
133 | - } | ||
134 | - break; | ||
135 | - case 2: | ||
136 | - if (data->is_16bit) | ||
137 | - /* 16-bit gray without alpha. */ | ||
138 | - { | ||
139 | - for (i = 0; i < (data->image_width * data->image_height); | ||
140 | - i++, d1 += 4, d2 += 2) | ||
141 | - { | ||
142 | - d1[R3] = d2[1]; | ||
143 | - d1[G3] = d2[1]; | ||
144 | - d1[B3] = d2[1]; | ||
145 | - } | ||
146 | - } | ||
147 | - else | ||
148 | - /* 8-bit gray with alpha. */ | ||
149 | - { | ||
150 | - for (i = 0; i < (data->image_width * data->image_height); | ||
151 | - i++, d1 += 4, d2 += 2) | ||
152 | - { | ||
153 | - d1[R4] = d2[1]; | ||
154 | - d1[G4] = d2[1]; | ||
155 | - d1[B4] = d2[1]; | ||
156 | - d1[A4] = d2[0]; | ||
157 | - } | ||
158 | - } | ||
159 | - break; | ||
160 | - /* 8-bit gray without alpha. */ | ||
161 | - case 1: | ||
162 | - for (i = 0; i < (data->image_width * data->image_height); | ||
163 | - i++, d1 += 3, d2++) | ||
164 | - { | ||
165 | - d1[R3] = d2[0]; | ||
166 | - d1[G3] = d2[0]; | ||
167 | - d1[B3] = d2[0]; | ||
168 | - } | ||
169 | - break; | ||
170 | - } | ||
171 | - return; | ||
172 | - } | ||
173 | - | ||
174 | { | ||
175 | /* Only copy the upper 8 bit. */ | ||
176 | #ifndef GRUB_CPU_WORDS_BIGENDIAN | ||
177 | -- | ||
178 | 2.34.1 | ||
179 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch b/meta/recipes-bsp/grub/files/CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch deleted file mode 100644 index f06514e665..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | From 210245129c932dc9e1c2748d9d35524fb95b5042 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Tue, 6 Jul 2021 23:25:07 +1000 | ||
4 | Subject: [PATCH] video/readers/png: Avoid heap OOB R/W inserting huff table | ||
5 | items | ||
6 | |||
7 | In fuzzing we observed crashes where a code would attempt to be inserted | ||
8 | into a huffman table before the start, leading to a set of heap OOB reads | ||
9 | and writes as table entries with negative indices were shifted around and | ||
10 | the new code written in. | ||
11 | |||
12 | Catch the case where we would underflow the array and bail. | ||
13 | |||
14 | Fixes: CVE-2021-3696 | ||
15 | |||
16 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
17 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
18 | |||
19 | Upstream-Status: Backport | ||
20 | CVE: CVE-2021-3696 | ||
21 | |||
22 | Reference to upstream patch: | ||
23 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=210245129c932dc9e1c2748d9d35524fb95b5042 | ||
24 | |||
25 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
26 | --- | ||
27 | grub-core/video/readers/png.c | 7 +++++++ | ||
28 | 1 file changed, 7 insertions(+) | ||
29 | |||
30 | diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c | ||
31 | index a3161e25b..d7ed5aa6c 100644 | ||
32 | --- a/grub-core/video/readers/png.c | ||
33 | +++ b/grub-core/video/readers/png.c | ||
34 | @@ -438,6 +438,13 @@ grub_png_insert_huff_item (struct huff_table *ht, int code, int len) | ||
35 | for (i = len; i < ht->max_length; i++) | ||
36 | n += ht->maxval[i]; | ||
37 | |||
38 | + if (n > ht->num_values) | ||
39 | + { | ||
40 | + grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
41 | + "png: out of range inserting huffman table item"); | ||
42 | + return; | ||
43 | + } | ||
44 | + | ||
45 | for (i = 0; i < n; i++) | ||
46 | ht->values[ht->num_values - i] = ht->values[ht->num_values - i - 1]; | ||
47 | |||
48 | -- | ||
49 | 2.34.1 | ||
50 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch b/meta/recipes-bsp/grub/files/CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch deleted file mode 100644 index e9fc52df86..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | From 22a3f97d39f6a10b08ad7fd1cc47c4dcd10413f6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Wed, 7 Jul 2021 15:38:19 +1000 | ||
4 | Subject: [PATCH] video/readers/jpeg: Block int underflow -> wild pointer write | ||
5 | |||
6 | Certain 1 px wide images caused a wild pointer write in | ||
7 | grub_jpeg_ycrcb_to_rgb(). This was caused because in grub_jpeg_decode_data(), | ||
8 | we have the following loop: | ||
9 | |||
10 | for (; data->r1 < nr1 && (!data->dri || rst); | ||
11 | data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3) | ||
12 | |||
13 | We did not check if vb * width >= hb * nc1. | ||
14 | |||
15 | On a 64-bit platform, if that turns out to be negative, it will underflow, | ||
16 | be interpreted as unsigned 64-bit, then be added to the 64-bit pointer, so | ||
17 | we see data->bitmap_ptr jump, e.g.: | ||
18 | |||
19 | 0x6180_0000_0480 to | ||
20 | 0x6181_0000_0498 | ||
21 | ^ | ||
22 | ~--- carry has occurred and this pointer is now far away from | ||
23 | any object. | ||
24 | |||
25 | On a 32-bit platform, it will decrement the pointer, creating a pointer | ||
26 | that won't crash but will overwrite random data. | ||
27 | |||
28 | Catch the underflow and error out. | ||
29 | |||
30 | Fixes: CVE-2021-3697 | ||
31 | |||
32 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
33 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
34 | |||
35 | Upstream-Status: Backport | ||
36 | CVE: CVE-2021-3697 | ||
37 | |||
38 | Reference to upstream patch: | ||
39 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=22a3f97d39f6a10b08ad7fd1cc47c4dcd10413f6 | ||
40 | |||
41 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
42 | --- | ||
43 | grub-core/video/readers/jpeg.c | 10 +++++++++- | ||
44 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
45 | |||
46 | diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c | ||
47 | index 579bbe8a4..09596fbf5 100644 | ||
48 | --- a/grub-core/video/readers/jpeg.c | ||
49 | +++ b/grub-core/video/readers/jpeg.c | ||
50 | @@ -23,6 +23,7 @@ | ||
51 | #include <grub/mm.h> | ||
52 | #include <grub/misc.h> | ||
53 | #include <grub/bufio.h> | ||
54 | +#include <grub/safemath.h> | ||
55 | |||
56 | GRUB_MOD_LICENSE ("GPLv3+"); | ||
57 | |||
58 | @@ -699,6 +700,7 @@ static grub_err_t | ||
59 | grub_jpeg_decode_data (struct grub_jpeg_data *data) | ||
60 | { | ||
61 | unsigned c1, vb, hb, nr1, nc1; | ||
62 | + unsigned stride_a, stride_b, stride; | ||
63 | int rst = data->dri; | ||
64 | grub_err_t err = GRUB_ERR_NONE; | ||
65 | |||
66 | @@ -711,8 +713,14 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) | ||
67 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
68 | "jpeg: attempted to decode data before start of stream"); | ||
69 | |||
70 | + if (grub_mul(vb, data->image_width, &stride_a) || | ||
71 | + grub_mul(hb, nc1, &stride_b) || | ||
72 | + grub_sub(stride_a, stride_b, &stride)) | ||
73 | + return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
74 | + "jpeg: cannot decode image with these dimensions"); | ||
75 | + | ||
76 | for (; data->r1 < nr1 && (!data->dri || rst); | ||
77 | - data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3) | ||
78 | + data->r1++, data->bitmap_ptr += stride * 3) | ||
79 | for (c1 = 0; c1 < nc1 && (!data->dri || rst); | ||
80 | c1++, rst--, data->bitmap_ptr += hb * 3) | ||
81 | { | ||
82 | -- | ||
83 | 2.34.1 | ||
84 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch b/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch deleted file mode 100644 index dae26fd8bb..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | From 0adec29674561034771c13e446069b41ef41e4d4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Chang <mchang@suse.com> | ||
3 | Date: Fri, 3 Dec 2021 16:13:28 +0800 | ||
4 | Subject: [PATCH] grub-mkconfig: Restore umask for the grub.cfg | ||
5 | |||
6 | The commit ab2e53c8a (grub-mkconfig: Honor a symlink when generating | ||
7 | configuration by grub-mkconfig) has inadvertently discarded umask for | ||
8 | creating grub.cfg in the process of running grub-mkconfig. The resulting | ||
9 | wrong permission (0644) would allow unprivileged users to read GRUB | ||
10 | configuration file content. This presents a low confidentiality risk | ||
11 | as grub.cfg may contain non-secured plain-text passwords. | ||
12 | |||
13 | This patch restores the missing umask and sets the creation file mode | ||
14 | to 0600 preventing unprivileged access. | ||
15 | |||
16 | Fixes: CVE-2021-3981 | ||
17 | |||
18 | Signed-off-by: Michael Chang <mchang@suse.com> | ||
19 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | CVE: CVE-2021-3981 | ||
23 | |||
24 | Reference to upstream patch: | ||
25 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=0adec29674561034771c13e446069b41ef41e4d4 | ||
26 | |||
27 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
28 | --- | ||
29 | util/grub-mkconfig.in | 3 +++ | ||
30 | 1 file changed, 3 insertions(+) | ||
31 | |||
32 | diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in | ||
33 | index c3ea7612e..62335d027 100644 | ||
34 | --- a/util/grub-mkconfig.in | ||
35 | +++ b/util/grub-mkconfig.in | ||
36 | @@ -301,7 +301,10 @@ and /etc/grub.d/* files or please file a bug report with | ||
37 | exit 1 | ||
38 | else | ||
39 | # none of the children aborted with error, install the new grub.cfg | ||
40 | + oldumask=$(umask) | ||
41 | + umask 077 | ||
42 | cat ${grub_cfg}.new > ${grub_cfg} | ||
43 | + umask $oldumask | ||
44 | rm -f ${grub_cfg}.new | ||
45 | fi | ||
46 | fi | ||
47 | -- | ||
48 | 2.31.1 | ||
49 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-2601.patch b/meta/recipes-bsp/grub/files/CVE-2022-2601.patch deleted file mode 100644 index 727c509694..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2022-2601.patch +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | From e8060722acf0bcca037982d7fb29472363ccdfd4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhang Boyang <zhangboyang.id@gmail.com> | ||
3 | Date: Fri, 5 Aug 2022 01:58:27 +0800 | ||
4 | Subject: [PATCH] font: Fix several integer overflows in | ||
5 | grub_font_construct_glyph() | ||
6 | |||
7 | This patch fixes several integer overflows in grub_font_construct_glyph(). | ||
8 | Glyphs of invalid size, zero or leading to an overflow, are rejected. | ||
9 | The inconsistency between "glyph" and "max_glyph_size" when grub_malloc() | ||
10 | returns NULL is fixed too. | ||
11 | |||
12 | Fixes: CVE-2022-2601 | ||
13 | |||
14 | Reported-by: Zhang Boyang <zhangboyang.id@gmail.com> | ||
15 | Signed-off-by: Zhang Boyang <zhangboyang.id@gmail.com> | ||
16 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
17 | |||
18 | Upstream-Status: Backport from | ||
19 | [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=768e1ef2fc159f6e14e7246e4be09363708ac39e] | ||
20 | CVE: CVE-2022-2601 | ||
21 | |||
22 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
23 | |||
24 | --- | ||
25 | grub-core/font/font.c | 29 +++++++++++++++++------------ | ||
26 | 1 file changed, 17 insertions(+), 12 deletions(-) | ||
27 | |||
28 | diff --git a/grub-core/font/font.c b/grub-core/font/font.c | ||
29 | index 876b5b6..0ff5525 100644 | ||
30 | --- a/grub-core/font/font.c | ||
31 | +++ b/grub-core/font/font.c | ||
32 | @@ -1515,6 +1515,7 @@ grub_font_construct_glyph (grub_font_t hinted_font, | ||
33 | struct grub_video_signed_rect bounds; | ||
34 | static struct grub_font_glyph *glyph = 0; | ||
35 | static grub_size_t max_glyph_size = 0; | ||
36 | + grub_size_t cur_glyph_size; | ||
37 | |||
38 | ensure_comb_space (glyph_id); | ||
39 | |||
40 | @@ -1531,29 +1532,33 @@ grub_font_construct_glyph (grub_font_t hinted_font, | ||
41 | if (!glyph_id->ncomb && !glyph_id->attributes) | ||
42 | return main_glyph; | ||
43 | |||
44 | - if (max_glyph_size < sizeof (*glyph) + (bounds.width * bounds.height + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT) | ||
45 | + if (grub_video_bitmap_calc_1bpp_bufsz (bounds.width, bounds.height, &cur_glyph_size) || | ||
46 | + grub_add (sizeof (*glyph), cur_glyph_size, &cur_glyph_size)) | ||
47 | + return main_glyph; | ||
48 | + | ||
49 | + if (max_glyph_size < cur_glyph_size) | ||
50 | { | ||
51 | grub_free (glyph); | ||
52 | - max_glyph_size = (sizeof (*glyph) + (bounds.width * bounds.height + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT) * 2; | ||
53 | - if (max_glyph_size < 8) | ||
54 | - max_glyph_size = 8; | ||
55 | - glyph = grub_malloc (max_glyph_size); | ||
56 | + if (grub_mul (cur_glyph_size, 2, &max_glyph_size)) | ||
57 | + max_glyph_size = 0; | ||
58 | + glyph = max_glyph_size > 0 ? grub_malloc (max_glyph_size) : NULL; | ||
59 | } | ||
60 | if (!glyph) | ||
61 | { | ||
62 | + max_glyph_size = 0; | ||
63 | grub_errno = GRUB_ERR_NONE; | ||
64 | return main_glyph; | ||
65 | } | ||
66 | |||
67 | - grub_memset (glyph, 0, sizeof (*glyph) | ||
68 | - + (bounds.width * bounds.height | ||
69 | - + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT); | ||
70 | + grub_memset (glyph, 0, cur_glyph_size); | ||
71 | |||
72 | glyph->font = main_glyph->font; | ||
73 | - glyph->width = bounds.width; | ||
74 | - glyph->height = bounds.height; | ||
75 | - glyph->offset_x = bounds.x; | ||
76 | - glyph->offset_y = bounds.y; | ||
77 | + if (bounds.width == 0 || bounds.height == 0 || | ||
78 | + grub_cast (bounds.width, &glyph->width) || | ||
79 | + grub_cast (bounds.height, &glyph->height) || | ||
80 | + grub_cast (bounds.x, &glyph->offset_x) || | ||
81 | + grub_cast (bounds.y, &glyph->offset_y)) | ||
82 | + return main_glyph; | ||
83 | |||
84 | if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR) | ||
85 | grub_font_blit_glyph_mirror (glyph, main_glyph, | ||
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch b/meta/recipes-bsp/grub/files/CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch deleted file mode 100644 index 8bf9090f94..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | From 3e4817538de828319ba6d59ced2fbb9b5ca13287 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Mon, 20 Dec 2021 19:41:21 +1100 | ||
4 | Subject: [PATCH] net/ip: Do IP fragment maths safely | ||
5 | |||
6 | We can receive packets with invalid IP fragmentation information. This | ||
7 | can lead to rsm->total_len underflowing and becoming very large. | ||
8 | |||
9 | Then, in grub_netbuff_alloc(), we add to this very large number, which can | ||
10 | cause it to overflow and wrap back around to a small positive number. | ||
11 | The allocation then succeeds, but the resulting buffer is too small and | ||
12 | subsequent operations can write past the end of the buffer. | ||
13 | |||
14 | Catch the underflow here. | ||
15 | |||
16 | Fixes: CVE-2022-28733 | ||
17 | |||
18 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
19 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | CVE: CVE-2022-28733 | ||
23 | |||
24 | Reference to upstream patch: | ||
25 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=3e4817538de828319ba6d59ced2fbb9b5ca13287 | ||
26 | |||
27 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
28 | |||
29 | --- | ||
30 | grub-core/net/ip.c | 10 +++++++++- | ||
31 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
32 | |||
33 | diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c | ||
34 | index e3d62e97f..3c3d0be0e 100644 | ||
35 | --- a/grub-core/net/ip.c | ||
36 | +++ b/grub-core/net/ip.c | ||
37 | @@ -25,6 +25,7 @@ | ||
38 | #include <grub/net/netbuff.h> | ||
39 | #include <grub/mm.h> | ||
40 | #include <grub/priority_queue.h> | ||
41 | +#include <grub/safemath.h> | ||
42 | #include <grub/time.h> | ||
43 | |||
44 | struct iphdr { | ||
45 | @@ -512,7 +513,14 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb, | ||
46 | { | ||
47 | rsm->total_len = (8 * (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK) | ||
48 | + (nb->tail - nb->data)); | ||
49 | - rsm->total_len -= ((iph->verhdrlen & 0xf) * sizeof (grub_uint32_t)); | ||
50 | + | ||
51 | + if (grub_sub (rsm->total_len, (iph->verhdrlen & 0xf) * sizeof (grub_uint32_t), | ||
52 | + &rsm->total_len)) | ||
53 | + { | ||
54 | + grub_dprintf ("net", "IP reassembly size underflow\n"); | ||
55 | + return GRUB_ERR_NONE; | ||
56 | + } | ||
57 | + | ||
58 | rsm->asm_netbuff = grub_netbuff_alloc (rsm->total_len); | ||
59 | if (!rsm->asm_netbuff) | ||
60 | { | ||
61 | -- | ||
62 | 2.34.1 | ||
63 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch b/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch deleted file mode 100644 index f31167d315..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | From b26b4c08e7119281ff30d0fb4a6169bd2afa8fe4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Tue, 8 Mar 2022 19:04:40 +1100 | ||
4 | Subject: [PATCH] net/http: Error out on headers with LF without CR | ||
5 | |||
6 | In a similar vein to the previous patch, parse_line() would write | ||
7 | a NUL byte past the end of the buffer if there was an HTTP header | ||
8 | with a LF rather than a CRLF. | ||
9 | |||
10 | RFC-2616 says: | ||
11 | |||
12 | Many HTTP/1.1 header field values consist of words separated by LWS | ||
13 | or special characters. These special characters MUST be in a quoted | ||
14 | string to be used within a parameter value (as defined in section 3.6). | ||
15 | |||
16 | We don't support quoted sections or continuation lines, etc. | ||
17 | |||
18 | If we see an LF that's not part of a CRLF, bail out. | ||
19 | |||
20 | Fixes: CVE-2022-28734 | ||
21 | |||
22 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
23 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
24 | |||
25 | Upstream-Status: Backport | ||
26 | CVE: CVE-2022-28734 | ||
27 | |||
28 | Reference to upstream patch: | ||
29 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b26b4c08e7119281ff30d0fb4a6169bd2afa8fe4 | ||
30 | |||
31 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
32 | --- | ||
33 | grub-core/net/http.c | 8 ++++++++ | ||
34 | 1 file changed, 8 insertions(+) | ||
35 | |||
36 | diff --git a/grub-core/net/http.c b/grub-core/net/http.c | ||
37 | index 33a0a28c4..9291a13e2 100644 | ||
38 | --- a/grub-core/net/http.c | ||
39 | +++ b/grub-core/net/http.c | ||
40 | @@ -68,7 +68,15 @@ parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len) | ||
41 | char *end = ptr + len; | ||
42 | while (end > ptr && *(end - 1) == '\r') | ||
43 | end--; | ||
44 | + | ||
45 | + /* LF without CR. */ | ||
46 | + if (end == ptr + len) | ||
47 | + { | ||
48 | + data->errmsg = grub_strdup (_("invalid HTTP header - LF without CR")); | ||
49 | + return GRUB_ERR_NONE; | ||
50 | + } | ||
51 | *end = 0; | ||
52 | + | ||
53 | /* Trailing CRLF. */ | ||
54 | if (data->in_chunk_len == 1) | ||
55 | { | ||
56 | -- | ||
57 | 2.34.1 | ||
58 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch b/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch deleted file mode 100644 index e0ca1eec44..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | From ec6bfd3237394c1c7dbf2fd73417173318d22f4b Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Tue, 8 Mar 2022 18:17:03 +1100 | ||
4 | Subject: [PATCH] net/http: Fix OOB write for split http headers | ||
5 | |||
6 | GRUB has special code for handling an http header that is split | ||
7 | across two packets. | ||
8 | |||
9 | The code tracks the end of line by looking for a "\n" byte. The | ||
10 | code for split headers has always advanced the pointer just past the | ||
11 | end of the line, whereas the code that handles unsplit headers does | ||
12 | not advance the pointer. This extra advance causes the length to be | ||
13 | one greater, which breaks an assumption in parse_line(), leading to | ||
14 | it writing a NUL byte one byte past the end of the buffer where we | ||
15 | reconstruct the line from the two packets. | ||
16 | |||
17 | It's conceivable that an attacker controlled set of packets could | ||
18 | cause this to zero out the first byte of the "next" pointer of the | ||
19 | grub_mm_region structure following the current_line buffer. | ||
20 | |||
21 | Do not advance the pointer in the split header case. | ||
22 | |||
23 | Fixes: CVE-2022-28734 | ||
24 | |||
25 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
26 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
27 | |||
28 | Upstream-Status: Backport | ||
29 | CVE: CVE-2022-28734 | ||
30 | |||
31 | Reference to upstream patch: | ||
32 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=ec6bfd3237394c1c7dbf2fd73417173318d22f4b | ||
33 | |||
34 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
35 | --- | ||
36 | grub-core/net/http.c | 4 +--- | ||
37 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
38 | |||
39 | diff --git a/grub-core/net/http.c b/grub-core/net/http.c | ||
40 | index f8d7bf0cd..33a0a28c4 100644 | ||
41 | --- a/grub-core/net/http.c | ||
42 | +++ b/grub-core/net/http.c | ||
43 | @@ -190,9 +190,7 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), | ||
44 | int have_line = 1; | ||
45 | char *t; | ||
46 | ptr = grub_memchr (nb->data, '\n', nb->tail - nb->data); | ||
47 | - if (ptr) | ||
48 | - ptr++; | ||
49 | - else | ||
50 | + if (ptr == NULL) | ||
51 | { | ||
52 | have_line = 0; | ||
53 | ptr = (char *) nb->tail; | ||
54 | -- | ||
55 | 2.34.1 | ||
56 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch b/meta/recipes-bsp/grub/files/CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch deleted file mode 100644 index 7a59f10bfb..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | From 6fe755c5c07bb386fda58306bfd19e4a1c974c53 Mon Sep 17 00:00:00 2001 | ||
2 | From: Julian Andres Klode <julian.klode@canonical.com> | ||
3 | Date: Thu, 2 Dec 2021 15:03:53 +0100 | ||
4 | Subject: [PATCH] kern/efi/sb: Reject non-kernel files in the shim_lock | ||
5 | verifier | ||
6 | |||
7 | We must not allow other verifiers to pass things like the GRUB modules. | ||
8 | Instead of maintaining a blocklist, maintain an allowlist of things | ||
9 | that we do not care about. | ||
10 | |||
11 | This allowlist really should be made reusable, and shared by the | ||
12 | lockdown verifier, but this is the minimal patch addressing | ||
13 | security concerns where the TPM verifier was able to mark modules | ||
14 | as verified (or the OpenPGP verifier for that matter), when it | ||
15 | should not do so on shim-powered secure boot systems. | ||
16 | |||
17 | Fixes: CVE-2022-28735 | ||
18 | |||
19 | Signed-off-by: Julian Andres Klode <julian.klode@canonical.com> | ||
20 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
21 | |||
22 | Upstream-Status: Backport | ||
23 | CVE:CVE-2022-28735 | ||
24 | |||
25 | Reference to upstream patch: | ||
26 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=6fe755c5c07bb386fda58306bfd19e4a1c974c53 | ||
27 | |||
28 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
29 | --- | ||
30 | grub-core/kern/efi/sb.c | 39 ++++++++++++++++++++++++++++++++++++--- | ||
31 | include/grub/verify.h | 1 + | ||
32 | 2 files changed, 37 insertions(+), 3 deletions(-) | ||
33 | |||
34 | diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c | ||
35 | index c52ec6226..89c4bb3fd 100644 | ||
36 | --- a/grub-core/kern/efi/sb.c | ||
37 | +++ b/grub-core/kern/efi/sb.c | ||
38 | @@ -119,10 +119,11 @@ shim_lock_verifier_init (grub_file_t io __attribute__ ((unused)), | ||
39 | void **context __attribute__ ((unused)), | ||
40 | enum grub_verify_flags *flags) | ||
41 | { | ||
42 | - *flags = GRUB_VERIFY_FLAGS_SKIP_VERIFICATION; | ||
43 | + *flags = GRUB_VERIFY_FLAGS_NONE; | ||
44 | |||
45 | switch (type & GRUB_FILE_TYPE_MASK) | ||
46 | { | ||
47 | + /* Files we check. */ | ||
48 | case GRUB_FILE_TYPE_LINUX_KERNEL: | ||
49 | case GRUB_FILE_TYPE_MULTIBOOT_KERNEL: | ||
50 | case GRUB_FILE_TYPE_BSD_KERNEL: | ||
51 | @@ -130,11 +131,43 @@ shim_lock_verifier_init (grub_file_t io __attribute__ ((unused)), | ||
52 | case GRUB_FILE_TYPE_PLAN9_KERNEL: | ||
53 | case GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE: | ||
54 | *flags = GRUB_VERIFY_FLAGS_SINGLE_CHUNK; | ||
55 | + return GRUB_ERR_NONE; | ||
56 | |||
57 | - /* Fall through. */ | ||
58 | + /* Files that do not affect secureboot state. */ | ||
59 | + case GRUB_FILE_TYPE_NONE: | ||
60 | + case GRUB_FILE_TYPE_LOOPBACK: | ||
61 | + case GRUB_FILE_TYPE_LINUX_INITRD: | ||
62 | + case GRUB_FILE_TYPE_OPENBSD_RAMDISK: | ||
63 | + case GRUB_FILE_TYPE_XNU_RAMDISK: | ||
64 | + case GRUB_FILE_TYPE_SIGNATURE: | ||
65 | + case GRUB_FILE_TYPE_PUBLIC_KEY: | ||
66 | + case GRUB_FILE_TYPE_PUBLIC_KEY_TRUST: | ||
67 | + case GRUB_FILE_TYPE_PRINT_BLOCKLIST: | ||
68 | + case GRUB_FILE_TYPE_TESTLOAD: | ||
69 | + case GRUB_FILE_TYPE_GET_SIZE: | ||
70 | + case GRUB_FILE_TYPE_FONT: | ||
71 | + case GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY: | ||
72 | + case GRUB_FILE_TYPE_CAT: | ||
73 | + case GRUB_FILE_TYPE_HEXCAT: | ||
74 | + case GRUB_FILE_TYPE_CMP: | ||
75 | + case GRUB_FILE_TYPE_HASHLIST: | ||
76 | + case GRUB_FILE_TYPE_TO_HASH: | ||
77 | + case GRUB_FILE_TYPE_KEYBOARD_LAYOUT: | ||
78 | + case GRUB_FILE_TYPE_PIXMAP: | ||
79 | + case GRUB_FILE_TYPE_GRUB_MODULE_LIST: | ||
80 | + case GRUB_FILE_TYPE_CONFIG: | ||
81 | + case GRUB_FILE_TYPE_THEME: | ||
82 | + case GRUB_FILE_TYPE_GETTEXT_CATALOG: | ||
83 | + case GRUB_FILE_TYPE_FS_SEARCH: | ||
84 | + case GRUB_FILE_TYPE_LOADENV: | ||
85 | + case GRUB_FILE_TYPE_SAVEENV: | ||
86 | + case GRUB_FILE_TYPE_VERIFY_SIGNATURE: | ||
87 | + *flags = GRUB_VERIFY_FLAGS_SKIP_VERIFICATION; | ||
88 | + return GRUB_ERR_NONE; | ||
89 | |||
90 | + /* Other files. */ | ||
91 | default: | ||
92 | - return GRUB_ERR_NONE; | ||
93 | + return grub_error (GRUB_ERR_ACCESS_DENIED, N_("prohibited by secure boot policy")); | ||
94 | } | ||
95 | } | ||
96 | |||
97 | diff --git a/include/grub/verify.h b/include/grub/verify.h | ||
98 | index cd129c398..672ae1692 100644 | ||
99 | --- a/include/grub/verify.h | ||
100 | +++ b/include/grub/verify.h | ||
101 | @@ -24,6 +24,7 @@ | ||
102 | |||
103 | enum grub_verify_flags | ||
104 | { | ||
105 | + GRUB_VERIFY_FLAGS_NONE = 0, | ||
106 | GRUB_VERIFY_FLAGS_SKIP_VERIFICATION = 1, | ||
107 | GRUB_VERIFY_FLAGS_SINGLE_CHUNK = 2, | ||
108 | /* Defer verification to another authority. */ | ||
109 | -- | ||
110 | 2.34.1 | ||
111 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch b/meta/recipes-bsp/grub/files/CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch deleted file mode 100644 index 5741e53f42..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | From 04c86e0bb7b58fc2f913f798cdb18934933e532d Mon Sep 17 00:00:00 2001 | ||
2 | From: Chris Coulson <chris.coulson@canonical.com> | ||
3 | Date: Tue, 5 Apr 2022 11:48:58 +0100 | ||
4 | Subject: [PATCH] loader/efi/chainloader: Use grub_loader_set_ex() | ||
5 | |||
6 | This ports the EFI chainloader to use grub_loader_set_ex() in order to fix | ||
7 | a use-after-free bug that occurs when grub_cmd_chainloader() is executed | ||
8 | more than once before a boot attempt is performed. | ||
9 | |||
10 | Fixes: CVE-2022-28736 | ||
11 | |||
12 | Signed-off-by: Chris Coulson <chris.coulson@canonical.com> | ||
13 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | CVE: CVE-2022-28736 | ||
17 | |||
18 | Reference to upstream patch: | ||
19 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=04c86e0bb7b58fc2f913f798cdb18934933e532d | ||
20 | |||
21 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
22 | --- | ||
23 | grub-core/loader/efi/chainloader.c | 16 +++++++--------- | ||
24 | 1 file changed, 7 insertions(+), 9 deletions(-) | ||
25 | |||
26 | diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c | ||
27 | index d1602c89b..7557eb269 100644 | ||
28 | --- a/grub-core/loader/efi/chainloader.c | ||
29 | +++ b/grub-core/loader/efi/chainloader.c | ||
30 | @@ -44,11 +44,10 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
31 | |||
32 | static grub_dl_t my_mod; | ||
33 | |||
34 | -static grub_efi_handle_t image_handle; | ||
35 | - | ||
36 | static grub_err_t | ||
37 | -grub_chainloader_unload (void) | ||
38 | +grub_chainloader_unload (void *context) | ||
39 | { | ||
40 | + grub_efi_handle_t image_handle = (grub_efi_handle_t) context; | ||
41 | grub_efi_loaded_image_t *loaded_image; | ||
42 | grub_efi_boot_services_t *b; | ||
43 | |||
44 | @@ -64,8 +63,9 @@ grub_chainloader_unload (void) | ||
45 | } | ||
46 | |||
47 | static grub_err_t | ||
48 | -grub_chainloader_boot (void) | ||
49 | +grub_chainloader_boot (void *context) | ||
50 | { | ||
51 | + grub_efi_handle_t image_handle = (grub_efi_handle_t) context; | ||
52 | grub_efi_boot_services_t *b; | ||
53 | grub_efi_status_t status; | ||
54 | grub_efi_uintn_t exit_data_size; | ||
55 | @@ -225,6 +225,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), | ||
56 | grub_efi_physical_address_t address = 0; | ||
57 | grub_efi_uintn_t pages = 0; | ||
58 | grub_efi_char16_t *cmdline = NULL; | ||
59 | + grub_efi_handle_t image_handle = NULL; | ||
60 | |||
61 | if (argc == 0) | ||
62 | return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); | ||
63 | @@ -405,7 +406,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), | ||
64 | efi_call_2 (b->free_pages, address, pages); | ||
65 | grub_free (file_path); | ||
66 | |||
67 | - grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); | ||
68 | + grub_loader_set_ex (grub_chainloader_boot, grub_chainloader_unload, image_handle, 0); | ||
69 | return 0; | ||
70 | |||
71 | fail: | ||
72 | @@ -423,10 +424,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), | ||
73 | efi_call_2 (b->free_pages, address, pages); | ||
74 | |||
75 | if (image_handle != NULL) | ||
76 | - { | ||
77 | - efi_call_1 (b->unload_image, image_handle); | ||
78 | - image_handle = NULL; | ||
79 | - } | ||
80 | + efi_call_1 (b->unload_image, image_handle); | ||
81 | |||
82 | grub_dl_unref (my_mod); | ||
83 | |||
84 | -- | ||
85 | 2.34.1 | ||
86 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-3775.patch b/meta/recipes-bsp/grub/files/CVE-2022-3775.patch deleted file mode 100644 index 853efd0486..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2022-3775.patch +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | From fdbe7209152ad6f09a1166f64f162017f2145ba3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhang Boyang <zhangboyang.id@gmail.com> | ||
3 | Date: Mon, 24 Oct 2022 08:05:35 +0800 | ||
4 | Subject: [PATCH] font: Fix an integer underflow in blit_comb() | ||
5 | |||
6 | The expression (ctx.bounds.height - combining_glyphs[i]->height) / 2 may | ||
7 | evaluate to a very big invalid value even if both ctx.bounds.height and | ||
8 | combining_glyphs[i]->height are small integers. For example, if | ||
9 | ctx.bounds.height is 10 and combining_glyphs[i]->height is 12, this | ||
10 | expression evaluates to 2147483647 (expected -1). This is because | ||
11 | coordinates are allowed to be negative but ctx.bounds.height is an | ||
12 | unsigned int. So, the subtraction operates on unsigned ints and | ||
13 | underflows to a very big value. The division makes things even worse. | ||
14 | The quotient is still an invalid value even if converted back to int. | ||
15 | |||
16 | This patch fixes the problem by casting ctx.bounds.height to int. As | ||
17 | a result the subtraction will operate on int and grub_uint16_t which | ||
18 | will be promoted to an int. So, the underflow will no longer happen. Other | ||
19 | uses of ctx.bounds.height (and ctx.bounds.width) are also casted to int, | ||
20 | to ensure coordinates are always calculated on signed integers. | ||
21 | |||
22 | Fixes: CVE-2022-3775 | ||
23 | |||
24 | Reported-by: Daniel Axtens <dja@axtens.net> | ||
25 | Signed-off-by: Zhang Boyang <zhangboyang.id@gmail.com> | ||
26 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
27 | |||
28 | Upstream-Status: Backport from | ||
29 | [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=992c06191babc1e109caf40d6a07ec6fdef427af] | ||
30 | CVE: CVE-2022-3775 | ||
31 | |||
32 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
33 | |||
34 | --- | ||
35 | grub-core/font/font.c | 16 ++++++++-------- | ||
36 | 1 file changed, 8 insertions(+), 8 deletions(-) | ||
37 | |||
38 | diff --git a/grub-core/font/font.c b/grub-core/font/font.c | ||
39 | index 0ff5525..7b1cbde 100644 | ||
40 | --- a/grub-core/font/font.c | ||
41 | +++ b/grub-core/font/font.c | ||
42 | @@ -1206,12 +1206,12 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, | ||
43 | ctx.bounds.height = main_glyph->height; | ||
44 | |||
45 | above_rightx = main_glyph->offset_x + main_glyph->width; | ||
46 | - above_righty = ctx.bounds.y + ctx.bounds.height; | ||
47 | + above_righty = ctx.bounds.y + (int) ctx.bounds.height; | ||
48 | |||
49 | above_leftx = main_glyph->offset_x; | ||
50 | - above_lefty = ctx.bounds.y + ctx.bounds.height; | ||
51 | + above_lefty = ctx.bounds.y + (int) ctx.bounds.height; | ||
52 | |||
53 | - below_rightx = ctx.bounds.x + ctx.bounds.width; | ||
54 | + below_rightx = ctx.bounds.x + (int) ctx.bounds.width; | ||
55 | below_righty = ctx.bounds.y; | ||
56 | |||
57 | comb = grub_unicode_get_comb (glyph_id); | ||
58 | @@ -1224,7 +1224,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, | ||
59 | |||
60 | if (!combining_glyphs[i]) | ||
61 | continue; | ||
62 | - targetx = (ctx.bounds.width - combining_glyphs[i]->width) / 2 + ctx.bounds.x; | ||
63 | + targetx = ((int) ctx.bounds.width - combining_glyphs[i]->width) / 2 + ctx.bounds.x; | ||
64 | /* CGJ is to avoid diacritics reordering. */ | ||
65 | if (comb[i].code | ||
66 | == GRUB_UNICODE_COMBINING_GRAPHEME_JOINER) | ||
67 | @@ -1234,8 +1234,8 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, | ||
68 | case GRUB_UNICODE_COMB_OVERLAY: | ||
69 | do_blit (combining_glyphs[i], | ||
70 | targetx, | ||
71 | - (ctx.bounds.height - combining_glyphs[i]->height) / 2 | ||
72 | - - (ctx.bounds.height + ctx.bounds.y), &ctx); | ||
73 | + ((int) ctx.bounds.height - combining_glyphs[i]->height) / 2 | ||
74 | + - ((int) ctx.bounds.height + ctx.bounds.y), &ctx); | ||
75 | if (min_devwidth < combining_glyphs[i]->width) | ||
76 | min_devwidth = combining_glyphs[i]->width; | ||
77 | break; | ||
78 | @@ -1308,7 +1308,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, | ||
79 | /* Fallthrough. */ | ||
80 | case GRUB_UNICODE_STACK_ATTACHED_ABOVE: | ||
81 | do_blit (combining_glyphs[i], targetx, | ||
82 | - -(ctx.bounds.height + ctx.bounds.y + space | ||
83 | + -((int) ctx.bounds.height + ctx.bounds.y + space | ||
84 | + combining_glyphs[i]->height), &ctx); | ||
85 | if (min_devwidth < combining_glyphs[i]->width) | ||
86 | min_devwidth = combining_glyphs[i]->width; | ||
87 | @@ -1316,7 +1316,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, | ||
88 | |||
89 | case GRUB_UNICODE_COMB_HEBREW_DAGESH: | ||
90 | do_blit (combining_glyphs[i], targetx, | ||
91 | - -(ctx.bounds.height / 2 + ctx.bounds.y | ||
92 | + -((int) ctx.bounds.height / 2 + ctx.bounds.y | ||
93 | + combining_glyphs[i]->height / 2), &ctx); | ||
94 | if (min_devwidth < combining_glyphs[i]->width) | ||
95 | min_devwidth = combining_glyphs[i]->width; | ||
diff --git a/meta/recipes-bsp/grub/files/CVE-2023-4692.patch b/meta/recipes-bsp/grub/files/CVE-2023-4692.patch deleted file mode 100644 index 305fcc93d8..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2023-4692.patch +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | From 43651027d24e62a7a463254165e1e46e42aecdea Mon Sep 17 00:00:00 2001 | ||
2 | From: Maxim Suhanov <dfirblog@gmail.com> | ||
3 | Date: Mon, 28 Aug 2023 16:31:57 +0300 | ||
4 | Subject: [PATCH] fs/ntfs: Fix an OOB write when parsing the $ATTRIBUTE_LIST attribute | ||
5 | for the $MFT file | ||
6 | |||
7 | When parsing an extremely fragmented $MFT file, i.e., the file described | ||
8 | using the $ATTRIBUTE_LIST attribute, current NTFS code will reuse a buffer | ||
9 | containing bytes read from the underlying drive to store sector numbers, | ||
10 | which are consumed later to read data from these sectors into another buffer. | ||
11 | |||
12 | These sectors numbers, two 32-bit integers, are always stored at predefined | ||
13 | offsets, 0x10 and 0x14, relative to first byte of the selected entry within | ||
14 | the $ATTRIBUTE_LIST attribute. Usually, this won't cause any problem. | ||
15 | |||
16 | However, when parsing a specially-crafted file system image, this may cause | ||
17 | the NTFS code to write these integers beyond the buffer boundary, likely | ||
18 | causing the GRUB memory allocator to misbehave or fail. These integers contain | ||
19 | values which are controlled by on-disk structures of the NTFS file system. | ||
20 | |||
21 | Such modification and resulting misbehavior may touch a memory range not | ||
22 | assigned to the GRUB and owned by firmware or another EFI application/driver. | ||
23 | |||
24 | This fix introduces checks to ensure that these sector numbers are never | ||
25 | written beyond the boundary. | ||
26 | |||
27 | Fixes: CVE-2023-4692 | ||
28 | |||
29 | Upstream-Status: Backport from | ||
30 | [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=43651027d24e62a7a463254165e1e46e42aecdea] | ||
31 | CVE: CVE-2023-4692 | ||
32 | |||
33 | Reported-by: Maxim Suhanov <dfirblog@gmail.com> | ||
34 | Signed-off-by: Maxim Suhanov <dfirblog@gmail.com> | ||
35 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
36 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
37 | --- | ||
38 | grub-core/fs/ntfs.c | 18 +++++++++++++++++- | ||
39 | 1 file changed, 17 insertions(+), 1 deletion(-) | ||
40 | |||
41 | diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c | ||
42 | index bbdbe24..c3c4db1 100644 | ||
43 | --- a/grub-core/fs/ntfs.c | ||
44 | +++ b/grub-core/fs/ntfs.c | ||
45 | @@ -184,7 +184,7 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) | ||
46 | } | ||
47 | if (at->attr_end) | ||
48 | { | ||
49 | - grub_uint8_t *pa; | ||
50 | + grub_uint8_t *pa, *pa_end; | ||
51 | |||
52 | at->emft_buf = grub_malloc (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR); | ||
53 | if (at->emft_buf == NULL) | ||
54 | @@ -209,11 +209,13 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) | ||
55 | } | ||
56 | at->attr_nxt = at->edat_buf; | ||
57 | at->attr_end = at->edat_buf + u32at (pa, 0x30); | ||
58 | + pa_end = at->edat_buf + n; | ||
59 | } | ||
60 | else | ||
61 | { | ||
62 | at->attr_nxt = at->attr_end + u16at (pa, 0x14); | ||
63 | at->attr_end = at->attr_end + u32at (pa, 4); | ||
64 | + pa_end = at->mft->buf + (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR); | ||
65 | } | ||
66 | at->flags |= GRUB_NTFS_AF_ALST; | ||
67 | while (at->attr_nxt < at->attr_end) | ||
68 | @@ -230,6 +232,13 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) | ||
69 | at->flags |= GRUB_NTFS_AF_GPOS; | ||
70 | at->attr_cur = at->attr_nxt; | ||
71 | pa = at->attr_cur; | ||
72 | + | ||
73 | + if ((pa >= pa_end) || (pa_end - pa < 0x18)) | ||
74 | + { | ||
75 | + grub_error (GRUB_ERR_BAD_FS, "can\'t parse attribute list"); | ||
76 | + return NULL; | ||
77 | + } | ||
78 | + | ||
79 | grub_set_unaligned32 ((char *) pa + 0x10, | ||
80 | grub_cpu_to_le32 (at->mft->data->mft_start)); | ||
81 | grub_set_unaligned32 ((char *) pa + 0x14, | ||
82 | @@ -240,6 +249,13 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) | ||
83 | { | ||
84 | if (*pa != attr) | ||
85 | break; | ||
86 | + | ||
87 | + if ((pa >= pa_end) || (pa_end - pa < 0x18)) | ||
88 | + { | ||
89 | + grub_error (GRUB_ERR_BAD_FS, "can\'t parse attribute list"); | ||
90 | + return NULL; | ||
91 | + } | ||
92 | + | ||
93 | if (read_attr | ||
94 | (at, pa + 0x10, | ||
95 | u32at (pa, 0x10) * (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR), | ||
96 | -- | ||
97 | cgit v1.1 | ||
98 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2023-4693.patch b/meta/recipes-bsp/grub/files/CVE-2023-4693.patch deleted file mode 100644 index 420fe92ac3..0000000000 --- a/meta/recipes-bsp/grub/files/CVE-2023-4693.patch +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | From 0ed2458cc4eff6d9a9199527e2a0b6d445802f94 Mon Sep 17 00:00:00 2001 | ||
2 | From: Maxim Suhanov <dfirblog@...> | ||
3 | Date: Mon, 28 Aug 2023 16:32:33 +0300 | ||
4 | Subject: fs/ntfs: Fix an OOB read when reading data from the resident $DATA | ||
5 | attribute | ||
6 | |||
7 | When reading a file containing resident data, i.e., the file data is stored in | ||
8 | the $DATA attribute within the NTFS file record, not in external clusters, | ||
9 | there are no checks that this resident data actually fits the corresponding | ||
10 | file record segment. | ||
11 | |||
12 | When parsing a specially-crafted file system image, the current NTFS code will | ||
13 | read the file data from an arbitrary, attacker-chosen memory offset and of | ||
14 | arbitrary, attacker-chosen length. | ||
15 | |||
16 | This allows an attacker to display arbitrary chunks of memory, which could | ||
17 | contain sensitive information like password hashes or even plain-text, | ||
18 | obfuscated passwords from BS EFI variables. | ||
19 | |||
20 | This fix implements a check to ensure that resident data is read from the | ||
21 | corresponding file record segment only. | ||
22 | |||
23 | Fixes: CVE-2023-4693 | ||
24 | |||
25 | Upstream-Status: Backport from | ||
26 | [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=0ed2458cc4eff6d9a9199527e2a0b6d445802f94] | ||
27 | CVE: CVE-2023-4693 | ||
28 | |||
29 | Reported-by: Maxim Suhanov <dfirblog@...> | ||
30 | Signed-off-by: Maxim Suhanov <dfirblog@...> | ||
31 | Reviewed-by: Daniel Kiper <daniel.kiper@...> | ||
32 | Signed-off-by: Xiangyu Chen <xiangyu.chen@...> | ||
33 | --- | ||
34 | grub-core/fs/ntfs.c | 13 ++++++++++++- | ||
35 | 1 file changed, 12 insertions(+), 1 deletion(-) | ||
36 | |||
37 | diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c | ||
38 | index c3c4db1..a68e173 100644 | ||
39 | --- a/grub-core/fs/ntfs.c | ||
40 | +++ b/grub-core/fs/ntfs.c | ||
41 | @@ -401,7 +401,18 @@ read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa, grub_uint8_t *dest, | ||
42 | { | ||
43 | if (ofs + len > u32at (pa, 0x10)) | ||
44 | return grub_error (GRUB_ERR_BAD_FS, "read out of range"); | ||
45 | - grub_memcpy (dest, pa + u32at (pa, 0x14) + ofs, len); | ||
46 | + | ||
47 | + if (u32at (pa, 0x10) > (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR)) | ||
48 | + return grub_error (GRUB_ERR_BAD_FS, "resident attribute too large"); | ||
49 | + | ||
50 | + if (pa >= at->mft->buf + (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR)) | ||
51 | + return grub_error (GRUB_ERR_BAD_FS, "resident attribute out of range"); | ||
52 | + | ||
53 | + if (u16at (pa, 0x14) + u32at (pa, 0x10) > | ||
54 | + (grub_addr_t) at->mft->buf + (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR) - (grub_addr_t) pa) | ||
55 | + return grub_error (GRUB_ERR_BAD_FS, "resident attribute out of range"); | ||
56 | + | ||
57 | + grub_memcpy (dest, pa + u16at (pa, 0x14) + ofs, len); | ||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | -- | ||
62 | cgit v1.1 | ||
63 | |||
diff --git a/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch b/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch index 1323a54a59..f8dfda90ab 100644 --- a/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch +++ b/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 8790aa8bea736f52341a0430ff3e317d3be0f99b Mon Sep 17 00:00:00 2001 | 1 | From 14c1d0459fb3561e627d3a5f6e91a0d2f7b4aa45 Mon Sep 17 00:00:00 2001 |
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | 2 | From: Naveen Saini <naveen.kumar.saini@intel.com> |
3 | Date: Mon, 15 Mar 2021 14:44:15 +0800 | 3 | Date: Mon, 15 Mar 2021 14:44:15 +0800 |
4 | Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in | 4 | Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in |
@@ -14,15 +14,16 @@ Upstream-Status: Inappropriate [OE specific] | |||
14 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | 14 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> |
15 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | 15 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> |
16 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | 16 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> |
17 | |||
17 | --- | 18 | --- |
18 | autogen.sh | 2 +- | 19 | autogen.sh | 2 +- |
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | 20 | 1 file changed, 1 insertion(+), 1 deletion(-) |
20 | 21 | ||
21 | diff --git a/autogen.sh b/autogen.sh | 22 | diff --git a/autogen.sh b/autogen.sh |
22 | index 31b0ced7e..c63ae766c 100755 | 23 | index 195daa5..773b7b4 100755 |
23 | --- a/autogen.sh | 24 | --- a/autogen.sh |
24 | +++ b/autogen.sh | 25 | +++ b/autogen.sh |
25 | @@ -13,7 +13,7 @@ fi | 26 | @@ -26,7 +26,7 @@ fi |
26 | export LC_COLLATE=C | 27 | export LC_COLLATE=C |
27 | unset LC_ALL | 28 | unset LC_ALL |
28 | 29 | ||
@@ -31,6 +32,3 @@ index 31b0ced7e..c63ae766c 100755 | |||
31 | find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in | 32 | find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in |
32 | 33 | ||
33 | echo "Importing unicode..." | 34 | echo "Importing unicode..." |
34 | -- | ||
35 | 2.17.1 | ||
36 | |||
diff --git a/meta/recipes-bsp/grub/files/commands-boot-Add-API-to-pass-context-to-loader.patch b/meta/recipes-bsp/grub/files/commands-boot-Add-API-to-pass-context-to-loader.patch deleted file mode 100644 index a2c0530f04..0000000000 --- a/meta/recipes-bsp/grub/files/commands-boot-Add-API-to-pass-context-to-loader.patch +++ /dev/null | |||
@@ -1,168 +0,0 @@ | |||
1 | From 14ceb3b3ff6db664649138442b6562c114dcf56e Mon Sep 17 00:00:00 2001 | ||
2 | From: Chris Coulson <chris.coulson@canonical.com> | ||
3 | Date: Tue, 5 Apr 2022 10:58:28 +0100 | ||
4 | Subject: [PATCH] commands/boot: Add API to pass context to loader | ||
5 | |||
6 | Loaders rely on global variables for saving context which is consumed | ||
7 | in the boot hook and freed in the unload hook. In the case where a loader | ||
8 | command is executed twice, calling grub_loader_set() a second time executes | ||
9 | the unload hook, but in some cases this runs when the loader's global | ||
10 | context has already been updated, resulting in the updated context being | ||
11 | freed and potential use-after-free bugs when the boot hook is subsequently | ||
12 | called. | ||
13 | |||
14 | This adds a new API, grub_loader_set_ex(), which allows a loader to specify | ||
15 | context that is passed to its boot and unload hooks. This is an alternative | ||
16 | to requiring that loaders call grub_loader_unset() before mutating their | ||
17 | global context. | ||
18 | |||
19 | Signed-off-by: Chris Coulson <chris.coulson@canonical.com> | ||
20 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
21 | |||
22 | Upstream-Status: Backport | ||
23 | |||
24 | Reference to upstream patch: | ||
25 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=14ceb3b3ff6db664649138442b6562c114dcf56e | ||
26 | |||
27 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
28 | --- | ||
29 | grub-core/commands/boot.c | 66 ++++++++++++++++++++++++++++++++++----- | ||
30 | include/grub/loader.h | 5 +++ | ||
31 | 2 files changed, 63 insertions(+), 8 deletions(-) | ||
32 | |||
33 | diff --git a/grub-core/commands/boot.c b/grub-core/commands/boot.c | ||
34 | index bbca81e94..61514788e 100644 | ||
35 | --- a/grub-core/commands/boot.c | ||
36 | +++ b/grub-core/commands/boot.c | ||
37 | @@ -27,10 +27,20 @@ | ||
38 | |||
39 | GRUB_MOD_LICENSE ("GPLv3+"); | ||
40 | |||
41 | -static grub_err_t (*grub_loader_boot_func) (void); | ||
42 | -static grub_err_t (*grub_loader_unload_func) (void); | ||
43 | +static grub_err_t (*grub_loader_boot_func) (void *context); | ||
44 | +static grub_err_t (*grub_loader_unload_func) (void *context); | ||
45 | +static void *grub_loader_context; | ||
46 | static int grub_loader_flags; | ||
47 | |||
48 | +struct grub_simple_loader_hooks | ||
49 | +{ | ||
50 | + grub_err_t (*boot) (void); | ||
51 | + grub_err_t (*unload) (void); | ||
52 | +}; | ||
53 | + | ||
54 | +/* Don't heap allocate this to avoid making grub_loader_set() fallible. */ | ||
55 | +static struct grub_simple_loader_hooks simple_loader_hooks; | ||
56 | + | ||
57 | struct grub_preboot | ||
58 | { | ||
59 | grub_err_t (*preboot_func) (int); | ||
60 | @@ -44,6 +54,29 @@ static int grub_loader_loaded; | ||
61 | static struct grub_preboot *preboots_head = 0, | ||
62 | *preboots_tail = 0; | ||
63 | |||
64 | +static grub_err_t | ||
65 | +grub_simple_boot_hook (void *context) | ||
66 | +{ | ||
67 | + struct grub_simple_loader_hooks *hooks; | ||
68 | + | ||
69 | + hooks = (struct grub_simple_loader_hooks *) context; | ||
70 | + return hooks->boot (); | ||
71 | +} | ||
72 | + | ||
73 | +static grub_err_t | ||
74 | +grub_simple_unload_hook (void *context) | ||
75 | +{ | ||
76 | + struct grub_simple_loader_hooks *hooks; | ||
77 | + grub_err_t ret; | ||
78 | + | ||
79 | + hooks = (struct grub_simple_loader_hooks *) context; | ||
80 | + | ||
81 | + ret = hooks->unload (); | ||
82 | + grub_memset (hooks, 0, sizeof (*hooks)); | ||
83 | + | ||
84 | + return ret; | ||
85 | +} | ||
86 | + | ||
87 | int | ||
88 | grub_loader_is_loaded (void) | ||
89 | { | ||
90 | @@ -110,28 +143,45 @@ grub_loader_unregister_preboot_hook (struct grub_preboot *hnd) | ||
91 | } | ||
92 | |||
93 | void | ||
94 | -grub_loader_set (grub_err_t (*boot) (void), | ||
95 | - grub_err_t (*unload) (void), | ||
96 | - int flags) | ||
97 | +grub_loader_set_ex (grub_err_t (*boot) (void *context), | ||
98 | + grub_err_t (*unload) (void *context), | ||
99 | + void *context, | ||
100 | + int flags) | ||
101 | { | ||
102 | if (grub_loader_loaded && grub_loader_unload_func) | ||
103 | - grub_loader_unload_func (); | ||
104 | + grub_loader_unload_func (grub_loader_context); | ||
105 | |||
106 | grub_loader_boot_func = boot; | ||
107 | grub_loader_unload_func = unload; | ||
108 | + grub_loader_context = context; | ||
109 | grub_loader_flags = flags; | ||
110 | |||
111 | grub_loader_loaded = 1; | ||
112 | } | ||
113 | |||
114 | +void | ||
115 | +grub_loader_set (grub_err_t (*boot) (void), | ||
116 | + grub_err_t (*unload) (void), | ||
117 | + int flags) | ||
118 | +{ | ||
119 | + grub_loader_set_ex (grub_simple_boot_hook, | ||
120 | + grub_simple_unload_hook, | ||
121 | + &simple_loader_hooks, | ||
122 | + flags); | ||
123 | + | ||
124 | + simple_loader_hooks.boot = boot; | ||
125 | + simple_loader_hooks.unload = unload; | ||
126 | +} | ||
127 | + | ||
128 | void | ||
129 | grub_loader_unset(void) | ||
130 | { | ||
131 | if (grub_loader_loaded && grub_loader_unload_func) | ||
132 | - grub_loader_unload_func (); | ||
133 | + grub_loader_unload_func (grub_loader_context); | ||
134 | |||
135 | grub_loader_boot_func = 0; | ||
136 | grub_loader_unload_func = 0; | ||
137 | + grub_loader_context = 0; | ||
138 | |||
139 | grub_loader_loaded = 0; | ||
140 | } | ||
141 | @@ -158,7 +208,7 @@ grub_loader_boot (void) | ||
142 | return err; | ||
143 | } | ||
144 | } | ||
145 | - err = (grub_loader_boot_func) (); | ||
146 | + err = (grub_loader_boot_func) (grub_loader_context); | ||
147 | |||
148 | for (cur = preboots_tail; cur; cur = cur->prev) | ||
149 | if (! err) | ||
150 | diff --git a/include/grub/loader.h b/include/grub/loader.h | ||
151 | index b20864282..97f231054 100644 | ||
152 | --- a/include/grub/loader.h | ||
153 | +++ b/include/grub/loader.h | ||
154 | @@ -40,6 +40,11 @@ void EXPORT_FUNC (grub_loader_set) (grub_err_t (*boot) (void), | ||
155 | grub_err_t (*unload) (void), | ||
156 | int flags); | ||
157 | |||
158 | +void EXPORT_FUNC (grub_loader_set_ex) (grub_err_t (*boot) (void *context), | ||
159 | + grub_err_t (*unload) (void *context), | ||
160 | + void *context, | ||
161 | + int flags); | ||
162 | + | ||
163 | /* Unset current loader, if any. */ | ||
164 | void EXPORT_FUNC (grub_loader_unset) (void); | ||
165 | |||
166 | -- | ||
167 | 2.34.1 | ||
168 | |||
diff --git a/meta/recipes-bsp/grub/files/determinism.patch b/meta/recipes-bsp/grub/files/determinism.patch deleted file mode 100644 index 852b95a856..0000000000 --- a/meta/recipes-bsp/grub/files/determinism.patch +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | From b6f9b3f6fa782807c4a7ec16ee8ef868cdfbf468 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Mon, 15 Mar 2021 14:56:18 +0800 | ||
4 | Subject: [PATCH] The output in moddep.lst generated from syminfo.lst using | ||
5 | genmoddep.awk is not deterministic since the order of the dependencies on | ||
6 | each line can vary depending on how awk sorts the values in the array. | ||
7 | |||
8 | Be deterministic in the output by sorting the dependencies on each line. | ||
9 | |||
10 | Also, the output of the SOURCES lines in grub-core/Makefile.core.am, generated | ||
11 | from grub-core/Makefile.core.def with gentpl.py is not deterministic due to | ||
12 | missing sorting of the list used to generate it. Add such a sort. | ||
13 | |||
14 | Also ensure the generated unidata.c file is deterministic by sorting the | ||
15 | keys of the dict. | ||
16 | |||
17 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/grub-devel/2023-06/index.html] | ||
18 | Richard Purdie <richard.purdie@linuxfoundation.org> | ||
19 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
20 | --- | ||
21 | gentpl.py | 1 + | ||
22 | grub-core/genmoddep.awk | 4 +++- | ||
23 | util/import_unicode.py | 2 +- | ||
24 | 3 files changed, 5 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/gentpl.py b/gentpl.py | ||
27 | index c86550d4f..589285192 100644 | ||
28 | --- a/gentpl.py | ||
29 | +++ b/gentpl.py | ||
30 | @@ -568,6 +568,7 @@ def foreach_platform_value(defn, platform, suffix, closure): | ||
31 | for group in RMAP[platform]: | ||
32 | for value in defn.find_all(group + suffix): | ||
33 | r.append(closure(value)) | ||
34 | + r.sort() | ||
35 | return ''.join(r) | ||
36 | |||
37 | def platform_conditional(platform, closure): | ||
38 | diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk | ||
39 | index 04c2863e5..247436392 100644 | ||
40 | --- a/grub-core/genmoddep.awk | ||
41 | +++ b/grub-core/genmoddep.awk | ||
42 | @@ -59,7 +59,9 @@ END { | ||
43 | } | ||
44 | modlist = "" | ||
45 | depcount[mod] = 0 | ||
46 | - for (depmod in uniqmods) { | ||
47 | + n = asorti(uniqmods, w) | ||
48 | + for (i = 1; i <= n; i++) { | ||
49 | + depmod = w[i] | ||
50 | modlist = modlist " " depmod; | ||
51 | inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod | ||
52 | depcount[mod]++ | ||
53 | diff --git a/util/import_unicode.py b/util/import_unicode.py | ||
54 | index 08f80591e..1f434a069 100644 | ||
55 | --- a/util/import_unicode.py | ||
56 | +++ b/util/import_unicode.py | ||
57 | @@ -174,7 +174,7 @@ infile.close () | ||
58 | |||
59 | outfile.write ("struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[] = {\n ") | ||
60 | |||
61 | -for x in arabicsubst: | ||
62 | +for x in sorted(arabicsubst): | ||
63 | try: | ||
64 | if arabicsubst[x]['join'] == "DUAL": | ||
65 | outfile.write ("{0x%x, 0x%x, 0x%x, 0x%x, 0x%x},\n " % (arabicsubst[x][0], arabicsubst[x][1], arabicsubst[x][2], arabicsubst[x][3], arabicsubst[x][4])) | ||
66 | -- | ||
67 | 2.17.1 | ||
68 | |||
diff --git a/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch b/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch index 26890261b7..d9012d1dd6 100644 --- a/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch +++ b/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 917133acc701dbc4636165d3b08d15dc5829a06f Mon Sep 17 00:00:00 2001 | 1 | From b316ed326bd492106006d78f5bfcd767b49a4f2e Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
3 | Date: Wed, 17 Aug 2016 04:06:34 -0400 | 3 | Date: Wed, 17 Aug 2016 04:06:34 -0400 |
4 | Subject: [PATCH] grub module explicitly keeps symbole .module_license | 4 | Subject: [PATCH] grub module explicitly keeps symbole .module_license |
@@ -8,7 +8,7 @@ it stripped symbol table: | |||
8 | 8 | ||
9 | --------------- | 9 | --------------- |
10 | root@localhost:~# objdump -t all_video.mod | 10 | root@localhost:~# objdump -t all_video.mod |
11 | 11 | ||
12 | all_video.mod: file format elf64-x86-64 | 12 | all_video.mod: file format elf64-x86-64 |
13 | 13 | ||
14 | SYMBOL TABLE: | 14 | SYMBOL TABLE: |
@@ -40,12 +40,13 @@ SYMBOL TABLE: | |||
40 | Upstream-Status: Pending | 40 | Upstream-Status: Pending |
41 | 41 | ||
42 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 42 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
43 | |||
43 | --- | 44 | --- |
44 | grub-core/genmod.sh.in | 2 +- | 45 | grub-core/genmod.sh.in | 2 +- |
45 | 1 file changed, 1 insertion(+), 1 deletion(-) | 46 | 1 file changed, 1 insertion(+), 1 deletion(-) |
46 | 47 | ||
47 | diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in | 48 | diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in |
48 | index 1250589..dd14308 100644 | 49 | index e57c4d9..42bb1ba 100644 |
49 | --- a/grub-core/genmod.sh.in | 50 | --- a/grub-core/genmod.sh.in |
50 | +++ b/grub-core/genmod.sh.in | 51 | +++ b/grub-core/genmod.sh.in |
51 | @@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then | 52 | @@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then |
diff --git a/meta/recipes-bsp/grub/files/loader-efi-chainloader-Simplify-the-loader-state.patch b/meta/recipes-bsp/grub/files/loader-efi-chainloader-Simplify-the-loader-state.patch deleted file mode 100644 index a43025d425..0000000000 --- a/meta/recipes-bsp/grub/files/loader-efi-chainloader-Simplify-the-loader-state.patch +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | From 1469983ebb9674753ad333d37087fb8cb20e1dce Mon Sep 17 00:00:00 2001 | ||
2 | From: Chris Coulson <chris.coulson@canonical.com> | ||
3 | Date: Tue, 5 Apr 2022 10:02:04 +0100 | ||
4 | Subject: [PATCH] loader/efi/chainloader: Simplify the loader state | ||
5 | |||
6 | The chainloader command retains the source buffer and device path passed | ||
7 | to LoadImage(), requiring the unload hook passed to grub_loader_set() to | ||
8 | free them. It isn't required to retain this state though - they aren't | ||
9 | required by StartImage() or anything else in the boot hook, so clean them | ||
10 | up before grub_cmd_chainloader() finishes. | ||
11 | |||
12 | Signed-off-by: Chris Coulson <chris.coulson@canonical.com> | ||
13 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | |||
17 | Reference to upstream patch: | ||
18 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=1469983ebb9674753ad333d37087fb8cb20e1dce | ||
19 | |||
20 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
21 | --- | ||
22 | grub-core/loader/efi/chainloader.c | 38 +++++++++++++++++------------- | ||
23 | 1 file changed, 21 insertions(+), 17 deletions(-) | ||
24 | |||
25 | diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c | ||
26 | index 2bd80f4db..d1602c89b 100644 | ||
27 | --- a/grub-core/loader/efi/chainloader.c | ||
28 | +++ b/grub-core/loader/efi/chainloader.c | ||
29 | @@ -44,25 +44,20 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
30 | |||
31 | static grub_dl_t my_mod; | ||
32 | |||
33 | -static grub_efi_physical_address_t address; | ||
34 | -static grub_efi_uintn_t pages; | ||
35 | -static grub_efi_device_path_t *file_path; | ||
36 | static grub_efi_handle_t image_handle; | ||
37 | -static grub_efi_char16_t *cmdline; | ||
38 | |||
39 | static grub_err_t | ||
40 | grub_chainloader_unload (void) | ||
41 | { | ||
42 | + grub_efi_loaded_image_t *loaded_image; | ||
43 | grub_efi_boot_services_t *b; | ||
44 | |||
45 | + loaded_image = grub_efi_get_loaded_image (image_handle); | ||
46 | + if (loaded_image != NULL) | ||
47 | + grub_free (loaded_image->load_options); | ||
48 | + | ||
49 | b = grub_efi_system_table->boot_services; | ||
50 | efi_call_1 (b->unload_image, image_handle); | ||
51 | - efi_call_2 (b->free_pages, address, pages); | ||
52 | - | ||
53 | - grub_free (file_path); | ||
54 | - grub_free (cmdline); | ||
55 | - cmdline = 0; | ||
56 | - file_path = 0; | ||
57 | |||
58 | grub_dl_unref (my_mod); | ||
59 | return GRUB_ERR_NONE; | ||
60 | @@ -140,7 +135,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) | ||
61 | char *dir_start; | ||
62 | char *dir_end; | ||
63 | grub_size_t size; | ||
64 | - grub_efi_device_path_t *d; | ||
65 | + grub_efi_device_path_t *d, *file_path; | ||
66 | |||
67 | dir_start = grub_strchr (filename, ')'); | ||
68 | if (! dir_start) | ||
69 | @@ -222,11 +217,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), | ||
70 | grub_efi_status_t status; | ||
71 | grub_efi_boot_services_t *b; | ||
72 | grub_device_t dev = 0; | ||
73 | - grub_efi_device_path_t *dp = 0; | ||
74 | + grub_efi_device_path_t *dp = NULL, *file_path = NULL; | ||
75 | grub_efi_loaded_image_t *loaded_image; | ||
76 | char *filename; | ||
77 | void *boot_image = 0; | ||
78 | grub_efi_handle_t dev_handle = 0; | ||
79 | + grub_efi_physical_address_t address = 0; | ||
80 | + grub_efi_uintn_t pages = 0; | ||
81 | + grub_efi_char16_t *cmdline = NULL; | ||
82 | |||
83 | if (argc == 0) | ||
84 | return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); | ||
85 | @@ -234,11 +232,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), | ||
86 | |||
87 | grub_dl_ref (my_mod); | ||
88 | |||
89 | - /* Initialize some global variables. */ | ||
90 | - address = 0; | ||
91 | - image_handle = 0; | ||
92 | - file_path = 0; | ||
93 | - | ||
94 | b = grub_efi_system_table->boot_services; | ||
95 | |||
96 | file = grub_file_open (filename, GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE); | ||
97 | @@ -408,6 +401,10 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), | ||
98 | grub_file_close (file); | ||
99 | grub_device_close (dev); | ||
100 | |||
101 | + /* We're finished with the source image buffer and file path now. */ | ||
102 | + efi_call_2 (b->free_pages, address, pages); | ||
103 | + grub_free (file_path); | ||
104 | + | ||
105 | grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); | ||
106 | return 0; | ||
107 | |||
108 | @@ -419,11 +416,18 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), | ||
109 | if (file) | ||
110 | grub_file_close (file); | ||
111 | |||
112 | + grub_free (cmdline); | ||
113 | grub_free (file_path); | ||
114 | |||
115 | if (address) | ||
116 | efi_call_2 (b->free_pages, address, pages); | ||
117 | |||
118 | + if (image_handle != NULL) | ||
119 | + { | ||
120 | + efi_call_1 (b->unload_image, image_handle); | ||
121 | + image_handle = NULL; | ||
122 | + } | ||
123 | + | ||
124 | grub_dl_unref (my_mod); | ||
125 | |||
126 | return grub_errno; | ||
127 | -- | ||
128 | 2.34.1 | ||
129 | |||
diff --git a/meta/recipes-bsp/grub/files/video-Remove-trailing-whitespaces.patch b/meta/recipes-bsp/grub/files/video-Remove-trailing-whitespaces.patch deleted file mode 100644 index 2db9bcbbc5..0000000000 --- a/meta/recipes-bsp/grub/files/video-Remove-trailing-whitespaces.patch +++ /dev/null | |||
@@ -1,693 +0,0 @@ | |||
1 | From 1f48917d8ddb490dcdc70176e0f58136b7f7811a Mon Sep 17 00:00:00 2001 | ||
2 | From: Elyes Haouas <ehaouas@noos.fr> | ||
3 | Date: Fri, 4 Mar 2022 07:42:13 +0100 | ||
4 | Subject: [PATCH] video: Remove trailing whitespaces | ||
5 | |||
6 | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> | ||
7 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | Reference to upstream patch: | ||
12 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=1f48917d8ddb490dcdc70176e0f58136b7f7811a | ||
13 | |||
14 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
15 | --- | ||
16 | grub-core/video/bochs.c | 2 +- | ||
17 | grub-core/video/capture.c | 2 +- | ||
18 | grub-core/video/cirrus.c | 4 ++-- | ||
19 | grub-core/video/coreboot/cbfb.c | 2 +- | ||
20 | grub-core/video/efi_gop.c | 22 +++++++++---------- | ||
21 | grub-core/video/fb/fbblit.c | 8 +++---- | ||
22 | grub-core/video/fb/video_fb.c | 10 ++++----- | ||
23 | grub-core/video/i386/pc/vbe.c | 34 ++++++++++++++--------------- | ||
24 | grub-core/video/i386/pc/vga.c | 6 ++--- | ||
25 | grub-core/video/ieee1275.c | 4 ++-- | ||
26 | grub-core/video/radeon_fuloong2e.c | 6 ++--- | ||
27 | grub-core/video/radeon_yeeloong3a.c | 6 ++--- | ||
28 | grub-core/video/readers/png.c | 2 +- | ||
29 | grub-core/video/readers/tga.c | 2 +- | ||
30 | grub-core/video/sis315_init.c | 2 +- | ||
31 | grub-core/video/sis315pro.c | 8 +++---- | ||
32 | grub-core/video/sm712.c | 10 ++++----- | ||
33 | grub-core/video/video.c | 8 +++---- | ||
34 | 18 files changed, 69 insertions(+), 69 deletions(-) | ||
35 | |||
36 | diff --git a/grub-core/video/bochs.c b/grub-core/video/bochs.c | ||
37 | index 30ea1bd82..edc651697 100644 | ||
38 | --- a/grub-core/video/bochs.c | ||
39 | +++ b/grub-core/video/bochs.c | ||
40 | @@ -212,7 +212,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) | ||
41 | |||
42 | if (((class >> 16) & 0xffff) != 0x0300 || pciid != 0x11111234) | ||
43 | return 0; | ||
44 | - | ||
45 | + | ||
46 | addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); | ||
47 | framebuffer.base = grub_pci_read (addr) & GRUB_PCI_ADDR_MEM_MASK; | ||
48 | if (!framebuffer.base) | ||
49 | diff --git a/grub-core/video/capture.c b/grub-core/video/capture.c | ||
50 | index 4d3195e01..c653d89f9 100644 | ||
51 | --- a/grub-core/video/capture.c | ||
52 | +++ b/grub-core/video/capture.c | ||
53 | @@ -92,7 +92,7 @@ grub_video_capture_start (const struct grub_video_mode_info *mode_info, | ||
54 | framebuffer.ptr = grub_calloc (framebuffer.mode_info.height, framebuffer.mode_info.pitch); | ||
55 | if (!framebuffer.ptr) | ||
56 | return grub_errno; | ||
57 | - | ||
58 | + | ||
59 | err = grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target, | ||
60 | &framebuffer.mode_info, | ||
61 | framebuffer.ptr); | ||
62 | diff --git a/grub-core/video/cirrus.c b/grub-core/video/cirrus.c | ||
63 | index e2149e8ce..f5542ccdc 100644 | ||
64 | --- a/grub-core/video/cirrus.c | ||
65 | +++ b/grub-core/video/cirrus.c | ||
66 | @@ -354,11 +354,11 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height, | ||
67 | grub_uint8_t sr_ext = 0, hidden_dac = 0; | ||
68 | |||
69 | grub_vga_set_geometry (&config, grub_vga_cr_write); | ||
70 | - | ||
71 | + | ||
72 | grub_vga_gr_write (GRUB_VGA_GR_MODE_256_COLOR | GRUB_VGA_GR_MODE_READ_MODE1, | ||
73 | GRUB_VGA_GR_MODE); | ||
74 | grub_vga_gr_write (GRUB_VGA_GR_GR6_GRAPHICS_MODE, GRUB_VGA_GR_GR6); | ||
75 | - | ||
76 | + | ||
77 | grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_NORMAL, GRUB_VGA_SR_MEMORY_MODE); | ||
78 | |||
79 | grub_vga_cr_write ((config.pitch >> CIRRUS_CR_EXTENDED_DISPLAY_PITCH_SHIFT) | ||
80 | diff --git a/grub-core/video/coreboot/cbfb.c b/grub-core/video/coreboot/cbfb.c | ||
81 | index 9af81fa5b..986003c51 100644 | ||
82 | --- a/grub-core/video/coreboot/cbfb.c | ||
83 | +++ b/grub-core/video/coreboot/cbfb.c | ||
84 | @@ -106,7 +106,7 @@ grub_video_cbfb_setup (unsigned int width, unsigned int height, | ||
85 | |||
86 | grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, | ||
87 | grub_video_fbstd_colors); | ||
88 | - | ||
89 | + | ||
90 | return err; | ||
91 | } | ||
92 | |||
93 | diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c | ||
94 | index b7590dc6c..7a5054631 100644 | ||
95 | --- a/grub-core/video/efi_gop.c | ||
96 | +++ b/grub-core/video/efi_gop.c | ||
97 | @@ -273,7 +273,7 @@ grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, vo | ||
98 | grub_efi_status_t status; | ||
99 | struct grub_efi_gop_mode_info *info = NULL; | ||
100 | struct grub_video_mode_info mode_info; | ||
101 | - | ||
102 | + | ||
103 | status = efi_call_4 (gop->query_mode, gop, mode, &size, &info); | ||
104 | |||
105 | if (status) | ||
106 | @@ -390,7 +390,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height, | ||
107 | found = 1; | ||
108 | } | ||
109 | } | ||
110 | - | ||
111 | + | ||
112 | if (!found) | ||
113 | { | ||
114 | unsigned mode; | ||
115 | @@ -399,7 +399,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height, | ||
116 | { | ||
117 | grub_efi_uintn_t size; | ||
118 | grub_efi_status_t status; | ||
119 | - | ||
120 | + | ||
121 | status = efi_call_4 (gop->query_mode, gop, mode, &size, &info); | ||
122 | if (status) | ||
123 | { | ||
124 | @@ -472,11 +472,11 @@ grub_video_gop_setup (unsigned int width, unsigned int height, | ||
125 | framebuffer.ptr = (void *) (grub_addr_t) gop->mode->fb_base; | ||
126 | framebuffer.offscreen | ||
127 | = grub_malloc (framebuffer.mode_info.height | ||
128 | - * framebuffer.mode_info.width | ||
129 | + * framebuffer.mode_info.width | ||
130 | * sizeof (struct grub_efi_gop_blt_pixel)); | ||
131 | |||
132 | buffer = framebuffer.offscreen; | ||
133 | - | ||
134 | + | ||
135 | if (!buffer) | ||
136 | { | ||
137 | grub_dprintf ("video", "GOP: couldn't allocate shadow\n"); | ||
138 | @@ -485,11 +485,11 @@ grub_video_gop_setup (unsigned int width, unsigned int height, | ||
139 | &framebuffer.mode_info); | ||
140 | buffer = framebuffer.ptr; | ||
141 | } | ||
142 | - | ||
143 | + | ||
144 | grub_dprintf ("video", "GOP: initialising FB @ %p %dx%dx%d\n", | ||
145 | framebuffer.ptr, framebuffer.mode_info.width, | ||
146 | framebuffer.mode_info.height, framebuffer.mode_info.bpp); | ||
147 | - | ||
148 | + | ||
149 | err = grub_video_fb_create_render_target_from_pointer | ||
150 | (&framebuffer.render_target, &framebuffer.mode_info, buffer); | ||
151 | |||
152 | @@ -498,15 +498,15 @@ grub_video_gop_setup (unsigned int width, unsigned int height, | ||
153 | grub_dprintf ("video", "GOP: Couldn't create FB target\n"); | ||
154 | return err; | ||
155 | } | ||
156 | - | ||
157 | + | ||
158 | err = grub_video_fb_set_active_render_target (framebuffer.render_target); | ||
159 | - | ||
160 | + | ||
161 | if (err) | ||
162 | { | ||
163 | grub_dprintf ("video", "GOP: Couldn't set FB target\n"); | ||
164 | return err; | ||
165 | } | ||
166 | - | ||
167 | + | ||
168 | err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, | ||
169 | grub_video_fbstd_colors); | ||
170 | |||
171 | @@ -514,7 +514,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height, | ||
172 | grub_dprintf ("video", "GOP: Couldn't set palette\n"); | ||
173 | else | ||
174 | grub_dprintf ("video", "GOP: Success\n"); | ||
175 | - | ||
176 | + | ||
177 | return err; | ||
178 | } | ||
179 | |||
180 | diff --git a/grub-core/video/fb/fbblit.c b/grub-core/video/fb/fbblit.c | ||
181 | index d55924837..1010ef393 100644 | ||
182 | --- a/grub-core/video/fb/fbblit.c | ||
183 | +++ b/grub-core/video/fb/fbblit.c | ||
184 | @@ -466,7 +466,7 @@ grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst, | ||
185 | for (i = 0; i < width; i++) | ||
186 | { | ||
187 | register grub_uint32_t col; | ||
188 | - if (*srcptr == 0xf0) | ||
189 | + if (*srcptr == 0xf0) | ||
190 | col = palette[16]; | ||
191 | else | ||
192 | col = palette[*srcptr & 0xf]; | ||
193 | @@ -478,7 +478,7 @@ grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst, | ||
194 | *dstptr++ = col >> 0; | ||
195 | *dstptr++ = col >> 8; | ||
196 | *dstptr++ = col >> 16; | ||
197 | -#endif | ||
198 | +#endif | ||
199 | srcptr++; | ||
200 | } | ||
201 | |||
202 | @@ -651,7 +651,7 @@ grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst, | ||
203 | for (i = 0; i < width; i++) | ||
204 | { | ||
205 | register grub_uint32_t col; | ||
206 | - if (*srcptr != 0xf0) | ||
207 | + if (*srcptr != 0xf0) | ||
208 | { | ||
209 | col = palette[*srcptr & 0xf]; | ||
210 | #ifdef GRUB_CPU_WORDS_BIGENDIAN | ||
211 | @@ -662,7 +662,7 @@ grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst, | ||
212 | *dstptr++ = col >> 0; | ||
213 | *dstptr++ = col >> 8; | ||
214 | *dstptr++ = col >> 16; | ||
215 | -#endif | ||
216 | +#endif | ||
217 | } | ||
218 | else | ||
219 | dstptr += 3; | ||
220 | diff --git a/grub-core/video/fb/video_fb.c b/grub-core/video/fb/video_fb.c | ||
221 | index ae6b89f9a..fa4ebde26 100644 | ||
222 | --- a/grub-core/video/fb/video_fb.c | ||
223 | +++ b/grub-core/video/fb/video_fb.c | ||
224 | @@ -754,7 +754,7 @@ grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source, | ||
225 | *alpha = 0; | ||
226 | return; | ||
227 | } | ||
228 | - | ||
229 | + | ||
230 | /* If we have an out-of-bounds color, return transparent black. */ | ||
231 | if (color > 255) | ||
232 | { | ||
233 | @@ -1141,7 +1141,7 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) | ||
234 | /* If everything is aligned on 32-bit use 32-bit copy. */ | ||
235 | if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y) | ||
236 | % sizeof (grub_uint32_t) == 0 | ||
237 | - && (grub_addr_t) grub_video_fb_get_video_ptr (&target, dst_x, dst_y) | ||
238 | + && (grub_addr_t) grub_video_fb_get_video_ptr (&target, dst_x, dst_y) | ||
239 | % sizeof (grub_uint32_t) == 0 | ||
240 | && linelen % sizeof (grub_uint32_t) == 0 | ||
241 | && linedelta % sizeof (grub_uint32_t) == 0) | ||
242 | @@ -1155,7 +1155,7 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) | ||
243 | else if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y) | ||
244 | % sizeof (grub_uint16_t) == 0 | ||
245 | && (grub_addr_t) grub_video_fb_get_video_ptr (&target, | ||
246 | - dst_x, dst_y) | ||
247 | + dst_x, dst_y) | ||
248 | % sizeof (grub_uint16_t) == 0 | ||
249 | && linelen % sizeof (grub_uint16_t) == 0 | ||
250 | && linedelta % sizeof (grub_uint16_t) == 0) | ||
251 | @@ -1170,7 +1170,7 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) | ||
252 | { | ||
253 | grub_uint8_t *src, *dst; | ||
254 | DO_SCROLL | ||
255 | - } | ||
256 | + } | ||
257 | } | ||
258 | |||
259 | /* 4. Fill empty space with specified color. In this implementation | ||
260 | @@ -1615,7 +1615,7 @@ grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask, | ||
261 | framebuffer.render_target = framebuffer.back_target; | ||
262 | return GRUB_ERR_NONE; | ||
263 | } | ||
264 | - | ||
265 | + | ||
266 | mode_info->mode_type &= ~(GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED | ||
267 | | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); | ||
268 | |||
269 | diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c | ||
270 | index b7f911926..0e65b5206 100644 | ||
271 | --- a/grub-core/video/i386/pc/vbe.c | ||
272 | +++ b/grub-core/video/i386/pc/vbe.c | ||
273 | @@ -219,7 +219,7 @@ grub_vbe_disable_mtrr (int mtrr) | ||
274 | } | ||
275 | |||
276 | /* Call VESA BIOS 0x4f09 to set palette data, return status. */ | ||
277 | -static grub_vbe_status_t | ||
278 | +static grub_vbe_status_t | ||
279 | grub_vbe_bios_set_palette_data (grub_uint32_t color_count, | ||
280 | grub_uint32_t start_index, | ||
281 | struct grub_vbe_palette_data *palette_data) | ||
282 | @@ -237,7 +237,7 @@ grub_vbe_bios_set_palette_data (grub_uint32_t color_count, | ||
283 | } | ||
284 | |||
285 | /* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */ | ||
286 | -grub_vbe_status_t | ||
287 | +grub_vbe_status_t | ||
288 | grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *ci) | ||
289 | { | ||
290 | struct grub_bios_int_registers regs; | ||
291 | @@ -251,7 +251,7 @@ grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *ci) | ||
292 | } | ||
293 | |||
294 | /* Call VESA BIOS 0x4f01 to get VBE Mode Information, return status. */ | ||
295 | -grub_vbe_status_t | ||
296 | +grub_vbe_status_t | ||
297 | grub_vbe_bios_get_mode_info (grub_uint32_t mode, | ||
298 | struct grub_vbe_mode_info_block *mode_info) | ||
299 | { | ||
300 | @@ -285,7 +285,7 @@ grub_vbe_bios_set_mode (grub_uint32_t mode, | ||
301 | } | ||
302 | |||
303 | /* Call VESA BIOS 0x4f03 to return current VBE Mode, return status. */ | ||
304 | -grub_vbe_status_t | ||
305 | +grub_vbe_status_t | ||
306 | grub_vbe_bios_get_mode (grub_uint32_t *mode) | ||
307 | { | ||
308 | struct grub_bios_int_registers regs; | ||
309 | @@ -298,7 +298,7 @@ grub_vbe_bios_get_mode (grub_uint32_t *mode) | ||
310 | return regs.eax & 0xffff; | ||
311 | } | ||
312 | |||
313 | -grub_vbe_status_t | ||
314 | +grub_vbe_status_t | ||
315 | grub_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size) | ||
316 | { | ||
317 | struct grub_bios_int_registers regs; | ||
318 | @@ -346,7 +346,7 @@ grub_vbe_bios_get_memory_window (grub_uint32_t window, | ||
319 | } | ||
320 | |||
321 | /* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status. */ | ||
322 | -grub_vbe_status_t | ||
323 | +grub_vbe_status_t | ||
324 | grub_vbe_bios_set_scanline_length (grub_uint32_t length) | ||
325 | { | ||
326 | struct grub_bios_int_registers regs; | ||
327 | @@ -354,14 +354,14 @@ grub_vbe_bios_set_scanline_length (grub_uint32_t length) | ||
328 | regs.ecx = length; | ||
329 | regs.eax = 0x4f06; | ||
330 | /* BL = 2, Set Scan Line in Bytes. */ | ||
331 | - regs.ebx = 0x0002; | ||
332 | + regs.ebx = 0x0002; | ||
333 | regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; | ||
334 | grub_bios_interrupt (0x10, ®s); | ||
335 | return regs.eax & 0xffff; | ||
336 | } | ||
337 | |||
338 | /* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status. */ | ||
339 | -grub_vbe_status_t | ||
340 | +grub_vbe_status_t | ||
341 | grub_vbe_bios_get_scanline_length (grub_uint32_t *length) | ||
342 | { | ||
343 | struct grub_bios_int_registers regs; | ||
344 | @@ -377,7 +377,7 @@ grub_vbe_bios_get_scanline_length (grub_uint32_t *length) | ||
345 | } | ||
346 | |||
347 | /* Call VESA BIOS 0x4f07 to set display start, return status. */ | ||
348 | -static grub_vbe_status_t | ||
349 | +static grub_vbe_status_t | ||
350 | grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y) | ||
351 | { | ||
352 | struct grub_bios_int_registers regs; | ||
353 | @@ -390,7 +390,7 @@ grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y) | ||
354 | regs.edx = y; | ||
355 | regs.eax = 0x4f07; | ||
356 | /* BL = 80h, Set Display Start during Vertical Retrace. */ | ||
357 | - regs.ebx = 0x0080; | ||
358 | + regs.ebx = 0x0080; | ||
359 | regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; | ||
360 | grub_bios_interrupt (0x10, ®s); | ||
361 | |||
362 | @@ -401,7 +401,7 @@ grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y) | ||
363 | } | ||
364 | |||
365 | /* Call VESA BIOS 0x4f07 to get display start, return status. */ | ||
366 | -grub_vbe_status_t | ||
367 | +grub_vbe_status_t | ||
368 | grub_vbe_bios_get_display_start (grub_uint32_t *x, | ||
369 | grub_uint32_t *y) | ||
370 | { | ||
371 | @@ -419,7 +419,7 @@ grub_vbe_bios_get_display_start (grub_uint32_t *x, | ||
372 | } | ||
373 | |||
374 | /* Call VESA BIOS 0x4f0a. */ | ||
375 | -grub_vbe_status_t | ||
376 | +grub_vbe_status_t | ||
377 | grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset, | ||
378 | grub_uint16_t *length) | ||
379 | { | ||
380 | @@ -896,7 +896,7 @@ vbe2videoinfo (grub_uint32_t mode, | ||
381 | case GRUB_VBE_MEMORY_MODEL_YUV: | ||
382 | mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_YUV; | ||
383 | break; | ||
384 | - | ||
385 | + | ||
386 | case GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR: | ||
387 | mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_RGB; | ||
388 | break; | ||
389 | @@ -923,10 +923,10 @@ vbe2videoinfo (grub_uint32_t mode, | ||
390 | break; | ||
391 | case 8: | ||
392 | mode_info->bytes_per_pixel = 1; | ||
393 | - break; | ||
394 | + break; | ||
395 | case 4: | ||
396 | mode_info->bytes_per_pixel = 0; | ||
397 | - break; | ||
398 | + break; | ||
399 | } | ||
400 | |||
401 | if (controller_info.version >= 0x300) | ||
402 | @@ -976,7 +976,7 @@ grub_video_vbe_iterate (int (*hook) (const struct grub_video_mode_info *info, vo | ||
403 | |||
404 | static grub_err_t | ||
405 | grub_video_vbe_setup (unsigned int width, unsigned int height, | ||
406 | - grub_video_mode_type_t mode_type, | ||
407 | + grub_video_mode_type_t mode_type, | ||
408 | grub_video_mode_type_t mode_mask) | ||
409 | { | ||
410 | grub_uint16_t *p; | ||
411 | @@ -1193,7 +1193,7 @@ grub_video_vbe_print_adapter_specific_info (void) | ||
412 | controller_info.version & 0xFF, | ||
413 | controller_info.oem_software_rev >> 8, | ||
414 | controller_info.oem_software_rev & 0xFF); | ||
415 | - | ||
416 | + | ||
417 | /* The total_memory field is in 64 KiB units. */ | ||
418 | grub_printf_ (N_(" total memory: %d KiB\n"), | ||
419 | (controller_info.total_memory << 6)); | ||
420 | diff --git a/grub-core/video/i386/pc/vga.c b/grub-core/video/i386/pc/vga.c | ||
421 | index b2f776c99..50d0b5e02 100644 | ||
422 | --- a/grub-core/video/i386/pc/vga.c | ||
423 | +++ b/grub-core/video/i386/pc/vga.c | ||
424 | @@ -48,7 +48,7 @@ static struct | ||
425 | int back_page; | ||
426 | } framebuffer; | ||
427 | |||
428 | -static unsigned char | ||
429 | +static unsigned char | ||
430 | grub_vga_set_mode (unsigned char mode) | ||
431 | { | ||
432 | struct grub_bios_int_registers regs; | ||
433 | @@ -182,10 +182,10 @@ grub_video_vga_setup (unsigned int width, unsigned int height, | ||
434 | |||
435 | is_target = 1; | ||
436 | err = grub_video_fb_set_active_render_target (framebuffer.render_target); | ||
437 | - | ||
438 | + | ||
439 | if (err) | ||
440 | return err; | ||
441 | - | ||
442 | + | ||
443 | err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, | ||
444 | grub_video_fbstd_colors); | ||
445 | |||
446 | diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c | ||
447 | index f437fb0df..ca3d3c3b2 100644 | ||
448 | --- a/grub-core/video/ieee1275.c | ||
449 | +++ b/grub-core/video/ieee1275.c | ||
450 | @@ -233,7 +233,7 @@ grub_video_ieee1275_setup (unsigned int width, unsigned int height, | ||
451 | /* TODO. */ | ||
452 | return grub_error (GRUB_ERR_IO, "can't set mode %dx%d", width, height); | ||
453 | } | ||
454 | - | ||
455 | + | ||
456 | err = grub_video_ieee1275_fill_mode_info (dev, &framebuffer.mode_info); | ||
457 | if (err) | ||
458 | { | ||
459 | @@ -260,7 +260,7 @@ grub_video_ieee1275_setup (unsigned int width, unsigned int height, | ||
460 | |||
461 | grub_video_ieee1275_set_palette (0, framebuffer.mode_info.number_of_colors, | ||
462 | grub_video_fbstd_colors); | ||
463 | - | ||
464 | + | ||
465 | return err; | ||
466 | } | ||
467 | |||
468 | diff --git a/grub-core/video/radeon_fuloong2e.c b/grub-core/video/radeon_fuloong2e.c | ||
469 | index b4da34b5e..40917acb7 100644 | ||
470 | --- a/grub-core/video/radeon_fuloong2e.c | ||
471 | +++ b/grub-core/video/radeon_fuloong2e.c | ||
472 | @@ -75,7 +75,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) | ||
473 | if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA | ||
474 | || pciid != 0x515a1002) | ||
475 | return 0; | ||
476 | - | ||
477 | + | ||
478 | *found = 1; | ||
479 | |||
480 | addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); | ||
481 | @@ -139,7 +139,7 @@ grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height, | ||
482 | framebuffer.mapped = 1; | ||
483 | |||
484 | /* Prevent garbage from appearing on the screen. */ | ||
485 | - grub_memset (framebuffer.ptr, 0x55, | ||
486 | + grub_memset (framebuffer.ptr, 0x55, | ||
487 | framebuffer.mode_info.height * framebuffer.mode_info.pitch); | ||
488 | |||
489 | #ifndef TEST | ||
490 | @@ -152,7 +152,7 @@ grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height, | ||
491 | return err; | ||
492 | |||
493 | err = grub_video_fb_set_active_render_target (framebuffer.render_target); | ||
494 | - | ||
495 | + | ||
496 | if (err) | ||
497 | return err; | ||
498 | |||
499 | diff --git a/grub-core/video/radeon_yeeloong3a.c b/grub-core/video/radeon_yeeloong3a.c | ||
500 | index 52614feb6..48631c181 100644 | ||
501 | --- a/grub-core/video/radeon_yeeloong3a.c | ||
502 | +++ b/grub-core/video/radeon_yeeloong3a.c | ||
503 | @@ -74,7 +74,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) | ||
504 | if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA | ||
505 | || pciid != 0x96151002) | ||
506 | return 0; | ||
507 | - | ||
508 | + | ||
509 | *found = 1; | ||
510 | |||
511 | addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); | ||
512 | @@ -137,7 +137,7 @@ grub_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height, | ||
513 | #endif | ||
514 | |||
515 | /* Prevent garbage from appearing on the screen. */ | ||
516 | - grub_memset (framebuffer.ptr, 0, | ||
517 | + grub_memset (framebuffer.ptr, 0, | ||
518 | framebuffer.mode_info.height * framebuffer.mode_info.pitch); | ||
519 | |||
520 | #ifndef TEST | ||
521 | @@ -150,7 +150,7 @@ grub_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height, | ||
522 | return err; | ||
523 | |||
524 | err = grub_video_fb_set_active_render_target (framebuffer.render_target); | ||
525 | - | ||
526 | + | ||
527 | if (err) | ||
528 | return err; | ||
529 | |||
530 | diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c | ||
531 | index 0157ff742..54dfedf43 100644 | ||
532 | --- a/grub-core/video/readers/png.c | ||
533 | +++ b/grub-core/video/readers/png.c | ||
534 | @@ -916,7 +916,7 @@ grub_png_convert_image (struct grub_png_data *data) | ||
535 | } | ||
536 | return; | ||
537 | } | ||
538 | - | ||
539 | + | ||
540 | if (data->is_gray) | ||
541 | { | ||
542 | switch (data->bpp) | ||
543 | diff --git a/grub-core/video/readers/tga.c b/grub-core/video/readers/tga.c | ||
544 | index 7cb9d1d2a..a9ec3a1b6 100644 | ||
545 | --- a/grub-core/video/readers/tga.c | ||
546 | +++ b/grub-core/video/readers/tga.c | ||
547 | @@ -127,7 +127,7 @@ tga_load_palette (struct tga_data *data) | ||
548 | |||
549 | if (len > sizeof (data->palette)) | ||
550 | len = sizeof (data->palette); | ||
551 | - | ||
552 | + | ||
553 | if (grub_file_read (data->file, &data->palette, len) | ||
554 | != (grub_ssize_t) len) | ||
555 | return grub_errno; | ||
556 | diff --git a/grub-core/video/sis315_init.c b/grub-core/video/sis315_init.c | ||
557 | index ae5c1419c..09c3c7bbe 100644 | ||
558 | --- a/grub-core/video/sis315_init.c | ||
559 | +++ b/grub-core/video/sis315_init.c | ||
560 | @@ -1,4 +1,4 @@ | ||
561 | -static const struct { grub_uint8_t reg; grub_uint8_t val; } sr_dump [] = | ||
562 | +static const struct { grub_uint8_t reg; grub_uint8_t val; } sr_dump [] = | ||
563 | { | ||
564 | { 0x28, 0x81 }, | ||
565 | { 0x2a, 0x00 }, | ||
566 | diff --git a/grub-core/video/sis315pro.c b/grub-core/video/sis315pro.c | ||
567 | index 22a0c85a6..4d2f9999a 100644 | ||
568 | --- a/grub-core/video/sis315pro.c | ||
569 | +++ b/grub-core/video/sis315pro.c | ||
570 | @@ -103,7 +103,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) | ||
571 | if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA | ||
572 | || pciid != GRUB_SIS315PRO_PCIID) | ||
573 | return 0; | ||
574 | - | ||
575 | + | ||
576 | *found = 1; | ||
577 | |||
578 | addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); | ||
579 | @@ -218,7 +218,7 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height, | ||
580 | |||
581 | #ifndef TEST | ||
582 | /* Prevent garbage from appearing on the screen. */ | ||
583 | - grub_memset (framebuffer.ptr, 0, | ||
584 | + grub_memset (framebuffer.ptr, 0, | ||
585 | framebuffer.mode_info.height * framebuffer.mode_info.pitch); | ||
586 | grub_arch_sync_dma_caches (framebuffer.ptr, | ||
587 | framebuffer.mode_info.height | ||
588 | @@ -231,7 +231,7 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height, | ||
589 | | GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0 | ||
590 | | GRUB_VGA_IO_MISC_28MHZ | ||
591 | | GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS | ||
592 | - | GRUB_VGA_IO_MISC_COLOR, | ||
593 | + | GRUB_VGA_IO_MISC_COLOR, | ||
594 | GRUB_VGA_IO_MISC_WRITE + GRUB_MACHINE_PCI_IO_BASE); | ||
595 | |||
596 | grub_vga_sr_write (0x86, 5); | ||
597 | @@ -335,7 +335,7 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height, | ||
598 | { | ||
599 | if (read_sis_cmd (0x5) != 0xa1) | ||
600 | write_sis_cmd (0x86, 0x5); | ||
601 | - | ||
602 | + | ||
603 | write_sis_cmd (read_sis_cmd (0x20) | 0xa1, 0x20); | ||
604 | write_sis_cmd (read_sis_cmd (0x1e) | 0xda, 0x1e); | ||
605 | |||
606 | diff --git a/grub-core/video/sm712.c b/grub-core/video/sm712.c | ||
607 | index 10c46eb65..65f59f84b 100644 | ||
608 | --- a/grub-core/video/sm712.c | ||
609 | +++ b/grub-core/video/sm712.c | ||
610 | @@ -167,7 +167,7 @@ enum | ||
611 | GRUB_SM712_CR_SHADOW_VGA_VBLANK_START = 0x46, | ||
612 | GRUB_SM712_CR_SHADOW_VGA_VBLANK_END = 0x47, | ||
613 | GRUB_SM712_CR_SHADOW_VGA_VRETRACE_START = 0x48, | ||
614 | - GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END = 0x49, | ||
615 | + GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END = 0x49, | ||
616 | GRUB_SM712_CR_SHADOW_VGA_OVERFLOW = 0x4a, | ||
617 | GRUB_SM712_CR_SHADOW_VGA_CELL_HEIGHT = 0x4b, | ||
618 | GRUB_SM712_CR_SHADOW_VGA_HDISPLAY_END = 0x4c, | ||
619 | @@ -375,7 +375,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) | ||
620 | if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA | ||
621 | || pciid != GRUB_SM712_PCIID) | ||
622 | return 0; | ||
623 | - | ||
624 | + | ||
625 | *found = 1; | ||
626 | |||
627 | addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); | ||
628 | @@ -471,7 +471,7 @@ grub_video_sm712_setup (unsigned int width, unsigned int height, | ||
629 | |||
630 | #if !defined (TEST) && !defined(GENINIT) | ||
631 | /* Prevent garbage from appearing on the screen. */ | ||
632 | - grub_memset ((void *) framebuffer.cached_ptr, 0, | ||
633 | + grub_memset ((void *) framebuffer.cached_ptr, 0, | ||
634 | framebuffer.mode_info.height * framebuffer.mode_info.pitch); | ||
635 | #endif | ||
636 | |||
637 | @@ -482,7 +482,7 @@ grub_video_sm712_setup (unsigned int width, unsigned int height, | ||
638 | grub_sm712_sr_write (0x2, 0x6b); | ||
639 | grub_sm712_write_reg (0, GRUB_VGA_IO_PIXEL_MASK); | ||
640 | grub_sm712_sr_write (GRUB_VGA_SR_RESET_ASYNC, GRUB_VGA_SR_RESET); | ||
641 | - grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY | ||
642 | + grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY | ||
643 | | GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY | ||
644 | | GRUB_VGA_IO_MISC_UPPER_64K | ||
645 | | GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0 | ||
646 | @@ -694,7 +694,7 @@ grub_video_sm712_setup (unsigned int width, unsigned int height, | ||
647 | for (i = 0; i < ARRAY_SIZE (dda_lookups); i++) | ||
648 | grub_sm712_write_dda_lookup (i, dda_lookups[i].compare, dda_lookups[i].dda, | ||
649 | dda_lookups[i].vcentering); | ||
650 | - | ||
651 | + | ||
652 | /* Undocumented */ | ||
653 | grub_sm712_cr_write (0, 0x9c); | ||
654 | grub_sm712_cr_write (0, 0x9d); | ||
655 | diff --git a/grub-core/video/video.c b/grub-core/video/video.c | ||
656 | index 983424107..8937da745 100644 | ||
657 | --- a/grub-core/video/video.c | ||
658 | +++ b/grub-core/video/video.c | ||
659 | @@ -491,13 +491,13 @@ parse_modespec (const char *current_mode, int *width, int *height, int *depth) | ||
660 | current_mode); | ||
661 | |||
662 | param++; | ||
663 | - | ||
664 | + | ||
665 | *width = grub_strtoul (value, 0, 0); | ||
666 | if (grub_errno != GRUB_ERR_NONE) | ||
667 | return grub_error (GRUB_ERR_BAD_ARGUMENT, | ||
668 | N_("invalid video mode specification `%s'"), | ||
669 | current_mode); | ||
670 | - | ||
671 | + | ||
672 | /* Find height value. */ | ||
673 | value = param; | ||
674 | param = grub_strchr(param, 'x'); | ||
675 | @@ -513,13 +513,13 @@ parse_modespec (const char *current_mode, int *width, int *height, int *depth) | ||
676 | { | ||
677 | /* We have optional color depth value. */ | ||
678 | param++; | ||
679 | - | ||
680 | + | ||
681 | *height = grub_strtoul (value, 0, 0); | ||
682 | if (grub_errno != GRUB_ERR_NONE) | ||
683 | return grub_error (GRUB_ERR_BAD_ARGUMENT, | ||
684 | N_("invalid video mode specification `%s'"), | ||
685 | current_mode); | ||
686 | - | ||
687 | + | ||
688 | /* Convert color depth value. */ | ||
689 | value = param; | ||
690 | *depth = grub_strtoul (value, 0, 0); | ||
691 | -- | ||
692 | 2.34.1 | ||
693 | |||
diff --git a/meta/recipes-bsp/grub/files/video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch b/meta/recipes-bsp/grub/files/video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch deleted file mode 100644 index 0c7deae858..0000000000 --- a/meta/recipes-bsp/grub/files/video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch +++ /dev/null | |||
@@ -1,264 +0,0 @@ | |||
1 | From d5caac8ab79d068ad9a41030c772d03a4d4fbd7b Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Mon, 28 Jun 2021 14:16:14 +1000 | ||
4 | Subject: [PATCH] video/readers/jpeg: Abort sooner if a read operation fails | ||
5 | |||
6 | Fuzzing revealed some inputs that were taking a long time, potentially | ||
7 | forever, because they did not bail quickly upon encountering an I/O error. | ||
8 | |||
9 | Try to catch I/O errors sooner and bail out. | ||
10 | |||
11 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
12 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | |||
16 | Reference to upstream patch: | ||
17 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=d5caac8ab79d068ad9a41030c772d03a4d4fbd7b | ||
18 | |||
19 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
20 | --- | ||
21 | grub-core/video/readers/jpeg.c | 86 +++++++++++++++++++++++++++------- | ||
22 | 1 file changed, 70 insertions(+), 16 deletions(-) | ||
23 | |||
24 | diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c | ||
25 | index c47ffd651..806c56c78 100644 | ||
26 | --- a/grub-core/video/readers/jpeg.c | ||
27 | +++ b/grub-core/video/readers/jpeg.c | ||
28 | @@ -109,9 +109,17 @@ static grub_uint8_t | ||
29 | grub_jpeg_get_byte (struct grub_jpeg_data *data) | ||
30 | { | ||
31 | grub_uint8_t r; | ||
32 | + grub_ssize_t bytes_read; | ||
33 | |||
34 | r = 0; | ||
35 | - grub_file_read (data->file, &r, 1); | ||
36 | + bytes_read = grub_file_read (data->file, &r, 1); | ||
37 | + | ||
38 | + if (bytes_read != 1) | ||
39 | + { | ||
40 | + grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
41 | + "jpeg: unexpected end of data"); | ||
42 | + return 0; | ||
43 | + } | ||
44 | |||
45 | return r; | ||
46 | } | ||
47 | @@ -120,9 +128,17 @@ static grub_uint16_t | ||
48 | grub_jpeg_get_word (struct grub_jpeg_data *data) | ||
49 | { | ||
50 | grub_uint16_t r; | ||
51 | + grub_ssize_t bytes_read; | ||
52 | |||
53 | r = 0; | ||
54 | - grub_file_read (data->file, &r, sizeof (grub_uint16_t)); | ||
55 | + bytes_read = grub_file_read (data->file, &r, sizeof (grub_uint16_t)); | ||
56 | + | ||
57 | + if (bytes_read != sizeof (grub_uint16_t)) | ||
58 | + { | ||
59 | + grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
60 | + "jpeg: unexpected end of data"); | ||
61 | + return 0; | ||
62 | + } | ||
63 | |||
64 | return grub_be_to_cpu16 (r); | ||
65 | } | ||
66 | @@ -135,6 +151,11 @@ grub_jpeg_get_bit (struct grub_jpeg_data *data) | ||
67 | if (data->bit_mask == 0) | ||
68 | { | ||
69 | data->bit_save = grub_jpeg_get_byte (data); | ||
70 | + if (grub_errno != GRUB_ERR_NONE) { | ||
71 | + grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
72 | + "jpeg: file read error"); | ||
73 | + return 0; | ||
74 | + } | ||
75 | if (data->bit_save == JPEG_ESC_CHAR) | ||
76 | { | ||
77 | if (grub_jpeg_get_byte (data) != 0) | ||
78 | @@ -143,6 +164,11 @@ grub_jpeg_get_bit (struct grub_jpeg_data *data) | ||
79 | "jpeg: invalid 0xFF in data stream"); | ||
80 | return 0; | ||
81 | } | ||
82 | + if (grub_errno != GRUB_ERR_NONE) | ||
83 | + { | ||
84 | + grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: file read error"); | ||
85 | + return 0; | ||
86 | + } | ||
87 | } | ||
88 | data->bit_mask = 0x80; | ||
89 | } | ||
90 | @@ -161,7 +187,7 @@ grub_jpeg_get_number (struct grub_jpeg_data *data, int num) | ||
91 | return 0; | ||
92 | |||
93 | msb = value = grub_jpeg_get_bit (data); | ||
94 | - for (i = 1; i < num; i++) | ||
95 | + for (i = 1; i < num && grub_errno == GRUB_ERR_NONE; i++) | ||
96 | value = (value << 1) + (grub_jpeg_get_bit (data) != 0); | ||
97 | if (!msb) | ||
98 | value += 1 - (1 << num); | ||
99 | @@ -208,6 +234,8 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data) | ||
100 | while (data->file->offset + sizeof (count) + 1 <= next_marker) | ||
101 | { | ||
102 | id = grub_jpeg_get_byte (data); | ||
103 | + if (grub_errno != GRUB_ERR_NONE) | ||
104 | + return grub_errno; | ||
105 | ac = (id >> 4) & 1; | ||
106 | id &= 0xF; | ||
107 | if (id > 1) | ||
108 | @@ -258,6 +286,8 @@ grub_jpeg_decode_quan_table (struct grub_jpeg_data *data) | ||
109 | |||
110 | next_marker = data->file->offset; | ||
111 | next_marker += grub_jpeg_get_word (data); | ||
112 | + if (grub_errno != GRUB_ERR_NONE) | ||
113 | + return grub_errno; | ||
114 | |||
115 | if (next_marker > data->file->size) | ||
116 | { | ||
117 | @@ -269,6 +299,8 @@ grub_jpeg_decode_quan_table (struct grub_jpeg_data *data) | ||
118 | <= next_marker) | ||
119 | { | ||
120 | id = grub_jpeg_get_byte (data); | ||
121 | + if (grub_errno != GRUB_ERR_NONE) | ||
122 | + return grub_errno; | ||
123 | if (id >= 0x10) /* Upper 4-bit is precision. */ | ||
124 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
125 | "jpeg: only 8-bit precision is supported"); | ||
126 | @@ -300,6 +332,9 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data) | ||
127 | next_marker = data->file->offset; | ||
128 | next_marker += grub_jpeg_get_word (data); | ||
129 | |||
130 | + if (grub_errno != GRUB_ERR_NONE) | ||
131 | + return grub_errno; | ||
132 | + | ||
133 | if (grub_jpeg_get_byte (data) != 8) | ||
134 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
135 | "jpeg: only 8-bit precision is supported"); | ||
136 | @@ -325,6 +360,8 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data) | ||
137 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid index"); | ||
138 | |||
139 | ss = grub_jpeg_get_byte (data); /* Sampling factor. */ | ||
140 | + if (grub_errno != GRUB_ERR_NONE) | ||
141 | + return grub_errno; | ||
142 | if (!id) | ||
143 | { | ||
144 | grub_uint8_t vs, hs; | ||
145 | @@ -504,7 +541,7 @@ grub_jpeg_idct_transform (jpeg_data_unit_t du) | ||
146 | } | ||
147 | } | ||
148 | |||
149 | -static void | ||
150 | +static grub_err_t | ||
151 | grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du) | ||
152 | { | ||
153 | int h1, h2, qt; | ||
154 | @@ -519,6 +556,9 @@ grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du) | ||
155 | data->dc_value[id] += | ||
156 | grub_jpeg_get_number (data, grub_jpeg_get_huff_code (data, h1)); | ||
157 | |||
158 | + if (grub_errno != GRUB_ERR_NONE) | ||
159 | + return grub_errno; | ||
160 | + | ||
161 | du[0] = data->dc_value[id] * (int) data->quan_table[qt][0]; | ||
162 | pos = 1; | ||
163 | while (pos < ARRAY_SIZE (data->quan_table[qt])) | ||
164 | @@ -533,11 +573,13 @@ grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du) | ||
165 | num >>= 4; | ||
166 | pos += num; | ||
167 | |||
168 | + if (grub_errno != GRUB_ERR_NONE) | ||
169 | + return grub_errno; | ||
170 | + | ||
171 | if (pos >= ARRAY_SIZE (jpeg_zigzag_order)) | ||
172 | { | ||
173 | - grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
174 | - "jpeg: invalid position in zigzag order!?"); | ||
175 | - return; | ||
176 | + return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
177 | + "jpeg: invalid position in zigzag order!?"); | ||
178 | } | ||
179 | |||
180 | du[jpeg_zigzag_order[pos]] = val * (int) data->quan_table[qt][pos]; | ||
181 | @@ -545,6 +587,7 @@ grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du) | ||
182 | } | ||
183 | |||
184 | grub_jpeg_idct_transform (du); | ||
185 | + return GRUB_ERR_NONE; | ||
186 | } | ||
187 | |||
188 | static void | ||
189 | @@ -603,7 +646,8 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data) | ||
190 | data_offset += grub_jpeg_get_word (data); | ||
191 | |||
192 | cc = grub_jpeg_get_byte (data); | ||
193 | - | ||
194 | + if (grub_errno != GRUB_ERR_NONE) | ||
195 | + return grub_errno; | ||
196 | if (cc != 3 && cc != 1) | ||
197 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
198 | "jpeg: component count must be 1 or 3"); | ||
199 | @@ -616,7 +660,8 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data) | ||
200 | id = grub_jpeg_get_byte (data) - 1; | ||
201 | if ((id < 0) || (id >= 3)) | ||
202 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid index"); | ||
203 | - | ||
204 | + if (grub_errno != GRUB_ERR_NONE) | ||
205 | + return grub_errno; | ||
206 | ht = grub_jpeg_get_byte (data); | ||
207 | data->comp_index[id][1] = (ht >> 4); | ||
208 | data->comp_index[id][2] = (ht & 0xF) + 2; | ||
209 | @@ -624,11 +669,14 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data) | ||
210 | if ((data->comp_index[id][1] < 0) || (data->comp_index[id][1] > 3) || | ||
211 | (data->comp_index[id][2] < 0) || (data->comp_index[id][2] > 3)) | ||
212 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid hufftable index"); | ||
213 | + if (grub_errno != GRUB_ERR_NONE) | ||
214 | + return grub_errno; | ||
215 | } | ||
216 | |||
217 | grub_jpeg_get_byte (data); /* Skip 3 unused bytes. */ | ||
218 | grub_jpeg_get_word (data); | ||
219 | - | ||
220 | + if (grub_errno != GRUB_ERR_NONE) | ||
221 | + return grub_errno; | ||
222 | if (data->file->offset != data_offset) | ||
223 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sos"); | ||
224 | |||
225 | @@ -646,6 +694,7 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) | ||
226 | { | ||
227 | unsigned c1, vb, hb, nr1, nc1; | ||
228 | int rst = data->dri; | ||
229 | + grub_err_t err = GRUB_ERR_NONE; | ||
230 | |||
231 | vb = 8 << data->log_vs; | ||
232 | hb = 8 << data->log_hs; | ||
233 | @@ -666,17 +715,22 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) | ||
234 | |||
235 | for (r2 = 0; r2 < (1U << data->log_vs); r2++) | ||
236 | for (c2 = 0; c2 < (1U << data->log_hs); c2++) | ||
237 | - grub_jpeg_decode_du (data, 0, data->ydu[r2 * 2 + c2]); | ||
238 | + { | ||
239 | + err = grub_jpeg_decode_du (data, 0, data->ydu[r2 * 2 + c2]); | ||
240 | + if (err != GRUB_ERR_NONE) | ||
241 | + return err; | ||
242 | + } | ||
243 | |||
244 | if (data->color_components >= 3) | ||
245 | { | ||
246 | - grub_jpeg_decode_du (data, 1, data->cbdu); | ||
247 | - grub_jpeg_decode_du (data, 2, data->crdu); | ||
248 | + err = grub_jpeg_decode_du (data, 1, data->cbdu); | ||
249 | + if (err != GRUB_ERR_NONE) | ||
250 | + return err; | ||
251 | + err = grub_jpeg_decode_du (data, 2, data->crdu); | ||
252 | + if (err != GRUB_ERR_NONE) | ||
253 | + return err; | ||
254 | } | ||
255 | |||
256 | - if (grub_errno) | ||
257 | - return grub_errno; | ||
258 | - | ||
259 | nr2 = (data->r1 == nr1 - 1) ? (data->image_height - data->r1 * vb) : vb; | ||
260 | nc2 = (c1 == nc1 - 1) ? (data->image_width - c1 * hb) : hb; | ||
261 | |||
262 | -- | ||
263 | 2.34.1 | ||
264 | |||
diff --git a/meta/recipes-bsp/grub/files/video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch b/meta/recipes-bsp/grub/files/video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch deleted file mode 100644 index 91ecaad98a..0000000000 --- a/meta/recipes-bsp/grub/files/video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | From 166a4d61448f74745afe1dac2f2cfb85d04909bf Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Axtens <dja@axtens.net> | ||
3 | Date: Mon, 28 Jun 2021 14:25:17 +1000 | ||
4 | Subject: [PATCH] video/readers/jpeg: Refuse to handle multiple start of | ||
5 | streams | ||
6 | |||
7 | An invalid file could contain multiple start of stream blocks, which | ||
8 | would cause us to reallocate and leak our bitmap. Refuse to handle | ||
9 | multiple start of streams. | ||
10 | |||
11 | Additionally, fix a grub_error() call formatting. | ||
12 | |||
13 | Signed-off-by: Daniel Axtens <dja@axtens.net> | ||
14 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
15 | |||
16 | Upstream-Status: Backport | ||
17 | |||
18 | Reference to upstream patch: | ||
19 | https://git.savannah.gnu.org/cgit/grub.git/commit/?id=166a4d61448f74745afe1dac2f2cfb85d04909bf | ||
20 | |||
21 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
22 | --- | ||
23 | grub-core/video/readers/jpeg.c | 7 +++++-- | ||
24 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c | ||
27 | index 2284a6c06..579bbe8a4 100644 | ||
28 | --- a/grub-core/video/readers/jpeg.c | ||
29 | +++ b/grub-core/video/readers/jpeg.c | ||
30 | @@ -683,6 +683,9 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data) | ||
31 | if (data->file->offset != data_offset) | ||
32 | return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sos"); | ||
33 | |||
34 | + if (*data->bitmap) | ||
35 | + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: too many start of scan blocks"); | ||
36 | + | ||
37 | if (grub_video_bitmap_create (data->bitmap, data->image_width, | ||
38 | data->image_height, | ||
39 | GRUB_VIDEO_BLIT_FORMAT_RGB_888)) | ||
40 | @@ -705,8 +708,8 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) | ||
41 | nc1 = (data->image_width + hb - 1) >> (3 + data->log_hs); | ||
42 | |||
43 | if (data->bitmap_ptr == NULL) | ||
44 | - return grub_error(GRUB_ERR_BAD_FILE_TYPE, | ||
45 | - "jpeg: attempted to decode data before start of stream"); | ||
46 | + return grub_error (GRUB_ERR_BAD_FILE_TYPE, | ||
47 | + "jpeg: attempted to decode data before start of stream"); | ||
48 | |||
49 | for (; data->r1 < nr1 && (!data->dri || rst); | ||
50 | data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3) | ||
51 | -- | ||
52 | 2.34.1 | ||
53 | |||
diff --git a/meta/recipes-bsp/grub/grub-efi_2.06.bb b/meta/recipes-bsp/grub/grub-efi_2.12.bb index 9857e8e036..9857e8e036 100644 --- a/meta/recipes-bsp/grub/grub-efi_2.06.bb +++ b/meta/recipes-bsp/grub/grub-efi_2.12.bb | |||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 1215b24668..5685cae0ab 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
@@ -18,36 +18,10 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
18 | file://autogen.sh-exclude-pc.patch \ | 18 | file://autogen.sh-exclude-pc.patch \ |
19 | file://grub-module-explicitly-keeps-symbole-.module_license.patch \ | 19 | file://grub-module-explicitly-keeps-symbole-.module_license.patch \ |
20 | file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ | 20 | file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ |
21 | file://determinism.patch \ | ||
22 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ | 21 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ |
23 | file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \ | ||
24 | file://0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch \ | ||
25 | file://video-Remove-trailing-whitespaces.patch \ | ||
26 | file://CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch \ | ||
27 | file://CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch \ | ||
28 | file://video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch \ | ||
29 | file://video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch \ | ||
30 | file://CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch \ | ||
31 | file://CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch \ | ||
32 | file://CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch \ | ||
33 | file://CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch \ | ||
34 | file://CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch \ | ||
35 | file://0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch \ | ||
36 | file://0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch \ | ||
37 | file://loader-efi-chainloader-Simplify-the-loader-state.patch \ | ||
38 | file://commands-boot-Add-API-to-pass-context-to-loader.patch \ | ||
39 | file://CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch\ | ||
40 | file://0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch \ | ||
41 | file://CVE-2022-2601.patch \ | ||
42 | file://CVE-2022-3775.patch \ | ||
43 | file://0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch \ | ||
44 | file://0001-fs-ext2-Ignore-checksum-seed-incompat-feature.patch \ | ||
45 | file://CVE-2023-4692.patch \ | ||
46 | file://CVE-2023-4693.patch \ | ||
47 | file://0001-fs-fat-Don-t-error-when-mtime-is-0.patch \ | ||
48 | " | 22 | " |
49 | 23 | ||
50 | SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" | 24 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" |
51 | 25 | ||
52 | CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL" | 26 | CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL" |
53 | CVE_STATUS[CVE-2021-46705] = "not-applicable-platform: Applies only to SUSE" | 27 | CVE_STATUS[CVE-2021-46705] = "not-applicable-platform: Applies only to SUSE" |
@@ -101,6 +75,11 @@ export PYTHON = "python3" | |||
101 | 75 | ||
102 | do_configure:prepend() { | 76 | do_configure:prepend() { |
103 | cd ${S} | 77 | cd ${S} |
78 | |||
79 | # Remove in next version. | ||
80 | # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e | ||
81 | echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst | ||
82 | |||
104 | FROM_BOOTSTRAP=1 ${S}/autogen.sh | 83 | FROM_BOOTSTRAP=1 ${S}/autogen.sh |
105 | cd ${B} | 84 | cd ${B} |
106 | } | 85 | } |
diff --git a/meta/recipes-bsp/grub/grub_2.06.bb b/meta/recipes-bsp/grub/grub_2.12.bb index 05d462785c..05d462785c 100644 --- a/meta/recipes-bsp/grub/grub_2.06.bb +++ b/meta/recipes-bsp/grub/grub_2.12.bb | |||