diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-03-06 16:28:48 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-03-06 16:56:37 +0000 |
commit | dcb50f550d816af150ca4294fbeadfab497b40f0 (patch) | |
tree | 1935a6c9d052b1989570e3eb63d6041cc869470c /src/image | |
parent | e51e7bbad7d043a6b369b0050ff4e1c0e62f3b5d (diff) | |
download | ipxe-interpreter.zip ipxe-interpreter.tar.gz ipxe-interpreter.tar.bz2 |
[image] Always unregister currently executing imageinterpreter
We unregister script images during their execution, to prevent a
"boot" command from re-executing the containing script. This also has
the side effect of preventing executing scripts from showing up within
the Linux magic initrd image (or the Multiboot module list).
Additional logic in bzimage.c and efi_file.c prevents a currently
executing kernel from showing up within the magic initrd image.
Similar logic in multiboot.c prevents the Multiboot kernel from
showing up as a Multiboot module.
This still leaves some corner cases that are not covered correctly.
For example: when using a gzip-compressed kernel image, nothing will
currently hide the original compressed image from the magic initrd.
Fix by moving the logic that temporarily unregisters the current image
from script_exec() to image_exec(), so that it applies to all image
types, and simplify the magic initrd and Multiboot module list
construction logic on the basis that no further filtering of the
registered image list is necessary.
This change has the side effect of hiding currently executing EFI
images from the virtual filesystem exposed by iPXE. For example, when
using iPXE to boot wimboot, the wimboot binary itself will no longer
be visible within the virtual filesystem.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/script.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/image/script.c b/src/image/script.c index 2805086..b34df1e 100644 --- a/src/image/script.c +++ b/src/image/script.c @@ -197,11 +197,6 @@ static int script_exec ( struct image *image ) { size_t saved_offset; int rc; - /* Temporarily de-register image, so that a "boot" command - * doesn't throw us into an execution loop. - */ - unregister_image ( image ); - /* Preserve state of any currently-running script */ saved_offset = script_offset; @@ -212,10 +207,6 @@ static int script_exec ( struct image *image ) { /* Restore saved state */ script_offset = saved_offset; - /* Re-register image (unless we have been replaced) */ - if ( ! image->replacement ) - register_image ( image ); - return rc; } |