From nobody Mon Jan 20 16:58:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGk33KRTz5kMqv; Mon, 20 Jan 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGk32c1qz3YCg; Mon, 20 Jan 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737392283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5RjYd/zbFLzTPMFPiwEMWtqhU88hXVL8TrGQh17GFo=; b=PsxI5Po4BPi/wdjbpWd8lrBTXl/YL2/C/G0TcD2G9oQXuzuetLVg1BzNVX+PBcDPzFDE0N t90LuBwnqGQEWqdMpuOD5p2opfaWNwefUKkgcaHbDOWgBMaUZnd9ZPk+h+POEMHKgNhGH5 J0fPqx6C46Htsz8FMmz0OoWQXxpfVxcF7JL4GwOdTb9rPaauytuVpuA2f/VPUI1Offx7MW oNuqBFozRbQhp0pvN5g46ydz6E4sxNQNQyIBuDhRSmcPZ+dVZzg3g9nDN660FqnF/BCKIY GIaB/3W0krC65lvqz+ejPEc0E/7s89xCcsfz8S98PCteingKES0qZg9HcQ4trA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737392283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5RjYd/zbFLzTPMFPiwEMWtqhU88hXVL8TrGQh17GFo=; b=rBdA9rN8JfJrJTjPEjLnHA5PlKb1T+1yVliGPVeqq2Wqa0pZtfMCakrHZPYo58cQvH5ykI 7LdoYqxRPRSy/eFHvbIv1LvOayTrhSUPmKKzZ2FSvGrFbMmlm3H4CHuuxEJch7HGxmOXeS vJe60X7eOSmr27n8z5UIlSa4z30UW61e2/JeqK7hlvEcRZCDLazvTBsdnzB9t3Va2D49b3 DVdOA/udH/5MhdLvQwafKO7cPR4/S+ej+uITGO5/i2vgsW7gshZ0IIlx1VuE9hYUrozW69 0He3KHSjBI+VHSLeH9B0L3zpE5rnEgy3MmHtRibgBTjBmfJ5ywLn2g7ys1uTUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737392283; a=rsa-sha256; cv=none; b=QWo1HhNopA4ir616ol1nV2GLed7tWyCwxlvf3Ql7nj3SnPNl8p8Sc6UTKvUd1lZWBK5plV tcPGND4Rmol1OkAMqbHLrEvbZv3udf8OQRfROwSGNH71q85Ojj4wa4LyS7hZelUawvAEVd yqfHsVOgHXPtMUB0C6Cq5R+9FxWCxdR++EW4Yo9g+0Zo3E2iNfd2epnc96FGbOwvO/D7yD FrcmGRVwLPl0dWrgDM463FESLPsL4BiVFyqXK1dJH5Q1QzogiPG6AFoRaUeWr6cdT/zc19 F8pMelWbwBy2o310WBQawpwmn+1p/ShXrvvfyD+ZigheUHPI86LBNKH5BFv5VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGk31klPzCmH; Mon, 20 Jan 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGw3H4069188; Mon, 20 Jan 2025 16:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGw3Z6069185; Mon, 20 Jan 2025 16:58:03 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:58:03 GMT Message-Id: <202501201658.50KGw3Z6069185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 3dc01440a064 - stable/14 - Fix lib/libc/nss/getgr_test with large numbers of groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3dc01440a064c95bc5f125acf7c0ef6acbb5c257 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc01440a064c95bc5f125acf7c0ef6acbb5c257 commit 3dc01440a064c95bc5f125acf7c0ef6acbb5c257 Author: Alan Somers AuthorDate: 2024-12-31 20:41:01 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:54:45 +0000 Fix lib/libc/nss/getgr_test with large numbers of groups These tests create a linked list with one entry for every group on the running system. On a system with about 30,000 groups, the test took 69 seconds to run, and crashed Kyua with the below error: kyua: E: string or blob too big (sqlite op: sqlite3_bind_blob) (sqlite db: /root/.kyua/store/results.usr_tests.20241231-203317-570235.db). Fix the test by limiting it to operating on the first 1024 groups. Apply the same change to getpw_test and getserv_test too, which are vulnerable to the same problem. Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48275 (cherry picked from commit d11904b350214943dedb64c7121d4602799d7afd) --- lib/libc/tests/nss/getgr_test.c | 4 ++++ lib/libc/tests/nss/getpw_test.c | 4 ++++ lib/libc/tests/nss/getserv_test.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c index 7c0e265fa6f6..974632d4b7c7 100644 --- a/lib/libc/tests/nss/getgr_test.c +++ b/lib/libc/tests/nss/getgr_test.c @@ -293,6 +293,8 @@ group_fill_test_data(struct group_test_data *td, int (*cb)(struct group *, void *)) { struct group *grp; + const int limit = 1024; + int count = 0; setgroupent(1); while ((grp = getgrent()) != NULL) { @@ -303,6 +305,8 @@ group_fill_test_data(struct group_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endgrent(); diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c index 3a44497cf848..434d86a31591 100644 --- a/lib/libc/tests/nss/getpw_test.c +++ b/lib/libc/tests/nss/getpw_test.c @@ -240,6 +240,8 @@ passwd_fill_test_data(struct passwd_test_data *td, int (*cb)(struct passwd *, void *)) { struct passwd *pwd; + const int limit = 1024; + int count = 0; setpassent(1); while ((pwd = getpwent()) != NULL) { @@ -250,6 +252,8 @@ passwd_fill_test_data(struct passwd_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endpwent(); diff --git a/lib/libc/tests/nss/getserv_test.c b/lib/libc/tests/nss/getserv_test.c index 486a8c20836f..cc66fdb2fa52 100644 --- a/lib/libc/tests/nss/getserv_test.c +++ b/lib/libc/tests/nss/getserv_test.c @@ -283,6 +283,8 @@ static int servent_fill_test_data(struct servent_test_data *td) { struct servent *serv; + const int limit = 1024; + int count = 0; setservent(1); while ((serv = getservent()) != NULL) { @@ -290,6 +292,8 @@ servent_fill_test_data(struct servent_test_data *td) TEST_DATA_APPEND(servent, td, serv); else return (-1); + if (++count >= limit) + break; } endservent();