From patchwork Thu Aug 12 12:09:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1516265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=gwVW60HB; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gllqb73DHz9sXV; Thu, 12 Aug 2021 22:09:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mE9Wp-0005wQ-EW; Thu, 12 Aug 2021 12:09:43 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mE9Wc-0005qN-GD for kernel-team@lists.ubuntu.com; Thu, 12 Aug 2021 12:09:30 +0000 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 4EC9F3F051 for ; Thu, 12 Aug 2021 12:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628770170; bh=iBaghYSiNLEsiq74+1A7RndzHsFxW81Wiu2A8lkKxW4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gwVW60HBunZRSP0aFWsZsGwwJh3za2xBUN0008CVISDwJfRWnVWweLZUVbb3fXp57 wfq5fcyFbgs33J1Qo2G7yTa81cj/8y5j5aPjqUNW6xXqtwFxFkAdY2pkVMvWZc1DQa D4F1SSTfxgbC6ITFHgZpTVq1CAyXyyEoLGTlxdwQWrtkBkig6tjlmeeuluCooJJgkK zWM8dU7p3aYyimfz1UpsNLgHUmD6cthOsZwJXiNH/HMqe0/TXxOIXJ8StVtTAJ7JzW ib4SU7FpLQtCt7EwaUt/7potHXAEOW/WTWSnxuiCVZ+4SE3v2fa9Zo3aUYfuZEA/PN uyqsr8HQnhGCQ== Received: by mail-pj1-f71.google.com with SMTP id j6-20020a17090ac486b0290178ffdbd20dso230330pjt.0 for ; Thu, 12 Aug 2021 05:09:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iBaghYSiNLEsiq74+1A7RndzHsFxW81Wiu2A8lkKxW4=; b=XUaZ7+HLMvvGC85p/fL/TOlGesF1VwEFMbnhLMZDeJW0wr+L3fMLgN41c8KnO/8B70 mfdEyu1tXR7KTTCeQ8pyAowootkfj+otjhwKaB5Xl6p1zPlx93d5Xw7mDOF02zv9asIM eNFzzkWHpy/DFCnBVE+KYEc7OeUpuMuTdI+rkZuwK6PS9ZNCYwXeGoeeM+Kb3UW7mjX2 IoGoRXyxx7+e8CByHrSB3cgHyFhNB2NYeEa3irfHRdrJqbBmol2M8BYHjaknBTKMNzS+ z1tDvcPUszkO9GhkBIEPkSe3ccesBTs88NDfJaJeqyyLBD+R8/SqFkiRs75hoQlkHRnr 0B8w== X-Gm-Message-State: AOAM532Fs6bdObAMs7gKgpySvCiOD/ZQLgezU2XOVwxCZDqJ1bPbr7JE Bm6YEbnCgWftjSaFmrjyLOTUxhAbbleBjWUFs/u9G8e/p0ByLdIC/Q7twjdG7n3JmI9Y0fyvbuj sRbm5ddxmhkcL71ta4JAsiwAHGb5ix7OvZcR9luXplw== X-Received: by 2002:a63:83c7:: with SMTP id h190mr3615059pge.51.1628770168660; Thu, 12 Aug 2021 05:09:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB3UvLWrFhEzICVDasWaNFSqhMH7n8fmg5eYIXfnoeZbdU3X7Ahs59BwusXBi0jL+ZvXTNig== X-Received: by 2002:a63:83c7:: with SMTP id h190mr3615042pge.51.1628770168454; Thu, 12 Aug 2021 05:09:28 -0700 (PDT) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id i11sm3204940pfo.29.2021.08.12.05.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 05:09:27 -0700 (PDT) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/8] UBUNTU: SAUCE: ubuntu/sgx: Fix signed integer overflow on shift Date: Thu, 12 Aug 2021 06:09:11 -0600 Message-Id: <20210812120913.9316-7-tim.gardner@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210812120913.9316-1-tim.gardner@canonical.com> References: <20210812120913.9316-1-tim.gardner@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1936240 https://github.com/intel/SGXDataCenterAttestationPrimitives af9a396cbc0977898d779950e69b493802432591 Fix signed integer overflow on shift Signed-off-by: Tim Gardner --- ubuntu/sgx/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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];