<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libprocstat, branch releng/13.5</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.5</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.5'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2025-01-17T12:24:55Z</updated>
<entry>
<title>libprocstat: ZFS support: Makefile: Tidy up a bit</title>
<updated>2025-01-17T12:24:55Z</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2024-12-12T21:37:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6f43ca650d64d3d217fff9a4881f0cbea9f7efd0'/>
<id>urn:sha1:6f43ca650d64d3d217fff9a4881f0cbea9f7efd0</id>
<content type='text'>
Regroup assignments tweaking preprocessor defines/undefs, and separately
those about include directories.

Re-order include directories a bit more logically, and remove redundant
ones.

Separate logical groups by blank lines.

Build artifacts have been verified to stay the same when produced with
an external LLVM 18 toolchain.

MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48070

(cherry picked from commit 618c97b87b7124cdfb10d2f33a213c3302c8a98b)
</content>
</entry>
<entry>
<title>cred: proc_set_cred(), proc_unset_cred(): Update user's process count</title>
<updated>2025-01-17T12:24:53Z</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2024-08-02T15:57:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f872814e2d7a8841411569fc707b028463c7656b'/>
<id>urn:sha1:f872814e2d7a8841411569fc707b028463c7656b</id>
<content type='text'>
As a process really changes credentials at the moment proc_set_cred() or
proc_unset_cred() is called, these functions are the proper locations to
perform the update of the new and old real users' process count (using
chgproccnt()).

Before this change, change_ruid() instead would perform that update,
although it operates only on a passed credential which is a priori not
tied to the calling process (or not to any process at all).  This was
arguably a flaw of commit b1fc0ec1a7a49ded, r77183, based on its commit
message, and in particular the portion "(...) In each case, the call now
acts on a credential not a process (...)".

Fixing this makes using change_ruid() more natural when building
candidate credentials that in the end are not applied to a process,
e.g., because of some intervening privilege check.  Also, it removes
a hack around this unwanted process count change in unionfs.

We also introduce the new proc_set_cred_enforce_proc_lim() so that
callers can respect the per-user process limit, and will use it for the
upcoming setcred().  We plan to change all callers of proc_set_cred() to
call this new function instead at some point.  In the meantime, both
proc_set_cred() and the new function will coexist.

As detailed in some proc_set_cred_enforce_proc_lim()'s comment, checking
against the process limit is currently flawed as the kernel doesn't
really maintain the number of processes per UID (besides RLIMIT_NPROC,
this in fact also applies to RLIMIT_KQUEUES, RLIMIT_NPTS, RLIMIT_SBSIZE
and RLIMIT_SWAP).  The applied limit is currently that of the old real
UID.  Root (or a process granted with PRIV_PROC_LIMIT) is not subject to
this limit.

Approved by:    markj (mentor)
Fixes:          b1fc0ec1a7a49ded
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46923

(cherry picked from commit d2be7ed63affd8af5fe6203002b7cc3cbe7f7891)

Additional changes for this MFC:
1. &lt;sys/types.h&gt; was added as an include in &lt;sys/ucred.h&gt;, as some of
   its types are necessary whether the header is included by the kernel
   or userland.  Some later -CURRENT commits added it, but are not
   planned to be MFCed (mac_do(4) series, which doesn't exist in
   stable/13).
2. A number of files in 'lib/libprocstat' that include (indirectly)
   &lt;sys/ucred.h&gt; with _KERNEL defined were patched to include
   &lt;stdbool.h&gt; beforehand, so that 'bool', which is part of the new
   signature for proc_set_cred*(), is defined when &lt;sys/ucred.h&gt; is
   processed (&lt;sys/types.h&gt; does not define it when _KERNEL is defined).
</content>
</entry>
<entry>
<title>libprocstat: improve conditional for 32-bit compat</title>
<updated>2023-10-26T20:38:41Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2023-10-26T20:38:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=302ff7e6aff0da1ea3b4de79940aac8103e4bb9c'/>
<id>urn:sha1:302ff7e6aff0da1ea3b4de79940aac8103e4bb9c</id>
<content type='text'>
Include support for translating 32-bit auxv vectors on non-64-bit
platforms that aren't riscv (which has no 32-bit ABI support and
probably never will).

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42201

(cherry picked from commit 248fe3d3483cb3ec2c78dd31dc02a467060a6577)
</content>
</entry>
<entry>
<title>libprocstat: copy all the 32-bit auxv entries</title>
<updated>2023-10-26T20:38:41Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2023-10-26T20:38:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ea7f064a780b6f6bb023757a5eb8b997bd272687'/>
<id>urn:sha1:ea7f064a780b6f6bb023757a5eb8b997bd272687</id>
<content type='text'>
Use source struct size not the destination struct size so we copy all
the auxv entries, not just the first half of them.

Fix a style issue on an adjacent line.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42200

(cherry picked from commit 8f06fabe39ac3ebca4ab448a456945008305a23f)
</content>
</entry>
<entry>
<title>libprocstat: make sv_name not static</title>
<updated>2023-10-26T20:38:41Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2023-10-26T20:38:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=efeba8da1d2da9d2c471936415cfad5f63daae76'/>
<id>urn:sha1:efeba8da1d2da9d2c471936415cfad5f63daae76</id>
<content type='text'>
Making this variable static makes is_elf32_sysctl() and callers thread
unsafe.

Use a less absurd length for sv_name.  The longest name in the system is
"FreeBSD ELF64 V2" which tips the scales at 16+1 bytes.  We'll almost
certainly have other problems if we exceed 32 characters.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42199

(cherry picked from commit 72a4ee26a7c665ae1c31abe1c6feeaa7ccaba140)
</content>
</entry>
<entry>
<title>libprocstat: simplify auxv value conversion</title>
<updated>2023-10-26T20:38:41Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2023-10-26T20:38:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9fcbd4c0d19cdbfa1fb4711c00c9c9cf84dbefb0'/>
<id>urn:sha1:9fcbd4c0d19cdbfa1fb4711c00c9c9cf84dbefb0</id>
<content type='text'>
Avoid a weird dance through the union and treat all 32-bit values as
unsigned integers.  This avoids sign extension of flags and userspace
pointers.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42198

(cherry picked from commit 9735cc0e41825bb9e95d16433d381ffe4c190f38)
</content>
</entry>
<entry>
<title>libprocstat: style: space after switch</title>
<updated>2023-10-26T20:38:40Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2023-10-26T20:38:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8888b14f1b771e65013601801a82b27ca539a5e0'/>
<id>urn:sha1:8888b14f1b771e65013601801a82b27ca539a5e0</id>
<content type='text'>
Style demands a space after the switch keyword.

Noticed reviewing code in CheriBSD that propagated the style bug.

Reported by:	markj
Sponsored by:	DARPA
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D42041

(cherry picked from commit ccac440f7cbb013de41aa3933f3f7be77225c44f)
</content>
</entry>
<entry>
<title>libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum</title>
<updated>2023-09-26T13:04:40Z</updated>
<author>
<name>John Hein</name>
<email>jcfyecrayz@liamekaens.com</email>
</author>
<published>2023-09-21T23:43:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=09cd74a0b8d5a0b625ac7706ddc4655664fb05f9'/>
<id>urn:sha1:09cd74a0b8d5a0b625ac7706ddc4655664fb05f9</id>
<content type='text'>
PR:             273966
Reviewed by:	emaste

(cherry picked from commit 633094c27f0ac1b1001d5bd24a883240b4bce1dc)
(cherry picked from commit fd8bf2ecc05af841aa7e8369a43861cdc122d404)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line nroff pattern</title>
<updated>2023-08-23T17:43:31Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:32:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b144e70a3325e033163aa4e6e15d0446e245702d'/>
<id>urn:sha1:b144e70a3325e033163aa4e6e15d0446e245702d</id>
<content type='text'>
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit fa9896e082a1)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-23T17:43:30Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:32:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=023fc80ee38a117fa65b2ccb2abf8bdc7dbd6fd9'/>
<id>urn:sha1:023fc80ee38a117fa65b2ccb2abf8bdc7dbd6fd9</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit d0b2dbfa0ecf)
</content>
</entry>
</feed>
