rune/libenclave/epm: add support for sgx kernel driver upstreamed
SGX device node has been changed from /dev/sgx/enclave to /dev/sgx_enclave.
This implementation matches with this change.
Fixes:
@@ -12,7 +12,9 @@ import (
*/
const (
EnclavePath = "/dev/sgx/enclave"
+ EnclaveNewPath = "/dev/sgx_enclave"
EnclavePathPool = "/sgx/enclave"
+ EnclaveNewPathPool = "/sgx_enclave"
)
func GetEnclProcMaps(pid int) ([]*procfs.ProcMap, error) {
@@ -35,7 +37,7 @@ func GetEnclProcMaps(pid int) ([]*procfs.ProcMap, error) {
for idx := range maps {
pathname := maps[idx].Pathname
- if pathname == EnclavePath || pathname == EnclavePathPool {
+ if pathname == EnclavePath || pathname == EnclavePathPool || pathname == EnclaveNewPath || pathname == EnclaveNewPathPool {
enclprocmaps = append(enclprocmaps, maps[idx])
}
}
@@ -60,7 +62,7 @@ func GetEnclaveFd(pid int) (int, error) {
}
for fd, n := range names {
- if n == EnclavePath || n == EnclavePathPool {
+ if n == EnclavePath || n == EnclavePathPool || pathname == EnclaveNewPath || pathname == EnclaveNewPathPool {
return int(fd), err
}
}
