aboutsummaryrefslogtreecommitdiff
path: root/lib/libprocstat/libprocstat.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-12-02 18:03:01 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-12-02 22:52:49 +0000
commit7a9423d6f360e3758ca67fbb25d309140ea93670 (patch)
tree987d9d8e7fec173927daad71bfa3f792d089f837 /lib/libprocstat/libprocstat.c
parent0ea3e4a27bc0d1b0fdf876c3ef89d790e29ad5b1 (diff)
downloadsrc-7a9423d6f360e3758ca67fbb25d309140ea93670.tar.gz
src-7a9423d6f360e3758ca67fbb25d309140ea93670.zip
procstat_getfiles_sysctl: do not require non-null ki_fd
ki_fd is legitimately NULL when 32bit process requests process data from 64bit host kernel. The field is not used by the code for sysctl case; procstat_getfiles_kvm() checks ki_fd. PR: 260174 Reported by: Damjan Jovanovic <damjan.jov@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'lib/libprocstat/libprocstat.c')
-rw-r--r--lib/libprocstat/libprocstat.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c
index b50875db1637..850d37598423 100644
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -865,8 +865,6 @@ procstat_getfiles_sysctl(struct procstat *procstat, struct kinfo_proc *kp,
cap_rights_t cap_rights;
assert(kp);
- if (kp->ki_fd == NULL)
- return (NULL);
switch (procstat->type) {
case PROCSTAT_SYSCTL:
files = kinfo_getfile(kp->ki_pid, &cnt);