mirror of https://github.com/ipxe/ipxe.git
Avoid leaving preloaded_undi with invalid PXENV+/!PXE structure
addresses if the signature checks fail.pull/1/head
parent
697bcc9d24
commit
a2be828a33
|
@ -48,9 +48,9 @@ detect_pxenv:
|
||||||
/* Signature check */
|
/* Signature check */
|
||||||
les pxenv_segoff, %di
|
les pxenv_segoff, %di
|
||||||
cmpl $0x4e455850, %es:(%di) /* 'PXEN' signature */
|
cmpl $0x4e455850, %es:(%di) /* 'PXEN' signature */
|
||||||
jne 99f
|
jne no_pxenv
|
||||||
cmpw $0x2b56, %es:4(%di) /* 'V+' signature */
|
cmpw $0x2b56, %es:4(%di) /* 'V+' signature */
|
||||||
jne 99f
|
jne no_pxenv
|
||||||
/* Record entry point and UNDI segments */
|
/* Record entry point and UNDI segments */
|
||||||
pushl %es:0x0a(%di) /* Entry point */
|
pushl %es:0x0a(%di) /* Entry point */
|
||||||
popl entry_segoff
|
popl entry_segoff
|
||||||
|
@ -67,9 +67,15 @@ detect_pxenv:
|
||||||
call print_segoff
|
call print_segoff
|
||||||
movb $',', %al
|
movb $',', %al
|
||||||
call print_character
|
call print_character
|
||||||
|
jmp 99f
|
||||||
.section ".prefix.data"
|
.section ".prefix.data"
|
||||||
10: .asciz " PXENV+ at "
|
10: .asciz " PXENV+ at "
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
|
no_pxenv:
|
||||||
|
xorl %eax, %eax
|
||||||
|
movl %eax, pxenv_segoff
|
||||||
|
|
||||||
99:
|
99:
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
@ -80,7 +86,7 @@ detect_ppxe:
|
||||||
/* Signature check */
|
/* Signature check */
|
||||||
les ppxe_segoff, %di
|
les ppxe_segoff, %di
|
||||||
cmpl $0x45585021, %es:(%di) /* '!PXE' signature */
|
cmpl $0x45585021, %es:(%di) /* '!PXE' signature */
|
||||||
jne 99f
|
jne no_ppxe
|
||||||
/* Record structure address, entry point, and UNDI segments */
|
/* Record structure address, entry point, and UNDI segments */
|
||||||
pushw %es
|
pushw %es
|
||||||
popw ppxe_segment
|
popw ppxe_segment
|
||||||
|
@ -99,9 +105,15 @@ detect_ppxe:
|
||||||
call print_segoff
|
call print_segoff
|
||||||
movb $',', %al
|
movb $',', %al
|
||||||
call print_character
|
call print_character
|
||||||
|
jmp 99f
|
||||||
.section ".prefix.data"
|
.section ".prefix.data"
|
||||||
10: .asciz " !PXE at "
|
10: .asciz " !PXE at "
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
|
no_ppxe:
|
||||||
|
xorl %eax, %eax
|
||||||
|
movl %eax, ppxe_segoff
|
||||||
|
|
||||||
99:
|
99:
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue