Hi Daniel,
> Reviewed-by: Daniel Kiper for both patches...
Thank you!
> I assume I can add your SOB on your behalf...
Oh! Yes! Sorry, 2 years of closed source development have apparently caused me
to lose my 'git commit -s' habits!
The sign-off for both patches is:
Signed-off-by:
ARRAY_SIZE is the count of elements, but the element size is 4 bytes, so
this was only initing the first 1/4th of the table. Detected with valgrind.
This should only matter in error paths, and I've not been able to identify
any actual misbehaviour that results from reading in-bounds but uninited
This isn't intended to be a functional change, but it makes a lot of failures a
lot
faster, which is extremely helpful for fuzzing.
Without this change, we keep trying and trying to read more bytes into our
buffer,
never being able to (read always returns 0) and so we just return old buffer
passes.
Daniel Axtens (2):
gzio: abort early when get_byte reads nothing
gzio: Properly init a table
grub-core/io/gzio.c | 55 -
1 file changed, 35 insertions(+), 20 deletions(-)
--
2.39.3 (Apple Git-145
bitrary input in all of grub.
For this series:
Tested-by: Daniel Axtens mailto:d...@axtens.net>> # fuzz
testing only
Kind regards,
Daniel
> Thanks,
> Gao Xiang
>
>> Yifan Zhao (2):
>> fs/erofs: Add support for EROFS
>> fs/erofs: Add tests for EROFS in grub-f
> There is the problem with the new bli module, that it requires the
> part_gpt module to be loaded beforehand, but the module dependency list
> for bli is emplty (see moddep.lst).
>
> The part_gpt module only exports one function,
> grub_gpt_partition_map_iterate(). This is not used in the bli
(Unless anything has changed dramatically in the last year:) Dependencies are
calculated automatically on the basis of symbols that you use in your module.
If you look at genmoddep.awk and work out from there you can get a handle on
the process. If you only use symbols provided by the ‘kernel’,
, that this would have been 2021-2022. The
code was released to a cross-company grub security working group at this time.
I left IBM in April 2022. Work subsequent to that is my own, and is unrelated
to my subsequent employer.
Signed-off-by: Daniel Axtens
---
.gitignore | 1
Large images mean large memory allocations, which could fail or at least be
very slow.
Also large images mean large files, which fuzzing generally cannot create.
Finally,
most parsing bugs (at least that we've found!) don't seem to rely on actually
large
images. So simply reduce the maximum
As with png, but this time testing jpeg.
Signed-off-by: Daniel Axtens
---
.gitignore | 1 +
Makefile.util.def | 21 +
grub-core/tests/fuzz/jpeg.c | 3 +++
3 files changed, 25 insertions(+)
create mode 100644 grub-core/tests/fuzz/jpeg.c
diff
This is basic documentation.
There are a few extra, super-hacky things we can do to get asan or afl++ going
which
are a bit too messy at the moment to commit to the docs. But, so as they are
not lost
to time, here's the invocations that currently work for me:
libfuzzer + ASan:
./configure
This is a cleaned up version of the fuzzers that I used to find
CVE-2021-3695, CVE-2021-3696 and CVE-2021-3697.
We're releasing this now because the techniques are not novel, the
code is not hard to independently replicate, and it's hard to see what
is gained by not releasing them. (I should add
If detected, COND_ENABLE_FUZZERS is set, which can be used in Makefile
templates.
This allows us to build libfuzzer fuzzers for parts of grub.
---
configure.ac | 32
1 file changed, 32 insertions(+)
diff --git a/configure.ac b/configure.ac
index
TGA, the only parser where I didn't find any memory-corruption bugs. Yet.
Signed-off-by: Daniel Axtens
---
.gitignore | 1 +
Makefile.util.def | 21 +
grub-core/tests/fuzz/tga.c | 3 +++
3 files changed, 25 insertions(+)
create mode 100644 grub
Oops. You're allowed to have up to n = NAT_JOURNAL_ENTRIES entries
_inclusive_, because the loop below uses i < n, not i <= n. D'oh.
Fixes: 4bd9877f6216 ("fs/f2fs: Do not read past the end of nat journal entries")
Reported-by: программист нект
Tested-by: программист нект
Signe
Steve McIntyre writes:
> Hi all!
>
> программист некто (in CC) reported this bug a few weeks back in
> Debian. Since I applied the bundle of filesystem bounds-checking fixes
> a few months back, he can't run grub-install. He's done the work to
> determine that the patch that breaks things for
Alec Brown writes:
> In grub-core/video/readers/jpeg.c, the function grub_jpeg_decode_huff_table()
> has the variable next_marker which reads data from grub_jpeg_get_word() and
> then uses it as an upper limit in a while loop. However, the function isn't
> checking that next_marker is within the
ons.
1024 is a bit arbitrary, yes, and I feel a bit like I'm tempting fate
here, but I think 1024 disks in an array (that grub has to read to boot!)
should be enough for anyone.
Signed-off-by: Daniel Axtens
---
v2: add a minimum of 1 disk as nmemb is a signed integer.
Tested with `./grub-fs-tes
Patrick Steinhardt writes:
> On Thu, Sep 22, 2022 at 05:59:34PM +0200, Daniel Kiper wrote:
>> Adding some folks who may be interested in this thing too...
>>
>> On Tue, Sep 20, 2022 at 12:30:30AM +1000, Daniel Axtens wrote:
>> > We have multiple reports of things b
We have multiple reports of things being slower with a 1MB initial static
allocation, and a report (more difficult to nail down) of a boot failure
as a result of the smaller initial allocation.
Make the initial memory allocation 32MB.
Signed-off-by: Daniel Axtens
---
grub-core/kern/efi/mm.c
"Vladimir 'phcoder' Serbinenko" writes:
> Le ven. 26 août 2022, 15:47, Daniel Axtens a écrit :
>
>> Let me answer this out of order.
>>
>> > I understand the need to sometimes get rid of old code, but since the HFS
>> > module can be blacklisted a
Let me answer this out of order.
> I understand the need to sometimes get rid of old code, but since the HFS
> module can be blacklisted as Vladimir explains, I don't really understand
> the reasoning in this particular case.
I want _all_ grub code to reach a minimum standard of not crashing or
Hector Martin writes:
> On 21/08/2022 21.35, Daniel Axtens wrote:
>> Hi Hector,
>>
>> Thanks for your patch and for taking the trouble to put it together.
>>
>>> GRUB is already running out of memory on Apple M1 systems, causing
>>> graphics init
Daniel Axtens writes:
> This is 'belt and braces' with the last fix: we end up trying to use
> too much memory in situations like corrupted Linux software raid setups
> purporting to usew a huge number of disks. Simply refuse to permit such
> configurations.
>
> 1024 is a
Hi Hector,
Thanks for your patch and for taking the trouble to put it together.
> GRUB is already running out of memory on Apple M1 systems, causing
> graphics init to fail, as of the latest Git changes. Since dynamic
> growing of the heap isn't done yet, double the default heap size for
> now.
fate
here, but I think 1024 disks in an array (that grub has to read to boot!)
should be enough for anyone.
Signed-off-by: Daniel Axtens
---
grub-core/disk/diskfilter.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c
index
-by: Daniel Axtens
---
grub-core/disk/diskfilter.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c
index 2edcff6e8987..4ac50320ef4e 100644
--- a/grub-core/disk/diskfilter.c
+++ b/grub-core/disk/diskfilter.c
@@ -1163,6 +1163,9
"Vladimir 'phcoder' Serbinenko" writes:
> No go from me either. Older macs may not be able to read HFS+ /boot. Also
> HFS+ presents couple of problems the biggest one is that in case of sudden
> reboot HFS+ often needs to be mounted by OSX or cleaning dirty flag
> manually before it becomes
>> As Daniel Axtens has been finding out, the HFS code is terrible in
>> terms of security. If you still need it for old/semi-dead machines,
>> maybe you should fork an older grub release and stay with that?
>
> I don't know what should be the deal with the security of a bo
weeks I will
>>> >>> merge this patch or a variant of it in the second half of September.
>>> >>
>>> >> We’re still formatting our /boot partitions for Debian PowerPC for
>>> >> PowerMacs using HFS, so this change would be a breaking change for
John Paul Adrian Glaubitz writes:
>> On Aug 19, 2022, at 3:59 PM, Daniel Kiper wrote:
>>
>> On Fri, Aug 19, 2022 at 11:38:26PM +1000, Daniel Axtens wrote:
>>> HFS is so so very old now. According to Wikipedia, HFS was
>>> introduced in 1985 and the success
would have
been part of the HFS->HFS+ transition, but I'm not really game to
mess with either, in particular as macbless writes(!) to disk live.
(I'm fairly sure the grub-macbless tool invokes code from the
macbless module as well.)
Signed-off-by: Daniel Axtens
---
`make check` is unc
zeof(struct option_vector5) - 2,
> +.vec5 = {
> + 0, 0, 0, 0, 0, 0, 0, 0, 256
This maybe should be indented 6 spaces instead of 1 tab? But I wouldn't
do a whole new revision just for this.
Acked-by: Daniel Axtens
Kind regards,
Daniel
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
Hi,
Sorry, I missed this as well - my otherwise lovely threaded email client
doesn't sort on the basis of most recent message, but thread start date.
> root@ibook-g4-14:/home/glaubitz/grub# grub-install -d ./grub-core
> --macppc-directory=/boot/grub --no-nvram
> Installing for powerpc-ieee1275
Hi Michael,
apologies for the delay, I've left IBM and am taking a while to get back
on my feet.
> On Thu, Apr 21, 2022 at 09:32:41PM +1000, Daniel Axtens wrote:
>> Hi,
>>
>> >> This code allows us to parse:
>> >>
>> >> - PKCS#7 signedD
^^
> This should be updated I suppose.
So this is - surprisingly - still accurate! We still only support 1
_Extended_ Key Usage. The change that we made as a result of SUSE's bug
report was to support additional regular, non-extended key
usages. Here's the cha
This explains how appended signatures can be used to form part of
a secure boot chain, and documents the commands and variables
introduced.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
v3: fix CR->LF, thanks Stefan Berger.
v2: fix a grammar issue, thanks Stefan Berger.
---
d
These tests are run through all_functional_test and test a range
of commands and behaviours.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
v3: clean up error codes at the start, fix copyright headers.
v2 changes:
- add a test for EKU
- add tests for files signed
/blob/857543cc24114431dd5dde0e83c2c44b9b7e6050/lib/gnutls_asn1_tab.c
-
https://github.com/gnutls/gnutls/blob/857543cc24114431dd5dde0e83c2c44b9b7e6050/lib/pkix_asn1_tab.c
The GNUTLS license is LGPLv2.1+, which is GPLv3 compatible, allowing
us to import it without issue.
Signed-off-by: Daniel
Trying to start grub-emu with a module that calls grub_dl_set_persistent
will crash because grub-emu fakes modules and passes NULL to the module
init function.
Provide an empty function for the emu case.
Fixes: ee7808e2197c (dl: Add support for persistent modules)
Signed-off-by: Daniel Axtens
avoid the need for minmax.h,
which is convenient because it means we don't have to
import it from gnulib.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
grub-core/lib/libtasn1/lib/coding.c| 12 ++--
grub-core/lib/libtasn1/lib/decoding.c | 2 ++
grub-core/lib/libtasn1/lib
Signing grub for firmware that verifies an appended signature is a
bit fiddly. I don't want people to have to figure it out from scratch
so document it here.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
docs/grub.texi | 42 ++
1 file
also use that value.
- Provide strto[u]l[l] preprocessor macros that resolve to
grub_strto[u]l[l]. To avoid gcrypt redefining strtoul, we
also define HAVE_STRTOUL here.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
grub-core/lib/posix_wrap/limits.h| 1 +
grub-core/lib
Before adding information about how grub is signed with an appended
signature scheme, it's worth adding some information about how it
can currently be signed for UEFI.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
docs/grub.texi | 22 +-
1 file changed, 21
module.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
grub-core/Makefile.core.def | 8 +
grub-core/commands/pgp.c| 28 ++
grub-core/lib/pkcs1_v15.c | 59 +
include/grub/pkcs1_v15.h| 27 +
4 files changed
e appended signature
structure (not at the end) so that the final bytes of a signed ELF file
are the appended signature magic.
A subsequent patch documents how to create a grub core.img validly signed
under this scheme.
Signed-off-by: Daniel Axtens
Signed-off-by: Rashmica Gupta
---
You can exper
Daniel Axtens (17):
docs/grub: Document signing grub under UEFI
docs/grub: Document signing grub with an appended signature
dl: provide a fake grub_dl_set_persistent for the emu target
pgp: factor out rsa_pad
crypto: move storage for grub_crypto_pk_* to crypto.c
posix_wrap: tweaks
.
Signed-off-by: Alastair D'Silva
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
grub-core/commands/pgp.c| 2 +-
include/grub/kernel.h | 3 ++-
include/grub/util/install.h | 7 +--
util/grub-install-common.c | 22 +++-
util/grub-mkimage.c | 15
Create a wrapper file that specifies the module license.
Set up the makefile so it is built.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
v3: Proper copyright headers.
---
grub-core/Makefile.core.def| 15 +++
grub-core/lib/libtasn1_wrap/wrap.c | 27
If the 'ibm,secure-boot' property of the root node is 2 or greater,
enter lockdown.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
docs/grub.texi | 4 ++--
grub-core/Makefile.core.def| 1 +
grub-core/kern/ieee1275/init.c | 27
pher handle. That depends on grub_ciphers being populated
by people calling grub_cipher_register. import_gcry.py ensures that the
symmetric ciphers call it.]
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
grub-core/commands/pgp.c | 4
grub-core/lib/crypto.c | 4
2 f
Signed-off-by: Daniel Axtens
---
v3 changes:
- fix nits from Stefan
- correct copyright headers
- fixes for libtasn1-4.18.0
- Roll in a fix for a bug reported by Michal:
Currently the x509 certificate parser for appended signature
verification requires that the certificate have the Digitial
, such as a password or lockdown, must be used to ensure
that a user cannot drop to the grub shell and disable verification.
Signed-off-by: Daniel Axtens
---
v3: Correct copyright header, fix some nits from Stefan.
v2 changes:
- Improve x509 parser function name
- Constify data parameters
on 32 bit platforms.
Signed-off-by: Daniel Axtens
Reviewed-by: Stefan Berger
---
v2: Clean up strcat handling, thanks Stefan Berger.
---
grub-core/lib/libtasn1/lib/decoding.c | 11 +-
grub-core/lib/libtasn1/lib/element.c| 3 ++-
grub-core/lib/libtasn1/lib/gstr.c | 4 ++--
gru
le
>> +
>> +Refer to the section on password-protecting GRUB (@pxref{Authentication
>> +and authorisation}) for more information on preventing this.
>> +
>> +Additionally, special care must be taken around the @command{loadenv}
>> command,
>> +which can be used to turn off @code{check_appended_signature}.
>> +
>> @node UEFI secure boot and shim
>> @section UEFI secure boot and shim support
>>
>
>
> With this nit fixed: Reviewed-by: Stefan Berger
Thanks!
Kind regards,
Daniel Axtens
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
);
+#endif
void grub_mm_init_region (void *addr, grub_size_t size);
void *EXPORT_FUNC(grub_calloc) (grub_size_t nmemb, grub_size_t size);
I've updated by GH branches.
Daniel K, are you right to fold this in when you merge this?
Kind regards,
Daniel
Daniel Axtens writes:
> From: Patrick Steinha
>> +static enum
>> +{ check_sigs_no = 0,
>
>
> nit: newline after '{'
>
fixed
>
>> + check_sigs_enforce = 1,
>> + check_sigs_forced = 2
>> +} check_sigs = check_sigs_no;
>
>
> What does 'forced' mean?
It means that it cannot be turned of with `set check_appended_signatures=0`
at the grub
Stefan Berger writes:
> On 6/30/21 4:40 AM, Daniel Axtens wrote:
>
>> This code allows us to parse:
>>
>> - PKCS#7 signedData messages. Only a single signerInfo is supported,
>> which is all that the Linux sign-file utility supports creating
>> out-o
Stefan Berger writes:
> On 6/30/21 4:40 AM, Daniel Axtens wrote:
>> Do a few things to make libtasn1 compile as part of grub:
>>
>> - redefine _asn1_strcat. grub removed strcat so replace it with the
>> appropriate calls to memcpy and strlen. Use this int
there's not
enough pages available in the current heap.
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
grub-core/kern/efi/mm.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/grub-core/kern/efi/mm.c b/grub-core
.
Allow other space to be allocated at runtime.
Tested-by: Stefan Berger
Signed-off-by: Daniel Axtens
---
v2: reformat, rework and explain better, add debug prints with
grub_dprintf
---
docs/grub-dev.texi | 7 +-
grub-core/kern/ieee1275/init.c | 267
large allocations:
- how much memory can we allocate in one chunk?
- how many 1MB chunks can we allocate?
- check that gap-filling works with a 1MB aligned 900kB alloc + a
100kB alloc.
Signed-off-by: Daniel Axtens
---
I haven't addressed most of the change requests yet. This will need
.
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
grub-core/kern/efi/mm.c | 35 +++
1 file changed, 3 insertions(+), 32 deletions(-)
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index d8e4114541a4
or pseries) or under PFW for Power8.
I don't have access to old Mac hardware, but if anyone feels especially
strongly we can put it under some feature flag. I really want to disable
it under pseries because it will mess with region merging.
Signed-off-by: Daniel Axtens
---
grub-core/kern/ieee1275/
berately lower
the amount of memory your partition has below 512MB.)
Signed-off-by: Daniel Axtens
---
v2: reformat
v3: extend to option vectors 3 & 4
I wrongly assumed that the most compatible way to perform CAS
negotiation was to only set the minimum number of vectors required
to ask for m
with `grub_dl_unload_unneeded()`
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
grub-core/kern/dl.c | 20
grub-core/kern/mm.c | 8
include/grub/dl.h | 1 -
3 files changed, 29 deletions(-)
diff --git a/grub-core/kern/dl.c b/grub-core
()` in case
`grub_efi_mm_add_regions ()` returns an error.
Signed-off-by: Patrick Steinhardt
[dja: clarify error messages]
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
v2: Thank you Glenn and Daniel K for the feedback.
This and all EFI changes were not tested on real hardware
From: Patrick Steinhardt
In preparation of support for runtime-allocating additional memory
region, this patch extracts the function to retrieve the EFI memory map
and add a subset of it to GRUB's own memory regions.
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
Reviewed
This is handy for debugging. Enable with `set debug=regions`.
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
grub-core/kern/mm.c | 19 ---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
index 6e4e8f325a05
message to be displayed in the Linux kernel log. Those users will
have to update their machines to the firmware levels mentioned
above.
Cc: Eric Snowberg
Signed-off-by: Stefan Berger
Signed-off-by: Daniel Axtens
---
docs/grub.texi| 3 +-
grub-core/Makefile.core.def
implicit here: rather than changing
grub_mm_region_init() to ALIGN_UP(), require that the struct is
explictly a multiple of the header size.
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
v2: Thanks Daniel K for feedback.
---
include/grub/mm_private.h | 14 ++
1 file
that are not multiples
of GRUB_MM_ALIGN.
* Allow merging of regions immediately _after_ existing regions, not
just before. As with the other approach, we create an allocated
block to represent the new space and the pass it to grub_free() to
get the metadata right.
Signed-off-by: Daniel Axtens
Tested
, in hopes that region merging means that we end up
with enough memory for things to work out.
Signed-off-by: Patrick Steinhardt
[dja: add this to the documentation at the top of mm.c
v2: fallback to non-contiguous]
Signed-off-by: Daniel Axtens
Tested-by: Stefan Berger
Reviewed-by: Daniel
This breaks the tests on pseries - just restrict it to x86 platforms
that don't specify a BIOS.
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
v2: Thanks Daniel K and Glenn for feedback.
---
tests/util/grub-shell.in | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff
-specific patches only.
Kind regards,
Daniel
Daniel Axtens (8):
grub-shell: only pass SeaBIOS fw_opt in for x86 BIOS platforms
mm: assert that we preserve header vs region alignment
mm: when adding a region, merge with region after as well as before
mm: debug support for region operations
there's not
enough pages available in the current heap.
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
grub-core/kern/efi/mm.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/grub-core/kern/efi/mm.c b/grub-core
This is handy for debugging. Enable with `set debug=regions`.
Signed-off-by: Daniel Axtens
---
grub-core/kern/mm.c | 19 ---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
index 94e78f9a910d..f36499865632 100644
large allocations:
- how much memory can we allocate in one chunk?
- how many 1MB chunks can we allocate?
- check that gap-filling works with a 1MB aligned 900kB alloc + a
100kB alloc.
Signed-off-by: Daniel Axtens
---
I haven't addressed most of the change requests yet. This will need
.
Allow other space to be allocated at runtime.
Tested-by: Stefan Berger
Signed-off-by: Daniel Axtens
---
v2: reformat, rework and explain better, add debug prints with
grub_dprintf
---
docs/grub-dev.texi | 7 +-
grub-core/kern/ieee1275/init.c | 267
message to be displayed in the Linux kernel log. Those users will
have to update their machines to the firmware levels mentioned
above.
Cc: Eric Snowberg
Signed-off-by: Stefan Berger
Signed-off-by: Daniel Axtens
---
docs/grub.texi| 3 +-
grub-core/Makefile.core.def
ize - it persists even on cold boots.
So if you've ever booted Linux in a partition, you'll probably never have
grub call CAS. It'll only ever fire the first time a partition loads grub,
or if you deliberately lower the amount of memory your partition has below
512MB.)
Signed-off-by: Daniel Axtens
or pseries) or under PFW for Power8.
I don't have access to old Mac hardware, but if anyone feels especially
strongly we can put it under some feature flag. I really want to disable
it under pseries because it will mess with region merging.
Signed-off-by: Daniel Axtens
---
grub-core/kern/ieee1275/
()` in case
`grub_efi_mm_add_regions ()` returns an error.
Signed-off-by: Patrick Steinhardt
[dja: clarify error messages]
Signed-off-by: Daniel Axtens
---
v2: Thank you Glenn and Daniel K for the feedback.
This and all EFI changes were not tested on real hardware.
---
grub-core/kern/efi/mm.c | 22
From: Patrick Steinhardt
In preparation of support for runtime-allocating additional memory
region, this patch extracts the function to retrieve the EFI memory map
and add a subset of it to GRUB's own memory regions.
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
---
grub
.
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
grub-core/kern/efi/mm.c | 35 +++
1 file changed, 3 insertions(+), 32 deletions(-)
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index d8e4114541a4
, in hopes that region merging means that we end up
with enough memory for things to work out.
Tested-by: Stefan Berger
Signed-off-by: Patrick Steinhardt
[dja: add this to the documentation at the top of mm.c
v2: fallback to non-contiguous]
Signed-off-by: Daniel Axtens
---
Daniel K: you
with `grub_dl_unload_unneeded()`
Signed-off-by: Patrick Steinhardt
Signed-off-by: Daniel Axtens
Reviewed-by: Daniel Kiper
---
grub-core/kern/dl.c | 20
grub-core/kern/mm.c | 8
include/grub/dl.h | 1 -
3 files changed, 29 deletions(-)
diff --git a/grub-core/kern/dl.c b/grub-core
This breaks the tests on pseries - just restrict it to x86 platforms
that don't specify a BIOS.
Signed-off-by: Daniel Axtens
---
v2: Thanks Daniel K and Glenn for feedback.
---
tests/util/grub-shell.in | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/util/grub
-by: Daniel Axtens
---
v2: Thanks Daniel K for feedback.
---
grub-core/kern/mm.c | 123 +++---
include/grub/mm_private.h | 9 +++
2 files changed, 85 insertions(+), 47 deletions(-)
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
index 079c28da7cdf
implicit here: rather than changing
grub_mm_region_init() to ALIGN_UP(), require that the struct is
explictly a multiple of the header size.
Signed-off-by: Daniel Axtens
---
v2: Thanks Daniel K for feedback.
---
include/grub/mm_private.h | 14 ++
1 file changed, 14 insertions(+)
diff
in the patch.
I've also included Stefan's vTPM patch - Stefan kindly tested that his patch
worked with my memory rework series. I have added his tested-by to relevant
Power-specific patches only.
Kind regards,
Daniel
Daniel Axtens (8):
grub-shell: pseries: don't pass fw_opt to qemu
mm: assert
>>/* Prepare a memory region to store two memory maps. */
>>memory_map = grub_efi_allocate_any_pages (2 * BYTES_TO_PAGES
>> (MEMORY_MAP_SIZE));
>>if (! memory_map)
>> -grub_fatal ("cannot allocate memory");
>> +return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate
> s/struct grub_mm_region/grub_mm_region_t/
> s/struct grub_mm_header/grub_mm_header_t/
The problem is that grub_mm_{region,header}_t is a pointer type, not a
struct type. So sizeof (grub_mm_region_t) == sizeof(void *). You also
can't do sizeof (*grub_mm_region_t), because you can't dereference
nb->data > nb->tail, which should not be.
Make grub_netbuff_pull check against both nb->tail and nb->end. In theory just
checking against ->tail should be sufficient but the extra check should be
cheap and seems like good defensive practice.
Signed-off-by: Daniel Axtens
Hi,
I tested this against grub-emu and it fixed the crash I had observed.
net_ls_addr reports an address as expected now also.
Reviewed-by: Daniel Axtens
Kind regards,
Daniel
Qiumiao Zhang via Grub-devel writes:
> During UEFI PXE boot in IPv6 network, if the DHCP server adopts state
dja@sauce ~]$ date -u
>> Tue Feb 8 04:46:40 UTC 2022
>>
>> After applying the patch, grub printed:
>>
>> grub> date
>> 2022-02-08 04:51:27 Tuesday
>>
>> It seems the patch makes things better.
>
> Great thanks Daniel for confirming this.
se, before
the patch, grub printed:
grub> date
2022-02-09 04:31:10 Wednesday
whereas on booting:
[dja@sauce ~]$ date -u
Tue Feb 8 04:46:40 UTC 2022
After applying the patch, grub printed:
grub> date
2022-02-08 04:51:27 Tuesday
It seems the patch makes things better.
Tested-by: Dani
Daniel Kiper writes:
> On Thu, Nov 25, 2021 at 02:22:49AM +1100, Daniel Axtens wrote:
>> grub_mm_init_region does some things that seem magical, especially
>> around region merging. Make it a bit clearer.
>>
>> Signed-off-by: Daniel Axtens
>>
/mm.c (grub_real_malloc): Decrease
cut-off of moving the")
Signed-off-by: Daniel Axtens
---
grub-core/kern/mm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
index 6efabe92df0e..ac41cf4aab15 100644
--- a/grub-core/kern/mm.c
+++ b/grub-core
Document that.
Signed-off-by: Daniel Axtens
---
grub-core/kern/mm.c | 76 -
1 file changed, 41 insertions(+), 35 deletions(-)
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
index c070afc621f8..6efabe92df0e 100644
--- a/grub-core/kern/mm.c
+++ b/
1 - 100 of 274 matches
Mail list logo