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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250912195339.20635-16-yana2bsh@gmail.com>
Date: Fri, 12 Sep 2025 22:53:38 +0300
From: Yana Bashlykova <yana2bsh@...il.com>
To: "David S. Miller" <davem@...emloft.net>
Cc: Yana Bashlykova <yana2bsh@...il.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Shuah Khan <shuah@...nel.org>,
	netdev@...r.kernel.org,
	linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org
Subject: [PATCH 6.1 15/15] selftests: net: genetlink: fix expectation for large family resolution

Correctly expect standard genl_ctrl_resolve() to fail for large families
with many multicast groups. While kernel handles large families correctly,
libnl's resolution fails due to message fragmentation:

- Responses exceed single message size (~32KB)
- Kernel fragments across multiple messages
- genl_ctrl_resolve() only processes first fragment
- Returns ENOMSG instead of family ID

Custom my_genl_ctrl_resolve() handles fragmentation correctly via dump
mechanism. Change EXPECT_TRUE(no_family_id > 0) to EXPECT_TRUE(no_family_id < 0)
to match actual behavior.

Signed-off-by: Yana Bashlykova <yana2bsh@...il.com>
---
 tools/testing/selftests/net/genetlink.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/genetlink.c b/tools/testing/selftests/net/genetlink.c
index a166f2c474b4..8a394991fe32 100644
--- a/tools/testing/selftests/net/genetlink.c
+++ b/tools/testing/selftests/net/genetlink.c
@@ -437,6 +437,7 @@ int validate_cb_ctrl(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	case CTRL_CMD_GETPOLICY:
+		;
 		struct ctrl_policy *exp =
 			&data_ctrl->expected_policy->policy[elem];
 		if (attrs[CTRL_ATTR_FAMILY_ID]) {
@@ -1485,7 +1486,7 @@ TEST(genl_ctrl_policy)
  *
  * Verification:
  * 1. Custom resolver returns valid ID (> 0)
- * 2. Standard resolver either fails or succeeds (platform-dependent)
+ * 2. Standard resolver fails
  */
 
 TEST(resolve_large_family_id)
@@ -1500,7 +1501,7 @@ TEST(resolve_large_family_id)
 	/* Test standard resolver (may fail) */
 	no_family_id = genl_ctrl_resolve(socket_alloc_and_conn(),
 					 LARGE_GENL_FAMILY_NAME);
-	EXPECT_TRUE(no_family_id > 0);
+	EXPECT_TRUE(no_family_id < 0);
 }
 
 /**
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ