Date: Fri, 22 Dec 2017 15:02:57 +0000 From: "Kamil Rytarowski" <ka...@netbsd.org> Message-ID: <20171222150257.8e519f...@cvs.netbsd.org>
| ptrace: Partially undo PT_{READ,WRITE}_{I,D} and unbreak these commands | | The refactored code did not work and was generating EFAULT. The only difference I see between the two (aside from an #if defined(__HAVE_RAS) which exists in the current version and is missing in the previous) is that the earlier one is missing UIO_SETUP_SYSSPACE(&uio); and consequently is not initialising uio->uio_vmspace (or not the same way, or properly) - the refactored code does uio.uio_vmspace = *vm; where vm is the final (6th) param to ptrace_doic() which it calls as if ((error = ptrace_doio(l, t, lt, &piod, addr, &vm)) != 0) where vm was declared as struct vmspace *vm; but is not otherwise initialised - fix this and the refactored code would probably work. kre