Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-0]: src/sys/arch/alpha Pull up following revision(s) (requested...
details: https://anonhg.NetBSD.org/src/rev/b55303f474ba
branches: netbsd-7-0
changeset: 801231:b55303f474ba
user: snj <snj%NetBSD.org@localhost>
date: Tue Nov 01 20:27:51 2016 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #1269):
sys/arch/alpha/alpha/machdep.c: revision 1.347
sys/arch/alpha/alpha/prom.c: revision 1.49
sys/arch/alpha/stand/common/booted_dev.c: revision 1.4
sys/arch/alpha/stand/common/prom.c: revision 1.15
Match the two prom_getenv() and fix buffer overflow causing wrong host
controller SCSI ID for DEC 3000.
OK skrll@
diffstat:
sys/arch/alpha/alpha/machdep.c | 6 +++---
sys/arch/alpha/alpha/prom.c | 16 ++++++++--------
sys/arch/alpha/stand/common/booted_dev.c | 5 ++---
sys/arch/alpha/stand/common/prom.c | 4 ++--
4 files changed, 15 insertions(+), 16 deletions(-)
diffs (112 lines):
diff -r fa0469f8950d -r b55303f474ba sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c Tue Nov 01 20:09:11 2016 +0000
+++ b/sys/arch/alpha/alpha/machdep.c Tue Nov 01 20:27:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.345 2014/05/16 19:18:21 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.345.4.1 2016/11/01 20:27:51 snj Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.345 2014/05/16 19:18:21 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.345.4.1 2016/11/01 20:27:51 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,7 +171,7 @@
/* For built-in TCDS */
#if defined(DEC_3000_300) || defined(DEC_3000_500)
-uint8_t dec_3000_scsiid[2], dec_3000_scsifast[2];
+uint8_t dec_3000_scsiid[3], dec_3000_scsifast[3];
#endif
struct platform platform;
diff -r fa0469f8950d -r b55303f474ba sys/arch/alpha/alpha/prom.c
--- a/sys/arch/alpha/alpha/prom.c Tue Nov 01 20:09:11 2016 +0000
+++ b/sys/arch/alpha/alpha/prom.c Tue Nov 01 20:27:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.48 2012/02/06 02:14:12 matt Exp $ */
+/* $NetBSD: prom.c,v 1.48.26.1 2016/11/01 20:27:51 snj Exp $ */
/*
* Copyright (c) 1992, 1994, 1995, 1996 Carnegie Mellon University
@@ -27,7 +27,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.48 2012/02/06 02:14:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.48.26.1 2016/11/01 20:27:51 snj Exp $");
#include "opt_multiprocessor.h"
@@ -95,7 +95,7 @@
init_prom_interface(hwrpb);
- prom_getenv(PROM_E_TTY_DEV, buf, 4);
+ prom_getenv(PROM_E_TTY_DEV, buf, sizeof(buf));
alpha_console = buf[0] - '0';
/* XXX fake out the console routines, for now */
@@ -238,14 +238,14 @@
prom_enter();
ret.bits = prom_getenv_disp(id, to, len);
+ if (ret.u.status & 0x4)
+ ret.u.retval = 0;
+ len = min(len - 1, ret.u.retval);
memcpy(buf, to, len);
+ buf[len] = '\0';
prom_leave();
- if (ret.u.status & 0x4)
- ret.u.retval = 0;
- buf[ret.u.retval] = '\0';
-
- return (ret.bits);
+ return len;
}
void
diff -r fa0469f8950d -r b55303f474ba sys/arch/alpha/stand/common/booted_dev.c
--- a/sys/arch/alpha/stand/common/booted_dev.c Tue Nov 01 20:09:11 2016 +0000
+++ b/sys/arch/alpha/stand/common/booted_dev.c Tue Nov 01 20:27:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: booted_dev.c,v 1.3 1999/11/13 21:38:20 thorpej Exp $ */
+/* $NetBSD: booted_dev.c,v 1.3.200.1 2016/11/01 20:27:51 snj Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -53,9 +53,8 @@
* We don't know what device names look like yet,
* so we can't change them.
*/
- ret.bits = prom_getenv(PROM_E_BOOTED_DEV, booted_dev_name,
+ devlen = prom_getenv(PROM_E_BOOTED_DEV, booted_dev_name,
sizeof(booted_dev_name));
- devlen = ret.u.retval;
ret.bits = prom_open(booted_dev_name, devlen);
diff -r fa0469f8950d -r b55303f474ba sys/arch/alpha/stand/common/prom.c
--- a/sys/arch/alpha/stand/common/prom.c Tue Nov 01 20:09:11 2016 +0000
+++ b/sys/arch/alpha/stand/common/prom.c Tue Nov 01 20:27:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.14 2009/03/18 10:22:22 cegger Exp $ */
+/* $NetBSD: prom.c,v 1.14.42.1 2016/11/01 20:27:51 snj Exp $ */
/*
* Mach Operating System
@@ -57,7 +57,7 @@
prom_dispatch_v.routine = c->crb_v_dispatch->entry_va;
/* Look for console tty. */
- prom_getenv(PROM_E_TTY_DEV, buf, 4);
+ prom_getenv(PROM_E_TTY_DEV, buf, sizeof(buf));
console = buf[0] - '0';
}
Home |
Main Index |
Thread Index |
Old Index