From nobody Tue Feb 10 00:00:11 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41F1021D3EA; Thu, 17 Apr 2025 15:08:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744902530; cv=none; b=ooG32tK6nGB00PAG+0bWGeHOeXXAhhy8dK9tIoXYO+y1L2kaBaBDt2bZzaVbDq8Kb1AyA3JC7dddFGAhXX1uklKo6b7gej+cI8QySBK+FtcED9hh0cALfc8Pn/PY45FtxgDoITa1ZzawQOsiV3qWkNG5Njl0t7SA4fNHBYmDPAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744902530; c=relaxed/simple; bh=F2GZRp++KxKOvNNAn2NVxZTL1RAxokaCzoH8dbomSxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=txINqyqUc/TjyrqEq9PuMXRcR2Qao/32bMXg0f2CD2omUmSg2ayIm5ZD2Au6RaYyaXDMzokbWM6lS2BU7anXuZ69USSvbIylnbvMdkQIui0cMEgd2VoEdPv3M9I7xA2pGAhTbhaz02ezNdeCxoIvU4WLPzqGPYh2AFMi3DeYxGE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ERKG8JzX; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ERKG8JzX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744902528; x=1776438528; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F2GZRp++KxKOvNNAn2NVxZTL1RAxokaCzoH8dbomSxA=; b=ERKG8JzXEexNOWy7Vg1pA0uwYbrdbhgcNFaChm5Y/ixbBJXN3g78dtpN t8W2vlvSqaF0vUfWHhSls1MSTcuLdsjZVGjgVYyDVVlMSAN1+m8DMyJaO tqX5mUxrERImrCnQ30YkoctyEsUZ2WKynjkMKQDA30ptZh3O3+qknVXuf 5tRL6fResCY9aoU541pfmd/xmvBoN+6EXoKAhntQne1mDDad8daRkierK K4DLLQign6oJU9or18smOIhjDkrDNaHp2byHqQmpL2Upu5/FbFeyMYrsS V0QlcCQUzxpaCOExwh17v6AkwM8VeJoyL29VQwJGWQ8Mhq1iRljSZ23/R w==; X-CSE-ConnectionGUID: bXuu3WHIQ9WMxVWeWX3gFg== X-CSE-MsgGUID: 083XihPqS3GEtuQf5qMjSA== X-IronPort-AV: E=McAfee;i="6700,10204,11406"; a="57488636" X-IronPort-AV: E=Sophos;i="6.15,219,1739865600"; d="scan'208";a="57488636" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2025 08:08:47 -0700 X-CSE-ConnectionGUID: bPmZ1V1mSQmkKcpH/My3DQ== X-CSE-MsgGUID: a+2UpJGDRZGV3Rq5stfpkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,219,1739865600"; d="scan'208";a="161876770" Received: from qiuxu-clx.sh.intel.com ([10.239.53.109]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2025 08:08:45 -0700 From: Qiuxu Zhuo To: Tony Luck Cc: Qiuxu Zhuo , Feng Xu , Borislav Petkov , James Morse , Mauro Carvalho Chehab , Robert Richter , Yi Lai , Shawn Fan , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] EDAC/skx_common: Fix general protection fault Date: Thu, 17 Apr 2025 23:07:18 +0800 Message-ID: <20250417150724.1170168-2-qiuxu.zhuo@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250417150724.1170168-1-qiuxu.zhuo@intel.com> References: <20250417150724.1170168-1-qiuxu.zhuo@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" After loading i10nm_edac (which automatically loads skx_edac_common), if unload only i10nm_edac, then reload it and perform error injection testing, a general protection fault may occur: mce: [Hardware Error]: Machine check events logged Oops: general protection fault ... ... Workqueue: events mce_gen_pool_process RIP: 0010:string+0x53/0xe0 ... Call Trace: ? die_addr+0x37/0x90 ? exc_general_protection+0x1e7/0x3f0 ? asm_exc_general_protection+0x26/0x30 ? string+0x53/0xe0 vsnprintf+0x23e/0x4c0 snprintf+0x4d/0x70 skx_adxl_decode+0x16a/0x330 [skx_edac_common] skx_mce_check_error.part.0+0xf8/0x220 [skx_edac_common] skx_mce_check_error+0x17/0x20 [skx_edac_common] ... The issue arose was because the variable 'adxl_component_count' (inside skx_edac_common), which counts the ADXL components, was not reset. During the reloading of i10nm_edac, the count was incremented by the actual number of ADXL components again, resulting in a count that was double the real number of ADXL components. This led to an out-of-bounds reference to the ADXL component array, causing the general protection fault above. Fix this issue by resetting the 'adxl_component_count' in adxl_put(), which is called during the unloading of {skx,i10nm}_edac. Fixes: 123b15863550 ("EDAC, i10nm: make skx_common.o a separate module") Reported-by: Feng Xu Tested-by: Feng Xu Signed-off-by: Qiuxu Zhuo --- drivers/edac/skx_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/edac/skx_common.c b/drivers/edac/skx_common.c index fa5b442b1844..c9ade45c1a99 100644 --- a/drivers/edac/skx_common.c +++ b/drivers/edac/skx_common.c @@ -116,6 +116,7 @@ EXPORT_SYMBOL_GPL(skx_adxl_get); =20 void skx_adxl_put(void) { + adxl_component_count =3D 0; kfree(adxl_values); kfree(adxl_msg); } --=20 2.43.0