summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux/common')
-rw-r--r--sys/compat/linux/common/linux_cdrom.c6
-rw-r--r--sys/compat/linux/common/linux_fdio.c5
-rw-r--r--sys/compat/linux/common/linux_file.c5
-rw-r--r--sys/compat/linux/common/linux_hdio.c6
-rw-r--r--sys/compat/linux/common/linux_misc.c7
-rw-r--r--sys/compat/linux/common/linux_mtio.c5
-rw-r--r--sys/compat/linux/common/linux_oldolduname.c6
-rw-r--r--sys/compat/linux/common/linux_olduname.c6
-rw-r--r--sys/compat/linux/common/linux_sched.c6
-rw-r--r--sys/compat/linux/common/linux_signal.c12
-rw-r--r--sys/compat/linux/common/linux_socket.c7
-rw-r--r--sys/compat/linux/common/linux_time.c6
12 files changed, 53 insertions, 24 deletions
diff --git a/sys/compat/linux/common/linux_cdrom.c b/sys/compat/linux/common/linux_cdrom.c
index 07d84540c02..ba34c44c5e0 100644
--- a/sys/compat/linux/common/linux_cdrom.c
+++ b/sys/compat/linux/common/linux_cdrom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_cdrom.c,v 1.27 2008/04/28 20:23:43 martin Exp $ */
+/* $NetBSD: linux_cdrom.c,v 1.27.92.1 2022/08/03 11:11:32 martin Exp $ */
/*
* Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.27 2008/04/28 20:23:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.27.92.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -186,6 +186,7 @@ linux_ioctl_cdrom(struct lwp *l, const struct linux_sys_ioctl_args *uap, registe
if (error)
break;
+ memset(&l_tochdr, 0, sizeof(l_tochdr));
l_tochdr.cdth_trk0 = t_header.starting_track;
l_tochdr.cdth_trk1 = t_header.ending_track;
@@ -238,6 +239,7 @@ linux_ioctl_cdrom(struct lwp *l, const struct linux_sys_ioctl_args *uap, registe
if (error)
break;
+ memset(&l_volctrl, 0, sizeof(l_volctrl));
l_volctrl.channel0 = t_vol.vol[0];
l_volctrl.channel1 = t_vol.vol[1];
l_volctrl.channel2 = t_vol.vol[2];
diff --git a/sys/compat/linux/common/linux_fdio.c b/sys/compat/linux/common/linux_fdio.c
index bf9b5be0590..6e2346d3dcd 100644
--- a/sys/compat/linux/common/linux_fdio.c
+++ b/sys/compat/linux/common/linux_fdio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fdio.c,v 1.13 2008/03/21 21:54:58 ad Exp $ */
+/* $NetBSD: linux_fdio.c,v 1.13.96.1 2022/08/03 11:11:32 martin Exp $ */
/*
* Copyright (c) 2000 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.13 2008/03/21 21:54:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.13.96.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -107,6 +107,7 @@ linux_ioctl_fdio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
error = ioctlf(fp, FDIOCGETFORMAT, &fparams);
if (error != 0)
break;
+ memset(&lflop, 0, sizeof(lflop));
lflop.size = fparams.ncyl * fparams.nspt * fparams.ntrk;
lflop.sect = fparams.nspt;
lflop.head = fparams.ntrk;
diff --git a/sys/compat/linux/common/linux_file.c b/sys/compat/linux/common/linux_file.c
index 446cc172fc4..d351fdb17dd 100644
--- a/sys/compat/linux/common/linux_file.c
+++ b/sys/compat/linux/common/linux_file.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file.c,v 1.116 2019/06/18 22:34:25 kamil Exp $ */
+/* $NetBSD: linux_file.c,v 1.116.2.1 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.116 2019/06/18 22:34:25 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.116.2.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -445,6 +445,7 @@ static void
bsd_to_linux_stat(struct stat *bsp, struct linux_stat *lsp)
{
+ memset(lsp, 0, sizeof(*lsp));
lsp->lst_dev = linux_fakedev(bsp->st_dev, 0);
lsp->lst_ino = bsp->st_ino;
lsp->lst_mode = (linux_mode_t)bsp->st_mode;
diff --git a/sys/compat/linux/common/linux_hdio.c b/sys/compat/linux/common/linux_hdio.c
index 79300d3ebd0..219881f6bea 100644
--- a/sys/compat/linux/common/linux_hdio.c
+++ b/sys/compat/linux/common/linux_hdio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_hdio.c,v 1.18 2019/02/03 03:19:26 mrg Exp $ */
+/* $NetBSD: linux_hdio.c,v 1.18.4.1 2022/08/03 11:11:32 martin Exp $ */
/*
* Copyright (c) 2000 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.18 2019/02/03 03:19:26 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.18.4.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -113,6 +113,7 @@ linux_ioctl_hdio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
error = error1;
break;
}
+ memset(&hdg, 0, sizeof(hdg));
hdg.start = error1 != 0 ? pi.pi_offset : 0;
hdg.heads = label.d_ntracks;
hdg.cylinders = label.d_ncylinders;
@@ -131,6 +132,7 @@ linux_ioctl_hdio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
error = error1;
break;
}
+ memset(&hdg_big, 0, sizeof(hdg_big));
hdg_big.start = error1 != 0 ? pi.pi_offset : 0;
hdg_big.heads = label.d_ntracks;
hdg_big.cylinders = label.d_ncylinders;
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index ac472d551f9..e81add112ba 100644
--- a/sys/compat/linux/common/linux_misc.c
+++ b/sys/compat/linux/common/linux_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.240.4.1 2019/09/13 06:25:25 martin Exp $ */
+/* $NetBSD: linux_misc.c,v 1.240.4.2 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.240.4.1 2019/09/13 06:25:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.240.4.2 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -628,6 +628,8 @@ linux_sys_times(struct lwp *l, const struct linux_sys_times_args *uap, register_
struct linux_tms ltms;
struct rusage ru;
+ memset(&ltms, 0, sizeof(ltms));
+
mutex_enter(p->p_lock);
calcru(p, &ru.ru_utime, &ru.ru_stime, NULL, NULL);
ltms.ltms_utime = CONVTCK(ru.ru_utime);
@@ -1392,6 +1394,7 @@ linux_sys_getrlimit(struct lwp *l, const struct linux_sys_getrlimit_args *uap, r
if (which < 0)
return -which;
+ memset(&orl, 0, sizeof(orl));
bsd_to_linux_rlimit(&orl, &l->l_proc->p_rlimit[which]);
return copyout(&orl, SCARG(uap, rlp), sizeof(orl));
diff --git a/sys/compat/linux/common/linux_mtio.c b/sys/compat/linux/common/linux_mtio.c
index b92051d65f2..7e47bff2274 100644
--- a/sys/compat/linux/common/linux_mtio.c
+++ b/sys/compat/linux/common/linux_mtio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_mtio.c,v 1.7 2008/03/21 21:54:58 ad Exp $ */
+/* $NetBSD: linux_mtio.c,v 1.7.96.1 2022/08/03 11:11:32 martin Exp $ */
/*
* Copyright (c) 2005 Soren S. Jorvang. All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_mtio.c,v 1.7 2008/03/21 21:54:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mtio.c,v 1.7.96.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -106,6 +106,7 @@ linux_ioctl_mtio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
error = ioctlf(fp, MTIOCTOP, &mt);
break;
case LINUX_MTIOCGET:
+ memset(&lmtget, 0, sizeof(lmtget));
lmtget.mt_type = LINUX_MT_ISUNKNOWN;
lmtget.mt_resid = 0;
lmtget.mt_dsreg = 0;
diff --git a/sys/compat/linux/common/linux_oldolduname.c b/sys/compat/linux/common/linux_oldolduname.c
index c48939d49e5..1a9ec1f2f68 100644
--- a/sys/compat/linux/common/linux_oldolduname.c
+++ b/sys/compat/linux/common/linux_oldolduname.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_oldolduname.c,v 1.66 2008/04/28 20:23:43 martin Exp $ */
+/* $NetBSD: linux_oldolduname.c,v 1.66.92.1 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.66 2008/04/28 20:23:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.66.92.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -58,6 +58,8 @@ linux_sys_oldolduname(struct lwp *l, const struct linux_sys_oldolduname_args *ua
} */
struct linux_oldoldutsname luts;
+ memset(&luts, 0, sizeof(luts));
+
strlcpy(luts.l_sysname, linux_sysname, sizeof(luts.l_sysname));
strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
strlcpy(luts.l_release, linux_release, sizeof(luts.l_release));
diff --git a/sys/compat/linux/common/linux_olduname.c b/sys/compat/linux/common/linux_olduname.c
index 20f9cde0581..a57434339b2 100644
--- a/sys/compat/linux/common/linux_olduname.c
+++ b/sys/compat/linux/common/linux_olduname.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_olduname.c,v 1.66 2008/04/28 20:23:43 martin Exp $ */
+/* $NetBSD: linux_olduname.c,v 1.66.92.1 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.66 2008/04/28 20:23:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.66.92.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -61,6 +61,8 @@ linux_sys_olduname(struct lwp *l, const struct linux_sys_olduname_args *uap, reg
} */
struct linux_oldutsname luts;
+ memset(&luts, 0, sizeof(luts));
+
strlcpy(luts.l_sysname, linux_sysname, sizeof(luts.l_sysname));
strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
strlcpy(luts.l_release, linux_release, sizeof(luts.l_release));
diff --git a/sys/compat/linux/common/linux_sched.c b/sys/compat/linux/common/linux_sched.c
index 63e5964c229..3ba701c611b 100644
--- a/sys/compat/linux/common/linux_sched.c
+++ b/sys/compat/linux/common/linux_sched.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sched.c,v 1.71 2018/04/16 14:51:59 kamil Exp $ */
+/* $NetBSD: linux_sched.c,v 1.71.6.1 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.71 2018/04/16 14:51:59 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.71.6.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -380,6 +380,8 @@ sched_native2linux(int native_policy, struct sched_param *native_params,
KASSERT(prio <= SCHED_PRI_MAX);
KASSERT(linux_params != NULL);
+ memset(linux_params, 0, sizeof(*linux_params));
+
DPRINTF(("%s: native: policy %d, priority %d\n",
__func__, native_policy, prio));
diff --git a/sys/compat/linux/common/linux_signal.c b/sys/compat/linux/common/linux_signal.c
index 2bb920ba396..b3fc8cbe3e3 100644
--- a/sys/compat/linux/common/linux_signal.c
+++ b/sys/compat/linux/common/linux_signal.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_signal.c,v 1.80.8.1 2019/09/13 06:25:25 martin Exp $ */
+/* $NetBSD: linux_signal.c,v 1.80.8.2 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.80.8.1 2019/09/13 06:25:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.80.8.2 2022/08/03 11:11:32 martin Exp $");
#define COMPAT_LINUX 1
@@ -274,6 +274,8 @@ linux_to_native_sigflags(const unsigned long lsf)
void
linux_old_to_native_sigaction(struct sigaction *bsa, const struct linux_old_sigaction *lsa)
{
+
+ memset(bsa, 0, sizeof(*bsa));
bsa->sa_handler = lsa->linux_sa_handler;
linux_old_to_native_sigset(&bsa->sa_mask, &lsa->linux_sa_mask);
bsa->sa_flags = linux_to_native_sigflags(lsa->linux_sa_flags);
@@ -282,6 +284,8 @@ linux_old_to_native_sigaction(struct sigaction *bsa, const struct linux_old_siga
void
native_to_linux_old_sigaction(struct linux_old_sigaction *lsa, const struct sigaction *bsa)
{
+
+ memset(lsa, 0, sizeof(*lsa));
lsa->linux_sa_handler = bsa->sa_handler;
native_to_linux_old_sigset(&lsa->linux_sa_mask, &bsa->sa_mask);
lsa->linux_sa_flags = native_to_linux_sigflags(bsa->sa_flags);
@@ -294,6 +298,8 @@ native_to_linux_old_sigaction(struct linux_old_sigaction *lsa, const struct siga
void
linux_to_native_sigaction(struct sigaction *bsa, const struct linux_sigaction *lsa)
{
+
+ memset(bsa, 0, sizeof(*bsa));
bsa->sa_handler = lsa->linux_sa_handler;
linux_to_native_sigset(&bsa->sa_mask, &lsa->linux_sa_mask);
bsa->sa_flags = linux_to_native_sigflags(lsa->linux_sa_flags);
@@ -302,6 +308,8 @@ linux_to_native_sigaction(struct sigaction *bsa, const struct linux_sigaction *l
void
native_to_linux_sigaction(struct linux_sigaction *lsa, const struct sigaction *bsa)
{
+
+ memset(lsa, 0, sizeof(*lsa));
lsa->linux_sa_handler = bsa->sa_handler;
native_to_linux_sigset(&lsa->linux_sa_mask, &bsa->sa_mask);
lsa->linux_sa_flags = native_to_linux_sigflags(bsa->sa_flags);
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c
index 00351a67c64..015018ea30b 100644
--- a/sys/compat/linux/common/linux_socket.c
+++ b/sys/compat/linux/common/linux_socket.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socket.c,v 1.145.4.3 2020/11/08 08:39:12 martin Exp $ */
+/* $NetBSD: linux_socket.c,v 1.145.4.4 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.145.4.3 2020/11/08 08:39:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.145.4.4 2022/08/03 11:11:32 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -440,6 +440,7 @@ linux_sys_sendto(struct lwp *l, const struct linux_sys_sendto_args *uap, registe
static void
linux_to_bsd_msghdr(const struct linux_msghdr *lmsg, struct msghdr *bmsg)
{
+ memset(bmsg, 0, sizeof(*bmsg));
bmsg->msg_name = lmsg->msg_name;
bmsg->msg_namelen = lmsg->msg_namelen;
bmsg->msg_iov = lmsg->msg_iov;
@@ -452,6 +453,7 @@ linux_to_bsd_msghdr(const struct linux_msghdr *lmsg, struct msghdr *bmsg)
static void
bsd_to_linux_msghdr(const struct msghdr *bmsg, struct linux_msghdr *lmsg)
{
+ memset(lmsg, 0, sizeof(*lmsg));
lmsg->msg_name = bmsg->msg_name;
lmsg->msg_namelen = bmsg->msg_namelen;
lmsg->msg_iov = bmsg->msg_iov;
@@ -699,6 +701,7 @@ linux_copyout_msg_control(struct lwp *l, struct msghdr *mp, struct mbuf *control
* 1. different values for level/type on some archs
* 2. different alignment of CMSG_DATA on some archs
*/
+ memset(&linux_cmsg, 0, sizeof(linux_cmsg));
linux_cmsg.cmsg_len = cmsg->cmsg_len - LINUX_CMSG_ALIGN_DELTA;
linux_cmsg.cmsg_level = cmsg->cmsg_level;
linux_cmsg.cmsg_type = cmsg->cmsg_type;
diff --git a/sys/compat/linux/common/linux_time.c b/sys/compat/linux/common/linux_time.c
index 7d689ff76a9..74cfc84d69d 100644
--- a/sys/compat/linux/common/linux_time.c
+++ b/sys/compat/linux/common/linux_time.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_time.c,v 1.39 2017/07/29 02:31:22 riastradh Exp $ */
+/* $NetBSD: linux_time.c,v 1.39.8.1 2022/08/03 11:11:32 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.39 2017/07/29 02:31:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.39.8.1 2022/08/03 11:11:32 martin Exp $");
#include <sys/param.h>
#include <sys/ucred.h>
@@ -117,6 +117,7 @@ linux_sys_settimeofday(struct lwp *l, const struct linux_sys_settimeofday_args *
void
native_to_linux_timespec(struct linux_timespec *ltp, struct timespec *ntp)
{
+ memset(ltp, 0, sizeof(*ltp));
ltp->tv_sec = ntp->tv_sec;
ltp->tv_nsec = ntp->tv_nsec;
}
@@ -124,6 +125,7 @@ native_to_linux_timespec(struct linux_timespec *ltp, struct timespec *ntp)
void
linux_to_native_timespec(struct timespec *ntp, struct linux_timespec *ltp)
{
+ memset(ntp, 0, sizeof(*ntp));
ntp->tv_sec = ltp->tv_sec;
ntp->tv_nsec = ltp->tv_nsec;
}