Bug #7713

fabric-xlate fmd(1m) module isn't 64-bit safe

Added by Jason King about 1 year ago.

Status:NewStart date:2016-12-30
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:cmd - userland programs
Target version:-
Difficulty:Medium Tags:needs-triage

Description

The fabric-xlate module causes fmd(1m) to segfault. The offending code is in usr/src/cmd/fm/modules/common/fabric-xlate/fx_subr.c:

if (tbl->reg_size == 16) {
        reg = (uint32_t)*((uint16_t *)
            ((uint32_t)data + tbl->reg_offset));
} else {
        reg = *((uint32_t *)((uint32_t)data + tbl->reg_offset));
}

tbl->reg_offset is the offset of a field member within the data struct, the uint32_t cast will truncate 64-bit addresses (and is just plain the wrong type).

Also available in: Atom