Skip to contentSkip to conversation

Odd looking #PF fault code

DISCUSSION Jarkko Sakkinen 2 participants 4 messages Apr 3, 2022 – Apr 5, 2022 Intel SGX

lore
Share & tools
lore

Jarkko Sakkinen

author maintainer
#0 lore raw

I get this when trying to get EAUG-EACCEPTCOPY to run on Enarx and I get:

Unexpected PF: address: 0x007f7fff910000, error code 0x15

I'm using patches from:

https://github.com/rchatre/linux/tree/sgx/sgx2_submitted_v2_plus_rwx

Fault code is in other words PROT|WRITE|USER|RSVD.

According to arch/x86/kernel/fault.c:

	/*
	 * Reserved bits are never expected to be set on
	 * entries in the user portion of the page tables.
	 */
	if (unlikely(error_code & X86_PF_RSVD))
		pgtable_bad(regs, error_code, address);

Any clue how this fault code could emit?

[*] https://github.com/enarx/enarx/pull/1608

BR, Jarkko

#1 lore raw

Hi Jarkko,

Quoted 2 lines · Jarkko Sakkinen

I get this when trying to get EAUG-EACCEPTCOPY to run on Enarx and I get:

There seems a difference in the error codes described:

Quoted 1 line

Unexpected PF: address: 0x007f7fff910000, error code 0x15

Error code 0x15 translates to binary 10101 which is:
BIT 0: Present
BIT 2: User
BIT 4: Instruction fetch

Quoted 6 lines

I'm using patches from:

https://github.com/rchatre/linux/tree/sgx/sgx2_submitted_v2_plus_rwx

Fault code is in other words PROT|WRITE|USER|RSVD.

PROT|WRITE|USER|RSVD is bits 0,1,2,3 which is 0xF

Did you obtain 0x15 or 0xF as error code?

If EAUG/EACCEPTCOPY was followed by an attempt to execute that page then 0x15 error could be explained since the page would only support RW permissions at that time.

Quoted 9 lines

According to arch/x86/kernel/fault.c:

	/*
	 * Reserved bits are never expected to be set on
	 * entries in the user portion of the page tables.
	 */
	if (unlikely(error_code & X86_PF_RSVD))
		pgtable_bad(regs, error_code, address);
Quoted 5 lines

Any clue how this fault code could emit?

[*] https://github.com/enarx/enarx/pull/1608

BR, Jarkko

Reinette

author maintainer
#2 lore raw
Quoted 6 lines · Reinette Chatre

Hi Jarkko,

Quoted 2 lines · Jarkko Sakkinen

I get this when trying to get EAUG-EACCEPTCOPY to run on Enarx and I get:

Quoted 8 lines

There seems a difference in the error codes described:

Quoted 1 line

Unexpected PF: address: 0x007f7fff910000, error code 0x15

Error code 0x15 translates to binary 10101 which is:
BIT 0: Present
BIT 2: User
BIT 4: Instruction fetch

Yeah, I misread it.

BR, Jarkko

author maintainer
#3 lore raw
In reply to Jarkko Sakkinen
Quoted 19 lines · Jarkko Sakkinen

I get this when trying to get EAUG-EACCEPTCOPY to run on Enarx and I get:

Unexpected PF: address: 0x007f7fff910000, error code 0x15

I'm using patches from:

https://github.com/rchatre/linux/tree/sgx/sgx2_submitted_v2_plus_rwx

Fault code is in other words PROT|WRITE|USER|RSVD.

According to arch/x86/kernel/fault.c:

        /*
         * Reserved bits are never expected to be set on
         * entries in the user portion of the page tables. */
        if (unlikely(error_code & X86_PF_RSVD)) pgtable_bad(regs, error_code, address);

Quoted 5 lines

Any clue how this fault code could emit?

[*] https://github.com/enarx/enarx/pull/1608

BR, Jarkko

Oops, off-by-one, I bit is set, not RSVD :-)

BR, Jarkko