mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
pdopenpid(2): in cap mode, translate all errors from pdopenpid1() to ECAPMODE
to not leak information about unused pids or system processes' pids.
Reviewed by: markj
Fixes: 73c92a978c ("pdopenpid(2): allow in capability mode with restrictions")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59252
This commit is contained in:
1 parent
d675662876
commit
326ab530dc
1 file changed
+3
@@ -728,7 +728,10 @@ kern_pdopenpid(struct thread *td, pid_t pid, int flags)
|
||||
fp->f_pdflags |= F_PD_NOKILL | F_PD_NOFINSTALL;
|
||||
filecaps_free(&fcaps);
|
||||
}
|
||||
} else if (IN_CAPABILITY_MODE(td)) {
|
||||
error = ECAPMODE;
|
||||
}
|
||||
|
||||
fdrop(fp, td);
|
||||
|
||||
if (pdf != NULL) {
|
||||
|
||||
Reference in new issue
Block a user