Page MenuHomeFreeBSD

comms/opencbm-kmod: Add error handling for copyin() and copyout() calls
ClosedPublic

Authored by markj on Jan 2 2024, 5:11 PM.
Tags
None
Referenced Files
F82302428: D43273.diff
Sat, Apr 27, 11:30 AM
F82279303: D43273.id132121.diff
Sat, Apr 27, 6:20 AM
Unknown Object (File)
Fri, Apr 26, 1:33 PM
Unknown Object (File)
Sun, Apr 14, 5:35 PM
Unknown Object (File)
Fri, Apr 12, 9:28 AM
Unknown Object (File)
Mon, Apr 8, 10:29 PM
Unknown Object (File)
Sun, Apr 7, 5:05 AM
Unknown Object (File)
Wed, Apr 3, 8:02 PM
Subscribers
None

Details

Summary

This will be required soon as my intent is to annotate copyin() and
related functions with __result_use_check. Moreover, the lack of error
handling here is a real bug.

I replaced the existing patch file with the one generated by
"make makepatch".

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jan 2 2024, 5:11 PM
markj created this revision.

Thanks for this! It seems I goofed here a long time ago when I ported the existing Linux driver to FreeBSD, the original code *does* error-check copy_[from|to]_user().

Would you mind creating an upstream pull request at https://github.com/OpenCBM/OpenCBM as well? The FreeBSD-14 patch was already included there.

comms/opencbm-kmod/files/patch-opencbm.c
37

nitpick, I'd suggest to keep the "condensed" coding style of the original linux driver:

if (rv)
    break;

It doesn't really matter though ....

This revision is now accepted and ready to land.Jan 3 2024, 11:34 AM
markj marked an inline comment as done.
  • Bump PORTREVISION
  • Remove unneeded braces
This revision now requires review to proceed.Jan 3 2024, 3:22 PM

Thanks for this! It seems I goofed here a long time ago when I ported the existing Linux driver to FreeBSD, the original code *does* error-check copy_[from|to]_user().

Would you mind creating an upstream pull request at https://github.com/OpenCBM/OpenCBM as well? The FreeBSD-14 patch was already included there.

Sure, done: https://github.com/OpenCBM/OpenCBM/pull/109

Thanks a lot again, please
shipit

This revision is now accepted and ready to land.Jan 3 2024, 4:46 PM

Thanks for the quick review!