Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3818537imw; Mon, 18 Jul 2022 15:15:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVPyRq+gh7IHEGfNVsrka7ubtvTl2OHL6jfPz3S497gxkCLqDTV+gmgTQfMjLE5ABxRvta X-Received: by 2002:a17:907:7205:b0:72f:38ec:f70e with SMTP id dr5-20020a170907720500b0072f38ecf70emr5399726ejc.130.1658182547279; Mon, 18 Jul 2022 15:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658182547; cv=none; d=google.com; s=arc-20160816; b=TLBJGu691Vpa2HPi6Ulx1/dpJ++HdGDhbZ02I5ofXp27JQVrw1r9haiNb+BWRVcOUD P71yu0jUI68x0Dlr+c3/SzO3oLYEmYDFDgaqCHXB5bdhTJmlMfj8kvEta6Ipx7HCI+RY h3IFHpHAf++RboeR+YQ1YCu6hdqcizW1bPM9QF355hAm/enTjy0f5IZve2XGRxALkwF5 aXU7+sePwpaswRG2gXLWQxwiXFX1pa5xBuYB0k36qpUdYQPt3qRclLjKvtc8+2p8Vlht 0y69xJjY+DVWcOh9g0BsKNQRYkA4V/rcieKcMfOiDwSwvcuUnqKAFsV3czaZOs0KArCw tWcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LjMsA7nXG5SN/UtodweW2Omh8Vzi6Z0d+s28Nt9jQGg=; b=kp1jsCoqeL9BOlzIdgtkgnvnfdP/32IDIG3hUDgJW9VoqHGvBe9VKsFlXCo6ictmf+ L6LyyxF5biG0YJtYvGSgeQsfuTicHviik4cXCJ5/zJmi/7VT0ZQ8wqfqoTwJWFIbeJvB n0Uct6+hFVljpN6APEOM+xlsKUIV8XdrhV7U5g8wLZuNqWhK8WWSI3upHY/16wz3Sqor twVGkKkkxmSO9+a8344Cm0K0mIFSpd/AWemtVJqKn4CO+/m2iobQc9iEUph+SfA11BfL wp4HXiPqorhEDtV4Jo1lxrhBUA20OdXahMLfuweffws2PTPLQe4b/K29cphf4AIDH81T 3yrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=N9DWiOIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs16-20020a1709072d1000b00718c7b4cbeasi21777101ejc.991.2022.07.18.15.15.22; Mon, 18 Jul 2022 15:15:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=N9DWiOIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236170AbiGRViw (ORCPT + 99 others); Mon, 18 Jul 2022 17:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236293AbiGRVi2 (ORCPT ); Mon, 18 Jul 2022 17:38:28 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E7032B88; Mon, 18 Jul 2022 14:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658180296; x=1689716296; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=4MDpTNrZVOEj5WSRtU1vgmEx0jrQ6p/FbPvAvILaUFE=; b=N9DWiOIlnSdAIIPoY3fOa8wC342sEMyVAP+6xkBnMVMZnRHMYryJV5Oc 9lV1mhin83pNF3piyuCWrWUkE6VzrlUiIMv3KaFa5TKdLuafCtkkMQ9HY cxKIFbYB37ULDjHWbE/QfE1l99R/oymux7+Oy5UBTDmFFqXGeslyj6e/P 9x+PYz2rGC9rdaYguRSumZ+QEn4972sX/w+6zR2l2oK8sSHLGQdbxFj9O nIfcQB4i7l31wJgVUwkt7SBDGcT/S3Wh88LKoDaNqbci5+/WKNXPHiQIf aeN2CxcTsovqM1WhoN2J7FooszJh3UQbDlyxeH1rFUK20qh4UjjHBgy19 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10412"; a="372633079" X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="372633079" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 14:37:54 -0700 X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="572578880" Received: from agluck-desk3.sc.intel.com ([172.25.222.78]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 14:37:54 -0700 Date: Mon, 18 Jul 2022 14:37:53 -0700 From: "Luck, Tony" To: Jane Chu Cc: "Williams, Dan J" , "bp@alien8.de" , "tglx@linutronix.de" , "mingo@redhat.com" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "hch@lst.de" , "nvdimm@lists.linux.dev" Subject: Re: [PATCH v3] x86/mce: retrieve poison range from hardware Message-ID: References: <20220717234805.1084386-1-jane.chu@oracle.com> <41db4a4b17a848798e487a058a2bc237@intel.com> <62d5b13b2cf1a_9291929433@dwillia2-xfh.jf.intel.com.notmuch> <797a2b64ed0949b6905b3c3e8f049a23@intel.com> <5a92e418-9f50-8212-92a0-4ac39cefa9ef@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a92e418-9f50-8212-92a0-4ac39cefa9ef@oracle.com> X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18, 2022 at 09:11:33PM +0000, Jane Chu wrote: > On 7/18/2022 12:22 PM, Luck, Tony wrote: > >> It appears the kernel is trusting that ->physical_addr_mask is non-zero > >> in other paths. So this is at least equally broken in the presence of a > >> broken BIOS. The impact is potentially larger though with this change, > >> so it might be a good follow-on patch to make sure that > >> ->physical_addr_mask gets fixed up to a minimum mask value. > > > > Agreed. Separate patch to sanitize early, so other kernel code can just use it. > > > > Is it possible that with > if (mem->validation_bits & CPER_MEM_VALID_PA_MASK) > the ->physical_addr_mask is still untrustworthy? The validation_bits just show which fields the BIOS *says* it filled in. If a validation bit isn't set, then Linux should certainly ignore that field. But if it is set, then Linux needs to decide whether to use the value, or do a sanity check first. -Tony