* [PATCH] x86/EDD: check MBR for BIOS magic before considering signature valid
@ 2012-05-30 15:36 Jan Beulich
2012-05-30 16:48 ` Keir Fraser
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-05-30 15:36 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
Signed-off-by: Jan Beulich <JBeulich@suse.com>
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -53,12 +53,16 @@ edd_mbr_sig_read:
jc edd_mbr_sig_done # on failure, we're done.
cmpb $0, %ah # some BIOSes do not set CF
jne edd_mbr_sig_done # on failure, we're done.
+ cmpw $0xaa55, bootsym(boot_edd_info)+0x1fe
+ jne .Ledd_mbr_sig_next
movl bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax
movb %dl, (%bx) # store BIOS drive number
movl %eax, 4(%bx) # store signature from MBR
incb bootsym(boot_mbr_signature_nr) # note that we stored something
- incb %dl # increment to next device
addw $8, %bx # increment sig buffer ptr
+.Ledd_mbr_sig_next:
+ incb %dl # increment to next device
+ jz edd_mbr_sig_done
cmpb $EDD_MBR_SIG_MAX,bootsym(boot_mbr_signature_nr)
jb edd_mbr_sig_read
edd_mbr_sig_done:
[-- Attachment #2: x86-edd-mbr-sig-check.patch --]
[-- Type: text/plain, Size: 1255 bytes --]
x86/EDD: check MBR for BIOS magic before considering signature valid
Signed-off-by: Jan Beulich <JBeulich@suse.com>
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -53,12 +53,16 @@ edd_mbr_sig_read:
jc edd_mbr_sig_done # on failure, we're done.
cmpb $0, %ah # some BIOSes do not set CF
jne edd_mbr_sig_done # on failure, we're done.
+ cmpw $0xaa55, bootsym(boot_edd_info)+0x1fe
+ jne .Ledd_mbr_sig_next
movl bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax
movb %dl, (%bx) # store BIOS drive number
movl %eax, 4(%bx) # store signature from MBR
incb bootsym(boot_mbr_signature_nr) # note that we stored something
- incb %dl # increment to next device
addw $8, %bx # increment sig buffer ptr
+.Ledd_mbr_sig_next:
+ incb %dl # increment to next device
+ jz edd_mbr_sig_done
cmpb $EDD_MBR_SIG_MAX,bootsym(boot_mbr_signature_nr)
jb edd_mbr_sig_read
edd_mbr_sig_done:
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/EDD: check MBR for BIOS magic before considering signature valid
2012-05-30 15:36 [PATCH] x86/EDD: check MBR for BIOS magic before considering signature valid Jan Beulich
@ 2012-05-30 16:48 ` Keir Fraser
0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2012-05-30 16:48 UTC (permalink / raw)
To: Jan Beulich, xen-devel
On 30/05/2012 16:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
> --- a/xen/arch/x86/boot/edd.S
> +++ b/xen/arch/x86/boot/edd.S
> @@ -53,12 +53,16 @@ edd_mbr_sig_read:
> jc edd_mbr_sig_done # on failure, we're done.
> cmpb $0, %ah # some BIOSes do not set CF
> jne edd_mbr_sig_done # on failure, we're done.
> + cmpw $0xaa55, bootsym(boot_edd_info)+0x1fe
> + jne .Ledd_mbr_sig_next
> movl bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax
> movb %dl, (%bx) # store BIOS drive number
> movl %eax, 4(%bx) # store signature from MBR
> incb bootsym(boot_mbr_signature_nr) # note that we stored
> something
> - incb %dl # increment to next device
> addw $8, %bx # increment sig buffer ptr
> +.Ledd_mbr_sig_next:
> + incb %dl # increment to next device
> + jz edd_mbr_sig_done
> cmpb $EDD_MBR_SIG_MAX,bootsym(boot_mbr_signature_nr)
> jb edd_mbr_sig_read
> edd_mbr_sig_done:
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-30 16:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 15:36 [PATCH] x86/EDD: check MBR for BIOS magic before considering signature valid Jan Beulich
2012-05-30 16:48 ` Keir Fraser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).