Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Apr 2011 01:19:15 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Oliver Pinter <oliver.pntr@gmail.com>
Cc:        svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   Re: svn commit: r218836 - in stable/8/sys: amd64/amd64 amd64/ia32 i386/i386 kern
Message-ID:  <20110416221915.GR48734@deviant.kiev.zoral.com.ua>
In-Reply-To: <BANLkTimOC-KrWNyDttZ_-iz4S0FH73p43Q@mail.gmail.com>
References:  <201102190739.p1J7dFjO087910@svn.freebsd.org> <BANLkTimOC-KrWNyDttZ_-iz4S0FH73p43Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--EqVOK5mkaJAMmtSx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Apr 16, 2011 at 11:04:38PM +0200, Oliver Pinter wrote:
> MFC this for 7-STABLE?
I do not reject the proposal, but I am quite curious why ?

I do not have any machine running 7, so please test the patch below.
It compiled for me on amd64.

Property changes on: .
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /head/sys:r218327

Index: kern/kern_context.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- kern/kern_context.c	(revision 220730)
+++ kern/kern_context.c	(working copy)
@@ -71,6 +71,7 @@
 		PROC_LOCK(td->td_proc);
 		uc.uc_sigmask =3D td->td_sigmask;
 		PROC_UNLOCK(td->td_proc);
+		bzero(uc.__spare__, sizeof(uc.__spare__));
 		ret =3D copyout(&uc, uap->ucp, UC_COPY_SIZE);
 	}
 	return (ret);
@@ -109,6 +110,7 @@
 		ret =3D EINVAL;
 	else {
 		get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
+		bzero(uc.__spare__, sizeof(uc.__spare__));
 		PROC_LOCK(td->td_proc);
 		uc.uc_sigmask =3D td->td_sigmask;
 		PROC_UNLOCK(td->td_proc);
Index: i386/i386/machdep.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- i386/i386/machdep.c	(revision 220730)
+++ i386/i386/machdep.c	(working copy)
@@ -342,12 +342,14 @@
 	/* Build the argument list for the signal handler. */
 	sf.sf_signum =3D sig;
 	sf.sf_scp =3D (register_t)&fp->sf_siginfo.si_sc;
+	bzero(&sf.sf_siginfo, sizeof(sf.sf_siginfo));
 	if (SIGISMEMBER(psp->ps_siginfo, sig)) {
 		/* Signal handler installed with SA_SIGINFO. */
 		sf.sf_arg2 =3D (register_t)&fp->sf_siginfo;
 		sf.sf_siginfo.si_signo =3D sig;
 		sf.sf_siginfo.si_code =3D ksi->ksi_code;
 		sf.sf_ahu.sf_action =3D (__osiginfohandler_t *)catcher;
+		sf.sf_addr =3D 0;
 	} else {
 		/* Old FreeBSD-style arguments. */
 		sf.sf_arg2 =3D ksi->ksi_code;
@@ -461,6 +463,11 @@
 	sf.sf_uc.uc_mcontext.mc_onstack =3D (oonstack) ? 1 : 0;
 	sf.sf_uc.uc_mcontext.mc_gs =3D rgs();
 	bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs));
+	bzero(sf.sf_uc.uc_mcontext.mc_fpregs,
+	    sizeof(sf.sf_uc.uc_mcontext.mc_fpregs));
+	bzero(sf.sf_uc.uc_mcontext.__spare__,
+	    sizeof(sf.sf_uc.uc_mcontext.__spare__));
+	bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
=20
 	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) !=3D 0 && !oonstack &&
@@ -480,6 +487,7 @@
 	/* Build the argument list for the signal handler. */
 	sf.sf_signum =3D sig;
 	sf.sf_ucontext =3D (register_t)&sfp->sf_uc;
+	bzero(&sf.sf_si, sizeof(sf.sf_si));
 	if (SIGISMEMBER(psp->ps_siginfo, sig)) {
 		/* Signal handler installed with SA_SIGINFO. */
 		sf.sf_siginfo =3D (register_t)&sfp->sf_si;
@@ -596,6 +604,11 @@
 	sf.sf_uc.uc_mcontext.mc_len =3D sizeof(sf.sf_uc.uc_mcontext); /* magic */
 	get_fpcontext(td, &sf.sf_uc.uc_mcontext);
 	fpstate_drop(td);
+	bzero(sf.sf_uc.uc_mcontext.mc_spare1,
+	    sizeof(sf.sf_uc.uc_mcontext.mc_spare1));
+	bzero(sf.sf_uc.uc_mcontext.mc_spare2,
+	    sizeof(sf.sf_uc.uc_mcontext.mc_spare2));
+	bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
=20
 	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) !=3D 0 && !oonstack &&
@@ -617,6 +630,7 @@
 	/* Build the argument list for the signal handler. */
 	sf.sf_signum =3D sig;
 	sf.sf_ucontext =3D (register_t)&sfp->sf_uc;
+	bzero(&sf.sf_si, sizeof(sf.sf_si));
 	if (SIGISMEMBER(psp->ps_siginfo, sig)) {
 		/* Signal handler installed with SA_SIGINFO. */
 		sf.sf_siginfo =3D (register_t)&sfp->sf_si;
@@ -2716,6 +2730,8 @@
 	mcp->mc_ss =3D tp->tf_ss;
 	mcp->mc_len =3D sizeof(*mcp);
 	get_fpcontext(td, mcp);
+	bzero(mcp->mc_spare1, sizeof(mcp->mc_spare1));
+	bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2));
 	return (0);
 }
=20
@@ -2763,6 +2779,7 @@
 #ifndef DEV_NPX
 	mcp->mc_fpformat =3D _MC_FPFMT_NODEV;
 	mcp->mc_ownedfp =3D _MC_FPOWNED_NONE;
+	bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate));
 #else
 	union savefpu *addr;
=20

Property changes on: contrib/pf
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /head/sys/contrib/pf:r218327


Property changes on: contrib/dev/acpica
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /head/sys/contrib/dev/acpica:r218327


Property changes on: cddl/contrib/opensolaris
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /head/sys/cddl/contrib/opensolaris:r218327

Index: amd64/amd64/machdep.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- amd64/amd64/machdep.c	(revision 220730)
+++ amd64/amd64/machdep.c	(working copy)
@@ -306,6 +306,9 @@
 	sf.sf_uc.uc_mcontext.mc_len =3D sizeof(sf.sf_uc.uc_mcontext); /* magic */
 	get_fpcontext(td, &sf.sf_uc.uc_mcontext);
 	fpstate_drop(td);
+	bzero(sf.sf_uc.uc_mcontext.mc_spare,
+	    sizeof(sf.sf_uc.uc_mcontext.mc_spare));
+	bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
=20
 	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) !=3D 0 && !oonstack &&
@@ -327,6 +330,7 @@
 	/* Build the argument list for the signal handler. */
 	regs->tf_rdi =3D sig;			/* arg 1 in %rdi */
 	regs->tf_rdx =3D (register_t)&sfp->sf_uc;	/* arg 3 in %rdx */
+	bzero(&sf.sf_si, sizeof(sf.sf_si));
 	if (SIGISMEMBER(psp->ps_siginfo, sig)) {
 		/* Signal handler installed with SA_SIGINFO. */
 		regs->tf_rsi =3D (register_t)&sfp->sf_si;	/* arg 2 in %rsi */
@@ -1653,6 +1657,7 @@
 	mcp->mc_ss =3D tp->tf_ss;
 	mcp->mc_len =3D sizeof(*mcp);
 	get_fpcontext(td, mcp);
+	bzero(mcp->mc_spare, sizeof(mcp->mc_spare));
 	return (0);
 }
=20
Index: amd64/ia32/ia32_signal.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- amd64/ia32/ia32_signal.c	(revision 220730)
+++ amd64/ia32/ia32_signal.c	(working copy)
@@ -158,6 +158,8 @@
 	mcp->mc_ss =3D tp->tf_ss;
 	mcp->mc_len =3D sizeof(*mcp);
 	ia32_get_fpcontext(td, mcp);
+	bzero(mcp->mc_spare1, sizeof(mcp->mc_spare1));
+	bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2));
 	return (0);
 }
=20
@@ -226,6 +228,7 @@
 		PROC_LOCK(td->td_proc);
 		uc.uc_sigmask =3D td->td_sigmask;
 		PROC_UNLOCK(td->td_proc);
+		bzero(&uc.__spare__, sizeof(uc.__spare__));
 		ret =3D copyout(&uc, uap->ucp, UC_COPY_SIZE);
 	}
 	return (ret);
@@ -345,6 +348,11 @@
 	sf.sf_uc.uc_mcontext.mc_eflags =3D regs->tf_rflags;
 	sf.sf_uc.uc_mcontext.mc_esp =3D regs->tf_rsp;
 	sf.sf_uc.uc_mcontext.mc_ss =3D regs->tf_ss;
+	bzero(sf.sf_uc.uc_mcontext.mc_fpregs,
+	    sizeof(sf.sf_uc.uc_mcontext.mc_fpregs));
+	bzero(sf.sf_uc.uc_mcontext.__spare__,
+	    sizeof(sf.sf_uc.uc_mcontext.__spare__));
+	bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
=20
 	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) !=3D 0 && !oonstack &&
@@ -362,6 +370,7 @@
 	/* Build the argument list for the signal handler. */
 	sf.sf_signum =3D sig;
 	sf.sf_ucontext =3D (register_t)&sfp->sf_uc;
+	bzero(&sf.sf_si, sizeof(sf.sf_si));
 	if (SIGISMEMBER(psp->ps_siginfo, sig)) {
 		/* Signal handler installed with SA_SIGINFO. */
 		sf.sf_siginfo =3D (u_int32_t)(uintptr_t)&sfp->sf_si;
@@ -463,6 +472,7 @@
 	sf.sf_uc.uc_mcontext.mc_len =3D sizeof(sf.sf_uc.uc_mcontext); /* magic */
 	ia32_get_fpcontext(td, &sf.sf_uc.uc_mcontext);
 	fpstate_drop(td);
+	bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
=20
 	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) !=3D 0 && !oonstack &&
@@ -482,6 +492,7 @@
 	/* Build the argument list for the signal handler. */
 	sf.sf_signum =3D sig;
 	sf.sf_ucontext =3D (register_t)&sfp->sf_uc;
+	bzero(&sf.sf_si, sizeof(sf.sf_si));
 	if (SIGISMEMBER(psp->ps_siginfo, sig)) {
 		/* Signal handler installed with SA_SIGINFO. */
 		sf.sf_siginfo =3D (u_int32_t)(uintptr_t)&sfp->sf_si;

--EqVOK5mkaJAMmtSx
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk2qFeIACgkQC3+MBN1Mb4hY7wCfbGQLZTOA0/mn4vEdbP2Yxyq4
TrwAoKw2g0eiHNk27FBA4C8WdkR8+Eq4
=Ro4W
-----END PGP SIGNATURE-----

--EqVOK5mkaJAMmtSx--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110416221915.GR48734>