]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[pxe] Remove userptr_t from PXE NBP image parsing
authorMichael Brown <mcb30@ipxe.org>
Thu, 24 Apr 2025 21:46:50 +0000 (22:46 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 24 Apr 2025 21:46:50 +0000 (22:46 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/image/pxe_image.c

index 9f8044fa1727acc62151ad710641483f89656d0f..d7acd008448fe486800541832eb129ad75a8760b 100644 (file)
@@ -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;