When using chipsec.chipset Python module from an unprivileged user, the Python interpreter crashes with a segmentation fault on an `outl` instruction. This is because `iopl(3)` failed and the "legacy PCI" implementation tried to write a value to an I/O port without being allowed to. Fix this by checking the return value of `iopl`. While at it, enable using `error` in the C library, to properly report the `EPERM` error. While working on this code, it appeared that: - `self.addr` was written twice in `PORTS`' constructor: once for the `inl` implementation and another one for `outl`. - Everytime `PORTS` or `LEGACY_PCI` objects were created, some memory was allocated (with `mmap.mmap`) to run the helpers and this memory was never freed. - The global variables `IN_PORT` and `OUT_PORT` were defined as lists but always used as bytes. Fix these issues by spliting `self.addr` into two variables, by introducing a class property which re-use previous `PORTS` instances (making this class a singleton) and by making `IN_PORT` and `OUT_PORT` directly `bytes`. While at it, change the names to the usual camel case convention (`PORTS` -> `Ports` and `LEGACY_PCI` -> `LegacyPci`) and add type hints. Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
CHIPSEC: Platform Security Assessment Framework
CHIPSEC is a framework for analyzing the security of PC platforms including hardware, system firmware (BIOS/UEFI), and platform components. It includes a security test suite, tools for accessing various low level interfaces, and forensic capabilities. It can be run on Windows, Linux, Mac OS X and UEFI shell. Instructions for installing and using CHIPSEC can be found in the manual.
NOTE: This software is for security testing purposes. Use at your own risk. Read WARNING.txt before using.
First version of CHIPSEC was released in March 2014: Announcement at CanSecWest 2014
Recent presentation on how to use CHIPSEC to find vulnerabilities in firmware, hypervisors and hardware configuration, explore low level system assets and even detect firmware implants: Exploring Your System Deeper
Release Convention
- CHIPSEC uses a major.minor.patch release version number
- Changes to the arguments or calling conventions will be held for a minor version update
Projects That Include CHIPSEC
Contact Us
For any questions or suggestions please contact us at: chipsec@intel.com
Mailing list:
Twitter:
- For CHIPSEC release alerts: Follow us at CHIPSEC Release
- For general CHIPSEC info: Follow CHIPSEC
For AMD related questions or suggestions please contact Gabriel Kerneis at: Gabriel.Kerneis@ssi.gouv.fr