Message ID | 20230922232606.1928026-7-jithu.joseph@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp133672vqu; Sat, 23 Sep 2023 05:03:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGO2SvGIIBouM5wQeldPd3xxPK/m5yGURA2REJ9OcMYhgT7ZtTVDdzCDJoSSOXADG3q0lCu X-Received: by 2002:a05:6358:6f0f:b0:135:57d0:d171 with SMTP id r15-20020a0563586f0f00b0013557d0d171mr1732449rwn.15.1695470583348; Sat, 23 Sep 2023 05:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695470583; cv=none; d=google.com; s=arc-20160816; b=OEm4QT4oma9Xkyr9toX/JZvcNuTzOd7LclICszuMBXVqsc39pBuZ3pF7ftea5E4NwV LfO4vpysHhxMzfUv/d2aMqlKvWuxZbDK1ZA3MbSSk76C7YT76Mb2SHFPoSyrfqq7cuBT aaXOqfGkqW6/n+Fe4vaWx9aABXZUth1OYCKflNWbAOwV/PkcFRLUzjmQNKmeI5s/qIdY SquUAM12W1/uGoCkFRRDaQib1HNYeWoBzY6VHQhsbNSaxuMBZu6zo1vRGRmvwvvo9GNr wh3fT5PAkiIHMnn8EnVddUY7OuUlZkJIl8Z8lIXESpX3ixJfNOAd0XWsJjA1G5kyvMDr sREw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bZSxBF10b7JzIBFF8G5vrsy/s9cjV1CpGPzr2DXNhYE=; fh=DZTEBuCdFfe2DSdaI+6ceTR59ce872SNjmboNXW/0pA=; b=FS8r98wJ3Mfj8YTGX3fsV5xYSsCVRMuNNtiTO0DuITZkVb5DoGNXgFKyd9E7EGUZI9 OTvTRvu63ubbw/qcfnicgWKupSSTfevpGRMbNTKlB/zs3tzX3I5MPbr13KdnzLE+g7Y3 HtGX1r3UXXqLwK40BiiEp7WqacZ6ck8dc/R2bJk93z6tOBJLBwOUITfzLpjuoWzJ9x97 8Dzd5CyQT+06+UvYYxVhnnsqsE3etPh57YIDglKkgBU8eo0v3eoF5AjRsHkqh08tuBXB xt0mqasrtGH/HeqfzQI6MnFCQmQUy3HYcxZI8vI49V2SH8rQZX5Alc4kk7QWORN+t/nz qEKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lMqjeJM3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id r17-20020a632b11000000b00578a56848a2si5762232pgr.648.2023.09.23.05.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 05:03:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lMqjeJM3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A2FDE82B5B82; Fri, 22 Sep 2023 16:31:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230429AbjIVXak (ORCPT <rfc822;pwkd43@gmail.com> + 28 others); Fri, 22 Sep 2023 19:30:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230321AbjIVXaW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 22 Sep 2023 19:30:22 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DE31A1; Fri, 22 Sep 2023 16:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695425416; x=1726961416; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WrOU0a7wgE3OYiSb3Tr3bbEuX5YDrEhEBdcjQkN5ci8=; b=lMqjeJM3mmZJtxPb7TTghy/n6DRieHWdTT/Dmr+ufAhIiGbhHt83rLGC UH9TsQNJF50YhwZshGiN2DgWrGBggS7RqCukxK6KyK3S7dwID5NPMv4Xk GbME4tBcZnS/cAW806wTyTyPFPxcGyzts0Px/fCW7Hf9K2YGCJOkzzafZ mbQ6V5N+LvJyU2lN1zmETi19JQcRRKLrBvuVVj2tvWgYQSbzvQjQxIjDh gclzbxTpISd83gw2hgO263m9RDHZBr/c5HYkJfgNIBaJ83FYhlQktXMf/ 8SBDm2LcYX1JDpTPm7sEx+PsOZeHds+SRSGw2uUeBTif+/1VYjGFY3tWz A==; X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="411896967" X-IronPort-AV: E=Sophos;i="6.03,169,1694761200"; d="scan'208";a="411896967" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 16:30:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="921350843" X-IronPort-AV: E=Sophos;i="6.03,169,1694761200"; d="scan'208";a="921350843" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 16:30:13 -0700 From: Jithu Joseph <jithu.joseph@intel.com> To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, pengfei.xu@intel.com, ilpo.jarvinen@linux.intel.com Subject: [PATCH v2 6/9] platform/x86/intel/ifs: Metadata validation for start_chunk Date: Fri, 22 Sep 2023 16:26:03 -0700 Message-Id: <20230922232606.1928026-7-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230922232606.1928026-1-jithu.joseph@intel.com> References: <20230913183348.1349409-1-jithu.joseph@intel.com> <20230922232606.1928026-1-jithu.joseph@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 16:31:20 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776950852170563737 X-GMAIL-MSGID: 1777829762739835407 |
Series |
IFS support for GNR and SRF
|
|
Commit Message
Jithu Joseph
Sept. 22, 2023, 11:26 p.m. UTC
Add an additional check to validate IFS image metadata field prior to loading the test image. If start_chunk is not a multiple of chunks_per_stride error out. Signed-off-by: Jithu Joseph <jithu.joseph@intel.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Tested-by: Pengfei Xu <pengfei.xu@intel.com> --- drivers/platform/x86/intel/ifs/load.c | 7 +++++++ 1 file changed, 7 insertions(+)
Comments
On Fri, 22 Sep 2023, Jithu Joseph wrote: > Add an additional check to validate IFS image metadata field prior to > loading the test image. > > If start_chunk is not a multiple of chunks_per_stride error out. > > Signed-off-by: Jithu Joseph <jithu.joseph@intel.com> > Reviewed-by: Tony Luck <tony.luck@intel.com> > Tested-by: Pengfei Xu <pengfei.xu@intel.com> > --- > drivers/platform/x86/intel/ifs/load.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c > index b09106034fac..c92d313b921f 100644 > --- a/drivers/platform/x86/intel/ifs/load.c > +++ b/drivers/platform/x86/intel/ifs/load.c > @@ -291,6 +291,13 @@ static int validate_ifs_metadata(struct device *dev) > return ret; > } > > + if (ifs_meta->chunks_per_stride != 0 && > + (ifs_meta->starting_chunk % ifs_meta->chunks_per_stride)) { I meant that != 0 should be on the second line.
On 9/25/2023 8:45 AM, Ilpo Järvinen wrote: > On Fri, 22 Sep 2023, Jithu Joseph wrote: > >> Add an additional check to validate IFS image metadata field prior to >> loading the test image. >> >> If start_chunk is not a multiple of chunks_per_stride error out. >> >> Signed-off-by: Jithu Joseph <jithu.joseph@intel.com> >> Reviewed-by: Tony Luck <tony.luck@intel.com> >> Tested-by: Pengfei Xu <pengfei.xu@intel.com> >> --- >> drivers/platform/x86/intel/ifs/load.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c >> index b09106034fac..c92d313b921f 100644 >> --- a/drivers/platform/x86/intel/ifs/load.c >> +++ b/drivers/platform/x86/intel/ifs/load.c >> @@ -291,6 +291,13 @@ static int validate_ifs_metadata(struct device *dev) >> return ret; >> } >> >> + if (ifs_meta->chunks_per_stride != 0 && >> + (ifs_meta->starting_chunk % ifs_meta->chunks_per_stride)) { > > I meant that != 0 should be on the second line. > Ah I see ... Will change Jithu
diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index b09106034fac..c92d313b921f 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -291,6 +291,13 @@ static int validate_ifs_metadata(struct device *dev) return ret; } + if (ifs_meta->chunks_per_stride != 0 && + (ifs_meta->starting_chunk % ifs_meta->chunks_per_stride)) { + dev_warn(dev, "Starting chunk num %d not a multiple of chunks_per_stride %d\n", + ifs_meta->starting_chunk, ifs_meta->chunks_per_stride); + return ret; + } + return 0; }