lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 1 Sep 2023 00:16:04 +0000
From:   "Huang, Kai" <kai.huang@...el.com>
To:     "linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
        "jarkko@...nel.org" <jarkko@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Van Bulck, Jo" <jo.vanbulck@...kuleuven.be>
CC:     "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH v5 08/13] selftests/sgx: Handle relocations in test
 enclave

On Fri, 2023-09-01 at 01:26 +0200, Jo Van Bulck wrote:
> On 01.09.23 01:13, Huang, Kai wrote:
> > > encl_body:
> > >      /* snipped */
> > >      lea    encl_op_array(%rip), %rcx
> > >      lea    __encl_base(%rip), %rax
> > >      add    (%rcx,%rdx,8),%rax
> > >      jmp    *%rax
> > 
> > call *%rax
> > 
> > ?
> > 
> > >      ret
> 
> Good catch, but this is indeed the code as generated with gcc -Os (for 
> readability). It seems the compiler choose a JMP over a CALL (as the 
> stack is untouched and the callee can immediately return to the caller).

Ah, OK.

I thought it's a typo, but obviously the compiler is smarter. :-)

> 
> Somehow, the compiler still emits a RET after the JMP (which is not 
> supposed to return here) though. I agree this is unnecessarily confusing 
> and can simply remove the RET from the commit message.

The RET is for encl_body itself I suppose.

> 
> Best,
> Jo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ