Page MenuHomeFreeBSD

ufshci: byte-swap big-endian UPIU fields
ClosedPublic

Authored by jaeyoon on Aug 5 2026, 8:07 AM.
Tags
None
Referenced Files
F171150375: D58664.id183762.diff
Wed, Sep 9, 12:58 AM
Unknown Object (File)
Mon, Sep 7, 4:38 PM
Unknown Object (File)
Mon, Sep 7, 4:36 PM
Unknown Object (File)
Sun, Sep 6, 11:24 PM
Unknown Object (File)
Sun, Sep 6, 9:56 PM
Unknown Object (File)
Sat, Sep 5, 10:50 PM
Unknown Object (File)
Fri, Sep 4, 8:18 PM
Unknown Object (File)
Thu, Sep 3, 1:52 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