Page MenuHomeFreeBSD

Move 32-bit compat support for FIODGNAME to the right place.
ClosedPublic

Authored by brooks on Oct 2 2018, 11:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 27 2023, 10:21 PM
Unknown Object (File)
Dec 23 2023, 12:38 AM
Unknown Object (File)
Sep 13 2023, 7:01 PM
Unknown Object (File)
Sep 5 2023, 1:53 AM
Unknown Object (File)
Sep 5 2023, 1:51 AM
Unknown Object (File)
Sep 5 2023, 1:50 AM
Unknown Object (File)
Aug 30 2023, 4:06 PM
Unknown Object (File)
Aug 11 2023, 10:29 AM
Subscribers
None

Details

Reviewers
kib
jhb
emaste
Summary

ioctl(2) commands only have meaning in the context of a file descriptor
so translating them in the syscall layer is incorrect.

The new handler users an accessor to retrieve/construct a pointer from
the last member of the passed structure and relies on type punning to
access the other member which requires no translation.

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19928
Build 19445: arc lint + arc unit

Event Timeline

sys/fs/devfs/devfs_vnops.c
789

Why do the calculation to extract the len when you can directly use FIODTYPEXXX value ?

brooks added inline comments.
sys/fs/devfs/devfs_vnops.c
789

Because this pattern is more general and costs basically nothing. I don't care much in this case, but I'd rather people find examples that are generalizable when looking to add compat support.

kib added inline comments.
sys/fs/devfs/devfs_vnops.c
789

I do not agree with 'more general' part, and it actually confused me when I read this patch initially. More, the type-punning you do is not common for our tree and typically the manual copying of the structure member is performed, as in the unpatched current sources. But ok.

791

() around sizeof() are not needed.

This revision is now accepted and ready to land.Oct 3 2018, 4:58 PM
  • Switch on the actual command not the size per kib.
This revision now requires review to proceed.Oct 3 2018, 5:35 PM
This revision is now accepted and ready to land.Oct 3 2018, 6:00 PM