Skip to content

[Task] Use Xorshift64starHasher for SMBIOS table modification detection #1161

@kat-perez

Description

@kat-perez

Summary

Replace the current simple checksum in SmbiosManager with Xorshift64starHasher for detecting direct table modifications.

Background

The current implementation uses a basic checksum to detect if the SMBIOS table was modified directly (bypassing the manager). While this works for most cases, it can miss edge cases where multiple fields change in ways that cancel each other out (e.g., FieldA: 1→0 and FieldB: 0→1 would produce the same checksum).

Proposed Change

Use the existing Xorshift64starHasher from protocol_db.rs:

let mut hasher = Xorshift64starHasher::default();
hasher.write(data);
cksum = hasher.finish() as u32; // truncate and keep bottom 32-bits of hash

Tasks

  • Move Xorshift64starHasher to a shared location for general use (e.g., patina::base or a new patina::hash module)
  • Update SmbiosManager to use the hasher instead of simple checksum
  • Update any tests that verify checksum behavior

Related

This enhancement was identified during PR #1147 (TplMutex ownership refactor).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions