diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-09-29 21:19:12 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-09-29 21:19:12 +0200 |
commit | a9b4126468e49b662c12d2d35251443a6d7a3192 (patch) | |
tree | 6ae92413b0771ec16b224aac6b0fabeb249e341a | |
parent | 87274893d81eda9315a7441ff49928a3a6741609 (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.c | 2 |
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; |