Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Why does SGX calling ioctl so many times?

Yoon__HanJae
Beginner
453 Views

Hello,

When I analysis sgx process by using strace, ioctl function is called so many times after mmap function like below.

1424  11:18:56 mmap(NULL, 4194304, PROT_NONE, MAP_SHARED, 4, 0) = 0x7f7e6a800000
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x00, 0x08), 0x7ffdadb760b0) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0

Is there anyone who knows why this function is called so many times?
What means this function?

0 Kudos
1 Reply
JesusG_Intel
Moderator
453 Views

Hello HanJae,

ioctl are system calls in the OS used to access kernel-level device drivers from the user space application. For example, you may find it after an attempt to open /dev/isgx or after memmap or munmap function calls. This wiki page has a good discussion on ioctl, https://en.wikipedia.org/wiki/Ioctl, also see https://linux.die.net/man/2/ioctl.

Regards,
Jesus

0 Kudos
Reply