Browse Source

Avoid leaving preloaded_undi with invalid PXENV+/!PXE structure

addresses if the signature checks fail.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
a2be828a33
1 changed files with 15 additions and 3 deletions
  1. 15
    3
      src/arch/i386/prefix/pxeprefix.S

+ 15
- 3
src/arch/i386/prefix/pxeprefix.S View File

@@ -48,9 +48,9 @@ detect_pxenv:
48 48
 	/* Signature check */
49 49
 	les	pxenv_segoff, %di
50 50
 	cmpl	$0x4e455850, %es:(%di)	/* 'PXEN' signature */
51
-	jne	99f
51
+	jne	no_pxenv
52 52
 	cmpw	$0x2b56, %es:4(%di)	/* 'V+' signature */
53
-	jne	99f
53
+	jne	no_pxenv
54 54
 	/* Record entry point and UNDI segments */
55 55
 	pushl	%es:0x0a(%di)		/* Entry point */
56 56
 	popl	entry_segoff
@@ -67,9 +67,15 @@ detect_pxenv:
67 67
 	call	print_segoff
68 68
 	movb	$',', %al
69 69
 	call	print_character
70
+	jmp	99f
70 71
 	.section ".prefix.data"
71 72
 10:	.asciz	" PXENV+ at "
72 73
 	.previous
74
+
75
+no_pxenv:
76
+	xorl	%eax, %eax
77
+	movl	%eax, pxenv_segoff
78
+	
73 79
 99:
74 80
 	
75 81
 /*****************************************************************************
@@ -80,7 +86,7 @@ detect_ppxe:
80 86
 	/* Signature check */
81 87
 	les	ppxe_segoff, %di
82 88
 	cmpl	$0x45585021, %es:(%di)	/* '!PXE' signature */
83
-	jne	99f
89
+	jne	no_ppxe
84 90
 	/* Record structure address, entry point, and UNDI segments */
85 91
 	pushw	%es
86 92
 	popw	ppxe_segment
@@ -99,9 +105,15 @@ detect_ppxe:
99 105
 	call	print_segoff
100 106
 	movb	$',', %al
101 107
 	call	print_character
108
+	jmp	99f
102 109
 	.section ".prefix.data"
103 110
 10:	.asciz	" !PXE at "
104 111
 	.previous
112
+
113
+no_ppxe:
114
+	xorl	%eax, %eax
115
+	movl	%eax, ppxe_segoff
116
+
105 117
 99:
106 118
 
107 119
 /*****************************************************************************

Loading…
Cancel
Save