ptrace::getregs
& ptrace::getregset
may lead to UB of uninitialized data read
#2447
Labels
ptrace::getregs
& ptrace::getregset
may lead to UB of uninitialized data read
#2447
ptrace::getregs
andptrace::getregset
are used to get register values of certain process (tracee), which utilizes theptrace(PTRACE_GETREGSET, ..)
syscall:In amd64 Linux, if the tracer is 64bit process, tracee is 32bit process, the
S::Regs
will be resolved to 64bit version oflibc::user_regs_struct
, while after the syscall return, theS::VALUE
buffer is filled by kernel with 32bit version of such struct. (Theiovec.iov_len
field will be 68 after returning, which confirms such thing). Reading the returnedS::Regs
will lead to uninitialized data, which is UB.The text was updated successfully, but these errors were encountered: