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
F131575586: D43273.id132191.diff
Thu, Oct 9, 10:21 AM
F131565662: D43273.diff
Thu, Oct 9, 7:57 AM
Unknown Object (File)
Sat, Oct 4, 7:35 AM
Unknown Object (File)
Fri, Oct 3, 6:38 PM
Unknown Object (File)
Fri, Oct 3, 9:12 AM
Unknown Object (File)
Thu, Oct 2, 6:12 PM
Unknown Object (File)
Tue, Sep 30, 6:52 AM
Unknown Object (File)
Wed, Sep 17, 4:18 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 55194
Build 52083: arc lint + arc unit

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
36

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!