diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-03-11 21:08:26 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-03-11 21:08:26 +0000 |
commit | 2bc57f9efb231d929f161c48a9cb21412f6a413d (patch) | |
tree | 620aa86454c987e1ce087e3e0e465dd24a40b97f /sys/arch/amd64/stand | |
parent | 168f2e6cc1e3d6e59469c4b110b51e8a5e437949 (diff) |
Zap stack garbage before passing buffer to biosd_io(), which may
be lied to by the BIOS about successfully reading data.
ok deraadt@ weingart@
Diffstat (limited to 'sys/arch/amd64/stand')
-rw-r--r-- | sys/arch/amd64/stand/libsa/biosdev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/amd64/stand/libsa/biosdev.c b/sys/arch/amd64/stand/libsa/biosdev.c index e25c7896ff4..2a111a9c918 100644 --- a/sys/arch/amd64/stand/libsa/biosdev.c +++ b/sys/arch/amd64/stand/libsa/biosdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.c,v 1.10 2011/03/08 17:24:31 krw Exp $ */ +/* $OpenBSD: biosdev.c,v 1.11 2011/03/11 21:08:25 krw Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -358,6 +358,7 @@ findopenbsd(bios_diskinfo_t *bd, daddr64_t mbroff, const char **err, int *n) } /* Read MBR */ + bzero(&mbr, sizeof(mbr)); error = biosd_io(F_READ, bd, mbroff, 1, &mbr); if (error) { *err = biosdisk_err(error); |