Page MenuHomeFreeBSD

ufshci: read UIC command results while holding the lock
ClosedPublic

Authored by jaeyoon on Aug 5 2026, 8:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 7, 10:07 PM
Unknown Object (File)
Mon, Sep 7, 9:54 PM
Unknown Object (File)
Sun, Sep 6, 7:22 PM
Unknown Object (File)
Sun, Sep 6, 10:41 AM
Unknown Object (File)
Sun, Sep 6, 12:48 AM
Unknown Object (File)
Tue, Sep 1, 5:59 PM
Unknown Object (File)
Sun, Aug 30, 11:04 AM
Unknown Object (File)
Fri, Aug 28, 4:15 PM
Subscribers
None

Details

Summary

The UIC result registers (UICCMDARG2/3) are only valid between a
command's completion and the next command's submission. They were read
after uic_cmd_lock was dropped, so a concurrent UIC submitter could
overwrite them in between. Read them into locals before releasing the
lock.

Also mask the generic error code to its [7:0] field when checking it,
so unrelated bits in UICCMDARG2 (such as the attribute set type echoed
for DME_SET) cannot be mistaken for an error.

Sponsored by: Samsung Electronics

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable