Page MenuHomeFreeBSD

cam: Let cam_periph_unmapmem() return an error
ClosedPublic

Authored by markj on Dec 26 2023, 11:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 3:20 AM
Unknown Object (File)
Fri, Dec 6, 8:16 AM
Unknown Object (File)
Fri, Dec 6, 8:16 AM
Unknown Object (File)
Dec 3 2024, 10:50 PM
Unknown Object (File)
Dec 3 2024, 10:29 PM
Unknown Object (File)
Dec 2 2024, 9:45 AM
Unknown Object (File)
Dec 2 2024, 9:14 AM
Unknown Object (File)
Sep 15 2024, 5:52 AM
Subscribers

Details

Summary

As of commit b059686a71c8, cam_periph_unmapmem() can legitimately fail,
if the copyout() operation fails. However, this failure is never
signaled to upper layers. In practice it is unlikely to occur since
cap_periph_mapmem() would most likely fail in such circumstances anyway.

However, some code reading revealed a few paths where the return value
of cam_periph_mapmem() is not checked, and this is definitely a bug.
Add error checking there and let cam_periph_unmapmem() return errors
from copyout().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 55129
Build 52018: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Dec 28 2023, 3:52 PM
mav added inline comments.
sys/cam/scsi/scsi_target.c
914–917

These printf's are weird to see, but I don't know anybody still using this code, so whatever.

sys/cam/scsi/scsi_target.c
914–917

Indeed, I just copied it for consistency with the printf below.

This revision was automatically updated to reflect the committed changes.