NetBSD-Bugs archive

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

re: kern/51514: ptrace(2) fails for 32-bit process on 64-bit kernel



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

From: matthew green <mrg%eterna.com.au@localhost>
To: Nick Hudson <skrll%netbsd.org@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, gnats-admin%netbsd.org@localhost,
    netbsd-bugs%netbsd.org@localhost, rokuyama%rk.phys.keio.ac.jp@localhost
Subject: re: kern/51514: ptrace(2) fails for 32-bit process on 64-bit kernel
Date: Mon, 17 Oct 2016 05:33:39 +1100

 >  	/* XXX avoid sign extension problems with unknown upper bits? */
 > +	regs->r_gs = tf->tf_gs & 0xffff;
 > +	regs->r_fs = tf->tf_fs & 0xffff;
 > +	regs->r_es = tf->tf_es & 0xffff;
 > +	regs->r_ds = tf->tf_ds & 0xffff;
 > +	regs->r_eflags = tf->tf_rflags;
 > @@ -501,9 +501,9 @@ netbsd32_process_read_regs(struct lwp *l
 > -	regs->r_cs = tf->tf_cs;
 > +	regs->r_cs = tf->tf_cs & 0xffff;
 >  	regs->r_esp = tf->tf_rsp & 0xffffffff;
 > -	regs->r_ss = tf->tf_ss;
 > +	regs->r_ss = tf->tf_ss & 0xffff;
 
 i wonder if there should be ASSERT()s that they're not set.  there
 really should never be anything set here.  x86-heads?
 
 > -	tf->tf_y = regs->r_pc;
 > +	tf->tf_y = regs->r_y;
 
 well spotted.
 
 rest LGTM and what i was envisioning.  thanks!
 
 
 .mrg.
 


Home | Main Index | Thread Index | Old Index