Commit Graph

42 Commits

Author SHA1 Message Date
net-wayfarer ff4a27367b Fix Makefile to work with DKMS
drivers/linux/Makefile:
* Replaced KERNEL_SRC_DIR variable with KSRC.
* Added KSRC variable which should enable successful DKMS compilation,
  as opposed to bailing out with "Unable to find the Linux source tree."

This patch has been tested on Black Arch.
2021-02-24 14:47:36 -08:00
Shawn C 9a2536c611 Fix two memory leak bugs
These are caught by PaX AUTOSLAB plugin.

Signed-off-by: Shawn C <citypw@hardenedlinux.org>
2021-02-17 15:44:19 -08:00
Shawn C 84f33831ea Workaround for function pointer complaints
* Some function pointers misuse caught by PaX RAP. These workaround fix would be useful
to the vanilla kernel since the recent TigerLake support Intel CET which might have
the same complaints if the implementation can achieve the current level as PaX RAP.

* Static call is a hack to make the function pointer writable. Please keep in mind that
this hack is only for the firmware audit reason. Be cautions if you intend to do the similar
things in production.

Thanks to Spender and PaX team points out the way to fix.

Signed-off-by: Shawn C <citypw@hardenedlinux.org>
2021-02-17 15:32:24 -08:00
Shawn C 9a1cead82c Fix #1086: Linux kernel v5.10 removed the old good syscalls get_fs/set_fs
in name of security reasons. The current workaround is get the kallsyms_lookup_name()
via kprobe if the kernel >= v5.10.

Signed-off-by: Shawn C <citypw@hardenedlinux.org>
2021-02-17 15:32:24 -08:00
gibarrasch 2c0c4c9fd1 Using CONFIG_EFI instead of user defined HAS_EFI (#1036)
Co-authored-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2021-02-17 15:31:12 -08:00
Shawn C f2f1ab2d4f Expand the conditional compilation based on d02624b to support more PaX/GRsec kernel
Signed-off-by: Shawn C <citypw@hardenedlinux.org>
2021-01-27 08:16:28 -08:00
Nathaniel Mitchell 2210002bab Fixed build error on latest Ubuntu
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2021-01-26 16:04:06 -08:00
Shawn C d746954e64 Add the support for access the kernel symbols by reading /proc/kallsyms directly
since kallsyms_lookup_name() and kallsyms_on_each_symbol() are no longer exported:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0bd476e6c67190b5eb7b6e105c8db8ff61103281

Signed-off-by: Shawn C <citypw@hardenedlinux.org>
2020-12-17 11:08:20 -08:00
gibarrasch 787e556b97 Fixed compilation in kernels >= 5.6 (#911) 2020-05-20 15:57:24 -07:00
brentholtsclaw 54860e3d45 Update IOCTL_LOAD_UCODE_PATCH in linux driver
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
2020-05-01 08:23:23 -07:00
brentholtsclaw acace8ec2c Modify rdmsr/wrmsr for linux driver
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
2020-05-01 08:22:28 -07:00
Cr4sh 6d491162bf linux helper HAS_EFI bugfix 2020-04-28 16:07:53 -07:00
RageLtMan d02624bbaf valid_mmap_phys_addr_range conflicts with upstream
PaX implements valid_mmap_phys_addr_range in the kernel, and the
(return 1) hack in chipsec_km.c has a name collision with it.

Add another conditional for exposing the definition predicated on
whether __HAVE_ARCH_PAX_OPEN_USERLAND is defined in the kernel
headers. If it is, dont redefine the original function.
2019-11-06 20:26:22 -08:00
Barry Rountree 8ad2ffcb53 Trivial README patch for module loading/unloading. 2019-09-03 11:09:26 -07:00
Barry Rountree bc66115d7f Explanation of Kbuild warning. 2019-09-03 11:09:14 -07:00
BrentHoltsclaw c29769d81a Fix Warning #535 2019-03-01 15:19:44 -08:00
BrentHoltsclaw 509bb0ba20 Fix Linux build error #535 2019-03-01 15:19:44 -08:00
BrentHoltsclaw e2d2442b08 Add #define to make future changes easier 2019-01-17 11:30:20 -08:00
BrentHoltsclaw 3a515e9cfb Address issue #249
changed drivers/linux/include/chipsec.h to start from 'C'
added logic to compute ioctl base based upon changes to chipsec.h above
2019-01-17 11:30:20 -08:00
BrentHoltsclaw e3c050b920 Fix 32bit linux cpuid assembly
Found that cpuid was causing a kernel error in 32bit linux
2019-01-14 09:57:16 -08:00
BrentHoltsclaw 0b685ff5fb Linux driver support for legacy BIOS and UEFI-compatibility mode
Issue #186
2019-01-14 09:54:26 -08:00
BrentHoltsclaw 10d6d1ea81 Fix for Issue #498
thanks @afoodu2
2019-01-04 11:39:14 -08:00
Erik Bjorge 02df863cdd Reverting to previous memory access method.
More debug is required before switching to this updated method for memory access.

Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
2018-10-01 10:32:20 -07:00
BrentHoltsclaw cf47af320c Forgot to change void * to char * and increment copyright 2018-05-21 13:12:35 -07:00
BrentHoltsclaw d025dba85b linux driver physmem write fix
copy_from_user was only zeroing bytes in some cases when physmem write
function was called.  Changed to a for loop which appears to fix the
issue.
2018-05-21 13:12:35 -07:00
BrentHoltsclaw 93fa9f19b5 Fix for issue #363
Defined function valid_mmap_phys_addr_range within linux driver if
kernel version is greater than 4.15.4
2018-04-17 14:07:40 -07:00
BrentHoltsclaw 4ebfc44123 Changed KERN_ALERT to KERN_INFO 2018-03-06 17:50:48 -08:00
BrentHoltsclaw 72fcb5d277 fixed up error handling 2018-03-06 17:50:48 -08:00
BrentHoltsclaw deee07d173 Change linux READ/WRITE Physical Memory Functionality 2018-03-06 17:50:48 -08:00
Erik Bjorge 9a5e095342 Revert "Change linux READ/WRITE Physical Memory Functionality"
This reverts commit 3c1c6906f9.

Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
2018-02-26 10:24:19 -08:00
BrentHoltsclaw 3c1c6906f9 Change linux READ/WRITE Physical Memory Functionality 2018-02-23 09:35:28 -08:00
Martin Galvan 5ff6efead6 Linux driver: Fix IOCTL_WRMMIO for x86_64
This patch fixes IOCTL_WRMMIO so that the high and low halves of the 8-byte MMIO
value are written to the appropriate addresses.
2017-08-10 10:12:18 -07:00
Nick Mooney 49348dc0db Add mmap support to kernel module 2017-07-24 13:26:08 -07:00
Nick Mooney 0f8fc1d86c Add mmap support to chipsec device 2017-07-24 13:26:08 -07:00
Oleksandr Bazhaniuk c2e7d7f5c4 fix mem read in kernel 4.8+ 2017-06-23 11:23:47 -07:00
abazhaniuk 1c09ea5ada fix issue with building driver on 32bit system (#203) 2017-04-21 06:34:25 -10:00
c7zero 5c5ae294eb Updated version and manual 2017-03-20 18:08:42 -07:00
Thiébaud Weksteen cd3961d00b Fix building of Linux x86 driver (#139) (#141) 2017-01-20 15:32:46 -08:00
abazhaniuk c377a72e28 Deb package (#135)
* merge

* Add Debian packaging

* cleanup

* Removed incorrect info into Copyright.

* One more: removed incorrect info in Copyright.
2017-01-06 12:57:13 -08:00
abazhaniuk f2dd9ad515 add DKMS support (#132)
* add DKMS support

* remove unnecessary functions

* moved get_version to defines

* raise an exception
2016-12-06 00:46:12 -08:00
Thiébaud Weksteen 63991da054 Improve build_ext (#115) 2016-11-03 15:27:24 -07:00
abazhaniuk 94fe7f02f1 change setup.py build driver by default. change root directory of chipsec. move WARNING.txt to chipsec. remove PKG-INFO (#107) 2016-10-18 18:19:42 -07:00