summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2013-09-20 11:23:28 -0500
committerSteve Langasek <steve.langasek@canonical.com>2013-09-20 11:23:28 -0500
commit50ab550ada429a1406a558f11ae4f1da624aa99c (patch)
treec6f84e087a79242cd89e2beb422550b0fa40af0d
parent4c13d15aab533c657fd9af27ec0bb0140b00c5e3 (diff)
downloadefi-boot-shim-50ab550ada429a1406a558f11ae4f1da624aa99c.tar.gz
efi-boot-shim-50ab550ada429a1406a558f11ae4f1da624aa99c.zip
debian/patches/fix-tftp-prototype: pass the right arguments to
EFI_PXE_BASE_CODE_TFTP_READ_FILE.
-rw-r--r--.pc/applied-patches1
-rw-r--r--debian/changelog7
-rw-r--r--debian/patches/fix-tftp-prototype42
-rw-r--r--debian/patches/series1
-rw-r--r--netboot.c4
-rw-r--r--shim.c2
6 files changed, 54 insertions, 3 deletions
diff --git a/.pc/applied-patches b/.pc/applied-patches
index c07f3b5c..6e35cc4f 100644
--- a/.pc/applied-patches
+++ b/.pc/applied-patches
@@ -3,3 +3,4 @@ second-stage-path
sbsigntool-not-pesign
no-output-by-default.patch
no-print-on-unsigned
+fix-tftp-prototype
diff --git a/debian/changelog b/debian/changelog
index b323a2b3..a32df9ce 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+shim (0.4-0ubuntu4) UNRELEASED; urgency=low
+
+ * debian/patches/fix-tftp-prototype: pass the right arguments to
+ EFI_PXE_BASE_CODE_TFTP_READ_FILE.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 20 Sep 2013 14:43:23 +0000
+
shim (0.4-0ubuntu3) saucy; urgency=low
[ Steve Langasek ]
diff --git a/debian/patches/fix-tftp-prototype b/debian/patches/fix-tftp-prototype
new file mode 100644
index 00000000..ba500cb5
--- /dev/null
+++ b/debian/patches/fix-tftp-prototype
@@ -0,0 +1,42 @@
+Description: 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.
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+
+=== modified file 'netboot.c'
+--- a/netboot.c 2013-05-31 19:34:11 +0000
++++ b/netboot.c 2013-09-20 16:07:27 +0000
+@@ -326,7 +326,7 @@
+ return rc;
+ }
+
+-EFI_STATUS FetchNetbootimage(EFI_HANDLE image_handle, VOID **buffer, UINTN *bufsiz)
++EFI_STATUS FetchNetbootimage(EFI_HANDLE image_handle, VOID **buffer, UINT64 *bufsiz)
+ {
+ EFI_STATUS rc;
+ EFI_PXE_BASE_CODE_TFTP_OPCODE read = EFI_PXE_BASE_CODE_TFTP_READ_FILE;
+@@ -344,7 +344,7 @@
+
+ try_again:
+ rc = uefi_call_wrapper(pxe->Mtftp, 10, pxe, read, *buffer, overwrite,
+- &bufsiz, &blksz, &tftp_addr, full_path, NULL, nobuffer);
++ bufsiz, &blksz, &tftp_addr, full_path, NULL, nobuffer);
+
+ if (rc == EFI_BUFFER_TOO_SMALL) {
+ /* try again, doubling buf size */
+
+=== modified file 'shim.c'
+--- a/shim.c 2013-08-08 15:12:06 +0000
++++ b/shim.c 2013-09-20 16:12:39 +0000
+@@ -1161,7 +1161,7 @@
+ EFI_DEVICE_PATH *path;
+ CHAR16 *PathName = NULL;
+ void *sourcebuffer = NULL;
+- UINTN sourcesize = 0;
++ UINT64 sourcesize = 0;
+ void *data = NULL;
+ int datasize;
+
+
diff --git a/debian/patches/series b/debian/patches/series
index c07f3b5c..6e35cc4f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ second-stage-path
sbsigntool-not-pesign
no-output-by-default.patch
no-print-on-unsigned
+fix-tftp-prototype
diff --git a/netboot.c b/netboot.c
index c44aeac5..66300d6d 100644
--- a/netboot.c
+++ b/netboot.c
@@ -326,7 +326,7 @@ EFI_STATUS parseNetbootinfo(EFI_HANDLE image_handle)
return rc;
}
-EFI_STATUS FetchNetbootimage(EFI_HANDLE image_handle, VOID **buffer, UINTN *bufsiz)
+EFI_STATUS FetchNetbootimage(EFI_HANDLE image_handle, VOID **buffer, UINT64 *bufsiz)
{
EFI_STATUS rc;
EFI_PXE_BASE_CODE_TFTP_OPCODE read = EFI_PXE_BASE_CODE_TFTP_READ_FILE;
@@ -344,7 +344,7 @@ EFI_STATUS FetchNetbootimage(EFI_HANDLE image_handle, VOID **buffer, UINTN *bufs
try_again:
rc = uefi_call_wrapper(pxe->Mtftp, 10, pxe, read, *buffer, overwrite,
- &bufsiz, &blksz, &tftp_addr, full_path, NULL, nobuffer);
+ bufsiz, &blksz, &tftp_addr, full_path, NULL, nobuffer);
if (rc == EFI_BUFFER_TOO_SMALL) {
/* try again, doubling buf size */
diff --git a/shim.c b/shim.c
index bfb6b0bd..ab6c9ee8 100644
--- a/shim.c
+++ b/shim.c
@@ -1161,7 +1161,7 @@ EFI_STATUS start_image(EFI_HANDLE image_handle, CHAR16 *ImagePath)
EFI_DEVICE_PATH *path;
CHAR16 *PathName = NULL;
void *sourcebuffer = NULL;
- UINTN sourcesize = 0;
+ UINT64 sourcesize = 0;
void *data = NULL;
int datasize;