Page MenuHomeFreeBSD

ufshci: byte-swap big-endian UPIU fields
ClosedPublic

Authored by jaeyoon on Aug 5 2026, 8:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 6, 10:00 PM
Unknown Object (File)
Mon, Oct 5, 10:22 PM
Unknown Object (File)
Sat, Oct 3, 4:28 PM
Unknown Object (File)
Sat, Oct 3, 5:33 AM
Unknown Object (File)
Mon, Sep 28, 1:09 PM
Unknown Object (File)
Mon, Sep 28, 1:01 AM
Unknown Object (File)
Sat, Sep 26, 6:03 AM
Unknown Object (File)
Fri, Sep 25, 11:08 PM
Subscribers
None

Details

Summary

The UPIU wire fields are big-endian. The task management and query
builders wrote host-order values into them. The completion paths also
read the results back without conversion. On a little-endian host an
ABORT_TASK carried a swapped task tag and LUN, a query carried a
swapped length, and attribute reads returned swapped values. Tolerant
devices masked most of the damage.

Convert with htobe*/be*toh at the wire boundary, as ufshci_sim.c
already does for its fields.

Sponsored by: Samsung Electronics

Diff Detail

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