efi_loader: stop network in EXIT_BOOT_SERVICES
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 5 Apr 2025 06:58:12 +0000 (08:58 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 6 Apr 2025 16:03:22 +0000 (10:03 -0600)
commit0efe8ea57fc7a1a6fc5f64fb3cf6bc4a1a4fc219
tree29461bba8272816737dfefb0a38fb976aea0bb01
parent1915fdcc21268c0f5df513461e3ddbb03a26f3c5
efi_loader: stop network in EXIT_BOOT_SERVICES

It has been reported that memory corruption can occurred because network
packages where received after EXIT_BOOT_SERVICES. See the thread
starting at [1].

We try to remove all drivers when EXIT_BOOT_SERVICES is called. But

* Some network drivers don't call their own stop method when removed.
* Some network drivers don't have a remove method.
* Some devices have CONFIG_DM_DEVICE_REMOVE=n.

Let's call eth_halt() in EXIT_BOOT_SERVICES explicitly.

[1]
https://lore.kernel.org/all/C101B675-EEE6-44CB-8A44-83F72182FBD6@kohlschutter.com/

Cc: Michael Brown <mcb30@ipxe.org>
Reported-by: Christian Kohlschütter <christian@kohlschutter.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Michael Brown <mcb30@ipxe.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Christian Kohlschütter <christian@kohlschutter.com>
lib/efi_loader/efi_boottime.c