lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260105100424.2626542-2-cratiu@nvidia.com>
Date: Mon, 5 Jan 2026 12:04:23 +0200
From: Cosmin Ratiu <cratiu@...dia.com>
To: <netdev@...r.kernel.org>
CC: Andrew Lunn <andrew+netdev@...n.ch>, "David S . Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Shuah Khan
	<shuah@...nel.org>, Cosmin Ratiu <cratiu@...dia.com>, Carolina Jubran
	<cjubran@...dia.com>, <linux-kselftest@...r.kernel.org>
Subject: [PATCH net-next 1/2] selftests: drv-net: psp: Use first device when multiple are present

The PSP responder fails when multiple devices are detected. There's
an option to select the device id to use (-d) but that's currently not
used from the PSP self test.

Change the default behavior of psp_responder to pick the first
device instead of giving up altogether.

Signed-off-by: Cosmin Ratiu <cratiu@...dia.com>
Reviewed-by: Carolina Jubran <cjubran@...dia.com>
---
 tools/testing/selftests/drivers/net/psp_responder.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/psp_responder.c b/tools/testing/selftests/drivers/net/psp_responder.c
index f309e0d73cbf..8d2bad134e63 100644
--- a/tools/testing/selftests/drivers/net/psp_responder.c
+++ b/tools/testing/selftests/drivers/net/psp_responder.c
@@ -410,6 +410,7 @@ static int psp_dev_set_ena(struct ynl_sock *ys, __u32 dev_id, __u32 versions)
 int main(int argc, char **argv)
 {
 	struct psp_dev_get_list *dev_list;
+	bool multiple_devs = false;
 	bool devid_found = false;
 	__u32 ver_ena, ver_cap;
 	struct opts opts = {};
@@ -446,8 +447,7 @@ int main(int argc, char **argv)
 			ver_ena = d->psp_versions_ena;
 			ver_cap = d->psp_versions_cap;
 		} else {
-			fprintf(stderr, "Multiple PSP devices found\n");
-			goto err_close_silent;
+			multiple_devs = true;
 		}
 	}
 	psp_dev_get_list_free(dev_list);
@@ -457,6 +457,10 @@ int main(int argc, char **argv)
 			opts.devid);
 		goto err_close_silent;
 	} else if (!opts.devid) {
+		if (multiple_devs)
+			fprintf(stderr,
+				"Multiple PSP devices found, choosing first one with devid %d\n",
+				first_id);
 		opts.devid = first_id;
 	}
 
-- 
2.45.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ