Re: [PATCH 12/14] selftests/sgx: Add page permission and exception test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jarkko,

On 9/16/2021 8:21 AM, Jarkko Sakkinen wrote:
On Wed, 2021-09-15 at 13:31 -0700, Reinette Chatre wrote:

...

+/*
+ * Return the offset in the enclave where the data segment can be found.
+ * The first RW segment loaded is the TCS, skip that to get info on the
+ * data segment.
+ */
+static off_t encl_get_data_offset(struct encl *encl)
+{
+	int i;
+
+	for (i = 0; i < encl->nr_segments; i++) {
+		struct encl_segment *seg = &encl->segment_tbl[i];
+
+		if (i != 0 && seg->prot == (PROT_READ | PROT_WRITE))
+			return seg->offset;

So, why not

	for (i = 1; i < encl->nr_segments; i++)

?

Thank you for catching this. Will do.

Reinette



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux