mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] x86/sgx: Initialize "ret" in sgx_ioc_enclave_add_pages()
       [not found] <20201202162200.88941-1-jarkko@kernel.org>
@ 2020-12-02 17:38 ` Borislav Petkov
  2020-12-03 18:24   ` Jarkko Sakkinen
  0 siblings, 1 reply; 2+ messages in thread
From: Borislav Petkov @ 2020-12-02 17:38 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: x86, linux-sgx, Dave Hansen, Dan Carpenter, lkml

On Wed, Dec 02, 2020 at 06:22:00PM +0200, Jarkko Sakkinen wrote:
> Initialize "ret" to zero as otherwise a zero length address range will
> leave it uninitialized.

That length is:

 * @length:     length of the data (multiple of the page size)

I think we wanna fail this even earlier when it wants to add data of
length 0 because that sounds nonsensical to me. Or is there some use
case for zero-length data?

Btw, pls CC lkml on patch submissions.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/sgx: Initialize "ret" in sgx_ioc_enclave_add_pages()
  2020-12-02 17:38 ` [PATCH] x86/sgx: Initialize "ret" in sgx_ioc_enclave_add_pages() Borislav Petkov
@ 2020-12-03 18:24   ` Jarkko Sakkinen
  0 siblings, 0 replies; 2+ messages in thread
From: Jarkko Sakkinen @ 2020-12-03 18:24 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Jarkko Sakkinen, x86, linux-sgx, Dave Hansen, Dan Carpenter, lkml

On Wed, Dec 02, 2020 at 06:38:29PM +0100, Borislav Petkov wrote:
> On Wed, Dec 02, 2020 at 06:22:00PM +0200, Jarkko Sakkinen wrote:
> > Initialize "ret" to zero as otherwise a zero length address range will
> > leave it uninitialized.
> 
> That length is:
> 
>  * @length:     length of the data (multiple of the page size)
> 
> I think we wanna fail this even earlier when it wants to add data of
> length 0 because that sounds nonsensical to me. Or is there some use
> case for zero-length data?
> 
> Btw, pls CC lkml on patch submissions.

Yeah, makes sense to fail right after copying the parameter struct
with -EINVAL.

> Thx.
> 
> -- 
> Regards/Gruss,
>     Boris.
> 
> https://people.kernel.org/tglx/notes-about-netiquette
> 

/Jarkko

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-03 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201202162200.88941-1-jarkko@kernel.org>
2020-12-02 17:38 ` [PATCH] x86/sgx: Initialize "ret" in sgx_ioc_enclave_add_pages() Borislav Petkov
2020-12-03 18:24   ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®