Page MenuHomeFreeBSD

ptrace: document ENOMEM
ClosedPublic

Authored by trasz on Apr 24 2021, 10:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 12:28 PM
Unknown Object (File)
Fri, Apr 5, 1:15 PM
Unknown Object (File)
Mar 7 2024, 11:38 PM
Unknown Object (File)
Feb 24 2024, 4:34 PM
Unknown Object (File)
Feb 11 2024, 10:41 PM
Unknown Object (File)
Jan 14 2024, 3:40 AM
Unknown Object (File)
Dec 24 2023, 12:03 AM
Unknown Object (File)
Dec 22 2023, 11:55 PM
Subscribers

Details

Diff Detail

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

Event Timeline

Note that I'm open to change the return value to EFAULT and documenting that instead; I'm a bit worried about possible breakage in eg debuggers, but, given Mark's explanation of how EFAULT and ENOMEM was squoshed together, it might be safe. So, if you think that's the right way, please tell.

Note that I'm open to change the return value to EFAULT and documenting that instead; I'm a bit worried about possible breakage in eg debuggers, but, given Mark's explanation of how EFAULT and ENOMEM was squoshed together, it might be safe. So, if you think that's the right way, please tell.

I don't have a strong feeling about it. I agree that it probably doesn't break anything. OTOH we have lots of errnos that don't really make sense, I'm not sure there's much value in fixing this one example. Documenting it is good enough IMO.

lib/libc/sys/ptrace.2
1222

We can always change both if we decide to use EFAULT instead, so I'm happy to see this go ahead

This revision is now accepted and ready to land.May 4 2021, 1:04 PM
This revision was automatically updated to reflect the committed changes.

I like it better if EFAULT is reserved as much as possible to the case where a syscall argument points to an invalid memory location for the calling process, which is undefined behaviour according to POSIX and other standards and often behaves poorly (for example, completing an operation but discarding the result). If the address in the target process passed to PT_READ_I is invalid, this is fully defined and may not be fully avoidable (for example if the traced process is running concurrently).