When the kernel module is already loaded, don't unload and try to load
it again.
This is not only useful during development where one might change the
kernel module code often and load it manually but also for setups that
lift the strict access restrictions to /dev/chipsec, e.g. to allow a
non-root group access to its interface.
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
On Arch Linux, `chipsec_main` fails:
################################################################
## ##
## CHIPSEC: Platform Hardware Security Assessment Framework ##
## ##
################################################################
[CHIPSEC] Version 1.5.10
[CHIPSEC] Arguments:
insmod: ERROR: could not insert module /var/lib/dkms/chipsec/1.5.10/
5.11.6-arch1-1/x86_64/module/chipsec.ko.xz: Operation not permitted
ERROR: Message: "Could not start Linux Helper, are you running as Admin/root?
{}.format(err)"
Showing `{}.format(err)` is a bug caused by a misplaced quote. With the
quote in the right position, the error is clearer:
ERROR: Message: "Could not start Linux Helper, are you running as Admin/root?
Command '['insmod', '/var/lib/dkms/chipsec/1.5.10/5.11.6-arch1-1/
x86_64/module/chipsec.ko.xz', '', '']' returned non-zero exit
status 1."
mmap() makes all the accesses to memory using a byte granularity,
when dealing with mmio registers that is not optimal and need to
perform the access at dword granularity
Signed-off-by: Ignacio Hernandez <ignacio.hernandez@intel.com>
The current method breaks when 'process' is found in the CPU
brand string. Instead use the multiprocessing module to collect
this information.
We could get the information from the MSR but that method does
not work when one or more CPUs are offline.
Signed-off-by: Ignacio Hernandez <ignacio.hernandez@intel.com>
Fedora compresses kernel modules using xz and thus probe for
chipsec.ko.xz, too.
Tested on Fedora 31. Chipsec no longer fails to load DKMS provided
chipsec kernel module.
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Remove dependency for win32helper to find .sys file within init
Fixup logic to better display when driver file cannot be found
Signed-off-by: BrentHoltsclaw <brent.holtsclaw@intel.com>
Add self.name and self.driverpath to Helper baseclass
Add get_info function into Helper baseclass which returns self.name and self.driverpath
Modify helpers to have proper name and driver location for driver loaded
Signed-off-by: BrentHoltsclaw <brent.holtsclaw@intel.com>
added COMPRESSION_ALGORITHMS within chipsec/defines
modified logic witin spi_uefi to rotate through valid algorithms until one is found
modified error within helpers where a list was put inside a list
modified linux helper to use subprocess.call opposed to subprocess.check_output
fixes issues #609, #610, #611
Signed-off-by: BrentHoltsclaw <brent.holtsclaw@intel.com>
When started with ~/chipsec/chipsec_util.py we want to use the decompression
tools built in ~/chipsec/chipsec_tools/compression/bin rather than the ones in
the current path.
-------------------
1. Removed previous compression methodology
a. All files were removed
2. Using compression tools directly from tianocore/edk2/BaseTools
a. Downloaded from master branch
b. Changed Makefiles to build within Chipsec
c. Added BrotliCompress
3. Reworked Windows and Linux Helper to utilize tools built from compression tools
a. Both helpers utilize same logic of calling compression tools
b. Updated to support BrotliCompress
4. Modified GUID functionality within uefi_common to unpack struct as strings opposed to numbers