diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-02-13 17:32:11 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-02-13 17:32:11 +0100 |
| commit | 3d8b7be7a14f09b3d64a05a276deac5e42603145 (patch) | |
| tree | 806d7e7ebd44a2ae25871b3cf900cbce2d06bc98 /src/boot/modules | |
| parent | 9523b61f4cfe8b70da8a8bac10c4332d96ec35cb (diff) | |
feat: kernel: net.efi: harderning and improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/boot/modules')
| -rw-r--r-- | src/boot/modules/BootNet/BootNet.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/boot/modules/BootNet/BootNet.cc b/src/boot/modules/BootNet/BootNet.cc index 34b8282b..bfb80d39 100644 --- a/src/boot/modules/BootNet/BootNet.cc +++ b/src/boot/modules/BootNet/BootNet.cc @@ -34,6 +34,17 @@ EXTERN_C Int32 BootNetModuleMain(Kernel::HEL::BootInfoHeader* handover) { bootnet_read_ip_packet(inet, &inet_out); + if (!inet_out) { + writer.Write("BootNet: Not a packet, aborting.\r"); + return kEfiFail; + } + + if (inet_out->NB1 != 'O' || inet_out->NB1 != 'N' || inet_out->NB1 != 'E' || + inet_out->NB1 != 'T') { + writer.Write("BootNet: Not a packet, aborting.\r"); + return kEfiFail; + } + if (inet_out->Length < 1) { writer.Write("BootNet: No executable attached to the packet, aborting.\r"); return kEfiFail; @@ -115,4 +126,4 @@ STATIC Void bootnet_read_ip_packet(BOOTNET_INTERNET_HEADER inet, kEfiProtocol->Stop(kEfiProtocol); kEfiProtocol->Shutdown(kEfiProtocol); -}
\ No newline at end of file +} |
