diff options
| author | Heinrich Schuchardt <[email protected]> | 2025-04-05 08:58:12 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-04-06 10:03:22 -0600 |
| commit | 0efe8ea57fc7a1a6fc5f64fb3cf6bc4a1a4fc219 (patch) | |
| tree | 29461bba8272816737dfefb0a38fb976aea0bb01 /lib/efi_loader | |
| parent | 1915fdcc21268c0f5df513461e3ddbb03a26f3c5 (diff) | |
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/[email protected]/
Cc: Michael Brown <[email protected]>
Reported-by: Christian Kohlschütter <[email protected]>
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Michael Brown <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Tested-by: Christian Kohlschütter <[email protected]>
Diffstat (limited to 'lib/efi_loader')
| -rw-r--r-- | lib/efi_loader/efi_boottime.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 5164cb15986..eaa6464fa39 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -15,6 +15,7 @@ #include <irq_func.h> #include <log.h> #include <malloc.h> +#include <net-common.h> #include <pe.h> #include <time.h> #include <u-boot/crc.h> @@ -2235,6 +2236,8 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle, bootm_disable_interrupts(); if (IS_ENABLED(CONFIG_USB_DEVICE)) udc_disconnect(); + if (IS_ENABLED(CONFIG_DM_ETH)) + eth_halt(); board_quiesce_devices(); dm_remove_devices_active(); } |
