From owner-svn-src-all@FreeBSD.ORG Sat Apr 16 21:34:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE8FA1065672; Sat, 16 Apr 2011 21:34:09 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id DCE508FC13; Sat, 16 Apr 2011 21:34:08 +0000 (UTC) Received: by wwc33 with SMTP id 33so4291116wwc.31 for ; Sat, 16 Apr 2011 14:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=CqOBizRFFLZm76MwYWhLLKs2gKN8txZQB3lKN1IxJJE=; b=UKSgPV5UYU+mCKpgt/nee1GleHm1wBBP4ajbk36rgDDEBzpxASRTANxhZFu7U6jHjx 0hm874Y+Z0IjFos+/pNuoyQHjAy/LGRWD2nsOhavN4cjZEOJTcv0cXLgxoMg7naLCbI7 9aYR0Ol6G7ziFE+IXSvZ21v/iYexxaiUKMzVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=LbaaideS0z40GVI+2e2L3oliYB8P+JtMi3uejfD8EGbCiz4WjHy4gQWhzGsIex9tbA 54eVPU5X8gOERPn935ZdlSBP1ZE9p5XlgT6pcQ6at2p/s2Cv1pp7923gt0hTH076BcAi 3MbJiWMrJfqKrYLc4WSMlzUFJUNF2R13DiXkY= MIME-Version: 1.0 Received: by 10.227.163.13 with SMTP id y13mr3455682wbx.56.1302987878614; Sat, 16 Apr 2011 14:04:38 -0700 (PDT) Received: by 10.227.136.199 with HTTP; Sat, 16 Apr 2011 14:04:38 -0700 (PDT) In-Reply-To: <201102190739.p1J7dFjO087910@svn.freebsd.org> References: <201102190739.p1J7dFjO087910@svn.freebsd.org> Date: Sat, 16 Apr 2011 23:04:38 +0200 Message-ID: From: Oliver Pinter To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 21:34:09 -0000 MFC this for 7-STABLE? On 2/19/11, Konstantin Belousov wrote: > Author: kib > Date: Sat Feb 19 07:39:14 2011 > New Revision: 218836 > URL: http://svn.freebsd.org/changeset/base/218836 > > Log: > MFC r218327: > Clear the padding when returning context to the usermode. > > Modified: > stable/8/sys/amd64/amd64/machdep.c > stable/8/sys/amd64/ia32/ia32_signal.c > stable/8/sys/i386/i386/machdep.c > stable/8/sys/kern/kern_context.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > > Modified: stable/8/sys/amd64/amd64/machdep.c > ============================================================================== > --- stable/8/sys/amd64/amd64/machdep.c Sat Feb 19 03:32:10 2011 (r218835) > +++ stable/8/sys/amd64/amd64/machdep.c Sat Feb 19 07:39:14 2011 (r218836) > @@ -329,6 +329,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, > fpstate_drop(td); > sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase; > sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase; > + 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__)); > > /* Allocate space for the signal handler context. */ > if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && > @@ -350,6 +353,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, > /* Build the argument list for the signal handler. */ > regs->tf_rdi = sig; /* arg 1 in %rdi */ > regs->tf_rdx = (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 = (register_t)&sfp->sf_si; /* arg 2 in %rsi */ > @@ -2034,6 +2038,7 @@ get_mcontext(struct thread *td, mcontext > get_fpcontext(td, mcp); > mcp->mc_fsbase = td->td_pcb->pcb_fsbase; > mcp->mc_gsbase = td->td_pcb->pcb_gsbase; > + bzero(mcp->mc_spare, sizeof(mcp->mc_spare)); > return (0); > } > > > Modified: stable/8/sys/amd64/ia32/ia32_signal.c > ============================================================================== > --- stable/8/sys/amd64/ia32/ia32_signal.c Sat Feb 19 03:32:10 2011 (r218835) > +++ stable/8/sys/amd64/ia32/ia32_signal.c Sat Feb 19 07:39:14 2011 (r218836) > @@ -164,6 +164,8 @@ ia32_get_mcontext(struct thread *td, str > ia32_get_fpcontext(td, mcp); > mcp->mc_fsbase = td->td_pcb->pcb_fsbase; > mcp->mc_gsbase = td->td_pcb->pcb_gsbase; > + bzero(mcp->mc_spare1, sizeof(mcp->mc_spare1)); > + bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2)); > td->td_pcb->pcb_full_iret = 1; > return (0); > } > @@ -230,6 +232,7 @@ freebsd32_getcontext(struct thread *td, > PROC_LOCK(td->td_proc); > uc.uc_sigmask = td->td_sigmask; > PROC_UNLOCK(td->td_proc); > + bzero(&uc.__spare__, sizeof(uc.__spare__)); > ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); > } > return (ret); > @@ -345,6 +348,11 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi > sf.sf_uc.uc_mcontext.mc_es = regs->tf_es; > sf.sf_uc.uc_mcontext.mc_fs = regs->tf_fs; > sf.sf_uc.uc_mcontext.mc_gs = regs->tf_gs; > + 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__)); > > /* Allocate space for the signal handler context. */ > if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && > @@ -362,6 +370,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi > /* Build the argument list for the signal handler. */ > sf.sf_signum = sig; > sf.sf_ucontext = (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 = (u_int32_t)(uintptr_t)&sfp->sf_si; > @@ -464,6 +473,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * > fpstate_drop(td); > sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase; > sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase; > + bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); > > /* Allocate space for the signal handler context. */ > if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && > @@ -483,6 +493,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * > /* Build the argument list for the signal handler. */ > sf.sf_signum = sig; > sf.sf_ucontext = (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 = (u_int32_t)(uintptr_t)&sfp->sf_si; > > Modified: stable/8/sys/i386/i386/machdep.c > ============================================================================== > --- stable/8/sys/i386/i386/machdep.c Sat Feb 19 03:32:10 2011 (r218835) > +++ stable/8/sys/i386/i386/machdep.c Sat Feb 19 07:39:14 2011 (r218836) > @@ -379,12 +379,14 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, > /* Build the argument list for the signal handler. */ > sf.sf_signum = sig; > sf.sf_scp = (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 = (register_t)&fp->sf_siginfo; > sf.sf_siginfo.si_signo = sig; > sf.sf_siginfo.si_code = ksi->ksi_code; > sf.sf_ahu.sf_action = (__osiginfohandler_t *)catcher; > + sf.sf_addr = 0; > } else { > /* Old FreeBSD-style arguments. */ > sf.sf_arg2 = ksi->ksi_code; > @@ -498,6 +500,11 @@ freebsd4_sendsig(sig_t catcher, ksiginfo > sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0; > sf.sf_uc.uc_mcontext.mc_gs = 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__)); > > /* Allocate space for the signal handler context. */ > if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && > @@ -517,6 +524,7 @@ freebsd4_sendsig(sig_t catcher, ksiginfo > /* Build the argument list for the signal handler. */ > sf.sf_signum = sig; > sf.sf_ucontext = (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 = (register_t)&sfp->sf_si; > @@ -643,6 +651,11 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, > sdp = &td->td_pcb->pcb_gsd; > sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | > sdp->sd_lobase; > + 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__)); > > /* Allocate space for the signal handler context. */ > if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && > @@ -664,6 +677,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, > /* Build the argument list for the signal handler. */ > sf.sf_signum = sig; > sf.sf_ucontext = (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 = (register_t)&sfp->sf_si; > @@ -3268,7 +3282,8 @@ get_mcontext(struct thread *td, mcontext > mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; > sdp = &td->td_pcb->pcb_gsd; > mcp->mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; > - > + bzero(mcp->mc_spare1, sizeof(mcp->mc_spare1)); > + bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2)); > return (0); > } > > @@ -3317,6 +3332,7 @@ get_fpcontext(struct thread *td, mcontex > #ifndef DEV_NPX > mcp->mc_fpformat = _MC_FPFMT_NODEV; > mcp->mc_ownedfp = _MC_FPOWNED_NONE; > + bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); > #else > mcp->mc_ownedfp = npxgetregs(td); > bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, > > Modified: stable/8/sys/kern/kern_context.c > ============================================================================== > --- stable/8/sys/kern/kern_context.c Sat Feb 19 03:32:10 2011 (r218835) > +++ stable/8/sys/kern/kern_context.c Sat Feb 19 07:39:14 2011 (r218836) > @@ -71,6 +71,7 @@ getcontext(struct thread *td, struct get > PROC_LOCK(td->td_proc); > uc.uc_sigmask = td->td_sigmask; > PROC_UNLOCK(td->td_proc); > + bzero(uc.__spare__, sizeof(uc.__spare__)); > ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); > } > return (ret); > @@ -107,6 +108,7 @@ swapcontext(struct thread *td, struct sw > ret = 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 = td->td_sigmask; > PROC_UNLOCK(td->td_proc); > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" >