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: <56384f82-6ce7-49c8-a20e-ffdf119804ae@ans.pl>
Date: Sun, 7 Jul 2024 20:41:38 -0700
From: Krzysztof Olędzki <ole@....pl>
To: Ido Schimmel <idosch@...dia.com>, Andrew Lunn <andrew@...n.ch>,
        Michal Kubecek <mkubecek@...e.cz>
Cc: Moshe Shemesh <moshe@...dia.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>, tariqt@...dia.com,
        Dan Merillat <git@....merillat.org>
Subject: [PATCH] qsfp: Better handling of Page 03h netlink read failure

Page 03h may not be available due to a bug in a driver.
This is a non-fatal error and sff8636_dom_parse() handles this
correctly, allowing it to provide the remaining information.

Also, add an error message to clarify otherwise cryptic
"netlink error: Invalid argument" message.
---
 qsfp.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/qsfp.c b/qsfp.c
index a2921fb..208eddc 100644
--- a/qsfp.c
+++ b/qsfp.c
@@ -1038,8 +1038,16 @@ sff8636_memory_map_init_pages(struct cmd_context *ctx,
 
 	sff8636_request_init(&request, 0x3, SFF8636_PAGE_SIZE);
 	ret = nl_get_eeprom_page(ctx, &request);
-	if (ret < 0)
-		return ret;
+	if (ret < 0) {
+		/* Page 03h is not available due to a bug in the driver.
+		 * This is a non-fatal error and sff8636_dom_parse()
+		 * handles this correctly.
+		 */
+
+		fprintf(stderr, "Failed to read Upper Page 03h, driver error?\n");
+		return 0;
+	}
+
 	map->page_03h = request.data - SFF8636_PAGE_SIZE;
 
 	return 0;
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ