These syscalls are allowed in capability mode but accept an arbitrary
pid (or lwpid for rtprio_thread(2)), so a sandboxed process can probe
for the existence of other processes and query or, subject to
p_cansched(), modify their scheduling parameters. Restrict them to the
calling process in capability mode, as was done for get/setpriority(2)
in 72e34b3e3907.
In capability mode rtprio_thread(2) only looks up threads of the
calling process, and returns ECAPMODE for any other lwpid, including
one that does not exist.
getpgid(2) and getsid(2) are handled in D57385.
Add capmode tests.
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>