From: Enrico Scholz (enrico.scholz_at_informatik.tu-chemnitz.de)
Date: Sun 03 Apr 2005 - 17:43:58 BST
Hello,
I discovered some irregularities regarding fakeinit functionality. The
following program gives different output on host and vservers:
| int main(int argc, char *argv[])
| {
| printf("%i\n", getsid(atoi(argv[1])));
| }
On host:
| # ./a.out 1
| 0
on VServer:
| # chcontext --xid 100 --flag fakeinit ./a.out 1
| 7448
This issue causes unexpected behaviour with SysV's 'killall5' which will
kill the init-process also.
Btw, this test reveals a minor security leak: getsid(2) does not test if
the pid is visible but gives out the correct result:
| # chcontext --xid 100 --flag fakeinit ./a.out $$
| 10461
('$$' expands to the pid of the bash invoking 'chcontext'). Ditto for
getpgid(2).
The used patch was vs1.9.5-rc4 on a 2.6.11.6 kernel.
Enrico
_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver