From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4363AC369DC for ; Tue, 29 Apr 2025 17:02:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD6316B0007; Tue, 29 Apr 2025 13:02:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C84446B0008; Tue, 29 Apr 2025 13:02:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B244A6B000A; Tue, 29 Apr 2025 13:02:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8DDAB6B0007 for ; Tue, 29 Apr 2025 13:02:11 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E4D9BB9F6A for ; Tue, 29 Apr 2025 17:02:12 +0000 (UTC) X-FDA: 83387699304.14.B47D8EC Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by imf02.hostedemail.com (Postfix) with ESMTP id 123E78001C for ; Tue, 29 Apr 2025 17:02:09 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=JdRkbvDu; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 198.175.65.9 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745946131; a=rsa-sha256; cv=none; b=nNFiAaJF1T6xqsAAlaszerWKTw2FsZXDIoG95QSFhl9lOnh70vmGzoh7GuSENr3m9hSfPO SNFSXgVriI0dZhf1nihATtFl0rKqLGY92BApO0+iYz4lJxkZSLMqrvapfHMNvCzRfB20Ak H2Lwa+VIm2Vr3VuQdRYBxF2qCZgsMYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745946131; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=leBPE+UajZRR36Ivzj/YpkFiX3sNGbeoAfE7i0CkqRE=; b=JPjgeCIGXesDTgM2cd4ALQp7pnkPF4HnQqEk+0yfpUWjNIQmpIc4xaoO0cf0izuZ0BIfTE QxMizZz3//3gda+qZdP02xo1TN2y31DkKsjBn5vvfxNqqJYtYbNscN+AkfWxJpgTYDbhrk 9Y2wmmtT4UDIGIAuokpjjI+HwojxEiM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=JdRkbvDu; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 198.175.65.9 as permitted sender) smtp.mailfrom=lkp@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745946131; x=1777482131; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=tX07ibvubTNZuG4eWUqG+QU03556YHXhSrXwyBwZdPI=; b=JdRkbvDup0vUVDLRzn5xcmJhcrpMKsLMKtcAQ/BNLziOcBy6zltRFkt+ qKSIpR7WoJvWCLkjGb2e94e5nfq1/FDBC8MMx77JfZ9snkXS+GfH1wyA6 2TG7cK3bnOeNsC4Bkw+etlMRwdI8SjGkz9t9hybsjXR/m/6bl2b8k2LSd zSAxr5BEXhdMBoaj592Xuj0LPGqxCRwc0bWCbYN8m4oklwPwir+FqA3kt xIuOoOUR+GJOA4kSinuG1dCL7izFsvBzvqrpPbTuLM9p+piEXLqUNSc6Q ZWst6WHrd1u/k+8YjHKqFB5bcKMIE6+hE1ofOcaBUGc008PTASZobwqEE Q==; X-CSE-ConnectionGUID: EzhIMm08TKKNcosrE4ORHA== X-CSE-MsgGUID: H5zh9Z8aTUG5vJrel3kPSw== X-IronPort-AV: E=McAfee;i="6700,10204,11418"; a="70084317" X-IronPort-AV: E=Sophos;i="6.15,249,1739865600"; d="scan'208";a="70084317" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2025 10:02:09 -0700 X-CSE-ConnectionGUID: 9s6T2LBeSban2xPiVXaiGw== X-CSE-MsgGUID: U4UqeuqLQEuiIBqhX13hcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,249,1739865600"; d="scan'208";a="133825211" Received: from lkp-server01.sh.intel.com (HELO 1992f890471c) ([10.239.97.150]) by fmviesa007.fm.intel.com with ESMTP; 29 Apr 2025 10:02:05 -0700 Received: from kbuild by 1992f890471c with local (Exim 4.96) (envelope-from ) id 1u9oLK-0001Br-2Z; Tue, 29 Apr 2025 17:02:02 +0000 Date: Wed, 30 Apr 2025 01:01:22 +0800 From: kernel test robot To: Donet Tom , Mike Rapoport , David Hildenbrand , Oscar Salvador , Greg Kroah-Hartman , Andrew Morton , rafael@kernel.org, Danilo Krummrich Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Ritesh Harjani , Jonathan Cameron , Alison Schofield , Yury Norov , Dave Jiang , linux-kernel@vger.kernel.org, Donet Tom Subject: Re: [PATCH v2 1/2] driver/base: Optimize memory block registration to reduce boot time Message-ID: <202504300024.YxAyenLy-lkp@intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 123E78001C X-Stat-Signature: qwqz7r7xxn6iqzu8dtjp5tq3eww19cwk X-Rspam-User: X-HE-Tag: 1745946129-161066 X-HE-Meta: U2FsdGVkX185mCe3G72kiIfO9U8EztF9KmHtEUFS9SQhodi/tcRcGcoOf84V7Q7W7L+Vl/E2dJVMNio5HaIEUBBq/DKvVmTeKZrQXnp8dCYeodpwHFleidJQ3qAmaciKDH0iyhhWVvFQBnvtCGQ8mKdJwjKlOT4IRC+P7eTykdL5AIcpB4EcYwZcmdwZJn0aWZ5SlKMl2n4OnXINSSI5mOw68H3y5dzsVuJ91PTHba0bKYR0GHLA9kAD0eywE1DUSFvxXXU2q8YBU0AKYJc9yiu1lkErzDhi3UFpqhPc26r6jAnoo5G+KgaqkxswLWSuHNBXnvM9pC2grupqzi7xl4Ncn2Rqd2KI4DesiCXEBS2yr0mwMwEI2wb3f6sBzlzhlT1fHhPqMW+ZnbyTL9gMuZAdBmpCttW3AMOrO9HgJ6zTZh0ZhH2UCrySRxfKejMWjIEpO+2CUoIY4HMi3LtSQRhGyXV5whJrjAvHFiXDofGZgV2p528wuQYG1/CcR3QOsxzvHFcyxzuze+oFlj4+ghulI9Dx5blwnU7Sq+opYNwhQa8ajEzqC1Qx8j1GZGkcYky4MhU4Fro8B5EO7D6T1xpwN76goxyx0I4sKtEvKIpqOUrVNG9m1Gwsw+OaVpIz0wWuv5YcQJ1rB+ND9AgmT9mGw0srSI1ZjHiQ9SJ3k/3xcEmKlrGhIDOBxyHKVUN6o6FRLw/GKr4TkKo0aGsd3jRz5qY6AnZLRKO2dhwI6yh0i8trGlZV0hiICXFh+hZmmoVAeVTf1ve7+9BbedTRm+H8hOZLM3SooCeqAIsXm3srlz34omY9jgI8w5g4QX5H915DyLSYujbNDsqZeC9fOWw5z7KAG/NYBHtM51Ng9wh/CCKWsLV3NHUXdez1XqKjR5yIqJkZ0Vg2MfSF4FCLmSBomBvQcPe0dqY2qDuPp7fLCiiJg2DJ60kmvNU7EwgY X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Donet, kernel test robot noticed the following build errors: [auto build test ERROR on akpm-mm/mm-everything] [also build test ERROR on linus/master v6.15-rc4 next-20250429] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Donet-Tom/driver-base-Remove-unused-functions/20250429-010442 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/fbe1e0c7d91bf3fa9a64ff5d84b53ded1d0d5ac7.1745852397.git.donettom%40linux.ibm.com patch subject: [PATCH v2 1/2] driver/base: Optimize memory block registration to reduce boot time config: x86_64-buildonly-randconfig-004-20250429 (https://download.01.org/0day-ci/archive/20250430/202504300024.YxAyenLy-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250430/202504300024.YxAyenLy-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202504300024.YxAyenLy-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from include/linux/swap.h:11, from include/linux/suspend.h:5, from arch/x86/kernel/asm-offsets.c:14: >> include/linux/node.h:124:6: warning: no previous prototype for 'register_memory_blocks_under_node_early' [-Wmissing-prototypes] 124 | void register_memory_blocks_under_node_early(int nid) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ld: security/keys/encrypted-keys/masterkey_trusted.o: in function `register_memory_blocks_under_node_early': >> security/keys/encrypted-keys/masterkey_trusted.c:125: multiple definition of `register_memory_blocks_under_node_early'; security/keys/encrypted-keys/encrypted.o:include/linux/node.h:125: first defined here -- In file included from include/linux/cpu.h:17, from include/linux/static_call.h:135, from include/linux/tracepoint.h:22, from include/trace/events/tlb.h:9, from arch/x86/include/asm/mmu_context.h:9, from include/linux/mmu_context.h:5, from include/linux/cpuset.h:18, from include/linux/sched/isolation.h:5, from kernel/sched/build_policy.c:19: >> include/linux/node.h:124:6: warning: no previous prototype for 'register_memory_blocks_under_node_early' [-Wmissing-prototypes] 124 | void register_memory_blocks_under_node_early(int nid) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from kernel/sched/build_policy.c:52: kernel/sched/rt.c:9:18: warning: 'max_rt_runtime' defined but not used [-Wunused-const-variable=] 9 | static const u64 max_rt_runtime = MAX_BW; | ^~~~~~~~~~~~~~ -- ld: drivers/usb/host/xhci-mem.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/usb/host/xhci.o:include/linux/node.h:125: first defined here ld: drivers/usb/host/xhci-ring.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/usb/host/xhci.o:include/linux/node.h:125: first defined here ld: drivers/usb/host/xhci-hub.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/usb/host/xhci.o:include/linux/node.h:125: first defined here ld: drivers/usb/host/xhci-trace.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/usb/host/xhci.o:include/linux/node.h:125: first defined here ld: drivers/usb/host/xhci-dbgcap.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/usb/host/xhci.o:include/linux/node.h:125: first defined here -- In file included from include/linux/acpi.h:18, from include/linux/i2c.h:13, from drivers/power/supply/sbs-battery.c:13: >> include/linux/node.h:124:6: warning: no previous prototype for 'register_memory_blocks_under_node_early' [-Wmissing-prototypes] 124 | void register_memory_blocks_under_node_early(int nid) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/power/supply/sbs-battery.c: In function 'sbs_get_property': drivers/power/supply/sbs-battery.c:834:30: warning: '%04x' directive writing between 4 and 8 bytes into a region of size 5 [-Wformat-overflow=] 834 | sprintf(sbs_serial, "%04x", ret); | ^~~~ In function 'sbs_get_battery_serial_number', inlined from 'sbs_get_property' at drivers/power/supply/sbs-battery.c:965:9: drivers/power/supply/sbs-battery.c:834:29: note: directive argument in the range [0, 2147483647] 834 | sprintf(sbs_serial, "%04x", ret); | ^~~~~~ drivers/power/supply/sbs-battery.c:834:9: note: 'sprintf' output between 5 and 9 bytes into a destination of size 5 834 | sprintf(sbs_serial, "%04x", ret); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- In file included from include/linux/swap.h:11, from include/linux/suspend.h:5, from include/linux/regulator/consumer.h:35, from include/linux/phy/phy.h:17, from include/linux/usb/otg.h:13, from include/linux/usb/of.h:11, from drivers/usb/core/usb.c:41: >> include/linux/node.h:124:6: warning: no previous prototype for 'register_memory_blocks_under_node_early' [-Wmissing-prototypes] 124 | void register_memory_blocks_under_node_early(int nid) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/usb/core/usb.c: In function 'usb_alloc_dev': drivers/usb/core/usb.c:706:37: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 15 [-Wformat-truncation=] 706 | "%s.%d", parent->devpath, port1); | ^~ drivers/usb/core/usb.c:706:33: note: using the range [-2147483648, 2147483647] for directive argument 706 | "%s.%d", parent->devpath, port1); | ^~~~~~~ drivers/usb/core/usb.c:705:25: note: 'snprintf' output between 3 and 28 bytes into a destination of size 16 705 | snprintf(dev->devpath, sizeof dev->devpath, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 706 | "%s.%d", parent->devpath, port1); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ld: drivers/i3c/master.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/device.o:include/linux/node.h:125: first defined here -- ld: drivers/i3c/master/mipi-i3c-hci/ext_caps.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here ld: drivers/i3c/master/mipi-i3c-hci/pio.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here ld: drivers/i3c/master/mipi-i3c-hci/dma.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here ld: drivers/i3c/master/mipi-i3c-hci/cmd_v1.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here ld: drivers/i3c/master/mipi-i3c-hci/cmd_v2.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here ld: drivers/i3c/master/mipi-i3c-hci/dat_v1.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here ld: drivers/i3c/master/mipi-i3c-hci/dct_v1.o: in function `register_memory_blocks_under_node_early': drivers/i3c/master/mipi-i3c-hci/dct_v1.c:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here ld: drivers/i3c/master/mipi-i3c-hci/hci_quirks.o: in function `register_memory_blocks_under_node_early': drivers/i3c/master/mipi-i3c-hci/hci_quirks.c:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/i3c/master/mipi-i3c-hci/core.o:include/linux/node.h:125: first defined here -- In file included from include/linux/acpi.h:18, from include/linux/i2c.h:13, from drivers/hwmon/pmbus/ibm-cffps.c:11: >> include/linux/node.h:124:6: warning: no previous prototype for 'register_memory_blocks_under_node_early' [-Wmissing-prototypes] 124 | void register_memory_blocks_under_node_early(int nid) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/hwmon/pmbus/ibm-cffps.c: In function 'ibm_cffps_debugfs_read': drivers/hwmon/pmbus/ibm-cffps.c:169:60: warning: '%02X' directive output may be truncated writing between 2 and 8 bytes into a region of size 3 [-Wformat-truncation=] 169 | snprintf(&data[i * 2], 3, "%02X", rc); | ^~~~ drivers/hwmon/pmbus/ibm-cffps.c:169:59: note: directive argument in the range [0, 2147483647] 169 | snprintf(&data[i * 2], 3, "%02X", rc); | ^~~~~~ drivers/hwmon/pmbus/ibm-cffps.c:169:33: note: 'snprintf' output between 3 and 9 bytes into a destination of size 3 169 | snprintf(&data[i * 2], 3, "%02X", rc); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/hwmon/pmbus/ibm-cffps.c:180:60: warning: '%04X' directive output may be truncated writing between 4 and 8 bytes into a region of size 5 [-Wformat-truncation=] 180 | snprintf(&data[i * 4], 5, "%04X", rc); | ^~~~ drivers/hwmon/pmbus/ibm-cffps.c:180:59: note: directive argument in the range [0, 2147483647] 180 | snprintf(&data[i * 4], 5, "%04X", rc); | ^~~~~~ drivers/hwmon/pmbus/ibm-cffps.c:180:33: note: 'snprintf' output between 5 and 9 bytes into a destination of size 5 180 | snprintf(&data[i * 4], 5, "%04X", rc); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ld: drivers/usb/typec/tipd/trace.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/usb/typec/tipd/core.o:include/linux/node.h:125: first defined here -- ld: drivers/usb/cdns3/drd.o: in function `register_memory_blocks_under_node_early': >> include/linux/node.h:125: multiple definition of `register_memory_blocks_under_node_early'; drivers/usb/cdns3/core.o:include/linux/node.h:125: first defined here .. vim +125 security/keys/encrypted-keys/masterkey_trusted.c b886d83c5b621a Thomas Gleixner 2019-06-01 1 // SPDX-License-Identifier: GPL-2.0-only 982e617a313b57 Mimi Zohar 2011-08-27 2 /* 982e617a313b57 Mimi Zohar 2011-08-27 3 * Copyright (C) 2010 IBM Corporation 982e617a313b57 Mimi Zohar 2011-08-27 4 * Copyright (C) 2010 Politecnico di Torino, Italy c9fecf505a3421 Alexander A. Klimov 2020-07-05 5 * TORSEC group -- https://security.polito.it 982e617a313b57 Mimi Zohar 2011-08-27 6 * 982e617a313b57 Mimi Zohar 2011-08-27 7 * Authors: 982e617a313b57 Mimi Zohar 2011-08-27 8 * Mimi Zohar 982e617a313b57 Mimi Zohar 2011-08-27 9 * Roberto Sassu 982e617a313b57 Mimi Zohar 2011-08-27 10 * 5395d312dff00d Kees Cook 2017-05-13 11 * See Documentation/security/keys/trusted-encrypted.rst 982e617a313b57 Mimi Zohar 2011-08-27 12 */ 982e617a313b57 Mimi Zohar 2011-08-27 13 982e617a313b57 Mimi Zohar 2011-08-27 14 #include cc100551b4d92f Stephen Rothwell 2011-09-15 15 #include 982e617a313b57 Mimi Zohar 2011-08-27 16 #include ee0b31a25a0101 Mimi Zohar 2012-01-17 17 #include ee0b31a25a0101 Mimi Zohar 2012-01-17 18 #include "encrypted.h" 982e617a313b57 Mimi Zohar 2011-08-27 19 982e617a313b57 Mimi Zohar 2011-08-27 20 /* 982e617a313b57 Mimi Zohar 2011-08-27 21 * request_trusted_key - request the trusted key 982e617a313b57 Mimi Zohar 2011-08-27 22 * 982e617a313b57 Mimi Zohar 2011-08-27 23 * Trusted keys are sealed to PCRs and other metadata. Although userspace 982e617a313b57 Mimi Zohar 2011-08-27 24 * manages both trusted/encrypted key-types, like the encrypted key type 982e617a313b57 Mimi Zohar 2011-08-27 25 * data, trusted key type data is not visible decrypted from userspace. 982e617a313b57 Mimi Zohar 2011-08-27 26 */ 982e617a313b57 Mimi Zohar 2011-08-27 27 struct key *request_trusted_key(const char *trusted_desc, 146aa8b1453bd8 David Howells 2015-10-21 28 const u8 **master_key, size_t *master_keylen) 982e617a313b57 Mimi Zohar 2011-08-27 29 { 982e617a313b57 Mimi Zohar 2011-08-27 30 struct trusted_key_payload *tpayload; 982e617a313b57 Mimi Zohar 2011-08-27 31 struct key *tkey; 982e617a313b57 Mimi Zohar 2011-08-27 32 028db3e290f15a Linus Torvalds 2019-07-10 33 tkey = request_key(&key_type_trusted, trusted_desc, NULL); 982e617a313b57 Mimi Zohar 2011-08-27 34 if (IS_ERR(tkey)) 982e617a313b57 Mimi Zohar 2011-08-27 35 goto error; 982e617a313b57 Mimi Zohar 2011-08-27 36 982e617a313b57 Mimi Zohar 2011-08-27 37 down_read(&tkey->sem); 146aa8b1453bd8 David Howells 2015-10-21 38 tpayload = tkey->payload.data[0]; 982e617a313b57 Mimi Zohar 2011-08-27 39 *master_key = tpayload->key; 982e617a313b57 Mimi Zohar 2011-08-27 40 *master_keylen = tpayload->key_len; 982e617a313b57 Mimi Zohar 2011-08-27 41 error: 982e617a313b57 Mimi Zohar 2011-08-27 42 return tkey; 982e617a313b57 Mimi Zohar 2011-08-27 43 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki