Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with intel main and add fix for kernel 6.5 OOT driver compilation error #1

Open
wants to merge 83 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
82413e8
Fix memory leak of SECS EPC page in error path.
Oct 30, 2017
24bd0ac
SGX 2.0 Implementation
Jun 5, 2017
45a66bd
Add sgx2.patch to the repository.
Oct 30, 2017
eb61a95
Update README
Oct 31, 2017
a7997da
Set sgx2 to master to rebase
Nov 22, 2017
fc0cb15
SGX 2.0 Implementation
Nov 27, 2017
7490f2e
check in sgx2.patch for latest rebase
Nov 30, 2017
dd4db1f
Merge pull request #44 from avchinch/sgx2
Dec 1, 2017
1544cce
Update README
lzha101 Dec 27, 2017
2ae922f
Merge pull request #47 from lzha101/lzha101-patch-2
lzha101 Dec 27, 2017
11f5228
Update README for SUSE
lzha101 Dec 27, 2017
03e9152
Merge pull request #49 from lzha101/lzha101-patch-2
lzha101 Dec 27, 2017
1bf506e
Update README.md
lzha101 Jan 11, 2018
f25da30
Update README.md
Jan 22, 2018
dc7dc1b
Merge pull request #51 from avchinch/sgx2
Jan 22, 2018
0ab9437
intel_sgx: use mmu_notifier_unregister w/o "no_release"
Apr 6, 2018
de9b9be
Merge pull request #58 from haitaohuang/not2
sergeay Apr 11, 2018
d1bf126
Removing conflicting compilation flags
sergeay Apr 24, 2018
dc5858a
Merge pull request #62 from intel/b2
sergeay Apr 26, 2018
e9c9d5b
Calling PF handler from isolate_range was not protected: down_read(mm…
sergeay Aug 20, 2018
4d69b9c
Merge pull request #67 from intel/sgx2_b
sergeay Aug 20, 2018
d1e0393
Update License.txt to 3-c BSD/GPL v2, to match src
Oct 17, 2018
24abf3b
Merge pull request #70 from avchinch/sgx2
andyzyb Oct 18, 2018
d452d4f
In order to cope with KSS feature:
sergeay Oct 29, 2018
778dd1f
Merge pull request #73 from intel/b2
lzha101 Oct 30, 2018
b51ecbf
vm_insert_pfn replaced by vmf_insert_pfn from kernel 4.20
sergeay Jan 24, 2019
5faf521
Merge pull request #79 from intel/b2
sergeay Jan 30, 2019
aa765e1
Enclave virtual address range should never be defined as MAP_PRIVATE.
sergeay Feb 3, 2019
982c6e3
Merge pull request #80 from intel/b2
sergeay Feb 4, 2019
56b7f9e
Kernel 4.20 and later: vmf_insert_pfn returns VM_FAULT_NOPAGE
sergeay Feb 5, 2019
f7dc97c
Merge pull request #82 from intel/br2
sergeay Feb 6, 2019
24011ec
sgx_vma: return unsigned int from sgx_vma_fault
iyernaveenr Apr 23, 2019
10a2f21
Merge pull request #86 from iyernaveenr/sgx_vma
sergeay May 2, 2019
d076fc3
For kernel 5.1 and higher, sgx_vma_fault returns unsigned int.
sergeay May 2, 2019
b4d290b
Merge pull request #87 from intel/br2
sergeay May 2, 2019
d8621de
Version number is 2.5.0
sergeay May 6, 2019
f104b6d
Merge pull request #89 from intel/b2
sergeay May 6, 2019
44adf28
Resetting rc after calling vmf_insert_pfn since it returns
sergeay May 15, 2019
dc891db
README file updated: master branch (SGX 1.5) not supported anymore.
sergeay May 15, 2019
fbbc01a
README file updated: master branch (SGX 1.5) not supported anymore.
sergeay May 15, 2019
5d6abcc
Merge pull request #92 from intel/n1
sergeay May 22, 2019
f2758d2
Merge pull request #91 from intel/n2
sergeay May 22, 2019
b34df89
Fix configid offset in secs.
lzha101 May 30, 2019
2605efa
Merge pull request #93 from lzha101/fix_configid
sergeay Jun 2, 2019
41c7e7f
elfutils-libelf-devel is a prerequisite for RedHat 8.0
sergeay Jul 25, 2019
791488f
Merge pull request #96 from intel/b2
andyzyb Jul 26, 2019
ff88f3d
Ubuntu 18.04 support added to README
sergeay Aug 12, 2019
a62f311
Merge pull request #98 from intel/bb2
sergeay Aug 13, 2019
efcde02
Build error fixes for kernel 5.3 and later
sergeay Sep 23, 2019
3ae95e0
Merge pull request #104 from intel/b4
sergeay Sep 23, 2019
fae3ce5
Version 2.6
haitaohuang Oct 9, 2019
4f5bb63
Merge pull request #106 from haitaohuang/sgx2
haitaohuang Oct 9, 2019
e047a87
Merge sgx2 into master
haitaohuang Oct 30, 2019
51c4821
README: switch to master branch for main development
haitaohuang Oct 30, 2019
287083f
Update README after deleting sgx2 branch
haitaohuang Jan 23, 2020
329facd
Rename MSR_IA32_FEATURE_CONTROL and FEATURE_CONTROL_LOCKED
npmccallum Feb 26, 2020
c25fa6a
Merge pull request #111 from npmccallum/master
haitaohuang Feb 27, 2020
d92c57d
Fix warning on 5.6 kernel
haitaohuang Feb 27, 2020
17697b5
Run depmod separately during install
haitaohuang Feb 27, 2020
95eaa6f
Merge pull request #112 from haitaohuang/minor_fixes
haitaohuang Feb 27, 2020
4e1dd1b
Update README.md
haitaohuang May 29, 2020
cf8b3d2
Fix build for RHEL 8.2
haitaohuang May 12, 2020
7acda57
Merge pull request #118 from haitaohuang/rhel82
haitaohuang Jun 4, 2020
602374c
Merge pull request #117 from intel/haitaohuang-patch-1
haitaohuang Jun 11, 2020
a021c08
Remove unnecessary if conditional statements
uudiin Jul 17, 2020
93797b0
Clean page_cache on failed exit path in sgx_dev_init()
uudiin Jul 17, 2020
92cdb8d
Delete unnecessary sgx_compat_ioctl()
uudiin Jul 17, 2020
bf768a4
Merge pull request #121 from uudiin/fix
haitaohuang Aug 3, 2020
0a6d266
Fix signed integer overflow on shift
haitaohuang Aug 4, 2020
b0a445b
Merge pull request #122 from haitaohuang/master
haitaohuang Aug 6, 2020
35ef6b1
Update version to 2.11
haitaohuang Sep 2, 2020
75bf89f
Merge pull request #124 from haitaohuang/master
haitaohuang Sep 2, 2020
276c5c6
Fix compilation on 5.8 kernel (#120)
donporter Sep 2, 2020
4382484
Clean more files
haitaohuang Sep 12, 2020
1bc987f
Reset MSRs for SGX launch enclave signing key public hash during init
haitaohuang Sep 12, 2020
4505f07
Merge pull request #125 from haitaohuang/master
haitaohuang Sep 16, 2020
3a4f6ac
Update supported OSes by referring to releases
haitaohuang Nov 9, 2020
0373e2e
Merge pull request #127 from haitaohuang/master
haitaohuang Nov 12, 2020
ed2c256
Use cpuid instead of boot_cpu_has to check cpu features
haitaohuang Apr 16, 2021
2d2b795
Merge pull request #133 from haitaohuang/master
haitaohuang Apr 20, 2021
54c9c4c
Add SECURITY.md
lzha101 Nov 10, 2021
b6f5b4a
Update README.md for documentation download links
haitaohuang Jan 29, 2024
2f69bc4
fix compilation on 6.5 and shift op
ticapix Feb 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.ko
*.o
*.cmd
*.mod
*.mod.*
*.symvers
*.order
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@ ifneq ($(KERNELRELEASE),)
sgx_ioctl.o \
sgx_vma.o \
sgx_util.o\
sgx_encl.o
sgx_encl.o \
sgx_encl2.o
obj-m += isgx.o
else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
$(MAKE) -C $(KDIR) M=$(PWD) modules

install: default
$(MAKE) INSTALL_MOD_DIR=kernel/drivers/intel/sgx -C $(KDIR) M=$(PWD) modules_install
depmod -A
sh -c "cat /etc/modules | grep -Fxq isgx || echo isgx >> /etc/modules"

endif

clean:
rm -vrf *.o *.ko *.order *.symvers *.mod.c .tmp_versions .*o.cmd
rm -vrf *.o *.ko *.order *.symvers *.mod.c .tmp_versions .*o.cmd *.mod
34 changes: 13 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,28 @@ The Linux SGX software stack is comprised of the Intel(R) SGX driver, the Intel(

The [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project hosts the out-of-tree driver for the Linux Intel(R) SGX software stack, which will be used until the driver upstreaming process is complete.

Within the linux-sgx-driver project, two versions of the out-of-tree driver are provided. Both versions are compatible with the linux-sgx PSW and SDK:
- SGX 2.0 Linux Driver (sgx2)
* The sgx2 branch of the linux-sgx-driver project contains the SGX 2.0 Linux Driver. This driver has additional support for SGX 2.0-based features available in upcoming CPUs. This driver has the same behavior as the SGX 1.5 Linux Driver (master) on CPUs without SGX 2.0 support.
- SGX 1.5 Linux Driver (master)
* The master branch of the linux-sgx-driver project tracks the proposed upstream version of the SGX 1.5 driver and does not yet support SGX 2.0-based features.
IMPORTANT:
---------
This driver can be used to support earlier SGX-capable CPUs without Flexible Launch Control (FLC). However, please note that the ABI of this driver is diverged from the upstreaming SGX kernel patches and extra effort may be required to migrate software using this driver to future kernels with SGX support. To minimize ABI divergence and better align all SGX software stack with future SGX enabled kernel, no new features will be added to this driver. Support for distro/kernel versions other than those listed here will be considered on a case-by-case basis.

The [DCAP driver]( https://github.com/intel/SGXDataCenterAttestationPrimitives/tree/master/driver) has been developed to track closely with the upstreaming kernel patches, and support all SGX CPUs with FLC. Therefore, we recommend SGX community to start using the DCAP driver to minimize future impact from adopting new mainline kernels with SGX support.

For new feature requests/patches, please submit them directly to the [linux-sgx mailing list](http://vger.kernel.org/vger-lists.html#linux-sgx)

License
-------
See License.txt for details.

Contributing
-------
Starting from 05/2017, we are importing the sgx driver code from the in-kernel sgx repository located at git-hub: https://github.com/jsakkine-intel/linux-sgx.git. Any contribution should be done there. Future versions of the sgx driver code will be imported later on. The motivation behind this decision is to maintain a single source code of the sgx linux driver.
An additional directory inker2ext/ has been created, it contains a script and a patch file that can be used in order to separately generate the code base of the sgx external module; it can be used in case someone wants the newest sgx driver as an external module and does not want to wait for next update.

The sgx2 branch hosts an initial implementation supporting SGX 2.0. This patch is maintained in inker2ext/sgx2.patch in the 2.0 branch and will be periodically rebased to take updates from the linux-sgx-driver:master branch. Contributions for this patch should be managed directly through the linux-sgx-driver project on Github.

Documentation
-------------
- [Intel(R) SGX for Linux\* OS](https://01.org/intel-softwareguard-extensions) project home page on [01.org](http://01.org)
- [Intel(R) SGX for Linux\* OS](https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/linux-overview.html)
- [Intel(R) SGX Programming Reference](https://software.intel.com/en-us/articles/intel-sdm)

Build and Install the Intel(R) SGX Driver
-----------------------------------------

### Prerequisites
- Ensure that you have the following required operating systems:
* Ubuntu* 16.04.3 LTS Desktop 64bits
* Ubuntu* 16.04.3 LTS Server 64bits
* Red Hat Enterprise Linux Server release 7.4 64bits
* CentOS 7.4.1708 64bits
* SUSE Linux Enterprise Server 12 64bits
- Ensure that you have an operating system version supported as listed for specific releases: [https://01.org/intel-software-guard-extensions/downloads](https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/linux-overview.html#downloads)
- Ensure that you have the following required hardware:
* 6th Generation Intel(R) Core(TM) Processor or newer
- Configure the system with the **SGX hardware enabled** option.
Expand All @@ -57,7 +46,7 @@ Build and Install the Intel(R) SGX Driver
```
$ sudo apt-get install linux-headers-$(uname -r)
```
* On CentOS and RHEL
* On CentOS, RHEL or Fedora
* To check if matching kernel headers are installed:
```
$ ls /usr/src/kernels/$(uname -r)
Expand All @@ -71,13 +60,16 @@ Build and Install the Intel(R) SGX Driver
$ sudo yum install kernel
$ sudo reboot
```
* On RHEL 8.0 elfutils-libelf-devel package is required:
```
$ sudo yum install elfutils-libelf-devel
```


**Note:** Refer to the *"Intel® SGX Resource Enumeration Leaves"* section in the [Intel SGX Programming reference guide](https://software.intel.com/en-us/articles/intel-sdm) to make sure your cpu has the SGX feature.


### Build the Intel(R) SGX Driver
**Note:** To use the SGX 2.0 driver, checkout or download the sgx2 branch and then follow the build instructions.

To build Intel(R) SGX driver, change the directory to the driver path and enter the following command:
```
Expand Down
12 changes: 12 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Security Policy

## Report a Vulnerability

Please report security issues or vulnerabilities to the [Intel Security Center].

For more information on how Intel works to resolve security issues, see
[Vulnerability Handling Guidelines].

[Intel Security Center]:https://www.intel.com/security

[Vulnerability Handling Guidelines]:https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html
Loading