Project

General

Profile

Bug #7713

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

Added by Jason King over 2 years ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2016-12-30
Due date:
% Done:

0%

Estimated time:
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 PDF