lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20240502103618.129017-1-dmitrii.bundin.a@gmail.com>
Date: Thu,  2 May 2024 13:36:18 +0300
From: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
To: dmitrii.bundin.a@...il.com
Cc: airlied@...il.com,
	bp@...e.de,
	daniel@...ll.ch,
	dri-devel@...ts.freedesktop.org,
	gongruiqi1@...wei.com,
	intel-gfx@...ts.freedesktop.org,
	jani.nikula@...ux.intel.com,
	joonas.lahtinen@...ux.intel.com,
	linux-kernel@...r.kernel.org,
	michal.wajdeczko@...el.com,
	rdunlap@...radead.org,
	rodrigo.vivi@...el.com,
	tursulin@...ulin.net
Subject: [PATCH RESEND] drm/i915/guc: Fix UB due to signed int overflow

Fix compile errors of the form "FIELD_PREP: mask is not constant" caused
by signed integer constant overflow. Files affected:

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

Reproducible with gcc 7.5

See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.

Signed-off-by: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
---
 drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h b/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
index 58012edd4eb0..8814d4cd371c 100644
--- a/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
+++ b/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
@@ -29,7 +29,7 @@
  */
 
 #define GUC_KLV_LEN_MIN				1u
-#define GUC_KLV_0_KEY				(0xffff << 16)
+#define GUC_KLV_0_KEY				(0xffffU << 16)
 #define GUC_KLV_0_LEN				(0xffff << 0)
 #define GUC_KLV_n_VALUE				(0xffffffff << 0)
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ