Currently Linux driver uses `memcpy` when reading physical memory. This causes a kernel panic on some systems when trying to access "forbidden" physical memory. The Linux kernel provides function `copy_from_kernel_nofault` (previously named `probe_kernel_read`) to read memory without crashing (and this function is used by the implementation of `/dev/mem`). Replace `memcpy` with `copy_from_kernel_nofault`, providing a simple wrapper for older kernels. While at it: - Move the allocation of a bounce buffer outside of the while loop. As memory is always read one page at a time, a `PAGE_SIZE` buffer is enough. - Use `size_t` as the type of `sz` instead of the signed type `ssize_t`. - Replace calls to `min_t` with `if` statements which are easier to read. - Name the number of written bytes `written` instead of `read`, in `write_mem`. - Remove stray spaces in various places. By the way, the `write_mem` function was not updated to use `copy_to_kernel_nofault`, as this function has no longer been exported since Linux 5.8. Fixes: https://github.com/chipsec/chipsec/issues/1094 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
Mailing lists:
- CHIPSEC users: chipsec-users
- CHIPSEC discussion list on 01.org
Twitter:
- For CHIPSEC release alerts: Follow us at CHIPSEC Release
- For general CHIPSEC info: Follow CHIPSEC