• J
    target: Fix off-by-seven in target_report_luns · 99f730d8
    Jörn Engel 提交于
    cdb_offset is always equal to offset - 8, so remove that one.  More
    importantly, the existing code only worked correct if
    se_cmd->data_length is a multiple of 8.  Pass in a length of, say, 9 and
    we will happily overwrite 7 bytes of "unallocated" memory.
    
    Now, afaics this bug is currently harmless, as allocations will
    implicitly be padded to multiples of 8 bytes.  But depending on such a
    fact wouldn't qualify as sound engineering practice.
    Signed-off-by: NJoern Engel <joern@logfs.org>
    Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
    99f730d8
target_core_device.c 47.8 KB