diff mbox series

[6/8] UBUNTU: SAUCE: ubuntu/sgx: Fix signed integer overflow on shift

Message ID 20210812120913.9316-7-tim.gardner@canonical.com
State New
Headers show
Series Sync to SGX 1.33.2 | expand

Commit Message

Tim Gardner Aug. 12, 2021, 12:09 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1936240

https://github.com/intel/SGXDataCenterAttestationPrimitives
af9a396cbc0977898d779950e69b493802432591 Fix signed integer overflow on shift

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 ubuntu/sgx/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ubuntu/sgx/ioctl.c b/ubuntu/sgx/ioctl.c
index 0dd2f4ef970d5..5c84447b8ac28 100644
--- a/ubuntu/sgx/ioctl.c
+++ b/ubuntu/sgx/ioctl.c
@@ -66,7 +66,7 @@  static u32 sgx_calc_ssaframesize(u32 miscselect, u64 xfrm)
 	int i;
 
 	for (i = 2; i < 64; i++) {
-		if (!((1 << i) & xfrm))
+		if (!((1UL << i) & xfrm))
 			continue;
 
 		size = SGX_SSA_GPRS_SIZE + sgx_xsave_size_tbl[i];