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)
Thu, Nov 27, 12:26 AM
Unknown Object (File)
Sat, Nov 22, 10:27 AM
Unknown Object (File)
Fri, Nov 21, 6:49 PM
Unknown Object (File)
Fri, Nov 21, 3:39 AM
Unknown Object (File)
Thu, Nov 20, 1:02 AM
Unknown Object (File)
Wed, Nov 19, 6:12 PM
Unknown Object (File)
Sun, Nov 9, 5:33 AM
Unknown Object (File)
Thu, Nov 6, 5:33 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.