vsyscall: send SIGSEGV to the caller if syscall fails

On CentOS 7 (RHEL 7?), "errno" isn't set when vsyscall_gettimeofday
fails. So, in such case, vsyscall_gettimeofday send SIGSEGV to the
caller to report failure of gettimeofday operation.
This commit is contained in:
NAKAMURA Gou
2015-09-16 13:14:18 +09:00
parent bd5708286d
commit b1b706453f

View File

@ -30,6 +30,9 @@ int vsyscall_gettimeofday(void *tv, void *tz)
: "a" (__NR_gettimeofday), "D" (tv), "S" (tz) : "a" (__NR_gettimeofday), "D" (tv), "S" (tz)
: "%rcx", "%r11", "memory"); : "%rcx", "%r11", "memory");
if (error) {
*(int *)0 = 0; /* i.e. raise(SIGSEGV) */
}
return error; return error;
} }