Commit Graph

121 Commits

Author SHA1 Message Date
ChipSec 4ca05a5a41 Update to 1.13.3 (#2210)
* Update to 1.13.3

Signed-off-by: Chipsec <chipsec@intel.com>

* update manual

Signed-off-by: Chipsec <chipsec@intel.com>

---------

Signed-off-by: Chipsec <chipsec@intel.com>
Co-authored-by: Chipsec <chipsec@intel.com>
2024-06-28 16:37:18 -07:00
ChipSec 8163a864ac Update to 1.13.2 (#2175)
* Update to 1.13.2

Signed-off-by: Chipsec <chipsec@intel.com>

* update manual

Signed-off-by: Chipsec <chipsec@intel.com>

---------

Signed-off-by: Chipsec <chipsec@intel.com>
Co-authored-by: Chipsec <chipsec@intel.com>
2024-05-29 16:17:31 -07:00
Carles Pey 19e2553138 Add SMI enumeration mode to the smm_ptr module (#2141)
* Add SMI enumeration mode to the smm_ptr module

Signed-off-by: Carles Pey <carles.pey@nccgroup.com>
2024-05-29 10:19:42 -07:00
ChipSec 69239ba1b6 Update to 1.13.1 (#2149)
* Update to 1.13.1

Signed-off-by: Chipsec <chipsec@intel.com>

* update manual

Signed-off-by: Chipsec <chipsec@intel.com>

---------

Signed-off-by: Chipsec <chipsec@intel.com>
Co-authored-by: Chipsec <chipsec@intel.com>
2024-04-25 14:51:03 -07:00
ChipSec 10ed132902 Update to 1.13.0 (#2112)
* Update to 1.13.0

Signed-off-by: Chipsec <chipsec@intel.com>

* update manual

Signed-off-by: Chipsec <chipsec@intel.com>

---------

Signed-off-by: Chipsec <chipsec@intel.com>
Co-authored-by: Chipsec <chipsec@intel.com>
2024-03-28 13:55:24 -07:00
ChipSec 6862cd6aa9 Update to 1.12.9 (#2071)
* Update to 1.12.9

Signed-off-by: Chipsec <chipsec@intel.com>

* update manual

Signed-off-by: Chipsec <chipsec@intel.com>

---------

Signed-off-by: Chipsec <chipsec@intel.com>
Co-authored-by: Chipsec <chipsec@intel.com>
2024-02-29 13:21:49 -08:00
Jason Zhou 2cc1ceec92 Update to 1.12.8
Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2024-01-25 13:31:17 -08:00
ChipSec 061378cc13 Update to 1.12.7 (#2045)
Update to 1.12.7

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2024-01-04 11:54:50 -08:00
ChipSec 696b3bc71f Update to 1.12.6 (#2029)
* Update to 1.12.6

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>

* update manual

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>

---------

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
Co-authored-by: Jason Zhou <jun2.zhou@intel.com>
2023-12-18 16:42:30 -08:00
Jason Zhou 576e34aecd Update to 1.12.5
Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2023-12-11 14:08:33 -08:00
Nathaniel Mitchell 9a32ef5f9a Update to 1.12.4
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-10-26 09:13:28 -07:00
Nathaniel Mitchell 6b22e9acd3 Update to 1.12.3
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-09-29 09:38:30 -07:00
Nathaniel Mitchell 7066ad538f Update to 1.12.2
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-09-08 15:23:27 -07:00
Nathaniel Mitchell 2b531e676c Update to 1.12.1
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-30 15:18:08 -07:00
Nathaniel Mitchell 025e15548f Update to 1.12.0
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-28 13:49:15 -07:00
Nathaniel Mitchell d3285ee2c5 Update to 1.11.1
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-06-28 11:11:52 -07:00
Nathaniel Mitchell 00ba41226e Update to 1.11.0
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-05-31 09:40:42 -07:00
Nicolas Iooss 666f085811 drivers/linux: increase the possible length of symbols
In Linux 6.1, `KSYM_NAME_LEN` was increased to 512 because "at the
moment, Rust symbols may reach up to 300 in length", according to
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/kallsyms.h?id=b8a94bfb33952bb17fbc65f8903d242a721c533d

Even though the version of `chipsec_lookup_name` which parses the
content of `/proc/kallsyms` is limited to kernels older than 5.10,
increase the size of the stack buffer to prevent possible issues.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-05-16 16:38:39 -07:00
Nathaniel Mitchell d08fb0f96b Update to 1.10.6
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-05-05 15:56:14 -07:00
Nathaniel Mitchell 8962072378 Update to 1.10.5
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-04-27 09:46:26 -07:00
Nathaniel Mitchell 2c42ead1fa Update to 1.10.4
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-03-30 14:32:57 -07:00
Dan Scott 094ce48082 Update to 1.10.3
Signed-off-by: Dan Scott <dan.scott@intel.com>
2023-03-01 15:11:58 -08:00
Nathaniel Mitchell 62fcefced3 Update to 1.10.2
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-02-03 09:45:53 -08:00
Nathaniel Mitchell 4ce4ebc56c Update to 1.10.1
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-01-25 12:33:55 -08:00
Dan Scott d1e3ab2800 Update to 1.10.0
Signed-off-by: Dan Scott <dan.scott@intel.com>
2022-12-19 15:10:12 -08:00
Nathaniel Mitchell d8c2a606bf Update to 1.9.1
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-10-28 12:20:42 -07:00
Dan Scott d91485a6d8 Update to 1.9.0
Signed-off-by: Dan Scott <dan.scott@intel.com>
2022-09-30 16:59:39 -07:00
Dan Scott fd1a986889 Update to 1.8.8
Signed-off-by: Dan Scott <dan.scott@intel.com>
2022-08-26 18:12:42 -07:00
Mathias Krause 81f859c572 drivers/linux: reinstantiate DMA32 allocations
Commit 81fa32bd7e ("drivers/linux: enforce address requirement for
IOCTL_ALLOC_PHYSMEM") tried to enforce the physical address constraints
provided by the user. However, it's broken for the memory range 16M-4G
as there's no DMA32 kmalloc cache, making the request allocate from the
normal zone which is free to return an address above 4GB for systems
with enough RAM.

Commit d010b82b0d ("Fix malloc issue in Linux driver") worked around
that issue by simple dropping the DMA32 allocation and only using DMA
allocations for which kmalloc slabs do exist.

As the DMA zone is a scarce resource and might be exhausted already, use
a different allocation scheme for chipsec that directly allocates memory
from the page allocator which honours both, DMA and DMA32 requests.

Also fix the allocation list handling while at it. The stored physical
address might be truncated on 32-bit PAE systems because of the use of
'physaddr_t' instead of 'phys_addr_t'.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-08-26 11:52:02 -07:00
Nathaniel Mitchell 7b9cc5cd44 Update to 1.8.7
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-07-28 10:05:01 -07:00
Nathaniel Mitchell d010b82b0d Fix malloc issue in Linux driver
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-07-27 12:59:47 -07:00
Nathaniel Mitchell 687a2ec7d2 Updating to 1.8.6
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-06-22 15:19:13 -07:00
Nathaniel Mitchell 07a532aac9 Updateing to 1.8.5
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-05-24 15:09:26 -07:00
Frinzell, Aaron 61219641ee Update to 1.8.4
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2022-04-27 18:00:16 -05:00
Frinzell, Aaron 5b70d7dc4f Updating to 1.8.3
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2022-03-30 18:22:15 -05:00
Nathaniel Mitchell 1d6a2668d5 Update to 1.8.2
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-03-01 13:44:21 -08:00
Mathias Krause 81fa32bd7e drivers/linux: enforce address requirement for IOCTL_ALLOC_PHYSMEM
Try harder to fulfill the physical address constraint for the
IOCTL_ALLOC_PHYSMEM ioctl by trying to allocate memory from the zones
that fit the maximum address best, but fall-back to the normal zone in
case the allocation fails.

If we fail to allocate memory that fulfills the maximum physical address
constraint, make the ioctl() fail as well instead of emitting a warning.

This is safer then making, e.g., the tools.smm.smm_ptr module corrupt
unrelated memory just because the allocation happens to be above 4GB but
the pointer passed to SMM is truncated to 32 bit.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-28 15:39:19 -08:00
Mathias Krause b7cbbd2712 drivers/linux: merge {read,write}_mem()
With the addition of a bounce buffer both functions are nearly
identical. They only differ in the direction of copy.

Merge them into a common helper function that gets the copy direction
passed as an argument.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-28 15:39:19 -08:00
Mathias Krause eb89b9c248 drivers/linux: add bounce buffer handling to write_mem()
If we try to write to an address that's not allowed by USERCOPY, the
copy will fail.

Use a bounce buffer to work around that, just like read_mem() does.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-28 15:39:19 -08:00
Mathias Krause a687d9e73b drivers/linux: reject invalid addresses in IOCTL_VA2PA
If we get passed an invalid virtual address, make IOCTL_VA2PA fail
instead of returning a bogus address.

Also simplify the code. No need to use 'PHYSICAL_ADDRESS' here,
'phys_addr_t' is just fine.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-28 15:39:19 -08:00
Nicolas Iooss 643306766e Add FORCE in Linux driver Makefile
Since Linux 5.15 (commit
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1f86d7b4b2a5213b012c2b4fe3e5b6ad537686e
), `make` now warns about missing `FORCE` prerequisite:

    /var/lib/dkms/chipsec/1.8.1/build/Makefile:39: FORCE prerequisite
    is missing

Fix this issue by adding the required prerequisite.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2022-02-16 08:24:33 -08:00
Mathias Krause af08f9cd93 drivers/linux: make more symbols static
chipsec_km.c is mostly self-contained and thereby has no need to export
symbols.

Make almost all of them 'static' and leave only the (config dependent)
unused ones non-static.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-16 08:22:33 -08:00
Mathias Krause 2a162c1efa drivers/linux: fix memory leak for IOCTL_ALLOC_PHYSMEM ioctl
If we fail to allocate memory for chaining the user requested allocation
to our accounting list, we leak 'va.'

Fix that. Also fix the return code to be -ENOMEM instead of -EFAULT for
failing memory allocations.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-16 08:22:33 -08:00
Mathias Krause 07f91de154 drivers/linux: handle xlate errors
In case my_xlate_dev_mem_ptr() fails for a given physical address, we
should return an error instead of trying to read/write to NULL.

Also fix whitespace issues around this code section.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-16 08:22:33 -08:00
Mathias Krause c80528e0a0 drivers/linux: make symbol search work with -freorder-functions
Commit 397b1b8d8b ("drivers/linux: simplify and fix symbol resolving
for kernels >= 5.10") introduced a method for finding the address of
kallsyms_lookup_name() by scanning kernel code around 'sprint_symbol.'
However, it only looked "backwards" which would be fine, as
kallsyms_lookup_name() gets defined before sprint_symbol() in
kallsyms.c. However, gcc's '-freorder-functions' (which is enabled by
default at -O2 / -Os) may put kallsyms_lookup_name() *after*
sprint_symbol() in the object file, making our search fail to find it.

Account for that and search around sprint_symbol() in both directions.
32kB is more than enough to cover all of kallsyms.o.

Fixes: 397b1b8d8b ("drivers/linux: simplify and fix symbol resolving for kernels >= 5.10")
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-16 08:22:33 -08:00
Mathias Krause d471f01dda drivers/linux: grsecurity compatibility for symbol resolving
grsecurity kernels stub out the kallsyms family of functions when the
feature CONFIG_GRKERNSEC_HIDESYM is enabled. This destroys out attempt
to find the address of 'kallsyms_lookup_name' via sprint_symbol().

Prevent that by making use of the '__INCLUDED_BY_HIDESYM' define
grsecurity provides for this exact purpose.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-16 08:22:33 -08:00
Mathias Krause cbe7bc39a5 drivers/linux: simplify __swsmi__()
The current implementation of __swsmi__ for x86-64 is rather complicated
as it uses more registers than needed. Simplyfy it.

We can use the passed SMI_CTX buffer as scratch space without the need
to use intermediate registers (beside for RDI, for which we use R10 -- a
callee clobbered register).

Bring the implementation more in line with its OS X counterpart and
adapt the comments and code to reflect reality, namely:
- change the C type members to mirror the used (and intended) registers,
- mark the registers as in/out parameters in the comments,
- drop the bogus comment about clobbering DX, as we don't do that and
- fix and tweak the comment about split i/o because of picky firmwares.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2022-02-16 08:22:33 -08:00
Nathaniel Mitchell 130309880f Update to 1.8.1
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-02-01 15:06:09 -08:00
net-wayfarer 463281907c [DKMS] Remove deprecated REMAKE_INITRD flag.
DKMS upstream has deprecated this flag;
https://github.com/dell/dkms/commit/961f9ceac4cf6772cb4c52bf4836a0f6c9818239
This PR removes the deprecated flag, which would otherwise generate a warning
whenever dkms is invoked.

Further, prior to this PR the flag was set to 'off'.
2022-01-28 11:07:08 -08:00
brentholtsclaw 64beb99e1d Update commments to match changes
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
2022-01-28 10:52:09 -08:00