From 2bc57f9efb231d929f161c48a9cb21412f6a413d Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Fri, 11 Mar 2011 21:08:26 +0000 Subject: Zap stack garbage before passing buffer to biosd_io(), which may be lied to by the BIOS about successfully reading data. ok deraadt@ weingart@ --- sys/arch/amd64/stand/libsa/biosdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/arch/amd64') 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); -- cgit v1.2.3