Page MenuHomeFreeBSD

cam: Zero bio pointer in user-supplied SCSI CCBs
ClosedPublic

Authored by cem on Nov 8 2016, 8:15 PM.
Tags
None
Referenced Files
F133015262: D8477.id.diff
Wed, Oct 22, 2:17 AM
Unknown Object (File)
Sun, Oct 19, 10:13 AM
Unknown Object (File)
Fri, Oct 10, 9:26 PM
Unknown Object (File)
Fri, Oct 10, 10:46 AM
Unknown Object (File)
Thu, Oct 2, 5:36 AM
Unknown Object (File)
Sep 13 2025, 6:17 AM
Unknown Object (File)
Aug 21 2025, 7:35 AM
Unknown Object (File)
Aug 1 2025, 11:52 PM
Subscribers
None

Details

Summary

The BUF_TRACKING bio pointer only makes sense for kernel consumers of CCBs.

PR: 214250
Reported by: trasz@

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5896
Build 6183: arc lint + arc unit

Event Timeline

cem retitled this revision from to cam: Zero bio pointer in user-supplied SCSI CCBs The BUF_TRACKING bio pointer only makes sense for kernel consumers of CCBs..
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added reviewers: trasz, imp, scottl, markj.
cem retitled this revision from cam: Zero bio pointer in user-supplied SCSI CCBs The BUF_TRACKING bio pointer only makes sense for kernel consumers of CCBs. to cam: Zero bio pointer in user-supplied SCSI CCBs.Nov 8 2016, 8:17 PM
cem updated this object.
imp edited edge metadata.

Though I wonder why only the SCSI_IOs?

This revision is now accepted and ready to land.Nov 8 2016, 8:20 PM
sys/cam/cam_xpt.c
418

Why not do this for all CCBs?

In D8477#176243, @imp wrote:

Though I wonder why only the SCSI_IOs?

That's just all we added the tracking to in r308155. It could be made more generic by a motivated person :-).

sys/cam/cam_xpt.c
418

Only XPT_SCSI_IO CCBs have valid inccb->csio members. For other CCBs that would scribble some random struct member.

markj edited edge metadata.
sys/cam/cam_xpt.c
418

What about XPT_ATA_IO? I guess this is a question more for the previous commit; it looks like XPT_ATA_IO was omitted from that too. Next question, since i wasn't on the review for the original commit, is why can't this be done with dtrace?

sys/cam/cam_xpt.c
418

What about XPT_ATA_IO? I guess this is a question more for the previous commit; it looks like XPT_ATA_IO was omitted from that too.

Yeah. Same answer as to Warner — we were only interested in SCSI. No reason it has to be exclusive to SCSI CCBs, though.

Next question, since i wasn't on the review for the original commit, is why can't this be done with dtrace?

I'm not sure it can be done in dtrace — the main utility of this tracking is for debugging panics. Can you access dtrace state from a panic or core? Even if you can, the overhead of dtrace is likely significantly higher.

This revision was automatically updated to reflect the committed changes.