Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1621186rdb; Mon, 2 Oct 2023 15:58:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPy0gT+Ji/xN6ACPG7E53D8//j1SvYqSppgN3P/afa13KxHxhN3D1f6h/Z5dzvBByMi0uR X-Received: by 2002:a05:6358:720c:b0:148:1a09:2469 with SMTP id h12-20020a056358720c00b001481a092469mr9012473rwa.25.1696287525286; Mon, 02 Oct 2023 15:58:45 -0700 (PDT) Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 14-20020a63020e000000b00565335587absi27282615pgc.802.2023.10.02.15.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 15:58:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kxczyzx6; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id CAF0D80BE3E0; Mon, 2 Oct 2023 15:58:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236781AbjJBW6d (ORCPT + 99 others); Mon, 2 Oct 2023 18:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbjJBW6c (ORCPT ); Mon, 2 Oct 2023 18:58:32 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA9A0B7; Mon, 2 Oct 2023 15:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696287508; x=1727823508; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=LkfR/eC1Xbt+Qyt4sRYKznRfpEafGPRbfXtClKfP7eQ=; b=kxczyzx61jKYk4zfHHdV4xSAtinVC4ny7688Ipt6jpqmZcRBXQV0uxtP jGHpN3f2OjBRdi6U8WDu7nCBhGnRPnXFlQwBi+o+/VQapQABJWbWpcdHt aDskX0dGzkfC4fwU6nE0El51cxX1zD56UD1tXul+HB/Qpq+tWxbDR9602 UtNynsZHF1xTrxgvSWov4yOYNsyT35CMcFiB3SS7UGvTHLEH/8H+u/wtk Oknjd03jaMGNqmweXrohfnc3Yg7tQHjNyvIfX3V7cWMN8Z7+UF258J3Pu Dv2whHhyo4Jbmcl1A50ylG1YiWaDspvbJF3aqxUqLAFzpMDZEZG3T+Qw/ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="385577988" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="385577988" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 15:58:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="841140758" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="841140758" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 02 Oct 2023 15:58:26 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 2 Oct 2023 15:58:26 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 2 Oct 2023 15:58:26 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Mon, 2 Oct 2023 15:58:26 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.177) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Mon, 2 Oct 2023 15:58:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KRx0iZnH2tq506rHl+wIhsw94PCqxW6Q/IDrpN10AMgblmMP6096RSZHIiAlgql9xjIhHOPRq1bw2A6A28ZY/0mAtaMPoYppFqNKOYf8DdKZgI3T1nYoAuZjg4CbZAxLztno1XOhVAzBrDeRUJbfZpkyzRB1mJ1DNErToEC4N6NCiyrSnzHjjqxjAzDIQ+l2J3tVuBh883B3nq58xaxNXJ3Ecuzedwr6pdbQmK2SuHe/IOWcwlCmNjAbFRC5ehLvXIIHU19umcvaAg1UwrzZTeUQim+tYgbTLcujH5GjUPGAm+tWmEOpx+SOmW5cJd2HHvHvdTFb6zj2z4YPeC/1Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0axU6bXq+oVMOPFt4AvY9w9CEVVu54HXdv6y387nU9Q=; b=PzFF7bUNMe8I7in1WrdKOruCT/xizMpM9jB9odyzsuUJyW0TfTnLeqwZuQWA/TKgiI6ZFoCuijiwwnb93MCTW507V+ZzPpj0nBFsOvG+b+nObyRQLwpwAHfXoAJoES4jrHeHZcS7xHkrRdnfDoYB0oCQ0ZUMhGAJeKALnIdbU7wMTp3qWBl/pTt2Nve8ljQqlvW1uKzNM6dufx4lbKvSTGTgbPlaS2XvtuvS+WZPxwxYC77MFn2XNqg3HkH0SOXe8CLQDmPcGjIDv45xM20I2F+jfzqtq0yuPmm8E2zl72YX9xK38COTNLyrVo/2ARCA/TLdHtapJldlAdVx5yXhIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3768.namprd11.prod.outlook.com (2603:10b6:a03:fa::20) by DM8PR11MB5592.namprd11.prod.outlook.com (2603:10b6:8:35::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.31; Mon, 2 Oct 2023 22:58:24 +0000 Received: from BYAPR11MB3768.namprd11.prod.outlook.com ([fe80::c438:45ad:1a1c:e168]) by BYAPR11MB3768.namprd11.prod.outlook.com ([fe80::c438:45ad:1a1c:e168%3]) with mapi id 15.20.6838.024; Mon, 2 Oct 2023 22:58:24 +0000 Message-ID: <9074ab58-7528-ddb4-7445-e4b4ccd66dea@intel.com> Date: Mon, 2 Oct 2023 15:58:20 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 6/9] platform/x86/intel/ifs: Metadata validation for start_chunk Content-Language: en-US To: =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= CC: Hans de Goede , , , , , , , , , , , LKML , , , , References: <20230922232606.1928026-1-jithu.joseph@intel.com> <20230929202436.2850388-1-jithu.joseph@intel.com> <20230929202436.2850388-7-jithu.joseph@intel.com> From: "Joseph, Jithu" In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MW4PR04CA0122.namprd04.prod.outlook.com (2603:10b6:303:84::7) To BYAPR11MB3768.namprd11.prod.outlook.com (2603:10b6:a03:fa::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR11MB3768:EE_|DM8PR11MB5592:EE_ X-MS-Office365-Filtering-Correlation-Id: 82aae871-6a56-4baf-bb5d-08dbc39b14e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BYGnXW5YxakoeXNkko6KfK+g2D/pZUwAq7rCQbMjmShcbwFwsX8Z4LHeG5i0hzTqu8hAi/o1Gi/R6vXGvVP5UCP78Usr4nWdi0dzQePZzrjNZzj6lZIfdD753KVgVEPRJx3NlFqa++mbOt0CDvLOVs3VUqrpwDewHm7zaPt8TEMbZmsGyGbWOnToHoGbSnqfKASsZu14qg0ZWCkPu8/EUyhhBsN3o1C3ks1Jv81ZKZGpt+VeqqUdFUcirPQuludvmd8olk24wlZuV5pWhs7MZHVod3Vn7HZxMqNDWs0GQlZzWu9mPvLvh9Km253y8TyBXukOOaB0d3OlRN6Q3FyHCxiBhi+d7NZRuOJBBF+iOLILcj3VYhKP362CqaHovYjGZTvyge0Cvzb/Ph2c0UHp7Yof4VIeIWG/KM7Tss/OOjz8pHqcYvjPHXbZwxwzNgcR+L1G0v0ywqsVxoMSdIMDgdARimsWD4rTvVsm7wfolfo1jBiBCltbOeDRN2A9L5AJeKkwD92zUDM9aL3MBUE2g5wbEqqVBJKqM6dWfrCKWoF0IGL4JMi9RY4n5gtYpxzxbFkm0DnFXMJAFL+DliJ3iQlhy0kjK16U5h0ytLXAumQoKOSt62H4UAfC0jFVDyKMXv18gocjaLXkF2s8jhyFXw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3768.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(136003)(39860400002)(346002)(396003)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(38100700002)(2906002)(83380400001)(7416002)(82960400001)(6512007)(53546011)(6486002)(66556008)(66476007)(478600001)(66946007)(54906003)(6666004)(66574015)(6506007)(4326008)(5660300002)(8936002)(41300700001)(8676002)(2616005)(316002)(6916009)(26005)(86362001)(31696002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZkhXbnRGY2V4NCtPNmtlSVRCSUlrdmx1azVMWlpkWWRsb1BqQ1ZQWTltMUQ4?= =?utf-8?B?a2VVU1JQazBUeWhyQzVPR3RHV2lJZHI1dDdSdHJ3bE9sQ3Y4cG0vOVo5aU85?= =?utf-8?B?WlRIcFhmVzJFN2VFYmwwZDR6UkJjdlFpUlVoRWo3ekJjMDZqc2hqMXBaeFZV?= =?utf-8?B?TGR0cXlmN21xVmpHQ1lVUFQrNEp1VEFrWnZaWlcwVWJqNVgrSWdDVVRsT2dI?= =?utf-8?B?Y0lHcy9YNEdoOU00Q3NyMW9iakNNbGJlb0kxeFNKS1Qvd2h5WUdVRXZPalZ2?= =?utf-8?B?R0c4RTI5dFRSaG5EZHJNcXZLSlUrRzRPdURHQll5QW5jaDdRWGc4M25BQ3k2?= =?utf-8?B?QURpVWEyZTZjZkQ0b01EdDBZVktXdUpvR2tTa2RjUTFwRDM5WVJD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PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 82aae871-6a56-4baf-bb5d-08dbc39b14e2 X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3768.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2023 22:58:24.2663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I22096YtYFuRiHxKY4wEYuoVlJWlEh3gcmOz6OSL37a1CYMEx8Xo57M0bVpiemtamJrbj1AOlSiJ82lWpM4kqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5592 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 02 Oct 2023 15:58:43 -0700 (PDT) On 10/2/2023 4:47 AM, Ilpo Järvinen wrote: > On Fri, 29 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 >> Reviewed-by: Tony Luck >> Tested-by: Pengfei Xu >> --- >> 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 da54fd060878..6f8abb4729e9 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 && >> + (ifs_meta->starting_chunk % ifs_meta->chunks_per_stride != 0)) { >> + 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); > > Please use %u as both are u32s. > Thanks for the review... I will make this change Jithu