Re: [PATCH 1/4] selftests/sgx: Fix segfault upon early test failure

Dave Hansen
2022-01-28T19:26:32Z

On 1/28/22 11:22, Reinette Chatre wrote:
> if (encl->segment_tbl) {
> + /*
> + * Most segments form part of the enclave binary
> + * and have their mappings deleted with earlier
> + * munmap() of encl->bin.
> + * As a mapping of anonymous memory the heap
> + * segment is separate from the enclave
> + * binary and needs its mapping deleted separately.
> + */
> heap_seg = &encl->segment_tbl[encl->nr_segments - 1];
> munmap(heap_seg->src, heap_seg->size);

I was more wondering why the status of heap_seg->src is tied to
encl->segment_tbl.