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)
Sep 21 2024, 2:39 AM
Unknown Object (File)
Sep 20 2024, 3:44 PM
Unknown Object (File)
Sep 17 2024, 2:45 AM
Unknown Object (File)
Sep 16 2024, 7:50 PM
Unknown Object (File)
Sep 15 2024, 2:19 PM
Unknown Object (File)
Sep 5 2024, 10:18 AM
Unknown Object (File)
Aug 2 2024, 12:51 AM
Unknown Object (File)
Jul 12 2024, 10:04 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 55067
Build 51956: arc lint + arc unit

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.