* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring
@ 2026-12-02 5:57 kernel test robot
0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2026-12-02 5:57 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org>
References: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org>
TO: Hannes Reinecke <hare@kernel.org>
TO: Keith Busch <kbusch@kernel.org>
TO: Jens Axboe <axboe@kernel.dk>
TO: Christoph Hellwig <hch@lst.de>
TO: Sagi Grimberg <sagi@grimberg.me>
TO: Hannes Reinecke <hare@suse.de>
TO: Chaitanya Kulkarni <kch@nvidia.com>
TO: Eric Biggers <ebiggers@kernel.org>
TO: David Howells <dhowells@redhat.com>
TO: Jarkko Sakkinen <jarkko@kernel.org>
TO: Jonathan Corbet <corbet@lwn.net>
TO: Shuah Khan <skhan@linuxfoundation.org>
TO: Randy Dunlap <rdunlap@infradead.org>
TO: Kees Cook <kees@kernel.org>
TO: "Gustavo A. R. Silva" <gustavoars@kernel.org>
CC: linux-nvme@lists.infradead.org
CC: linux-kernel@vger.kernel.org
CC: keyrings@vger.kernel.org
CC: linux-doc@vger.kernel.org
CC: linux-hardening@vger.kernel.org
Hi Hannes,
kernel test robot noticed the following build errors:
[auto build test ERROR on 68099cf27253a8c89d703a282d3d811446d9453b]
url: https://github.com/intel-lab-lkp/linux/commits/Hannes-Reinecke/nvme-auth-modify-nvme_auth_transform_key-to-return-status/20261126-151219
base: 68099cf27253a8c89d703a282d3d811446d9453b
patch link: https://lore.kernel.org/r/20261126-dhchap-keyring-v4-v7-5-ee438ffea527%40kernel.org
patch subject: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: i386-randconfig-2003-20261202 (https://download.01.org/0day-ci/archive/20261202/20261202065309.Fox0PFPW-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261202/20261202065309.Fox0PFPW-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261202065309.Fox0PFPW-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/nvme/host/tcp.c:15:
include/linux/nvme-keyring.h:47:5: warning: no previous prototype for 'nvme_keyring_unlink' [-Wmissing-prototypes]
47 | int nvme_keyring_unlink(struct key *keyring)
| ^~~~~~~~~~~~~~~~~~~
drivers/nvme/host/tcp.c: In function 'nvme_tcp_alloc_admin_queue':
>> drivers/nvme/host/tcp.c:2419:70: error: passing argument 1 of 'nvme_tls_psk_default' from incompatible pointer type [-Wincompatible-pointer-types]
2419 | pskid = nvme_tls_psk_default(ctrl->opts->host->nqn,
| ~~~~~~~~~~~~~~~~^~~~~
| |
| char *
include/linux/nvme-keyring.h:30:61: note: expected 'struct key *' but argument is of type 'char *'
30 | static inline key_serial_t nvme_tls_psk_default(struct key *keyring,
| ~~~~~~~~~~~~^~~~~~~
>> drivers/nvme/host/tcp.c:2419:33: error: too few arguments to function 'nvme_tls_psk_default'
2419 | pskid = nvme_tls_psk_default(ctrl->opts->host->nqn,
| ^~~~~~~~~~~~~~~~~~~~
include/linux/nvme-keyring.h:30:28: note: declared here
30 | static inline key_serial_t nvme_tls_psk_default(struct key *keyring,
| ^~~~~~~~~~~~~~~~~~~~
include/linux/nvme-keyring.h: At top level:
include/linux/nvme-keyring.h:43:12: warning: 'nvme_keyring_link' defined but not used [-Wunused-function]
43 | static int nvme_keyring_link(struct key *keyring)
| ^~~~~~~~~~~~~~~~~
include/linux/nvme-keyring.h:39:20: warning: 'nvme_keyring_name' defined but not used [-Wunused-function]
39 | static const char *nvme_keyring_name(void)
| ^~~~~~~~~~~~~~~~~
vim +/nvme_tls_psk_default +2419 drivers/nvme/host/tcp.c
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2409
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2410 static int nvme_tcp_alloc_admin_queue(struct nvme_ctrl *ctrl)
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2411 {
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2412 int ret;
be8e82caa68599 Hannes Reinecke 2023-08-24 2413 key_serial_t pskid = 0;
be8e82caa68599 Hannes Reinecke 2023-08-24 2414
363895767fbfa0 Hannes Reinecke 2024-07-22 2415 if (nvme_tcp_tls_configured(ctrl)) {
adf22c520b5ec4 Hannes Reinecke 2023-08-24 2416 if (ctrl->opts->tls_key)
adf22c520b5ec4 Hannes Reinecke 2023-08-24 2417 pskid = key_serial(ctrl->opts->tls_key);
e88a7595b57f2a Hannes Reinecke 2025-02-24 2418 else if (ctrl->opts->tls) {
83137991c12380 Hannes Reinecke 2026-11-26 @2419 pskid = nvme_tls_psk_default(ctrl->opts->host->nqn,
be8e82caa68599 Hannes Reinecke 2023-08-24 2420 ctrl->opts->subsysnqn);
be8e82caa68599 Hannes Reinecke 2023-08-24 2421 if (!pskid) {
be8e82caa68599 Hannes Reinecke 2023-08-24 2422 dev_err(ctrl->device, "no valid PSK found\n");
ef184b8844bf98 Guixin Liu 2023-12-31 2423 return -ENOKEY;
be8e82caa68599 Hannes Reinecke 2023-08-24 2424 }
be8e82caa68599 Hannes Reinecke 2023-08-24 2425 }
363895767fbfa0 Hannes Reinecke 2024-07-22 2426 }
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2427
be8e82caa68599 Hannes Reinecke 2023-08-24 2428 ret = nvme_tcp_alloc_queue(ctrl, 0, pskid);
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2429 if (ret)
ef184b8844bf98 Guixin Liu 2023-12-31 2430 return ret;
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2431
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2432 ret = nvme_tcp_alloc_async_req(to_tcp_ctrl(ctrl));
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2433 if (ret)
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2434 goto out_free_queue;
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2435
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2436 return 0;
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2437
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2438 out_free_queue:
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2439 nvme_tcp_free_queue(ctrl, 0);
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2440 return ret;
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2441 }
3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2442
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring @ 2026-12-02 5:36 kernel test robot 0 siblings, 0 replies; 9+ messages in thread From: kernel test robot @ 2026-12-02 5:36 UTC (permalink / raw) To: oe-kbuild; +Cc: lkp :::::: :::::: Manual check reason: "too many reports for this commit" :::::: BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev In-Reply-To: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org> References: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org> TO: Hannes Reinecke <hare@kernel.org> TO: Keith Busch <kbusch@kernel.org> TO: Jens Axboe <axboe@kernel.dk> TO: Christoph Hellwig <hch@lst.de> TO: Sagi Grimberg <sagi@grimberg.me> TO: Hannes Reinecke <hare@suse.de> TO: Chaitanya Kulkarni <kch@nvidia.com> TO: Eric Biggers <ebiggers@kernel.org> TO: David Howells <dhowells@redhat.com> TO: Jarkko Sakkinen <jarkko@kernel.org> TO: Jonathan Corbet <corbet@lwn.net> TO: Shuah Khan <skhan@linuxfoundation.org> TO: Randy Dunlap <rdunlap@infradead.org> TO: Kees Cook <kees@kernel.org> TO: "Gustavo A. R. Silva" <gustavoars@kernel.org> CC: linux-nvme@lists.infradead.org CC: linux-kernel@vger.kernel.org CC: keyrings@vger.kernel.org CC: linux-doc@vger.kernel.org CC: linux-hardening@vger.kernel.org Hi Hannes, kernel test robot noticed the following build errors: [auto build test ERROR on 68099cf27253a8c89d703a282d3d811446d9453b] url: https://github.com/intel-lab-lkp/linux/commits/Hannes-Reinecke/nvme-auth-modify-nvme_auth_transform_key-to-return-status/20261126-151219 base: 68099cf27253a8c89d703a282d3d811446d9453b patch link: https://lore.kernel.org/r/20261126-dhchap-keyring-v4-v7-5-ee438ffea527%40kernel.org patch subject: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring :::::: branch date: 6 days ago :::::: commit date: 6 days ago config: openrisc-randconfig-2200-20261202 (https://download.01.org/0day-ci/archive/20261202/20261202063410.ZST29aaT-lkp@intel.com/config) compiler: or1k-linux-gcc (GCC) 15.3.0 smatch: v0.5.0-9187-g5189e3fb reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261202/20261202063410.ZST29aaT-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 <lkp@intel.com> | Closes: https://lore.kernel.org/r/20261202063410.ZST29aaT-lkp@intel.com/ All errors (new ones prefixed by >>): or1k-linux-ld: drivers/nvme/host/fabrics.o: in function `nvme_keyring_unlink': >> include/linux/nvme-keyring.h:50: multiple definition of `nvme_keyring_unlink'; drivers/nvme/host/sysfs.o:include/linux/nvme-keyring.h:50: first defined here or1k-linux-ld: drivers/nvme/target/configfs.o: in function `nvme_keyring_unlink': >> include/linux/nvme-keyring.h:50: multiple definition of `nvme_keyring_unlink'; drivers/nvme/host/sysfs.o:include/linux/nvme-keyring.h:50: first defined here vim +50 include/linux/nvme-keyring.h 83137991c123807 Hannes Reinecke 2026-11-26 22 9d77eb52778499a Hannes Reinecke 2023-08-24 23 #else 62eb89323cb08f1 Hannes Reinecke 2025-02-24 24 static inline struct key *nvme_tls_psk_refresh(struct key *keyring, 83137991c123807 Hannes Reinecke 2026-11-26 25 const char *hostnqn, const char *subnqn, u8 hmac_id, 62eb89323cb08f1 Hannes Reinecke 2025-02-24 26 u8 *data, size_t data_len, const char *digest) 62eb89323cb08f1 Hannes Reinecke 2025-02-24 27 { 83137991c123807 Hannes Reinecke 2026-11-26 28 return ERR_PTR(-EOPNOTSUPP); 62eb89323cb08f1 Hannes Reinecke 2025-02-24 29 } 501cc6f4aca8dc0 Hannes Reinecke 2023-08-24 30 static inline key_serial_t nvme_tls_psk_default(struct key *keyring, 501cc6f4aca8dc0 Hannes Reinecke 2023-08-24 31 const char *hostnqn, const char *subnqn) 501cc6f4aca8dc0 Hannes Reinecke 2023-08-24 32 { 501cc6f4aca8dc0 Hannes Reinecke 2023-08-24 33 return 0; 501cc6f4aca8dc0 Hannes Reinecke 2023-08-24 34 } 9d77eb52778499a Hannes Reinecke 2023-08-24 35 static inline key_serial_t nvme_keyring_id(void) 9d77eb52778499a Hannes Reinecke 2023-08-24 36 { 9d77eb52778499a Hannes Reinecke 2023-08-24 37 return 0; 9d77eb52778499a Hannes Reinecke 2023-08-24 38 } 83137991c123807 Hannes Reinecke 2026-11-26 39 static const char *nvme_keyring_name(void) 83137991c123807 Hannes Reinecke 2026-11-26 40 { 83137991c123807 Hannes Reinecke 2026-11-26 41 return NULL; 83137991c123807 Hannes Reinecke 2026-11-26 42 } 83137991c123807 Hannes Reinecke 2026-11-26 43 static int nvme_keyring_link(struct key *keyring) 83137991c123807 Hannes Reinecke 2026-11-26 44 { 83137991c123807 Hannes Reinecke 2026-11-26 45 return 0; 83137991c123807 Hannes Reinecke 2026-11-26 46 } 83137991c123807 Hannes Reinecke 2026-11-26 47 int nvme_keyring_unlink(struct key *keyring) 83137991c123807 Hannes Reinecke 2026-11-26 48 { 83137991c123807 Hannes Reinecke 2026-11-26 49 return 0; 83137991c123807 Hannes Reinecke 2026-11-26 @50 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring
@ 2026-11-27 6:22 kernel test robot
0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2026-11-27 6:22 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org>
References: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org>
TO: Hannes Reinecke <hare@kernel.org>
TO: Keith Busch <kbusch@kernel.org>
TO: Jens Axboe <axboe@kernel.dk>
TO: Christoph Hellwig <hch@lst.de>
TO: Sagi Grimberg <sagi@grimberg.me>
TO: Hannes Reinecke <hare@suse.de>
TO: Chaitanya Kulkarni <kch@nvidia.com>
TO: Eric Biggers <ebiggers@kernel.org>
TO: David Howells <dhowells@redhat.com>
TO: Jarkko Sakkinen <jarkko@kernel.org>
TO: Jonathan Corbet <corbet@lwn.net>
TO: Shuah Khan <skhan@linuxfoundation.org>
TO: Randy Dunlap <rdunlap@infradead.org>
TO: Kees Cook <kees@kernel.org>
TO: "Gustavo A. R. Silva" <gustavoars@kernel.org>
CC: linux-nvme@lists.infradead.org
CC: linux-kernel@vger.kernel.org
CC: keyrings@vger.kernel.org
CC: linux-doc@vger.kernel.org
CC: linux-hardening@vger.kernel.org
Hi Hannes,
kernel test robot noticed the following build errors:
[auto build test ERROR on 68099cf27253a8c89d703a282d3d811446d9453b]
url: https://github.com/intel-lab-lkp/linux/commits/Hannes-Reinecke/nvme-auth-modify-nvme_auth_transform_key-to-return-status/20261126-151219
base: 68099cf27253a8c89d703a282d3d811446d9453b
patch link: https://lore.kernel.org/r/20261126-dhchap-keyring-v4-v7-5-ee438ffea527%40kernel.org
patch subject: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring
:::::: branch date: 16 hours ago
:::::: commit date: 16 hours ago
config: x86_64-buildonly-randconfig-1001-20261127 (https://download.01.org/0day-ci/archive/20261127/20261127141335.b6SnWt2Q-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261127/20261127141335.b6SnWt2Q-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261127141335.b6SnWt2Q-lkp@intel.com/
All errors (new ones prefixed by >>):
>> ld.lld: error: duplicate symbol: __cfi_nvme_keyring_unlink
>>> defined at sysfs.c
>>> drivers/nvme/host/sysfs.o:(__cfi_nvme_keyring_unlink) in archive vmlinux.a
>>> defined at fabrics.c
>>> drivers/nvme/host/fabrics.o:(.text+0x0) in archive vmlinux.a
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring
@ 2026-11-27 6:11 kernel test robot
0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2026-11-27 6:11 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org>
References: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org>
TO: Hannes Reinecke <hare@kernel.org>
TO: Keith Busch <kbusch@kernel.org>
TO: Jens Axboe <axboe@kernel.dk>
TO: Christoph Hellwig <hch@lst.de>
TO: Sagi Grimberg <sagi@grimberg.me>
TO: Hannes Reinecke <hare@suse.de>
TO: Chaitanya Kulkarni <kch@nvidia.com>
TO: Eric Biggers <ebiggers@kernel.org>
TO: David Howells <dhowells@redhat.com>
TO: Jarkko Sakkinen <jarkko@kernel.org>
TO: Jonathan Corbet <corbet@lwn.net>
TO: Shuah Khan <skhan@linuxfoundation.org>
TO: Randy Dunlap <rdunlap@infradead.org>
TO: Kees Cook <kees@kernel.org>
TO: "Gustavo A. R. Silva" <gustavoars@kernel.org>
CC: linux-nvme@lists.infradead.org
CC: linux-kernel@vger.kernel.org
CC: keyrings@vger.kernel.org
CC: linux-doc@vger.kernel.org
CC: linux-hardening@vger.kernel.org
Hi Hannes,
kernel test robot noticed the following build errors:
[auto build test ERROR on 68099cf27253a8c89d703a282d3d811446d9453b]
url: https://github.com/intel-lab-lkp/linux/commits/Hannes-Reinecke/nvme-auth-modify-nvme_auth_transform_key-to-return-status/20261126-151219
base: 68099cf27253a8c89d703a282d3d811446d9453b
patch link: https://lore.kernel.org/r/20261126-dhchap-keyring-v4-v7-5-ee438ffea527%40kernel.org
patch subject: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring
:::::: branch date: 16 hours ago
:::::: commit date: 16 hours ago
config: sparc-randconfig-1000-20261127 (https://download.01.org/0day-ci/archive/20261127/20261127140211.GB7lh0Bk-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261127/20261127140211.GB7lh0Bk-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261127140211.GB7lh0Bk-lkp@intel.com/
All errors (new ones prefixed by >>):
sparc64-linux-ld: drivers/nvme/host/fabrics.o: in function `nvme_keyring_unlink':
>> fabrics.c:(.text+0x3e00): multiple definition of `nvme_keyring_unlink'; drivers/nvme/host/sysfs.o:sysfs.c:(.text+0x4100): first defined here
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring @ 2026-11-27 3:08 kernel test robot 0 siblings, 0 replies; 9+ messages in thread From: kernel test robot @ 2026-11-27 3:08 UTC (permalink / raw) To: oe-kbuild; +Cc: lkp :::::: :::::: Manual check reason: "same reports for this branch" :::::: BCC: lkp@intel.com CC: llvm@lists.linux.dev CC: oe-kbuild-all@lists.linux.dev In-Reply-To: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org> References: <20261126-dhchap-keyring-v4-v7-5-ee438ffea527@kernel.org> TO: Hannes Reinecke <hare@kernel.org> TO: Keith Busch <kbusch@kernel.org> TO: Jens Axboe <axboe@kernel.dk> TO: Christoph Hellwig <hch@lst.de> TO: Sagi Grimberg <sagi@grimberg.me> TO: Hannes Reinecke <hare@suse.de> TO: Chaitanya Kulkarni <kch@nvidia.com> TO: Eric Biggers <ebiggers@kernel.org> TO: David Howells <dhowells@redhat.com> TO: Jarkko Sakkinen <jarkko@kernel.org> TO: Jonathan Corbet <corbet@lwn.net> TO: Shuah Khan <skhan@linuxfoundation.org> TO: Randy Dunlap <rdunlap@infradead.org> TO: Kees Cook <kees@kernel.org> TO: "Gustavo A. R. Silva" <gustavoars@kernel.org> CC: linux-nvme@lists.infradead.org CC: linux-kernel@vger.kernel.org CC: keyrings@vger.kernel.org CC: linux-doc@vger.kernel.org CC: linux-hardening@vger.kernel.org Hi Hannes, kernel test robot noticed the following build errors: [auto build test ERROR on 68099cf27253a8c89d703a282d3d811446d9453b] url: https://github.com/intel-lab-lkp/linux/commits/Hannes-Reinecke/nvme-auth-modify-nvme_auth_transform_key-to-return-status/20261126-151219 base: 68099cf27253a8c89d703a282d3d811446d9453b patch link: https://lore.kernel.org/r/20261126-dhchap-keyring-v4-v7-5-ee438ffea527%40kernel.org patch subject: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring :::::: branch date: 13 hours ago :::::: commit date: 13 hours ago config: i386-buildonly-randconfig-1005-20261127 (https://download.01.org/0day-ci/archive/20261127/20261127105430.zJkj0Nm7-lkp@intel.com/config) compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261127/20261127105430.zJkj0Nm7-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 <lkp@intel.com> | Closes: https://lore.kernel.org/r/20261127105430.zJkj0Nm7-lkp@intel.com/ All errors (new ones prefixed by >>): >> ld.lld: error: duplicate symbol: nvme_keyring_unlink >>> defined at nvme-keyring.h:48 (include/linux/nvme-keyring.h:48) >>> drivers/nvme/host/sysfs.o:(nvme_keyring_unlink) in archive vmlinux.a >>> defined at nvme-keyring.h:48 (include/linux/nvme-keyring.h:48) >>> drivers/nvme/target/configfs.o:(.text+0x0) in archive vmlinux.a -- >> ld.lld: error: duplicate symbol: nvme_keyring_unlink >>> defined at nvme-keyring.h:48 (include/linux/nvme-keyring.h:48) >>> drivers/nvme/host/sysfs.o:(nvme_keyring_unlink) in archive vmlinux.a >>> defined at nvme-keyring.h:48 (include/linux/nvme-keyring.h:48) >>> drivers/nvme/host/fabrics.o:(.text+0x0) in archive vmlinux.a -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v7 00/14] nvme-auth: switch to use the kernel keyring
@ 2026-11-26 14:12 Hannes Reinecke
2026-11-26 14:12 ` [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring Hannes Reinecke
0 siblings, 1 reply; 9+ messages in thread
From: Hannes Reinecke @ 2026-11-26 14:12 UTC (permalink / raw)
To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
Hannes Reinecke, Chaitanya Kulkarni, Eric Biggers, David Howells,
Jarkko Sakkinen, Jonathan Corbet, Shuah Khan, Randy Dunlap,
Kees Cook, Gustavo A. R. Silva
Cc: linux-nvme, linux-kernel, keyrings, linux-doc, linux-hardening,
Hannes Reinecke, Martin Belanger
Hey all,
the current NVMe authentication code is using a hand-crafted key
structure; idea was to have the initial implementation with a minimal
set of dependencies.
(And me not having a good grasp on how to use the kernel keyring :-)
That had the drawback that keys always had to be specified on the
nvme-cli commandline, which is far from ideal from a security standpoint.
So this patchset switches the authentication code over to use
'struct key' to hold DH-HMAC-CHAP secrets. User-facing interfaces
(namely argument to 'nvme connect') remain the same, but the key data
is converted into keys which are stored as a new key type 'dhchap' with
a random UUID as description in the .nvme keyring.
With this I have updated the dhchap arguments to 'nvme connect' and
the configfs interface to either be the keydata (ie the original
interface), a key description, _or_ a key serial referring to a
pre-populated dhchap key in the kernel keyring. This allows for external
provisioning of keys and avoids the security risk from having to specify
the key data on the kernel commandline.
The entire patchset can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/hare/nvme.git
branch dhchap-keyring.v6
As usual, comments and reviews are welcome.
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
Changes in v7:
- Fixup next round of issues from sashiko
- Modify to use key_serial_t instead of 'struct key' to pass key references
- Include suggestions from Martin Belanger
- Link to v6: https://lore.kernel.org/r/20261123-dhchap-keyring-v4-v6-0-5082a49715ab@kernel.org
Changes in v6:
- Fixup next round of issues from sashiko
- Fixup kbuild robot issues
- Link to v5: https://lore.kernel.org/r/20261123-dhchap-keyring-v4-v5-0-81eefb4c0724@kernel.org
Changes in v5:
- Fixup issues found by sashiko
- Link to v4: https://lore.kernel.org/r/20261120-dhchap-keyring-v4-v4-0-5f8c7d9926ee@kernel.org
---
Hannes Reinecke (14):
nvme-auth: modify nvme_auth_transform_key() to return status
nvme-keyring: add 'dhchap' key type
nvme-keyring: drop nvme_tls_psk_revoked()
Documentation/security/keys: fixup function name
nvme-keyring: link addtional keyring into .nvme keyring
nvme-auth: switch to use 'struct key'
nvme: parse dhchap keys during option parsing
nvmet-auth: parse dhchap key from configfs attribute
nvme: allow to pass in key description as dhchap secret
nvme-auth: allow to specify the key by key serial
nvme-auth: wait for authentication to finish when changing keys
nvme-fabrics: allow to pass in keyring by name
nvme-auth: link pre-provisioned keys into .nvme keyring
nvme-auth: allow to update pre-provisioned keys
Documentation/ABI/stable/sysfs-nvme | 10 +
Documentation/security/keys/core.rst | 2 +-
drivers/nvme/common/Kconfig | 2 +
drivers/nvme/common/auth.c | 232 ++++++++++------------
drivers/nvme/common/keyring.c | 370 ++++++++++++++++++++++++++++++++---
drivers/nvme/host/Kconfig | 1 -
drivers/nvme/host/auth.c | 176 ++++++++++++-----
drivers/nvme/host/fabrics.c | 169 ++++++++++++----
drivers/nvme/host/fabrics.h | 12 +-
drivers/nvme/host/nvme.h | 6 +-
drivers/nvme/host/sysfs.c | 300 ++++++++++++++++++++++------
drivers/nvme/host/tcp.c | 5 +-
drivers/nvme/target/Kconfig | 1 -
drivers/nvme/target/auth.c | 250 +++++++++++++++--------
drivers/nvme/target/configfs.c | 84 ++++++--
drivers/nvme/target/nvmet.h | 15 +-
include/linux/nvme-auth.h | 17 +-
include/linux/nvme-keyring.h | 47 ++++-
18 files changed, 1257 insertions(+), 442 deletions(-)
---
base-commit: 68099cf27253a8c89d703a282d3d811446d9453b
change-id: 20261120-dhchap-keyring-v4-09f0bac1d8c5
Best regards,
--
Hannes Reinecke <hare@kernel.org>
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring 2026-11-26 14:12 [PATCH v7 00/14] nvme-auth: switch to use the kernel keyring Hannes Reinecke @ 2026-11-26 14:12 ` Hannes Reinecke 2026-11-26 14:24 ` sashiko-bot ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Hannes Reinecke @ 2026-11-26 14:12 UTC (permalink / raw) To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg, Hannes Reinecke, Chaitanya Kulkarni, Eric Biggers, David Howells, Jarkko Sakkinen, Jonathan Corbet, Shuah Khan, Randy Dunlap, Kees Cook, Gustavo A. R. Silva Cc: linux-nvme, linux-kernel, keyrings, linux-doc, linux-hardening, Hannes Reinecke Rather than switching to a different keyring (and trying to deal with possibly restricted access to that keyring) we should link the additional keyring into the default .nvme keyring to make the keys available for lookup for the lifetime of the corresponding nvme structures. Signed-off-by: Hannes Reinecke <hare@kernel.org> --- drivers/nvme/common/keyring.c | 63 ++++++++++++++++++++++++++----------------- drivers/nvme/host/auth.c | 3 +-- drivers/nvme/host/fabrics.c | 13 +++++++-- drivers/nvme/host/sysfs.c | 3 +++ drivers/nvme/host/tcp.c | 3 +-- drivers/nvme/target/auth.c | 2 +- include/linux/nvme-keyring.h | 30 +++++++++++++++------ 7 files changed, 77 insertions(+), 40 deletions(-) diff --git a/drivers/nvme/common/keyring.c b/drivers/nvme/common/keyring.c index 373f51e1032a4d29ef945a62fd9fb3720f8a9ea8..0fc6b4825c2dd9a23daaf4aae3d9f63f4f07c164 100644 --- a/drivers/nvme/common/keyring.c +++ b/drivers/nvme/common/keyring.c @@ -22,6 +22,24 @@ key_serial_t nvme_keyring_id(void) } EXPORT_SYMBOL_GPL(nvme_keyring_id); +const char *nvme_keyring_name(void) +{ + return nvme_keyring->description; +} +EXPORT_SYMBOL_GPL(nvme_keyring_name); + +int nvme_keyring_link(struct key *keyring) +{ + return key_link(nvme_keyring, keyring); +} +EXPORT_SYMBOL_GPL(nvme_keyring_link); + +int nvme_keyring_unlink(struct key *keyring) +{ + return key_unlink(nvme_keyring, keyring); +} +EXPORT_SYMBOL_GPL(nvme_keyring_unlink); + struct key *nvme_tls_key_lookup(key_serial_t key_id) { struct key *key = key_lookup(key_id); @@ -88,14 +106,12 @@ static struct key_type nvme_tls_psk_key_type = { .read = user_read, }; -static struct key *nvme_tls_psk_lookup(struct key *keyring, - const char *hostnqn, const char *subnqn, +static struct key *nvme_tls_psk_lookup(const char *hostnqn, const char *subnqn, u8 hmac, u8 psk_ver, bool generated) { char *identity; size_t identity_len = (NVMF_NQN_SIZE) * 2 + 11; key_ref_t keyref; - key_serial_t keyring_id; identity = kzalloc(identity_len, GFP_KERNEL); if (!identity) @@ -104,12 +120,8 @@ static struct key *nvme_tls_psk_lookup(struct key *keyring, snprintf(identity, identity_len, "NVMe%u%c%02u %s %s", psk_ver, generated ? 'G' : 'R', hmac, hostnqn, subnqn); - if (!keyring) - keyring = nvme_keyring; - keyring_id = key_serial(keyring); - pr_debug("keyring %x lookup tls psk '%s'\n", - keyring_id, identity); - keyref = keyring_search(make_key_ref(keyring, true), + pr_debug("lookup tls psk '%s'\n", identity); + keyref = keyring_search(make_key_ref(nvme_keyring, true), &nvme_tls_psk_key_type, identity, false); if (IS_ERR(keyref)) { @@ -125,7 +137,6 @@ static struct key *nvme_tls_psk_lookup(struct key *keyring, /** * nvme_tls_psk_refresh - Refresh TLS PSK - * @keyring: Keyring holding the TLS PSK * @hostnqn: Host NQN to use * @subnqn: Subsystem NQN to use * @hmac_id: Hash function identifier @@ -139,9 +150,8 @@ static struct key *nvme_tls_psk_lookup(struct key *keyring, * * Returns the updated key success or an error pointer otherwise. */ -struct key *nvme_tls_psk_refresh(struct key *keyring, - const char *hostnqn, const char *subnqn, u8 hmac_id, - u8 *data, size_t data_len, const char *digest) +struct key *nvme_tls_psk_refresh(const char *hostnqn, const char *subnqn, + u8 hmac_id, u8 *data, size_t data_len, const char *digest) { key_perm_t keyperm = KEY_POS_SEARCH | KEY_POS_VIEW | KEY_POS_READ | @@ -149,7 +159,6 @@ struct key *nvme_tls_psk_refresh(struct key *keyring, KEY_USR_SEARCH | KEY_USR_VIEW | KEY_USR_READ; char *identity; key_ref_t keyref; - key_serial_t keyring_id; struct key *key; if (!hostnqn || !subnqn || !data || !data_len) @@ -160,12 +169,8 @@ struct key *nvme_tls_psk_refresh(struct key *keyring, if (!identity) return ERR_PTR(-ENOMEM); - if (!keyring) - keyring = nvme_keyring; - keyring_id = key_serial(keyring); - pr_debug("keyring %x refresh tls psk '%s'\n", - keyring_id, identity); - keyref = key_create_or_update(make_key_ref(keyring, true), + pr_debug("refresh tls psk '%s'\n", identity); + keyref = key_create_or_update(make_key_ref(nvme_keyring, true), "psk", identity, data, data_len, keyperm, KEY_ALLOC_NOT_IN_QUOTA | KEY_ALLOC_BUILT_IN | @@ -226,10 +231,18 @@ static struct nvme_tls_psk_priority_list { }; /* - * nvme_tls_psk_default - Return the preferred PSK to use for TLS ClientHello + * nvme_tls_psk_default - Select the preferred PSK to use for TLS ClientHello + * @hostnqn: Host NQN of the NVME TLS connection + * @subnqn: Subsystem NQN of the NVME TLS connection + * + * Looks up the preferred PSK to be used for the TLC ClientHello. + * The preferred PSK is the first matching PSK from the nvme_tls_psk_prio + * array. + * + * Returns: the key serial number of the preferred PSK or 0 if no matchine + * PSK was found. */ -key_serial_t nvme_tls_psk_default(struct key *keyring, - const char *hostnqn, const char *subnqn) +key_serial_t nvme_tls_psk_default(const char *hostnqn, const char *subnqn) { struct key *tls_key; key_serial_t tls_key_id; @@ -240,8 +253,8 @@ key_serial_t nvme_tls_psk_default(struct key *keyring, u8 ver = nvme_tls_psk_prio[prio].psk_ver; enum nvme_tcp_tls_cipher cipher = nvme_tls_psk_prio[prio].cipher; - tls_key = nvme_tls_psk_lookup(keyring, hostnqn, subnqn, - cipher, ver, generated); + tls_key = nvme_tls_psk_lookup(hostnqn, subnqn, cipher, + ver, generated); if (!IS_ERR(tls_key)) { tls_key_id = tls_key->serial; key_put(tls_key); diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c index 295e0a9533c8995c32781324650d73b6bfedbf13..06399c075405353325b05c099811a54134fbeb53 100644 --- a/drivers/nvme/host/auth.c +++ b/drivers/nvme/host/auth.c @@ -726,8 +726,7 @@ static int nvme_auth_secure_concat(struct nvme_ctrl *ctrl, goto out_free_digest; } - tls_key = nvme_tls_psk_refresh(ctrl->opts->keyring, - ctrl->opts->host->nqn, + tls_key = nvme_tls_psk_refresh(ctrl->opts->host->nqn, ctrl->opts->subsysnqn, chap->hash_id, tls_psk, psk_len, digest); if (IS_ERR(tls_key)) { diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 5ed91557f07065a284e664950a9c71d771614ec2..6a918d72d14c5dd92d00191c184e72b0e5614b7a 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -995,7 +995,11 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, ret = PTR_ERR(key); goto out; } - key_put(opts->keyring); + ret = nvme_keyring_link(opts->keyring); + if (ret) { + key_put(key); + goto out; + } opts->keyring = key; break; case NVMF_OPT_TLS_KEY: @@ -1296,7 +1300,12 @@ static int nvmf_check_allowed_opts(struct nvmf_ctrl_options *opts, void nvmf_free_options(struct nvmf_ctrl_options *opts) { nvmf_host_put(opts->host); - key_put(opts->keyring); + if (opts->keyring) { + int ret = nvme_keyring_unlink(opts->keyring); + + WARN_ON(ret); + key_put(opts->keyring); + } key_put(opts->tls_key); kfree(opts->transport); kfree(opts->traddr); diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c index 35f871e3e0c0ae49b390f0fb64c538796207a98f..c1375f23a97f6b5a47bb8aad6b12e7ff3ad12638 100644 --- a/drivers/nvme/host/sysfs.c +++ b/drivers/nvme/host/sysfs.c @@ -6,6 +6,7 @@ */ #include <linux/nvme-auth.h> +#include <linux/nvme-keyring.h> #include <linux/blkdev.h> #include "nvme.h" @@ -1069,6 +1070,8 @@ static ssize_t tls_keyring_show(struct device *dev, struct nvme_ctrl *ctrl = dev_get_drvdata(dev); struct key *keyring = ctrl->opts->keyring; + if (!keyring) + return sysfs_emit(buf, "%s\n", nvme_keyring_name()); return sysfs_emit(buf, "%s\n", keyring->description); } static DEVICE_ATTR_RO(tls_keyring); diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 62a594b8ab9bfa51a6f47b10ef2400839f9dd18e..585aba1d544518d6e712e23c7987741b130aee4d 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -2416,8 +2416,7 @@ static int nvme_tcp_alloc_admin_queue(struct nvme_ctrl *ctrl) if (ctrl->opts->tls_key) pskid = key_serial(ctrl->opts->tls_key); else if (ctrl->opts->tls) { - pskid = nvme_tls_psk_default(ctrl->opts->keyring, - ctrl->opts->host->nqn, + pskid = nvme_tls_psk_default(ctrl->opts->host->nqn, ctrl->opts->subsysnqn); if (!pskid) { dev_err(ctrl->device, "no valid PSK found\n"); diff --git a/drivers/nvme/target/auth.c b/drivers/nvme/target/auth.c index 150818d7009d8c2fca96e12fd54fdc1cb6b68882..7ebd867c89468e94e31fd2739d3ee77018775f18 100644 --- a/drivers/nvme/target/auth.c +++ b/drivers/nvme/target/auth.c @@ -523,7 +523,7 @@ void nvmet_auth_insert_psk(struct nvmet_sq *sq) goto out_free_digest; } #ifdef CONFIG_NVME_TARGET_TCP_TLS - tls_key = nvme_tls_psk_refresh(NULL, sq->ctrl->hostnqn, + tls_key = nvme_tls_psk_refresh(sq->ctrl->hostnqn, sq->ctrl->subsys->subsysnqn, sq->ctrl->shash_id, tls_psk, psk_len, digest); diff --git a/include/linux/nvme-keyring.h b/include/linux/nvme-keyring.h index ab8971afa9734a276d9197076b780321460dddc2..680eb93088d485ca3368f615715d71fa570b1077 100644 --- a/include/linux/nvme-keyring.h +++ b/include/linux/nvme-keyring.h @@ -10,20 +10,22 @@ #if IS_ENABLED(CONFIG_NVME_KEYRING) -struct key *nvme_tls_psk_refresh(struct key *keyring, - const char *hostnqn, const char *subnqn, u8 hmac_id, - u8 *data, size_t data_len, const char *digest); -key_serial_t nvme_tls_psk_default(struct key *keyring, - const char *hostnqn, const char *subnqn); +struct key *nvme_tls_psk_refresh(const char *hostnqn, const char *subnqn, + u8 hmac_id, u8 *data, size_t data_len, const char *digest); +key_serial_t nvme_tls_psk_default(const char *hostnqn, const char *subnqn); key_serial_t nvme_keyring_id(void); +const char *nvme_keyring_name(void); +int nvme_keyring_link(struct key *keyring); +int nvme_keyring_unlink(struct key *keyring); struct key *nvme_tls_key_lookup(key_serial_t key_id); + #else static inline struct key *nvme_tls_psk_refresh(struct key *keyring, - const char *hostnqn, char *subnqn, u8 hmac_id, + const char *hostnqn, const char *subnqn, u8 hmac_id, u8 *data, size_t data_len, const char *digest) { - return ERR_PTR(-ENOTSUPP); + return ERR_PTR(-EOPNOTSUPP); } static inline key_serial_t nvme_tls_psk_default(struct key *keyring, const char *hostnqn, const char *subnqn) @@ -34,9 +36,21 @@ static inline key_serial_t nvme_keyring_id(void) { return 0; } +static const char *nvme_keyring_name(void) +{ + return NULL; +} +static int nvme_keyring_link(struct key *keyring) +{ + return 0; +} +int nvme_keyring_unlink(struct key *keyring) +{ + return 0; +} static inline struct key *nvme_tls_key_lookup(key_serial_t key_id) { - return ERR_PTR(-ENOTSUPP); + return ERR_PTR(-EOPNOTSUPP); } #endif /* !CONFIG_NVME_KEYRING */ #endif /* _NVME_KEYRING_H */ -- 2.51.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring 2026-11-26 14:12 ` [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring Hannes Reinecke @ 2026-11-26 14:24 ` sashiko-bot 2026-11-26 19:49 ` kernel test robot 2026-11-26 20:22 ` kernel test robot 2 siblings, 0 replies; 9+ messages in thread From: sashiko-bot @ 2026-11-26 14:24 UTC (permalink / raw) To: Hannes Reinecke, Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg, Hannes Reinecke, Chaitanya Kulkarni, Eric Biggers, David Howells, Jarkko Sakkinen, Jonathan Corbet, Shuah Khan, Randy Dunlap, Kees Cook, Gustavo A. R. Silva Cc: linux-nvme, keyrings Thank you for your contribution! Sashiko AI review found 7 potential issues to consider: - [High] nvme-fabrics: NULL deref and key leak linking opts->keyring in nvmf_parse_options() - [High] nvme-keyring: broken !CONFIG_NVME_KEYRING stubs in include/linux/nvme-keyring.h - [High] nvme-keyring: non-recursive keyring_search() in nvme_tls_psk_lookup() skips linked keyrings - [High] nvme-tcp: nvme_tcp_start_tls() still passes opts->keyring instead of .nvme to tlshd - [Medium] nvme-fabrics: unrefcounted keyring link/unlink breaks shared keyrings and triggers WARN_ON - [Low] nvme: unreachable default keyring fallback in tls_keyring_show() - [Low] nvme-keyring: stale @keyring reference in nvme_tls_psk_refresh() kernel-doc -- commit baf89e86a63698b34af74abf311ec9f03c1d91b9 Author: Hannes Reinecke <hare@kernel.org> nvme-keyring: link addtional keyring into .nvme keyring This commit links any user-specified keyring into the default .nvme keyring for the lifetime of the controller options and updates TLS PSK lookup and refresh helpers to operate directly on the .nvme keyring. > diff --git a/drivers/nvme/common/keyring.c b/drivers/nvme/common/keyring.c > index 373f51e1032a4..0fc6b4825c2dd 100644 > --- a/drivers/nvme/common/keyring.c > +++ b/drivers/nvme/common/keyring.c [ ... ] > @@ -104,12 +120,8 @@ static struct key *nvme_tls_psk_lookup(struct key *keyring, > snprintf(identity, identity_len, "NVMe%u%c%02u %s %s", > psk_ver, generated ? 'G' : 'R', hmac, hostnqn, subnqn); > > - if (!keyring) > - keyring = nvme_keyring; > - keyring_id = key_serial(keyring); > - pr_debug("keyring %x lookup tls psk '%s'\n", > - keyring_id, identity); > - keyref = keyring_search(make_key_ref(keyring, true), > + pr_debug("lookup tls psk '%s'\n", identity); > + keyref = keyring_search(make_key_ref(nvme_keyring, true), > &nvme_tls_psk_key_type, > identity, false); [Severity: High] Should keyring_search() pass recurse = true here? With recurse = false, KEYRING_SEARCH_RECURSE is not set, so keyring_search() only checks the top-level nvme_keyring and never descends into keyrings linked via nvme_keyring_link(), causing nvme_tls_psk_default() lookups for keys in linked keyrings to fail with -ENOKEY. > if (IS_ERR(keyref)) { > @@ -125,7 +137,6 @@ static struct key *nvme_tls_psk_lookup(struct key *keyring, > > /** > * nvme_tls_psk_refresh - Refresh TLS PSK > - * @keyring: Keyring holding the TLS PSK > * @hostnqn: Host NQN to use > * @subnqn: Subsystem NQN to use > * @hmac_id: Hash function identifier [Severity: Low] This isn't a bug, but the kernel-doc body just below this hunk still says "in the keyring given by @keyring" after the @keyring parameter was removed. [ ... ] > diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c > index 295e0a9533c89..06399c0754053 100644 > --- a/drivers/nvme/host/auth.c > +++ b/drivers/nvme/host/auth.c > @@ -726,8 +726,7 @@ static int nvme_auth_secure_concat(struct nvme_ctrl *ctrl, > goto out_free_digest; > } > > - tls_key = nvme_tls_psk_refresh(ctrl->opts->keyring, > - ctrl->opts->host->nqn, > + tls_key = nvme_tls_psk_refresh(ctrl->opts->host->nqn, > ctrl->opts->subsysnqn, chap->hash_id, > tls_psk, psk_len, digest); > if (IS_ERR(tls_key)) { [Severity: High] When secure concatenation is used with a custom keyring, nvme_tls_psk_refresh() now inserts the generated PSK into the default .nvme keyring, but doesn't nvme_tcp_start_tls() still pass nctrl->opts->keyring to tlshd? drivers/nvme/host/tcp.c:nvme_tcp_start_tls() { ... key_serial_t keyring = nvme_keyring_id(); ... if (nctrl->opts->keyring) keyring = key_serial(nctrl->opts->keyring); args.ta_keyring = keyring; ... } Because nctrl->opts->keyring is linked beneath .nvme and not the other way around, tlshd searches nctrl->opts->keyring instead of .nvme and fails to find the generated PSK. > diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c > index 5ed91557f0706..6a918d72d14c5 100644 > --- a/drivers/nvme/host/fabrics.c > +++ b/drivers/nvme/host/fabrics.c > @@ -995,7 +995,11 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, > ret = PTR_ERR(key); > goto out; > } > - key_put(opts->keyring); > + ret = nvme_keyring_link(opts->keyring); > + if (ret) { > + key_put(key); > + goto out; > + } > opts->keyring = key; > break; [Severity: High] Does nvme_keyring_link(opts->keyring) pass NULL on the first keyring= option instead of linking the newly parsed key? key_link() immediately dereferences its key argument via key_check(key) and &key->index_key, causing a NULL pointer dereference oops when connecting with keyring=. Also, if keyring= is specified more than once in the option string, overwriting opts->keyring without unlinking and calling key_put() on the previous opts->keyring leaks the earlier keyring reference and link. > @@ -1296,7 +1300,12 @@ static int nvmf_check_allowed_opts(struct nvmf_ctrl_options *opts, > void nvmf_free_options(struct nvmf_ctrl_options *opts) > { > nvmf_host_put(opts->host); > - key_put(opts->keyring); > + if (opts->keyring) { > + int ret = nvme_keyring_unlink(opts->keyring); > + > + WARN_ON(ret); > + key_put(opts->keyring); > + } > key_put(opts->tls_key); [Severity: Medium] What happens if two controllers (or an active controller and a failed connection attempt) specify the same keyring? key_link() only maintains a single link to a given key in nvme_keyring rather than a reference count, so freeing the first controller unlinks the keyring from .nvme while the second controller still uses it, and freeing the second controller fails with -ENOENT and triggers WARN_ON(ret). > diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c > index 35f871e3e0c0a..c1375f23a97f6 100644 > --- a/drivers/nvme/host/sysfs.c > +++ b/drivers/nvme/host/sysfs.c [ ... ] > @@ -1069,6 +1070,8 @@ static ssize_t tls_keyring_show(struct device *dev, > struct nvme_ctrl *ctrl = dev_get_drvdata(dev); > struct key *keyring = ctrl->opts->keyring; > > + if (!keyring) > + return sysfs_emit(buf, "%s\n", nvme_keyring_name()); > return sysfs_emit(buf, "%s\n", keyring->description); > } > static DEVICE_ATTR_RO(tls_keyring); [Severity: Low] Is this !keyring branch reachable? nvme_tls_attrs_are_visible() still hides dev_attr_tls_keyring when !ctrl->opts->keyring: drivers/nvme/host/sysfs.c:nvme_tls_attrs_are_visible() { ... if (a == &dev_attr_tls_keyring.attr && !ctrl->opts->keyring) return 0; ... } > diff --git a/include/linux/nvme-keyring.h b/include/linux/nvme-keyring.h > index ab8971afa9734..680eb93088d48 100644 > --- a/include/linux/nvme-keyring.h > +++ b/include/linux/nvme-keyring.h > @@ -10,20 +10,22 @@ > > #if IS_ENABLED(CONFIG_NVME_KEYRING) > > -struct key *nvme_tls_psk_refresh(struct key *keyring, > - const char *hostnqn, const char *subnqn, u8 hmac_id, > - u8 *data, size_t data_len, const char *digest); > -key_serial_t nvme_tls_psk_default(struct key *keyring, > - const char *hostnqn, const char *subnqn); > +struct key *nvme_tls_psk_refresh(const char *hostnqn, const char *subnqn, > + u8 hmac_id, u8 *data, size_t data_len, const char *digest); > +key_serial_t nvme_tls_psk_default(const char *hostnqn, const char *subnqn); > > key_serial_t nvme_keyring_id(void); > +const char *nvme_keyring_name(void); > +int nvme_keyring_link(struct key *keyring); > +int nvme_keyring_unlink(struct key *keyring); > struct key *nvme_tls_key_lookup(key_serial_t key_id); > + > #else > static inline struct key *nvme_tls_psk_refresh(struct key *keyring, > - const char *hostnqn, char *subnqn, u8 hmac_id, > + const char *hostnqn, const char *subnqn, u8 hmac_id, > u8 *data, size_t data_len, const char *digest) > { > - return ERR_PTR(-ENOTSUPP); > + return ERR_PTR(-EOPNOTSUPP); > } > static inline key_serial_t nvme_tls_psk_default(struct key *keyring, > const char *hostnqn, const char *subnqn) > @@ -34,9 +36,21 @@ static inline key_serial_t nvme_keyring_id(void) > { > return 0; > } > +static const char *nvme_keyring_name(void) > +{ > + return NULL; > +} > +static int nvme_keyring_link(struct key *keyring) > +{ > + return 0; > +} > +int nvme_keyring_unlink(struct key *keyring) > +{ > + return 0; > +} [Severity: High] Does the !CONFIG_NVME_KEYRING build fail here? The nvme_tls_psk_refresh() and nvme_tls_psk_default() stubs still take struct key *keyring as their first argument, breaking compilation of callers like nvme_tcp_alloc_admin_queue() when CONFIG_NVME_KEYRING is disabled. In addition, nvme_keyring_unlink() is missing "static inline" (causing multiple-definition link errors across translation units including this header), and nvme_keyring_name() and nvme_keyring_link() are missing "inline" (triggering unused-function warnings). -- Sashiko AI review · https://sashiko.dev/#/patchset/20261126-dhchap-keyring-v4-v7-0-ee438ffea527@kernel.org?part=5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring 2026-11-26 14:12 ` [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring Hannes Reinecke 2026-11-26 14:24 ` sashiko-bot @ 2026-11-26 19:49 ` kernel test robot 2026-11-26 20:22 ` kernel test robot 2 siblings, 0 replies; 9+ messages in thread From: kernel test robot @ 2026-11-26 19:49 UTC (permalink / raw) To: Hannes Reinecke, Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg, Hannes Reinecke, Chaitanya Kulkarni, Eric Biggers, David Howells, Jarkko Sakkinen, Jonathan Corbet, Shuah Khan, Randy Dunlap, Kees Cook, Gustavo A. R. Silva Cc: llvm, oe-kbuild-all, linux-nvme, linux-kernel, keyrings, linux-doc, linux-hardening Hi Hannes, kernel test robot noticed the following build errors: [auto build test ERROR on 68099cf27253a8c89d703a282d3d811446d9453b] url: https://github.com/intel-lab-lkp/linux/commits/Hannes-Reinecke/nvme-auth-modify-nvme_auth_transform_key-to-return-status/20261126-151219 base: 68099cf27253a8c89d703a282d3d811446d9453b patch link: https://lore.kernel.org/r/20261126-dhchap-keyring-v4-v7-5-ee438ffea527%40kernel.org patch subject: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20261127/20261127034638.jk3QPDaD-lkp@intel.com/config) compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project fb29ca8163c3309160711e5a14eb46bc6d4fdad2) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261127/20261127034638.jk3QPDaD-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 <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/20261127034638.jk3QPDaD-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from drivers/nvme/host/sysfs.c:9: >> include/linux/nvme-keyring.h:47:5: warning: no previous prototype for function 'nvme_keyring_unlink' [-Wmissing-prototypes] 47 | int nvme_keyring_unlink(struct key *keyring) | ^ include/linux/nvme-keyring.h:47:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 47 | int nvme_keyring_unlink(struct key *keyring) | ^ | static include/linux/nvme-keyring.h:39:20: warning: unused function 'nvme_keyring_name' [-Wunused-function] 39 | static const char *nvme_keyring_name(void) | ^~~~~~~~~~~~~~~~~ include/linux/nvme-keyring.h:43:12: warning: unused function 'nvme_keyring_link' [-Wunused-function] 43 | static int nvme_keyring_link(struct key *keyring) | ^~~~~~~~~~~~~~~~~ 3 warnings generated. -- In file included from drivers/nvme/host/fabrics.c:15: >> include/linux/nvme-keyring.h:47:5: warning: no previous prototype for function 'nvme_keyring_unlink' [-Wmissing-prototypes] 47 | int nvme_keyring_unlink(struct key *keyring) | ^ include/linux/nvme-keyring.h:47:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 47 | int nvme_keyring_unlink(struct key *keyring) | ^ | static include/linux/nvme-keyring.h:39:20: warning: unused function 'nvme_keyring_name' [-Wunused-function] 39 | static const char *nvme_keyring_name(void) | ^~~~~~~~~~~~~~~~~ 2 warnings generated. -- In file included from drivers/nvme/host/tcp.c:15: >> include/linux/nvme-keyring.h:47:5: warning: no previous prototype for function 'nvme_keyring_unlink' [-Wmissing-prototypes] 47 | int nvme_keyring_unlink(struct key *keyring) | ^ include/linux/nvme-keyring.h:47:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 47 | int nvme_keyring_unlink(struct key *keyring) | ^ | static >> drivers/nvme/host/tcp.c:2420:34: error: too few arguments to function call, expected 3, have 2 2419 | pskid = nvme_tls_psk_default(ctrl->opts->host->nqn, | ~~~~~~~~~~~~~~~~~~~~ 2420 | ctrl->opts->subsysnqn); | ^ include/linux/nvme-keyring.h:30:28: note: 'nvme_tls_psk_default' declared here 30 | static inline key_serial_t nvme_tls_psk_default(struct key *keyring, | ^ ~~~~~~~~~~~~~~~~~~~~ 31 | const char *hostnqn, const char *subnqn) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. -- In file included from tcp.c:15: >> include/linux/nvme-keyring.h:47:5: warning: no previous prototype for function 'nvme_keyring_unlink' [-Wmissing-prototypes] 47 | int nvme_keyring_unlink(struct key *keyring) | ^ include/linux/nvme-keyring.h:47:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 47 | int nvme_keyring_unlink(struct key *keyring) | ^ | static tcp.c:2420:34: error: too few arguments to function call, expected 3, have 2 2419 | pskid = nvme_tls_psk_default(ctrl->opts->host->nqn, | ~~~~~~~~~~~~~~~~~~~~ 2420 | ctrl->opts->subsysnqn); | ^ include/linux/nvme-keyring.h:30:28: note: 'nvme_tls_psk_default' declared here 30 | static inline key_serial_t nvme_tls_psk_default(struct key *keyring, | ^ ~~~~~~~~~~~~~~~~~~~~ 31 | const char *hostnqn, const char *subnqn) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. vim +2420 drivers/nvme/host/tcp.c 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2409 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2410 static int nvme_tcp_alloc_admin_queue(struct nvme_ctrl *ctrl) 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2411 { 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2412 int ret; be8e82caa68599 Hannes Reinecke 2023-08-24 2413 key_serial_t pskid = 0; be8e82caa68599 Hannes Reinecke 2023-08-24 2414 363895767fbfa0 Hannes Reinecke 2024-07-22 2415 if (nvme_tcp_tls_configured(ctrl)) { adf22c520b5ec4 Hannes Reinecke 2023-08-24 2416 if (ctrl->opts->tls_key) adf22c520b5ec4 Hannes Reinecke 2023-08-24 2417 pskid = key_serial(ctrl->opts->tls_key); e88a7595b57f2a Hannes Reinecke 2025-02-24 2418 else if (ctrl->opts->tls) { 83137991c12380 Hannes Reinecke 2026-11-26 2419 pskid = nvme_tls_psk_default(ctrl->opts->host->nqn, be8e82caa68599 Hannes Reinecke 2023-08-24 @2420 ctrl->opts->subsysnqn); be8e82caa68599 Hannes Reinecke 2023-08-24 2421 if (!pskid) { be8e82caa68599 Hannes Reinecke 2023-08-24 2422 dev_err(ctrl->device, "no valid PSK found\n"); ef184b8844bf98 Guixin Liu 2023-12-31 2423 return -ENOKEY; be8e82caa68599 Hannes Reinecke 2023-08-24 2424 } be8e82caa68599 Hannes Reinecke 2023-08-24 2425 } 363895767fbfa0 Hannes Reinecke 2024-07-22 2426 } 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2427 be8e82caa68599 Hannes Reinecke 2023-08-24 2428 ret = nvme_tcp_alloc_queue(ctrl, 0, pskid); 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2429 if (ret) ef184b8844bf98 Guixin Liu 2023-12-31 2430 return ret; 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2431 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2432 ret = nvme_tcp_alloc_async_req(to_tcp_ctrl(ctrl)); 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2433 if (ret) 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2434 goto out_free_queue; 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2435 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2436 return 0; 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2437 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2438 out_free_queue: 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2439 nvme_tcp_free_queue(ctrl, 0); 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2440 return ret; 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2441 } 3f2304f8c6d6ed Sagi Grimberg 2018-12-03 2442 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring 2026-11-26 14:12 ` [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring Hannes Reinecke 2026-11-26 14:24 ` sashiko-bot 2026-11-26 19:49 ` kernel test robot @ 2026-11-26 20:22 ` kernel test robot 2 siblings, 0 replies; 9+ messages in thread From: kernel test robot @ 2026-11-26 20:22 UTC (permalink / raw) To: Hannes Reinecke, Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg, Hannes Reinecke, Chaitanya Kulkarni, Eric Biggers, David Howells, Jarkko Sakkinen, Jonathan Corbet, Shuah Khan, Randy Dunlap, Kees Cook, Gustavo A. R. Silva Cc: oe-kbuild-all, linux-nvme, linux-kernel, keyrings, linux-doc, linux-hardening Hi Hannes, kernel test robot noticed the following build warnings: [auto build test WARNING on 68099cf27253a8c89d703a282d3d811446d9453b] url: https://github.com/intel-lab-lkp/linux/commits/Hannes-Reinecke/nvme-auth-modify-nvme_auth_transform_key-to-return-status/20261126-151219 base: 68099cf27253a8c89d703a282d3d811446d9453b patch link: https://lore.kernel.org/r/20261126-dhchap-keyring-v4-v7-5-ee438ffea527%40kernel.org patch subject: [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring config: i386-randconfig-1003-20261126 (https://download.01.org/0day-ci/archive/20261127/20261127041445.UXBLiTUG-lkp@intel.com/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261127/20261127041445.UXBLiTUG-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 <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/20261127041445.UXBLiTUG-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from drivers/nvme/host/sysfs.c:9: >> include/linux/nvme-keyring.h:47:5: warning: no previous prototype for 'nvme_keyring_unlink' [-Wmissing-prototypes] 47 | int nvme_keyring_unlink(struct key *keyring) | ^~~~~~~~~~~~~~~~~~~ >> include/linux/nvme-keyring.h:43:12: warning: 'nvme_keyring_link' defined but not used [-Wunused-function] 43 | static int nvme_keyring_link(struct key *keyring) | ^~~~~~~~~~~~~~~~~ >> include/linux/nvme-keyring.h:39:20: warning: 'nvme_keyring_name' defined but not used [-Wunused-function] 39 | static const char *nvme_keyring_name(void) | ^~~~~~~~~~~~~~~~~ vim +/nvme_keyring_unlink +47 include/linux/nvme-keyring.h 22 23 #else 24 static inline struct key *nvme_tls_psk_refresh(struct key *keyring, 25 const char *hostnqn, const char *subnqn, u8 hmac_id, 26 u8 *data, size_t data_len, const char *digest) 27 { 28 return ERR_PTR(-EOPNOTSUPP); 29 } 30 static inline key_serial_t nvme_tls_psk_default(struct key *keyring, 31 const char *hostnqn, const char *subnqn) 32 { 33 return 0; 34 } 35 static inline key_serial_t nvme_keyring_id(void) 36 { 37 return 0; 38 } > 39 static const char *nvme_keyring_name(void) 40 { 41 return NULL; 42 } > 43 static int nvme_keyring_link(struct key *keyring) 44 { 45 return 0; 46 } > 47 int nvme_keyring_unlink(struct key *keyring) -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-12-02 5:58 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-12-02 5:57 [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring kernel test robot -- strict thread matches above, loose matches on Subject: below -- 2026-12-02 5:36 kernel test robot 2026-11-27 6:22 kernel test robot 2026-11-27 6:11 kernel test robot 2026-11-27 3:08 kernel test robot 2026-11-26 14:12 [PATCH v7 00/14] nvme-auth: switch to use the kernel keyring Hannes Reinecke 2026-11-26 14:12 ` [PATCH v7 05/14] nvme-keyring: link addtional keyring into .nvme keyring Hannes Reinecke 2026-11-26 14:24 ` sashiko-bot 2026-11-26 19:49 ` kernel test robot 2026-11-26 20:22 ` kernel test robot
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.