chroot() is from ancient Unix/BSD times and was in Linux since pretty much the beginning of Linux.
Changing its behavior after the fact would break expected behavior of existing programs AND would break compatibility with other Unixen.
Back in high school (in Austria, speaking German) I've been told several times by a Unix grey beard I had as a teacher that "Unixen" is the preferred plural of Unix, similar to "VAXen" for VAX, which the English Wiktionary does seem to know about.
Even Unix v7 insists on chroot() being only called by the root user (the chroot syscall is in /usr/sys/sys/sys4.c).
I do see the usage for bootstrapping and troubleshooting so that does cause an issue.
Going out of compliance will come at some cost.
https://pubs.opengroup.org/onlinepubs/7908799/xsh/chroot.htm...
Linux systems adhere to POSIX,[81] SUS,[82] LSB, ISO, and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.[83][84]
https://en.wikipedia.org/wiki/Linux
Archive.org has the supporting documents.
https://web.archive.org/web/20160404122450/http://www.linuxj...
"Unifix GmbH (Braunschweig, Germany) developed a Linux system that has been certified to conform to FIPS 151-2 (a superset of POSIX.1). This technology was available in Unifix' own distribution called Unifix Linux 2.0 and in Lasermoon's Linux-FT."
https://web.archive.org/web/20111010111215/http://www.debian...
But I believe the appropriate solution would be either:
- a prctrl like PR_SET_RESTRICED_CHROOT which will "degrade" CAP_SYS_CHROOT to require all the thinks listed (but still requires CAP_SYS_CHROOT).
- a new capability like CAP_SYS_RESTRICTED_CHROOT (probably not an option).
The current patch would weakening the security sandbox of any process dropping CAP_SYS_CHROOT which IMHO is unacceptable given that PR_SET_NO_NEW_PRIVS is known as being imperfect.