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

Loading…
Cancel
Save