Commit Graph

26 Commits

Author SHA1 Message Date
Fabian Grünbichler
b017e4554b New upstream version 16.0 2025-03-24 10:18:24 +01:00
Steve McIntyre
a075e58606 New upstream version 15.8 2024-02-17 17:35:37 +00:00
Steve McIntyre
8529e0f7f7 New upstream version 15.5 2022-04-27 22:41:59 +01:00
Steve McIntyre
031e5cce38 New upstream version 15.3 2021-03-23 23:49:46 +00:00
Mathieu Trudel-Lapierre
f892ac6608 New upstream version 15+1531942534.dd3230d 2018-07-24 16:24:23 -04:00
Mathieu Trudel-Lapierre
b6f94dbeac New upstream version 13~git1505328970.9c1c35c5 2017-09-13 12:09:40 -07:00
Mathieu Trudel-Lapierre
62f0afa2ec Import upstream version 0.9+1474479173.6c180c6 2016-09-21 20:29:42 -04:00
Peter Jones
159609ee4e Correctly reject bad tftp addresses earlier, rather than later.
This check is for end == NULL but was meant to be *end == '\0'.  Without
this change, we'll pass a plausibly bad address (i.e. one with no ']' at
the end) to Mtftp(... READ_FILE ...), which should fail correctly, but
our error messaging will be inconsistent.

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-10-02 01:01:54 -04:00
Sebastian Krahmer
f6bff34f51 shim buffer overflow on ipv6 option parsing 2014-10-02 01:01:54 -04:00
Ard Biesheuvel
f7a182154e Factor out x86-isms and add cross compile support
This patch cleans up and refactors the Makefiles to better allow new
architectures to be added:
- remove unused Makefile definitions
- import Makefile definitions from top level rather than redefining
- move x86 specific CFLAGS to inside ifeq() blocks
- remove x86 inline asm
- allow $(FORMAT) to be overridden: this is necessary as there exists no
  EFI or PE/COFF aware objcopy for ARM

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2014-08-12 10:54:05 -04:00
Gary Ching-Pang Lin
da49ac6d69 Fetch the netboot image from the same device
The previous strategy is to locate the first available PXE_BASE_CODE
protocol and to fetch the second stage image from it, and this may
cause shim to fetch the wrong second stage image, i.e. grub.efi.

Consider the machine with the following boot order:
1. PXE Boot
2. Hard Drive

Assume that the EFI image, e.g. bootx64.efi, in the PXE server is
broken, then "PXE Boot" will fail and fallback to "Hard Drive". While
shim.efi in "Hard Drive" is loaded, it will find the PXE protocol is
available and fetch grub.efi from the PXE server, not grub.efi in the
disk.

This commit checks the DeviceHandle from Loaded Image. If the device
supports PXE, then shim fetches grub.efi with the PXE protocol. Otherwise,
shim loads grub.efi from the disk.

Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2014-06-25 09:53:23 -04:00
Peter Jones
e724cfb1bf Lengths that might be -1 can't be unsigned, Peter.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-11-21 11:48:24 -05:00
Peter Jones
d9355ab635 Fix path generation for Dhcpv4 bootloader.
Right now we always look for e.g. "\grubx64.efi", which is completely
wrong.  This makes it look for the path shim was loaded from and modify
that to end in a sanitized version of our default loader name.

Resolves: rhbz#1032583

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-11-21 11:48:24 -05:00
Peter Jones
cb89c25aeb Use CHAR8 not UINT8 for character work.
This gets rid of a lot of type casting that we don't need, and helps
reduce warnings when I switch a bunch of gnu-efi stuff to taking const
arguments.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-02 10:46:26 -04:00
Peter Jones
e053c22701 Since different distros name grub*.efi differently, make it compile-time.
Basically, if you don't want grub.efi, you do:

make 'DEFAULT_LOADER=\\\\grubx64.efi'

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-09-26 11:58:02 -04:00
Gary Ching-Pang Lin
bd145c6082 Define the PXE 2nd stage loader in the beginning of the file
Make it easier to change the PXE 2nd stage loader.

Conflicts:
	netboot.c
2013-09-26 11:58:02 -04:00
Steve Langasek
5ccacd3a48 Fix a memory leak 2013-09-24 12:05:51 -04:00
Steve Langasek
69a54db486 Correct limits on the length of ipv6 addresses
The maximum length of a string representation of an ipv6 address is 39
characters (8 groups of 4 hex chars, with 7 colons in between).  So don't
allocate more room than this - and more importantly, don't blindly accept
strings from the server that are longer than our buffer...
2013-09-24 12:05:47 -04:00
Steve Langasek
af049ff457 More consistent types, fewer casts 2013-09-24 12:05:38 -04:00
Steve Langasek
6eaa1a9c9e Misc allocation cleanups 2013-09-24 12:05:34 -04:00
Steve Langasek
3816832bc5 Fix an off-by-one error
We don't need to add one because our end pointer is already off the end of
the string we want to copy.
2013-09-24 12:05:31 -04:00
Steve Langasek
e2979f2c5f Fix nul termination errors in filenames passed to tftp
Fix various errors in the tftp string handling, to ensure we always have
properly nul-terminated strings.
2013-09-24 12:05:28 -04:00
Steve Langasek
fbc486b50d Pass the right arguments to EFI_PXE_BASE_CODE_TFTP_READ_FILE
A wrong pointer was being passed to EFI_PXE_BASE_CODE_TFTP_READ_FILE,
preventing us from getting the file size back from the tftp call, ensuring
that we don't have enough information to properly secureboot-validate the
retrieved image.
2013-09-24 12:05:21 -04:00
Peter Jones
6cd79ef950 EFI_PXE_BASE_CODE_DHCPV6_PACKET is in gnu-efi-3.0t 2013-05-31 15:34:11 -04:00
Matthew Garrett
e4d55afe6a Don't fail if there's no network devices
findNetboot() would continue blindly even if no PXE-capable devices were
found. Fix that.
2012-11-01 16:03:24 -04:00
Matthew Garrett
1c5957068f Add draft version of Neil's netboot code 2012-10-12 20:14:14 -04:00