proot-me / proot

chroot, mount --bind, and binfmt_misc without privilege/setup for Linux
https://proot-me.github.io
GNU General Public License v2.0
1.97k stars 372 forks source link

Change restart_original_syscall to not use chained syscall #297

Closed yuyichao closed 2 years ago

yuyichao commented 2 years ago

If we are simply restarting a syscall, there's no need to do anything afterwards to restore any register values so we don't really need to keep a record of it ourselves in the chain syscall list.

By simply resetting the PC and the arguments, we avoid issue #292 for this function when we get a signal before we run the restarted syscall and confused syscall from the signal handler as the one we restarted (chained).