Page MenuHomeFreeBSD

Fix error handling for vmspace_rwmem() consumers
ClosedPublic

Authored by kib on Aug 14 2026, 5:50 AM.
Tags
None
Referenced Files
F174965866: D58838.id184049.diff
Wed, Oct 7, 6:21 AM
F174965816: D58838.id184036.diff
Wed, Oct 7, 6:20 AM
F174965663: D58838.id.diff
Wed, Oct 7, 6:19 AM
F174914369: D58838.diff
Tue, Oct 6, 10:50 PM
Unknown Object (File)
Sat, Oct 3, 12:30 PM
Unknown Object (File)
Tue, Sep 29, 4:42 PM
Unknown Object (File)
Tue, Sep 29, 4:41 PM
Unknown Object (File)
Tue, Sep 29, 11:32 AM
Subscribers

Details

Summary
kern/kern_proc.c: do not throw out read data in get_ps_strings()

Since vmspace_iop()/proc_readmem() might return -1 on error from
vmspace_rwmem(), account for this and stop reading but return already
accumulated data if any, instead of returning an error.

PR:     297512
Fixes:  e1b0d051bbf7 ("proc: Allow to make proc_rwmem() operate on a consistent address space")


kern/sys_process.c: make vmspace_rwmem() similar to io functions

In particular, if there were any bytes moved, and then vm_fault()
faulted, do not return an error, but report the short io instead.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable