CONFIG_GRKERNSEC_CHROOT_CAPS question
Posted: Fri Sep 02, 2011 6:39 pm
i have a kernel from ubuntu 10.04 patched with grsecurity patch 2.2.1.
i have enabled CONFIG_GRKERNSEC_CHROOT_CAPS option (and also appropriate sysctl option).
but when i running my daemon (if you want i can provide a source code) that needs cap_sys_time,cap_net_bind_service capabilities.
the work flow is the following:
[*] drop all capabilties to cap_sys_time,cap_net_bind_service,cap_sys_chroot,cap_setuid,cap_setgid
[*] seteuid (1000:1000)
[*] drop all capabilties to cap_sys_time,cap_net_bind_service,cap_sys_chroot
[*] chroot to some dir
[*] daemonize
[*] make chdir("/")
[*] drop all capabilties to final needed set: cap_sys_time,cap_net_bind_service
it succeeds to do everything including chroot but fails to drop allcapabilties to cap_sys_time,cap_net_bind_service.
however, the help of says:
i'm a little bit confused because my daemon runs in chroot with non-0 uid and gid...
however when disabling sysctl option
everything goes fine.
am i missing something?
i have enabled CONFIG_GRKERNSEC_CHROOT_CAPS option (and also appropriate sysctl option).
but when i running my daemon (if you want i can provide a source code) that needs cap_sys_time,cap_net_bind_service capabilities.
the work flow is the following:
[*] drop all capabilties to cap_sys_time,cap_net_bind_service,cap_sys_chroot,cap_setuid,cap_setgid
[*] seteuid (1000:1000)
[*] drop all capabilties to cap_sys_time,cap_net_bind_service,cap_sys_chroot
[*] chroot to some dir
[*] daemonize
[*] make chdir("/")
[*] drop all capabilties to final needed set: cap_sys_time,cap_net_bind_service
it succeeds to do everything including chroot but fails to drop allcapabilties to cap_sys_time,cap_net_bind_service.
however, the help of says:
the capabilities on all root processes within a
chroot jail will be lowered to stop module insertion, raw i/o,
system and net admin tasks, rebooting the system, modifying immutable
files, modifying IPC owned by another, and changing the system time.
i'm a little bit confused because my daemon runs in chroot with non-0 uid and gid...
however when disabling sysctl option
- Code: Select all
sysctl -w kernel.grsecurity.chroot_caps=0
everything goes fine.
am i missing something?