summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-09-29 21:19:12 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2017-09-29 21:19:12 +0200
commita9b4126468e49b662c12d2d35251443a6d7a3192 (patch)
tree6ae92413b0771ec16b224aac6b0fabeb249e341a
parent87274893d81eda9315a7441ff49928a3a6741609 (diff)
9boot: limit read size to 4K for efi simple file system protocol
copying files from the uefi shell works, reading plan9.ini works, loading the kernel by calling Read to read in the DATA section of the kernel *FAILS*. my guess is that uefi filesystem driver or nvme driver tries to allocate a temporary buffer and hasnt got the space. limiting the read size fixes it.
-rw-r--r--sys/src/boot/efi/fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/boot/efi/fs.c b/sys/src/boot/efi/fs.c
index c6d2331a8..5a13b3b6a 100644
--- a/sys/src/boot/efi/fs.c
+++ b/sys/src/boot/efi/fs.c
@@ -71,7 +71,7 @@ fsread(void *f, void *data, int len)
{
UINTN size;
- size = len;
+ size = len > 4096 ? 4096 : len;
if(eficall(((EFI_FILE_PROTOCOL*)f)->Read, f, &size, data))
return 0;
return (int)size;