by cormander » Mon Mar 22, 2010 10:01 am
No way with grsecurity to do this.
You need to be root to do this. You could create a suid binary that gets root, does the chroot, and then drops back down to the previous user's privileges. If you need something more persistent than that (ie; sub processes need to call chroot), then you can instead have the suid binary get root, drop all capabilities except CAP_SYS_CHROOT, and drop back down to the user privileges. That will make that process (and any sub-process, I believe) able to make the chroot system call without being root.
Or there might be another way to add a capability (CAP_SYS_CHROOT) to a binary, process, or user, with some of the libcap userspace utilities (setpcaps, sucap, etc) but I'm not aware of how to do this for your situation.