Enhance personality switching
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 23 Dec 2011 00:50:49 +0000 (00:50 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 23 Dec 2011 00:50:49 +0000 (00:50 +0000)
commita5a839a920da9d54c4174ebc82b29d7718839029
treee44bcac06e54707d90a4c62989b63b537dd7f554
parentb05fc5463be8df587b4acc8f522f51e21bc22be8
Enhance personality switching

On syscall entry, save current personality in the tcb structure
along with scno.
On syscall exit, restore current personality from the tcb structure.
* defs.h (struct tcb) [SUPPORTED_PERSONALITIES > 1]: Add currpers
field.
* strace.c (alloc_tcb) [SUPPORTED_PERSONALITIES > 1]: Initialize
tcp->currpers.
* syscall.c (update_personality) [SUPPORTED_PERSONALITIES > 1]: New
function.
(get_scno, trace_syscall_exiting): Use it.

Reported-by: Michael A Fetterman <mafetter@nvidia.com>
defs.h
strace.c
syscall.c