Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/compat Pull up following revision(s) (requested by ri...
details: https://anonhg.NetBSD.org/src/rev/c67915f1ca53
branches: netbsd-8
changeset: 376553:c67915f1ca53
user: martin <martin%NetBSD.org@localhost>
date: Wed Jun 21 21:16:09 2023 +0000
description:
Pull up following revision(s) (requested by riastradh in ticket #1839):
sys/compat/common/kern_time_30.c: revision 1.6
sys/compat/netbsd32/netbsd32_time.c: revision 1.50
Paranoia: zero COMPAT_30 ntptimeval and 32-bit ntptimeval too.
These structs don't have padding but safer to keep the code
structured the same way between the various ntp_gettimes in case
anyone makes more copypasta of it for future updates.
diffstat:
sys/compat/common/kern_time_30.c | 5 +++--
sys/compat/netbsd32/netbsd32_time.c | 7 +++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diffs (68 lines):
diff -r c77ab2e9daab -r c67915f1ca53 sys/compat/common/kern_time_30.c
--- a/sys/compat/common/kern_time_30.c Wed Jun 21 21:13:27 2023 +0000
+++ b/sys/compat/common/kern_time_30.c Wed Jun 21 21:16:09 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_time_30.c,v 1.5 2016/11/03 03:37:06 riastradh Exp $ */
+/* $NetBSD: kern_time_30.c,v 1.5.8.1 2023/06/21 21:16:09 martin Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time_30.c,v 1.5 2016/11/03 03:37:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_30.c,v 1.5.8.1 2023/06/21 21:16:09 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ntp.h"
@@ -68,6 +68,7 @@ compat_30_sys_ntp_gettime(struct lwp *l,
if (SCARG(uap, ntvp)) {
ntp_gettime(&ntv);
+ memset(&ntv30, 0, sizeof(ntv30));
TIMESPEC_TO_TIMEVAL(&tv, &ntv.time);
timeval_to_timeval50(&tv, &ntv30.time);
ntv30.maxerror = ntv.maxerror;
diff -r c77ab2e9daab -r c67915f1ca53 sys/compat/netbsd32/netbsd32_time.c
--- a/sys/compat/netbsd32/netbsd32_time.c Wed Jun 21 21:13:27 2023 +0000
+++ b/sys/compat/netbsd32/netbsd32_time.c Wed Jun 21 21:16:09 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_time.c,v 1.49.6.1 2023/06/21 21:04:01 martin Exp $ */
+/* $NetBSD: netbsd32_time.c,v 1.49.6.2 2023/06/21 21:16:09 martin Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.49.6.1 2023/06/21 21:04:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.49.6.2 2023/06/21 21:16:09 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ntp.h"
@@ -66,6 +66,7 @@ netbsd32___ntp_gettime50(struct lwp *l,
if (SCARG_P32(uap, ntvp)) {
ntp_gettime(&ntv);
+ memset(&ntv32, 0, sizeof(ntv32));
ntv32.time.tv_sec = ntv.time.tv_sec;
ntv32.time.tv_nsec = ntv.time.tv_nsec;
ntv32.maxerror = (netbsd32_long)ntv.maxerror;
@@ -96,6 +97,7 @@ compat_50_netbsd32_ntp_gettime(struct lw
if (SCARG_P32(uap, ntvp)) {
ntp_gettime(&ntv);
+ memset(&ntv32, 0, sizeof(ntv32));
ntv32.time.tv_sec = (int32_t)ntv.time.tv_sec;
ntv32.time.tv_nsec = ntv.time.tv_nsec;
ntv32.maxerror = (netbsd32_long)ntv.maxerror;
@@ -126,6 +128,7 @@ compat_30_netbsd32_ntp_gettime(struct lw
if (SCARG_P32(uap, ntvp)) {
ntp_gettime(&ntv);
+ memset(&ntv32, 0, sizeof(ntv32));
ntv32.time.tv_sec = ntv.time.tv_sec;
ntv32.time.tv_usec = ntv.time.tv_nsec / 1000;
ntv32.maxerror = (netbsd32_long)ntv.maxerror;
Home |
Main Index |
Thread Index |
Old Index