Page MenuHomeFreeBSD

umtx: Check for errors from suword32()
ClosedPublic

Authored by markj on Dec 21 2023, 2:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 5, 8:01 PM
Unknown Object (File)
May 2 2024, 8:02 AM
Unknown Object (File)
Apr 27 2024, 2:31 PM
Unknown Object (File)
Apr 27 2024, 2:26 PM
Unknown Object (File)
Apr 27 2024, 2:26 PM
Unknown Object (File)
Apr 27 2024, 2:26 PM
Unknown Object (File)
Apr 27 2024, 1:01 PM
Unknown Object (File)
Mar 19 2024, 7:42 PM
Subscribers

Details

Summary

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Diff Detail

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

Event Timeline

kib added inline comments.
sys/kern/kern_umtx.c
2970

I propose to write the last three line as error = EFAULT; goto out' with the obvious place for the out label. The function has single return place.

3222

Now this really asks for the CAS loop. Might be it would be a useful primitive in kern_umtx.c the wrapper around casueword32 which handles thread_check_susp().

This revision is now accepted and ready to land.Dec 21 2023, 12:14 PM
markj added inline comments.
sys/kern/kern_umtx.c
3222

I don't quite follow - why do we want CAS here? This is just an atomic decrement.

This revision now requires review to proceed.Dec 21 2023, 3:29 PM
sys/kern/kern_umtx.c
3222

There is no atomic decrement op for userspace, We have to implement all of them as CAS.

This revision is now accepted and ready to land.Dec 21 2023, 3:43 PM
This revision was automatically updated to reflect the committed changes.