[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160120095451.GB19898@mwanda>
Date: Wed, 20 Jan 2016 12:54:51 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Doug Thompson <dougthompson@...ssion.com>,
Borislav Petkov <bp@...en8.de>
Cc: Mauro Carvalho Chehab <mchehab@....samsung.com>,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] amd64_edac: shift wrapping issue in f1x_get_norm_dct_addr()
dct_sel_base_off is declared as a u64 but we're only using the lower 32
bits because of a shift wrapping bug.
Fixes: c8e518d5673d ('amd64_edac: Sanitize f10_get_base_addr_offset')
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
Static checker stuff. Not tested.
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 9eee13e..d87a475 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1452,7 +1452,7 @@ static u64 f1x_get_norm_dct_addr(struct amd64_pvt *pvt, u8 range,
u64 chan_off;
u64 dram_base = get_dram_base(pvt, range);
u64 hole_off = f10_dhar_offset(pvt);
- u64 dct_sel_base_off = (pvt->dct_sel_hi & 0xFFFFFC00) << 16;
+ u64 dct_sel_base_off = (u64)(pvt->dct_sel_hi & 0xFFFFFC00) << 16;
if (hi_rng) {
/*
Powered by blists - more mailing lists