freebsd-src icon indicating copy to clipboard operation
freebsd-src copied to clipboard

linprocfs: Continue on error when reading process limits

Open ricardobranco777 opened this issue 10 months ago • 4 comments

Continue on error when reading process limits.

Fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283726

Most text utilities with capsicum(4) enabled fail when reading /compat/linux/proc/*/limits because both LINUX_RLIMIT_SIGPENDING & LINUX_RLIMIT_MSGQUEUE call kernel_sysctlbyname.

The alternative would be to make the variables accessed by the kern.sigqueue.max_pending_per_proc & kern.ipc.msgmnb sysctl's public. This was done for reading /proc/cpuinfo in https://github.com/freebsd/freebsd-src/commit/d74a742704eb81f0c6f4aa83e4cb0de26a81c400

ricardobranco777 avatar Feb 06 '25 22:02 ricardobranco777

@bsdimp can we merge this? I've been using successfully without issues.

ricardobranco777 avatar Jun 18 '25 13:06 ricardobranco777

@lemul What do you think? I think this is good, but a second set of eyes would be good.

bsdimp avatar Jun 18 '25 19:06 bsdimp

Well, I'm not object it, but what sense to hide permission error from the user?

lemul avatar Jun 18 '25 20:06 lemul

Well, I'm not object it, but what sense to hide permission error from the user?

The intention is not to hide an error but to fetch the rest of the information because the sysctl fails with Capsicum enabled. We can either ignore the error or make the variables public to avoid making a sysctl call like it was done for cpuinfo here:

https://github.com/freebsd/freebsd-src/commit/d74a742704eb81f0c6f4aa83e4cb0de26a81c400

ricardobranco777 avatar Jun 18 '25 20:06 ricardobranco777

ping

ricardobranco777 avatar Jul 26 '25 15:07 ricardobranco777

Ooops. Missed the exchange back in June. I'll land this now. In the future, the commit message should have "PR: " in it. As well as an explanation for why, as you've provided in the comments. Since it was my bad to miss this in June, I've done those things and will push this in shortly.

bsdimp avatar Jul 26 '25 16:07 bsdimp

Automated message from ghpr: Thank you for your submission. This PR has been merged to FreeBSD's branch. These changes will appear shortly on our GitHub mirror.

bsdimp avatar Jul 26 '25 17:07 bsdimp