diff mbox series

[for_v22,03/11] x86/sgx: Return '0' when sgx_ioc_enclave_set_attribute() succeeds

Message ID 20190808001254.11926-4-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series x86/sgx: Bug fixes for v22 | expand

Commit Message

Sean Christopherson Aug. 8, 2019, 12:12 a.m. UTC
Ensure the local ret variable is set to zero when being returned via the
success path.

Reported-by: Shay Katz-zamir <shay.katz-zamir@intel.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/driver/ioctl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jarkko Sakkinen Aug. 8, 2019, 3:37 p.m. UTC | #1
On Wed, Aug 07, 2019 at 05:12:46PM -0700, Sean Christopherson wrote:
> Ensure the local ret variable is set to zero when being returned via the
> success path.
> 
> Reported-by: Shay Katz-zamir <shay.katz-zamir@intel.com>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

Acked-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/sgx/driver/ioctl.c b/arch/x86/kernel/cpu/sgx/driver/ioctl.c
index 89b3fb81c15b..ebb71eb3323a 100644
--- a/arch/x86/kernel/cpu/sgx/driver/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/driver/ioctl.c
@@ -810,6 +810,7 @@  static long sgx_ioc_enclave_set_attribute(struct file *filep, void __user *arg)
 	}
 
 	encl->allowed_attributes |= SGX_ATTR_PROVISIONKEY;
+	ret = 0;
 
 out:
 	fput(attribute_file);