Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5602540rwr; Tue, 9 May 2023 04:01:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hbeaUUGIFXV7XHSAEj8HHuIGb1Q2sCXjEhkndexGZvqmDtqeNsij9cQGAIhkE1swnAUFi X-Received: by 2002:a17:902:d38c:b0:1ab:675:3e31 with SMTP id e12-20020a170902d38c00b001ab06753e31mr15660931pld.37.1683630063216; Tue, 09 May 2023 04:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683630063; cv=none; d=google.com; s=arc-20160816; b=vehVC4lMVmCpH0fbvct4od6bqj6J1IdeOBeoeAyAqPtZZdu09uj+O6ZUWKoB1L2ozn H682FxE+TXd56gt2VCo2L8fbDf3tNMw4xRbLI23RjGniUPuUCY1DGaKRjuWr+QhX5bME 7rmZ6uE+TchIa40xvdSY4v5c9F2qGbkmQNxYEE/xXcmdtHUK+v3KDFRapcmUc69doiRg hJAjzF6PstSZNXmG1nP7hpz9nCesWi6uSqZnoO75XUjVVEjCdVYu7fc/+ce6oIpmjkGy cBhtOC9kgHqZIP/4oFew1XqorYQyDSh98+k10dQAIfs7RoRWKVP1DUWrZtqVSG39hUrG N5oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=b+AwxDCZHj25uwHMJI+L1Hgod23baHEjV5GBpLs/B4Q=; b=e4QEi4H9FyqATMOznxdmVsiyfHo6bwPYl5195hjt96Drg7f+wuRTeISHSs8hOy7N/l qgxxopxTZf9rfOZ7wO8prQ2lTOxmIrI6GlGEr9TpGg0RRCkNrWqREuPvVMDK3tRFTxy6 eDNtmNFS4q2QvHQj5qUcqKK+nYGUmHOUDc+VNkpyy9Z17ClDi5Wkwde2eUTiu4tJ1uVI B348xmZr1DN7uOHEu6pkDvNha0lEHGyWS2PNEeeCIc0viBUs/UE2ePb9SaAICYOZuWTq Hq+2Y5n3eIPHh8l8ftWgXy1XpT9lLMFmsw9bS9GhQPGwQ1nHnm/PSvAPyo/l9fXy/TFe bZ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nVPnIWWu; 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 ay12-20020a1709028b8c00b001a6565a16c4si1178608plb.493.2023.05.09.04.00.47; Tue, 09 May 2023 04:01:03 -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=nVPnIWWu; 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 S235284AbjEIKZS (ORCPT + 99 others); Tue, 9 May 2023 06:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235251AbjEIKZJ (ORCPT ); Tue, 9 May 2023 06:25:09 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DC06D875; Tue, 9 May 2023 03:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683627892; x=1715163892; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=0o2bVtjt2zCtsSa0VS6xp4L/71+buNa9+sz40AhrWz4=; b=nVPnIWWu8pq8aoWNELzzPWy58kaG958Tan5Df3lTTuGnC7w6lRP82iHp OsiD7lUae2dsu5NjMSUlXaD6WXKjAlxM8TGTx198n7cJw2QdVrxtrQHhz JfDkXKZLwbPvgKJ1faoalZWj4QJRYzJ/19aHrCSersmqUV+kKdHhtkXYY wMlNES9+taDYhd97dD5fH+WS8LrF390NxaBD5QThpk7k8+3SaH6h5h2CR Yl3Mji6BsJsxzPwIxPJRSg3bh1CCX/N7A9+B7AO//WWxuhmW0U6n9qQF7 H8OUcv3rHRq20vRjt+xbRhKC7Z1UbC4FyaQFCa0LYE724nQpq2P1mIl7H w==; X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="329512840" X-IronPort-AV: E=Sophos;i="5.99,261,1677571200"; d="scan'208";a="329512840" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2023 03:24:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="676415954" X-IronPort-AV: E=Sophos;i="5.99,261,1677571200"; d="scan'208";a="676415954" Received: from mbrdon-mobl.ger.corp.intel.com ([10.251.219.121]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2023 03:24:49 -0700 Date: Tue, 9 May 2023 13:24:47 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Jorge Lopez cc: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, LKML , thomas@t-8ch.de Subject: Re: [PATCH v12 04/13] HP BIOSCFG driver - int-attributes In-Reply-To: Message-ID: References: <20230505220043.39036-1-jorge.lopez2@hp.com> <20230505220043.39036-5-jorge.lopez2@hp.com> <51607d2d-2d74-7dd4-e266-cf3ec0235e7a@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-748359660-1683627890=:2036" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-748359660-1683627890=:2036 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Mon, 8 May 2023, Jorge Lopez wrote: > On Mon, May 8, 2023 at 9:45 AM Ilpo Järvinen > wrote: > > > > On Fri, 5 May 2023, Jorge Lopez wrote: > > > > > HP BIOS Configuration driver purpose is to provide a driver supporting > > > the latest sysfs class firmware attributes framework allowing the user > > > to change BIOS settings and security solutions on HP Inc.’s commercial > > > notebooks. > > > > > > Many features of HP Commercial notebooks can be managed using Windows > > > Management Instrumentation (WMI). WMI is an implementation of Web-Based > > > Enterprise Management (WBEM) that provides a standards-based interface > > > for changing and monitoring system settings. HP BIOSCFG driver provides > > > a native Linux solution and the exposed features facilitates the > > > migration to Linux environments. > > > > > > The Linux security features to be provided in hp-bioscfg driver enables > > > managing the BIOS settings and security solutions via sysfs, a virtual > > > filesystem that can be used by user-mode applications. The new > > > documentation cover HP-specific firmware sysfs attributes such Secure > > > Platform Management and Sure Start. Each section provides security > > > feature description and identifies sysfs directories and files exposed > > > by the driver. > > > > > > Many HP Commercial notebooks include a feature called Secure Platform > > > Management (SPM), which replaces older password-based BIOS settings > > > management with public key cryptography. PC secure product management > > > begins when a target system is provisioned with cryptographic keys > > > that are used to ensure the integrity of communications between system > > > management utilities and the BIOS. > > > > > > HP Commercial notebooks have several BIOS settings that control its > > > behaviour and capabilities, many of which are related to security. > > > To prevent unauthorized changes to these settings, the system can > > > be configured to use a cryptographic signature-based authorization > > > string that the BIOS will use to verify authorization to modify the > > > setting. > > > > > > Linux Security components are under development and not published yet. > > > The only linux component is the driver (hp bioscfg) at this time. > > > Other published security components are under Windows. > > > > > > Signed-off-by: Jorge Lopez > > > > > > --- > > > Based on the latest platform-drivers-x86.git/for-next > > > --- > > > +int alloc_integer_data(void) > > > +{ > > > + bioscfg_drv.integer_instances_count = get_instance_count(HP_WMI_BIOS_INTEGER_GUID); > > > + bioscfg_drv.integer_data = kcalloc(bioscfg_drv.integer_instances_count, > > > + sizeof(struct integer_data), GFP_KERNEL); > > > > It would be better to use sizeof(*...) format. > > I cannot use sizeof(*...) at this time, because it is allocating > bioscfg_drv.integer_instances_count number of integer_data > structures. Isn't bioscfg_drv.integer_data is a pointer to a single struct integer_data? Why cannot you do sizeof(*bioscfg_drv.integer_data)?? It is perfectly legal C construct for getting the size of the struct the pointer points to. -- i. --8323329-748359660-1683627890=:2036--