NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/56471: ntpd dies at startup on macppc/current, sshd randomly dies



The following reply was made to PR bin/56471; it has been noted by GNATS.

From: Jason Thorpe <thorpej%me.com@localhost>
To: Martin Husemann <martin%duskware.de@localhost>
Cc: gnats-bugs%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/56471: ntpd dies at startup on macppc/current, sshd randomly
 dies
Date: Sat, 30 Oct 2021 06:15:09 -0700

 --Apple-Mail=_CE036B8E-84DB-4C20-859B-EA82DAE652DB
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=utf-8
 
 
 > On Oct 30, 2021, at 5:48 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
 
 > I.e. does no checking, and simply forces it to what it should be =
 (modulo accepting the user-settable bits, which in the OEA case are =
 basically FP modes and single-stepping).
 
 Martin =E2=80=94 can you please try this patch?  I=E2=80=99d like to see =
 the debug output.
 
 
 --Apple-Mail=_CE036B8E-84DB-4C20-859B-EA82DAE652DB
 Content-Disposition: attachment;
 	filename=pr-56471-test-patch.txt
 Content-Type: text/plain;
 	x-unix-mode=0644;
 	name="pr-56471-test-patch.txt"
 Content-Transfer-Encoding: 7bit
 
 ? pr-56471-test-patch.txt
 Index: compat_16_machdep.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/compat_16_machdep.c,v
 retrieving revision 1.21
 diff -u -p -r1.21 compat_16_machdep.c
 --- compat_16_machdep.c	27 Oct 2021 04:15:00 -0000	1.21
 +++ compat_16_machdep.c	30 Oct 2021 13:13:30 -0000
 @@ -204,8 +204,11 @@ compat_16_sys___sigreturn14(struct lwp *
  	/*
  	 * Make sure SRR1 hasn't been maliciously tampered with.
  	 */
 -	if (!PSL_USEROK_P(sc.sc_frame.srr1))
 -		return (EINVAL);
 +	if (!PSL_USEROK_P(utf->srr1)) {
 +		printf("%s: XXX SRR1 = 0x%lx\n",
 +		    (u_long)sc.sc_frame.srr1);
 +		/* return (EINVAL); */
 +	}
  
  	/* Restore register context. */
  	memcpy(tf->tf_fixreg, utf->fixreg, sizeof(tf->tf_fixreg));
 @@ -214,7 +217,7 @@ compat_16_sys___sigreturn14(struct lwp *
  	tf->tf_xer  = utf->xer;
  	tf->tf_ctr  = utf->ctr;
  	tf->tf_srr0 = utf->srr0;
 -	tf->tf_srr1 = utf->srr1;
 +	tf->tf_srr1 = (utf->srr1 & PSL_USERMOD) | PSL_USERSET;
  
  #ifdef PPC_HAVE_FPU
  	struct pcb * const pcb = lwp_getpcb(l);
 
 --Apple-Mail=_CE036B8E-84DB-4C20-859B-EA82DAE652DB
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 
 
 -- thorpej
 
 
 --Apple-Mail=_CE036B8E-84DB-4C20-859B-EA82DAE652DB--
 


Home | Main Index | Thread Index | Old Index