From: Michael Brown Date: Thu, 24 Apr 2025 21:46:50 +0000 (+0100) Subject: [pxe] Remove userptr_t from PXE NBP image parsing X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7c94c4aa50f96b3a8c8ac2fea3b3a13516c598f;p=thirdparty%2Fipxe.git [pxe] Remove userptr_t from PXE NBP image parsing Signed-off-by: Michael Brown --- diff --git a/src/arch/x86/image/pxe_image.c b/src/arch/x86/image/pxe_image.c index 9f8044fa1..d7acd0084 100644 --- a/src/arch/x86/image/pxe_image.c +++ b/src/arch/x86/image/pxe_image.c @@ -142,7 +142,7 @@ int pxe_probe ( struct image *image ) { * @ret rc Return status code */ int pxe_probe_no_mz ( struct image *image ) { - uint16_t magic; + const uint16_t *magic; int rc; /* Probe PXE image */ @@ -152,9 +152,9 @@ int pxe_probe_no_mz ( struct image *image ) { /* Reject image with an "MZ" signature which may indicate an * EFI image incorrectly handed out to a BIOS system. */ - if ( image->len >= sizeof ( magic ) ) { - copy_from_user ( &magic, image->data, 0, sizeof ( magic ) ); - if ( magic == cpu_to_le16 ( EFI_IMAGE_DOS_SIGNATURE ) ) { + if ( image->len >= sizeof ( *magic ) ) { + magic = image->data; + if ( *magic == cpu_to_le16 ( EFI_IMAGE_DOS_SIGNATURE ) ) { DBGC ( image, "IMAGE %p may be an EFI image\n", image ); return -ENOTTY;