Handle unlikely errors from personality syscall

Despite being marked as SYSCALL_NEVER_FAILS, personality syscall still
might report a failure on some architectures due to obscure kernel
bugs.  Check for this unlikely case and let users know that their
kernel has gone bananas.

* personality.c (SYS_FUNC(personality)): Do not parse syscall return
value in case of syserror.
This commit is contained in:
Дмитрий Левин 2015-12-27 00:18:35 +00:00
parent abfa939f57
commit 0297e0c067

View File

@ -50,6 +50,9 @@ SYS_FUNC(personality)
return 0;
}
if (syserror(tcp))
return 0;
pers = tcp->u_rval;
const char *type = xlookup(personality_types, pers & PER_MASK);
char *p;