diff mbox

[intel-sgx-kernel-dev,v3,3/7] intel_sgx: fix null pointer deref in sgx_invalidate()

Message ID 20161130142323.5324-4-jarkko.sakkinen@linux.intel.com
State New, archived
Headers show

Commit Message

Jarkko Sakkinen Nov. 30, 2016, 2:23 p.m. UTC
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/platform/x86/intel_sgx_util.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/platform/x86/intel_sgx_util.c b/drivers/platform/x86/intel_sgx_util.c
index 30e9ca6..8ba2abd 100644
--- a/drivers/platform/x86/intel_sgx_util.c
+++ b/drivers/platform/x86/intel_sgx_util.c
@@ -173,6 +173,8 @@  void sgx_invalidate(struct sgx_encl *encl)
 		vma = sgx_find_vma(encl, addr);
 		if (vma)
 			sgx_zap_tcs_ptes(encl, vma);
+		else
+			break;
 	}
 
 	encl->flags |= SGX_ENCL_INVALIDATED;