9elements / converged-security-suite

Converged Security Suite for Intel & AMD platform security features
https://www.9esec.io
BSD 3-Clause "New" or "Revised" License
59 stars 15 forks source link

bugfix(registers): Avoid reading of ACM_POLICY_STATUS corruptor-register #251

Closed xaionaro closed 3 years ago

xaionaro commented 3 years ago

The problem is when we read this register (putted to the deny-list), it corrupts ACM_POLICY_STATUS (an undocumented behavior from PCH's side). Trying to avoid reading this register.

rihter007 commented 3 years ago

I would propose just to implement this hack here:

//FetchTXTConfigSpace returns a raw copy of the TXT config space func FetchTXTConfigSpace(txtAPI PhysicalMemoryReader) (TXTConfigSpace, error) { data := make([]byte, TxtPublicSpaceSize) if err := txtAPI.ReadPhysBuf(TxtPublicSpace, data); err != nil { return nil, err } return data, nil }

It might be even better to do: // FetchTXTConfigSpace avoids memory corruption problem caused by... func FetchTXTConfigSpaceSafe() ...

It will be closer to the problem, TxTAPI should be stay unmodified

xaionaro commented 3 years ago

It might be even better to do: // FetchTXTConfigSpace avoids memory corruption problem caused by... func FetchTXTConfigSpaceSafe() ...

It will be closer to the problem, TxTAPI should be stay unmodified

Yeah. You right. Fixed. Thanks :)