!78 backport some patches from upstream community and fix incorrect author names in patches
From: @zhangqiumiao Reviewed-by: @t_feng Signed-off-by: @t_feng
This commit is contained in:
commit
29f23203aa
@ -1,32 +1,56 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 54e42c1874f75cfe9129e0af0972becc5f9e71f5 Mon Sep 17 00:00:00 2001
|
||||
From: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Date: Mon, 24 Aug 2020 14:46:27 +0200
|
||||
Subject: [PATCH] tftp: roll over block counter to prevent timeouts with data
|
||||
packets
|
||||
Date: Thu, 10 Sep 2020 17:17:57 +0200
|
||||
Subject: [PATCH] tftp: Roll-over block counter to prevent data packets
|
||||
timeouts
|
||||
|
||||
The block number is a 16-bit counter which only allows to fetch
|
||||
files no bigger than 65535 * blksize. To avoid this limit, the
|
||||
counter is rolled over. This behavior isn't defined in RFC 1350
|
||||
but is handled by many TFTP servers and it's what GRUB was doing
|
||||
before implicitly due an overflow.
|
||||
Commit 781b3e5efc3 (tftp: Do not use priority queue) caused a regression
|
||||
when fetching files over TFTP whose size is bigger than 65535 * block size.
|
||||
|
||||
Fixing that bug led to TFTP timeouts, since GRUB wasn't acking
|
||||
data packets anymore for files with size bigger than the maximum
|
||||
mentioned above. Restore the old behavior to prevent this issue.
|
||||
grub> linux /images/pxeboot/vmlinuz
|
||||
grub> echo $?
|
||||
0
|
||||
grub> initrd /images/pxeboot/initrd.img
|
||||
error: timeout reading '/images/pxeboot/initrd.img'.
|
||||
grub> echo $?
|
||||
28
|
||||
|
||||
Resolves: rhbz#1869335
|
||||
It is caused by the block number counter being a 16-bit field, which leads
|
||||
to a maximum file size of ((1 << 16) - 1) * block size. Because GRUB sets
|
||||
the block size to 1024 octets (by using the TFTP Blocksize Option from RFC
|
||||
2348 [0]), the maximum file size that can be transferred is 67107840 bytes.
|
||||
|
||||
The TFTP PROTOCOL (REVISION 2) RFC 1350 [1] does not mention what a client
|
||||
should do when a file size is bigger than the maximum, but most TFTP hosts
|
||||
support the block number counter to be rolled over. That is, acking a data
|
||||
packet with a block number of 0 is taken as if the 65356th block was acked.
|
||||
|
||||
It was working before because the block counter roll-over was happening due
|
||||
an overflow. But that got fixed by the mentioned commit, which led to the
|
||||
regression when attempting to fetch files larger than the maximum size.
|
||||
|
||||
To allow TFTP file transfers of unlimited size again, re-introduce a block
|
||||
counter roll-over so the data packets are acked preventing the timeouts.
|
||||
|
||||
[0]: https://tools.ietf.org/html/rfc2348
|
||||
[1]: https://tools.ietf.org/html/rfc1350
|
||||
|
||||
Fixes: 781b3e5efc3 (tftp: Do not use priority queue)
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=a6838bbc6726ad624bd2b94991f690b8e9d23c69
|
||||
|
||||
Suggested-by: Peter Jones <pjones@redhat.com>
|
||||
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/net/tftp.c | 16 ++++++++++++++--
|
||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||
grub-core/net/tftp.c | 17 ++++++++++++++---
|
||||
1 file changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
|
||||
index 22badd74316..acbb01c10e7 100644
|
||||
index c2df3d7..300c5ca 100644
|
||||
--- a/grub-core/net/tftp.c
|
||||
+++ b/grub-core/net/tftp.c
|
||||
@@ -183,8 +183,20 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)),
|
||||
@@ -183,11 +183,22 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)),
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@ -35,17 +59,23 @@ index 22badd74316..acbb01c10e7 100644
|
||||
+ /*
|
||||
+ * Ack old/retransmitted block.
|
||||
+ *
|
||||
+ * The block number is a 16-bit counter which only allows to fetch
|
||||
+ * files no bigger than 65535 * blksize. To avoid this limit, the
|
||||
+ * counter is rolled over. This behavior isn't defined in RFC 1350
|
||||
+ * but is handled by many TFTP servers and it's what GRUB was doing
|
||||
+ * before implicitly due an overflow.
|
||||
+ * The block number is a 16-bit counter, thus the maximum file size that
|
||||
+ * could be transfered is 65535 * block size. Most TFTP hosts support to
|
||||
+ * roll-over the block counter to allow unlimited transfer file size.
|
||||
+ *
|
||||
+ * Fixing that bug led to TFTP timeouts, since GRUB wasn't acking
|
||||
+ * data packets anymore for files with size bigger than the maximum
|
||||
+ * mentioned above. Restore the old behavior to prevent this issue.
|
||||
+ * This behavior is not defined in the RFC 1350 [0] but is implemented by
|
||||
+ * most TFTP clients and hosts.
|
||||
+ *
|
||||
+ * [0]: https://tools.ietf.org/html/rfc1350
|
||||
+ */
|
||||
+ if (grub_be_to_cpu16 (tftph->u.data.block) < ((data->block + 1) & 0xffffu))
|
||||
+ if (grub_be_to_cpu16 (tftph->u.data.block) < ((grub_uint16_t) (data->block + 1)))
|
||||
ack (data, grub_be_to_cpu16 (tftph->u.data.block));
|
||||
/* Ignore unexpected block. */
|
||||
else if (grub_be_to_cpu16 (tftph->u.data.block) > data->block + 1)
|
||||
- else if (grub_be_to_cpu16 (tftph->u.data.block) > data->block + 1)
|
||||
+ else if (grub_be_to_cpu16 (tftph->u.data.block) > ((grub_uint16_t) (data->block + 1)))
|
||||
grub_dprintf ("tftp", "TFTP unexpected block # %d\n", tftph->u.data.block);
|
||||
else
|
||||
{
|
||||
--
|
||||
2.19.1
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
From f63402685ccd4bfa9c441d63067853db2a1f6c6a Mon Sep 17 00:00:00 2001
|
||||
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
|
||||
Date: Wed, 24 Mar 2021 21:26:10 -0400
|
||||
From: Darren Kenny <darren.kenny@oracle.com>
|
||||
Date: Tue, 8 Dec 2020 10:00:51 +0000
|
||||
Subject: [PATCH] disk/ldm: Fix memory leak on uninserted lv references
|
||||
|
||||
The problem here is that the memory allocated to the variable lv is not
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
From d172ca13c6fdf9a3daf1539eec9fd6b3a17dc16b Mon Sep 17 00:00:00 2001
|
||||
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
|
||||
From: Chris Coulson <chris.coulson@canonical.com>
|
||||
Date: Tue, 1 Dec 2020 23:41:24 +0000
|
||||
Subject: [PATCH] commands/hashsum: Fix a memory leak
|
||||
|
||||
|
||||
@ -1,9 +1,17 @@
|
||||
From 0699bb82f8c260161ff11cf28024c7e25f0a5dd5 Mon Sep 17 00:00:00 2001
|
||||
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
|
||||
Date: Thu, 25 Mar 2021 03:58:28 -0400
|
||||
From: Marco A Benatto <mbenatto@redhat.com>
|
||||
Date: Mon, 30 Nov 2020 12:18:24 -0300
|
||||
Subject: [PATCH] loader/xnu: Free driverkey data when an error is detected in
|
||||
grub_xnu_writetree_toheap()
|
||||
|
||||
... to avoid memory leaks.
|
||||
|
||||
Fixes: CID 96640
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=4b4027b6b1c877d7ab467896b04c7bd1aadcfa15
|
||||
|
||||
Signed-off-by: Marco A Benatto <mbenatto@redhat.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/loader/xnu.c | 24 ++++++++++++++++++++----
|
||||
1 file changed, 20 insertions(+), 4 deletions(-)
|
||||
|
||||
34
backport-0073-grub-mkconfig-Fix-typo-in-help-output.patch
Normal file
34
backport-0073-grub-mkconfig-Fix-typo-in-help-output.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 55453a6734278cf820d599b67c03e84e35e1d87b Mon Sep 17 00:00:00 2001
|
||||
From: Colin Watson <cjwatson@ubuntu.com>
|
||||
Date: Fri, 23 Aug 2019 12:00:30 +0100
|
||||
Subject: [PATCH] grub-mkconfig: Fix typo in --help output
|
||||
|
||||
The short form of "--version" that grub-mkconfig accepts is "-V", not "-v".
|
||||
|
||||
Fixes Debian bug #935504.
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=ff3e91be9cc3d6f040a7f47fac0db1c93f80a9a8
|
||||
|
||||
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
|
||||
Reviewed-by: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
util/grub-mkconfig.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
|
||||
index 2601bdc..0a2c1ce 100644
|
||||
--- a/util/grub-mkconfig.in
|
||||
+++ b/util/grub-mkconfig.in
|
||||
@@ -63,7 +63,7 @@ usage () {
|
||||
print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
|
||||
print_option_help "--no-grubenv-update" "$(gettext "do not update variables in the grubenv file")"
|
||||
print_option_help "-h, --help" "$(gettext "print this message and exit")"
|
||||
- print_option_help "-v, --version" "$(gettext "print the version information and exit")"
|
||||
+ print_option_help "-V, --version" "$(gettext "print the version information and exit")"
|
||||
echo
|
||||
gettext "Report bugs to <bug-grub@gnu.org>."; echo
|
||||
}
|
||||
--
|
||||
2.19.1
|
||||
|
||||
53
backport-0074-at_keyboard-Fix-unreliable-key-presses.patch
Normal file
53
backport-0074-at_keyboard-Fix-unreliable-key-presses.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From 2d3fcce21fc1118449219a8c66b25aefca989493 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Bideau <mica.devel@gmail.com>
|
||||
Date: Wed, 2 Oct 2019 23:48:10 +0200
|
||||
Subject: [PATCH] at_keyboard: Fix unreliable key presses
|
||||
|
||||
This patch fixes an issue that prevented the at_keyboard module to work
|
||||
(for me). The cause was a bad/wrong return value in the
|
||||
grub_at_keyboard_getkey() function in grub-core/term/at_keyboard.c file
|
||||
at line 237. My symptoms were to have an unresponsive keyboard. Keys
|
||||
needed to be pressed 10x and more to effectively be printed sometimes
|
||||
generating multiple key presses (after 1 or 2 sec of no printing). It
|
||||
was very problematic when typing passphrase in early stage (with
|
||||
GRUB_ENABLE_CRYPTODISK). When switched to "console" terminal input
|
||||
keyboard worked perfectly. It also worked great with the GRUB 2.02
|
||||
packaged by Debian (2.02+dfsg1-20). It was not an output issue but an
|
||||
input one.
|
||||
|
||||
I've managed to analyze the issue and found that it came from the commit
|
||||
216950a4e (at_keyboard: Split protocol from controller code.). Three
|
||||
lines where moved from the fetch_key() function in
|
||||
grub-core/term/at_keyboard.c file to the beginning of
|
||||
grub_at_keyboard_getkey() function (same file). However, returning -1
|
||||
made sense when it happened in fetch_key() function but not anymore in
|
||||
grub_at_keyboard_getkey() function which should return GRUB_TERM_NO_KEY.
|
||||
I think it was just an incomplete cut-paste missing a small manual
|
||||
correction. Let's fix it.
|
||||
|
||||
Note: Commit message updated by Daniel Kiper.
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=33203ca3484717712b54e199c46ae8a818374284
|
||||
|
||||
Signed-off-by: Michael Bideau <mica.devel@gmail.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/term/at_keyboard.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
|
||||
index f0a986e..5971110 100644
|
||||
--- a/grub-core/term/at_keyboard.c
|
||||
+++ b/grub-core/term/at_keyboard.c
|
||||
@@ -234,7 +234,7 @@ grub_at_keyboard_getkey (struct grub_term_input *term __attribute__ ((unused)))
|
||||
return GRUB_TERM_NO_KEY;
|
||||
|
||||
if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
|
||||
- return -1;
|
||||
+ return GRUB_TERM_NO_KEY;
|
||||
at_key = grub_inb (KEYBOARD_REG_DATA);
|
||||
old_led = ps2_state.led_status;
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
From 9917f2b39a6a6cd1f8d3ec50773b445158f9b1ef Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chang <MChang@suse.com>
|
||||
Date: Tue, 5 Nov 2019 09:19:26 +0000
|
||||
Subject: [PATCH] hostdisk: Set linux file descriptor to O_CLOEXEC as default
|
||||
|
||||
We are often bothered by this sort of lvm warning while running grub-install
|
||||
every now and then:
|
||||
|
||||
File descriptor 4 (/dev/vda1) leaked on vgs invocation. Parent PID 1991: /usr/sbin/grub2-install
|
||||
|
||||
The requirement related to the warning is dictated in the lvm man page:
|
||||
|
||||
"On invocation, lvm requires that only the standard file descriptors stdin,
|
||||
stdout and stderr are available. If others are found, they get closed and
|
||||
messages are issued warning about the leak. This warning can be suppressed by
|
||||
setting the environment variable LVM_SUPPRESS_FD_WARNINGS."
|
||||
|
||||
While it could be disabled through settings, most Linux distributions seem to
|
||||
enable it by default and the justification provided by the developer looks to
|
||||
be valid to me: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466138#15
|
||||
|
||||
Rather than trying to close and reopen the file descriptor to the same file
|
||||
multiple times, which is rather cumbersome, for the sake of no vgs invocation
|
||||
could happen in between. This patch enables the close-on-exec flag (O_CLOEXEC)
|
||||
for new file descriptor returned by the open() system call, making it closed
|
||||
thus not inherited by the child process forked and executed by the exec()
|
||||
family of functions.
|
||||
|
||||
Fixes Debian bug #466138.
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=42acdd3b405c44d08439a3bbfdbd3466049d172d
|
||||
|
||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/osdep/linux/hostdisk.c | 3 +++
|
||||
grub-core/osdep/unix/hostdisk.c | 3 +++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/grub-core/osdep/linux/hostdisk.c b/grub-core/osdep/linux/hostdisk.c
|
||||
index 370d027..7bc99ac 100644
|
||||
--- a/grub-core/osdep/linux/hostdisk.c
|
||||
+++ b/grub-core/osdep/linux/hostdisk.c
|
||||
@@ -366,6 +366,9 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f
|
||||
#ifdef O_BINARY
|
||||
flags |= O_BINARY;
|
||||
#endif
|
||||
+#ifdef O_CLOEXEC
|
||||
+ flags |= O_CLOEXEC;
|
||||
+#endif
|
||||
|
||||
/* Linux has a bug that the disk cache for a whole disk is not consistent
|
||||
with the one for a partition of the disk. */
|
||||
diff --git a/grub-core/osdep/unix/hostdisk.c b/grub-core/osdep/unix/hostdisk.c
|
||||
index 9115096..3a00d74 100644
|
||||
--- a/grub-core/osdep/unix/hostdisk.c
|
||||
+++ b/grub-core/osdep/unix/hostdisk.c
|
||||
@@ -164,6 +164,9 @@ grub_util_fd_open (const char *os_dev, int flags)
|
||||
#ifdef O_BINARY
|
||||
flags |= O_BINARY;
|
||||
#endif
|
||||
+#ifdef O_CLOEXEC
|
||||
+ flags |= O_CLOEXEC;
|
||||
+#endif
|
||||
|
||||
return open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
|
||||
}
|
||||
--
|
||||
2.19.1
|
||||
|
||||
40
backport-0076-squash4-Fix-an-uninitialized-variable.patch
Normal file
40
backport-0076-squash4-Fix-an-uninitialized-variable.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From eb6d0ed961e6f83ea1cc8f8c81fdb4904a11d984 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 27 Jan 2020 15:01:16 -0500
|
||||
Subject: [PATCH] squash4: Fix an uninitialized variable
|
||||
|
||||
gcc says:
|
||||
|
||||
grub-core/fs/squash4.c: In function ‘direct_read’:
|
||||
grub-core/fs/squash4.c:868:10: error: ‘err’ may be used uninitialized in
|
||||
this function [-Werror=maybe-uninitialized]
|
||||
868 | if (err)
|
||||
| ^
|
||||
cc1: all warnings being treated as errors
|
||||
|
||||
This patch initializes it to GRUB_ERR_NONE.
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=598de14d9340137cd7c7a099e8ed53d97f1f68a0
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/fs/squash4.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/fs/squash4.c b/grub-core/fs/squash4.c
|
||||
index 7851238..a5f35c1 100644
|
||||
--- a/grub-core/fs/squash4.c
|
||||
+++ b/grub-core/fs/squash4.c
|
||||
@@ -769,7 +769,7 @@ direct_read (struct grub_squash_data *data,
|
||||
struct grub_squash_cache_inode *ino,
|
||||
grub_off_t off, char *buf, grub_size_t len)
|
||||
{
|
||||
- grub_err_t err;
|
||||
+ grub_err_t err = GRUB_ERR_NONE;
|
||||
grub_off_t cumulated_uncompressed_size = 0;
|
||||
grub_uint64_t a = 0;
|
||||
grub_size_t i;
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
From 0ffa81ce9e0395b113ca3903a064ff7bcdfb4454 Mon Sep 17 00:00:00 2001
|
||||
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
|
||||
Date: Mon, 23 Mar 2020 19:52:51 +0800
|
||||
Subject: [PATCH] efi/tpm: Fix memory leak in grub_tpm1/2_log_event()
|
||||
|
||||
The memory requested for the event is not released here,
|
||||
causing memory leaks. This patch fixes this problem.
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=800de4a1d0e72022694f8773ec5fe7dca8e34ae6
|
||||
|
||||
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
|
||||
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
|
||||
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/commands/efi/tpm.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/grub-core/commands/efi/tpm.c b/grub-core/commands/efi/tpm.c
|
||||
index 32909c1..6a6cd0d 100644
|
||||
--- a/grub-core/commands/efi/tpm.c
|
||||
+++ b/grub-core/commands/efi/tpm.c
|
||||
@@ -247,6 +247,7 @@ grub_tpm1_log_event (grub_efi_handle_t tpm_handle, unsigned char *buf,
|
||||
algorithm = TCG_ALG_SHA;
|
||||
status = efi_call_7 (tpm->log_extend_event, tpm, (grub_addr_t) buf, (grub_uint64_t) size,
|
||||
algorithm, event, &eventnum, &lastevent);
|
||||
+ grub_free (event);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
@@ -297,6 +298,7 @@ grub_tpm2_log_event (grub_efi_handle_t tpm_handle, unsigned char *buf,
|
||||
|
||||
status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, (grub_addr_t) buf,
|
||||
(grub_uint64_t) size, event);
|
||||
+ grub_free (event);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
--
|
||||
2.19.1
|
||||
|
||||
54
backport-0078-powerpc-mkimage-Fix-CHRP-note-descsz.patch
Normal file
54
backport-0078-powerpc-mkimage-Fix-CHRP-note-descsz.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From 0a18ad3787b0aca65a6a9e246f03d8dd89d9dfdc Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Axtens <dja@axtens.net>
|
||||
Date: Tue, 7 Apr 2020 16:17:26 +1000
|
||||
Subject: [PATCH] powerpc/mkimage: Fix CHRP note descsz
|
||||
|
||||
Currently, an image generated with 'grub-mkimage -n' causes an error when
|
||||
read with 'readelf -a':
|
||||
|
||||
Displaying notes found at file offset 0x000106f0 with length 0x0000002c:
|
||||
Owner Data size Description
|
||||
readelf: Warning: note with invalid namesz and/or descsz found at offset 0x0
|
||||
readelf: Warning: type: 0x1275, namesize: 0x00000008, descsize: 0x0000002c, alignment: 4
|
||||
|
||||
This is because the descsz of the CHRP note is set to
|
||||
sizeof (struct grub_ieee1275_note)
|
||||
which is the size of the entire note, including name and elf header. The
|
||||
desczs should contain only the contents, not the name and header sizes.
|
||||
|
||||
Set the descsz instead to 'sizeof (struct grub_ieee1275_note_desc)'
|
||||
|
||||
Resultant readelf output:
|
||||
|
||||
Displaying notes found at file offset 0x00010710 with length 0x0000002c:
|
||||
Owner Data size Description
|
||||
PowerPC 0x00000018 Unknown note type: (0x00001275)
|
||||
description data: ff ff ff ff 00 c0 00 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 40 00
|
||||
|
||||
So far as I can tell this issue has existed for as long as the note
|
||||
generation code has existed, but I guess nothing really checks descsz.
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=06fd69a3fd9d6b86e4a5af6c0d5da1b12545d27c
|
||||
|
||||
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
util/grub-mkimagexx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
|
||||
index 52bc9c8..00f49cc 100644
|
||||
--- a/util/grub-mkimagexx.c
|
||||
+++ b/util/grub-mkimagexx.c
|
||||
@@ -463,7 +463,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc
|
||||
grub_util_info ("adding CHRP NOTE segment");
|
||||
|
||||
note_ptr->header.n_namesz = grub_host_to_target32 (sizeof (GRUB_IEEE1275_NOTE_NAME));
|
||||
- note_ptr->header.n_descsz = grub_host_to_target32 (note_size);
|
||||
+ note_ptr->header.n_descsz = grub_host_to_target32 (sizeof (struct grub_ieee1275_note_desc));
|
||||
note_ptr->header.n_type = grub_host_to_target32 (GRUB_IEEE1275_NOTE_TYPE);
|
||||
strcpy (note_ptr->name, GRUB_IEEE1275_NOTE_NAME);
|
||||
note_ptr->descriptor.real_mode = grub_host_to_target32 (0xffffffff);
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
From c98fb6f044005e65186a9dd2964143cb5cadeaa9 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
Date: Mon, 25 May 2020 21:02:15 +0200
|
||||
Subject: [PATCH] efi/tpm: Fix typo in grub_efi_tpm2_protocol struct
|
||||
|
||||
Rename get_active_pcr_blanks() to get_active_pcr_banks().
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=1e81bf6d2dd57ddee7a24ca9a8b4cac7700d3dc4
|
||||
|
||||
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
---
|
||||
include/grub/efi/tpm.h | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/include/grub/efi/tpm.h b/include/grub/efi/tpm.h
|
||||
index 3ea6b4d..ec39725 100644
|
||||
--- a/include/grub/efi/tpm.h
|
||||
+++ b/include/grub/efi/tpm.h
|
||||
@@ -176,10 +176,10 @@ struct grub_efi_tpm2_protocol
|
||||
OutputParameterBlockSize,
|
||||
grub_efi_uint8_t *
|
||||
OutputParameterBlock);
|
||||
- grub_efi_status_t (*get_active_pcr_blanks) (struct grub_efi_tpm2_protocol *
|
||||
- this,
|
||||
- grub_efi_uint32_t *
|
||||
- ActivePcrBanks);
|
||||
+ grub_efi_status_t (*get_active_pcr_banks) (struct grub_efi_tpm2_protocol *
|
||||
+ this,
|
||||
+ grub_efi_uint32_t *
|
||||
+ ActivePcrBanks);
|
||||
grub_efi_status_t (*set_active_pcr_banks) (struct grub_efi_tpm2_protocol *
|
||||
this,
|
||||
grub_efi_uint32_t
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
From 2e5e020db1e1ced5038c5ca9b847f62a224383ff Mon Sep 17 00:00:00 2001
|
||||
From: Glenn Washburn <development@efficientek.com>
|
||||
Date: Tue, 8 Dec 2020 16:45:33 -0600
|
||||
Subject: [PATCH] misc: Add parentheses around ALIGN_UP() and ALIGN_DOWN()
|
||||
arguments
|
||||
|
||||
This ensures that expected order of operations is preserved when arguments
|
||||
are expressions.
|
||||
|
||||
Reference: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=8e8b2316acbaef8c4e6c0839cf27a42217dfb7c3
|
||||
|
||||
Signed-off-by: Glenn Washburn <development@efficientek.com>
|
||||
Reviewed-by: Patrick Steinhardt <ps@pks.im>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
include/grub/misc.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/grub/misc.h b/include/grub/misc.h
|
||||
index 998e47e..08ea894 100644
|
||||
--- a/include/grub/misc.h
|
||||
+++ b/include/grub/misc.h
|
||||
@@ -28,10 +28,10 @@
|
||||
#include <grub/compiler.h>
|
||||
|
||||
#define ALIGN_UP(addr, align) \
|
||||
- ((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1))
|
||||
+ (((addr) + (typeof (addr)) (align) - 1) & ~((typeof (addr)) (align) - 1))
|
||||
#define ALIGN_UP_OVERHEAD(addr, align) ((-(addr)) & ((typeof (addr)) (align) - 1))
|
||||
#define ALIGN_DOWN(addr, align) \
|
||||
- ((addr) & ~((typeof (addr)) align - 1))
|
||||
+ ((addr) & ~((typeof (addr)) (align) - 1))
|
||||
#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
|
||||
#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -343,3 +343,11 @@ Patch0342: backport-0069-kern-efi-Add-initial-stack-protector-implementation.pat
|
||||
Patch0343: backport-0070-util-mkimage-Remove-unused-code-to-add-BSS-section.patch
|
||||
Patch0344: backport-0071-util-mkimage-Use-grub_host_to_target32-instead-of-gr.patch
|
||||
Patch0345: backport-0072-kern-mm-Fix-grub_debug_calloc-compilation-error.patch
|
||||
Patch0346: backport-0073-grub-mkconfig-Fix-typo-in-help-output.patch
|
||||
Patch0347: backport-0074-at_keyboard-Fix-unreliable-key-presses.patch
|
||||
Patch0348: backport-0075-hostdisk-Set-linux-file-descriptor-to-O_CLOEXEC-as-d.patch
|
||||
Patch0349: backport-0076-squash4-Fix-an-uninitialized-variable.patch
|
||||
Patch0350: backport-0077-efi-tpm-Fix-memory-leak-in-grub_tpm1-2_log_event.patch
|
||||
Patch0351: backport-0078-powerpc-mkimage-Fix-CHRP-note-descsz.patch
|
||||
Patch0352: backport-0079-efi-tpm-Fix-typo-in-grub_efi_tpm2_protocol-struct.patch
|
||||
Patch0353: backport-0080-misc-Add-parentheses-around-ALIGN_UP-and-ALIGN_DOWN-.patch
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
Name: grub2
|
||||
Epoch: 1
|
||||
Version: 2.04
|
||||
Release: 15
|
||||
Release: 16
|
||||
Summary: Bootloader with support for Linux, Multiboot and more
|
||||
License: GPLv3+
|
||||
URL: http://www.gnu.org/software/grub/
|
||||
@ -449,6 +449,13 @@ rm -r /boot/grub2.tmp/ || :
|
||||
%{_datadir}/man/man*
|
||||
|
||||
%changelog
|
||||
* Tue Mar 30 2021 zhangqiumiao <zhangqiumiao1@huawei.com> - 2.04-16
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:backport some patches from upstream community and fix incorrect
|
||||
author names in patches
|
||||
|
||||
* Mon Mar 29 2021 zhangqiumiao <zhangqiumiao1@huawei.com> - 2.04-15
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user