diff options
author | msmith <msmith@FreeBSD.org> | 1999-08-24 16:42:08 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-08-24 16:42:08 +0000 |
commit | f9e65abb2c30f44b4d7b8e4fec05ca61b98bf52d (patch) | |
tree | 2c19fbd5d8a98cb4c08b404a1f77667b07f59373 /sys/amd64 | |
parent | c0c53e4632722f32f1b7613235fc58df1ec66f41 (diff) | |
download | FreeBSD-src-f9e65abb2c30f44b4d7b8e4fec05ca61b98bf52d.zip FreeBSD-src-f9e65abb2c30f44b4d7b8e4fec05ca61b98bf52d.tar.gz |
Work around a bad design in some PnP BIOS code whereby the BIOS can reach
off the top of our constructed stack segment while it's trying to copy a
maximally-sized PnP argument frame around.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/bios.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c index 980c0b5..cc8e30b 100644 --- a/sys/amd64/amd64/bios.c +++ b/sys/amd64/amd64/bios.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bios.c,v 1.17 1999/08/18 02:19:52 msmith Exp $ + * $Id: bios.c,v 1.18 1999/08/20 21:08:41 msmith Exp $ */ /* @@ -315,7 +315,16 @@ bios16(struct bios_args *args, char *fmt, ...) arg_start = 0xffffffff; arg_end = 0; - stack = (caddr_t)PAGE_SIZE; + /* + * Some BIOS entrypoints attempt to copy the largest-case + * argument frame (in order to generalise handling for + * different entry types). If our argument frame is + * smaller than this, the BIOS will reach off the top of + * our constructed stack segment. Pad the top of the stack + * with some garbage to avoid this. + */ + stack = (caddr_t)PAGE_SIZE - 32; + va_start(ap, fmt); for (p = fmt; p && *p; p++) { switch (*p) { |