Page MenuHomeFreeBSD

Don't return errors from the cryptodev_process() method.
ClosedPublic

Authored by jhb on Tue, Sep 8, 4:51 PM.

Details

Summary

The cryptodev_process() method should either return 0 if it has
completed a request, or ERESTART to defer the request until later. If
a request encounters an error, the error should be reported via
crp_etype before completing the request via crypto_done().

Fix a few more drivers noticed by asomers@ similar to the fix in
r365389. This is an old bug, but went unnoticed since crypto requests
did not start failing as a normal part of operation until digest
verification was introduced which can fail requests with EBADMSG.

PR: 247986
Reported by: asomers

Test Plan
  • none yet, still need to compile test

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Tue, Sep 8, 4:51 PM
jhb requested review of this revision.Tue, Sep 8, 4:51 PM
jhb edited the summary of this revision. (Show Details)Tue, Sep 8, 4:52 PM
jhb added inline comments.
sys/dev/safe/safe.c
1262 ↗(On Diff #76777)

This is slightly different as we need to pass ERESTART to the caller.

asomers accepted this revision.Tue, Sep 8, 5:44 PM
This revision is now accepted and ready to land.Tue, Sep 8, 5:44 PM
This revision was automatically updated to reflect the committed changes.