man 2 unshare tells us
Use of CLONE_NEWPID requires the CAP_SYS_ADMIN capability
and the suggested readreading for further information as suggested man 7 pid_namespaces does not really disclose or talk aboutdiscuss the prosumablepresumable risk that makes it necessary to restrict pid_namespaces to be used by root/CAP_SYS_ADMIN only?.
Indeed I wonder strongly whatWhat would the risk of CLONE_NEWPID wouldCLONE_NEWPID be if run by a non-root user?
In a clone without CLONE_NEWPIDwithout CLONE_NEWPID the PID namespacepid_namespace would be unchanged and hence much broader and potentially more dangerous than it would be int the case of creating a new empty pid namespacepid_namespace.
Sadly the, without hackery orsome concept of user PID namespaces for a non-root user, keeping track of decendentdescendant processes reliably in linux cannot be improved when pid namespaces are not available, which thoughLinux becomes difficult. pid_namespaces would be a very handy functionality and makethus it incompehensibleis incomprehensible to me why only CAP_SYS_ADMINCAP_SYS_ADMIN is thought fit to run CLONE_NEWPIDCLONE_NEWPID. Did I miss a major point that makes CLONE_NEWPIDCLONE_NEWPID such a risky busyness?