From nobody Thu May 21 06:13:57 2026 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 4gLdQY2bzzz6fTHV for ; Thu, 21 May 2026 06:13:57 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gLdQY0nj0z3BmX for ; Thu, 21 May 2026 06:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779344037; 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=vhlSl2QPT4pj6wGZjYq/J49ZvyUC2iy5OLvg1kXOLWo=; b=A29EZZO66GqyM3zacRG5KzCLXIUQxvrQh74ZMhr5Z/uf2WJnOEY+BAn/9po3xGCCSTKdn8 t9kU5xJDM+JGZkNMRrU6LSmVDJskiFucYVbCy2/WWWaITS4I38wakUgTK8zMXMIC7Pr1dj dwoOBlqJ31UDMtF6usdx4xDKlX3hrzUPyGtSw/cqv63fFvkRRCQH19u3JcT5pjL2/+Bwz8 BzJNugOKhsE8h7Uav3vIvEecJSbTyO0xuI9zNkQcN+XM/2vGd/hN1AxTqoOM+xMjiosKl3 GwfTaTxQfgebKeqg9KQCNBolkSNw3fWJMV1crwqE5WIzSKMgO3KAJclaxZrWUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779344037; a=rsa-sha256; cv=none; b=JpAFsIjFuVqMEzJ3Gdv6sgV+bAk7xqyOpRJNaQ7QJb47OVKuzailjfEzNU7TLupYjBGaNo 7uBVbKCIJjlxIeSmkaK1MrOYZsEPhiv3Wr8iLWn+QLoieRjQKpXZfEiYcUwd1j5MeOmTyY sdN2FkWSGjsZBJOmDDKRjHcaKI5YHbCa69Yz4Y7C2oC9Puc6i+sqphieD8jYH5rZHRoR23 A+kg93HVhiQ1EPjoJwg4E9VXpBteFe7BPn7BGzMCH89InVkXeVS4P5FsdmKDpUzR01KuPF p5El4/y2oq1SkpVS6hO3JS6rCjNT7ata3aS94mKWkRMvXCvQaIgTweJBlwFxvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779344037; 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=vhlSl2QPT4pj6wGZjYq/J49ZvyUC2iy5OLvg1kXOLWo=; b=U8hvTPnM904yKgs/WSR39mZItDr2Nx9jvmpuubLzvAW0QdvlF64NLqYGFWHWmCBpYT0dJO sZZuBFoozkZW4kG0Miny2drzxr2nFWkN7Gs1u2iQzhMK+J1QmpQwSwUn1+InJ3HTKMqYAk DBm6ibjIcRH9chqTRSSUYHG5DTqxrMlPtWdQ1v5bAqET5/e/fB7y6+YAxjks3MMc+Q9llP 7DijyS8F1hu/nE4TSm6oaK1ptjPApUWmc8jnIegcZ3LLhrD/0aCIDuJ8MssIyVAeJKn+tZ PoW+Nmjr7SFZ44Oz+/udVWTw8bZXgtMw3hbfpzbyX1B83vOuvUUkS1bUABbCKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gLdQY0LZzz4qh for ; Thu, 21 May 2026 06:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34572 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 21 May 2026 06:13:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 1d0410fb349f - main - ping6: convert receive loop from pselect(2) to ppoll(2) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d0410fb349fded5a79db3c6e6d993eb9efcc10c Auto-Submitted: auto-generated Date: Thu, 21 May 2026 06:13:57 +0000 Message-Id: <6a0ea2a5.34572.49219d68@gitrepo.freebsd.org> The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=1d0410fb349fded5a79db3c6e6d993eb9efcc10c commit 1d0410fb349fded5a79db3c6e6d993eb9efcc10c Author: Mariusz Zaborski AuthorDate: 2026-05-21 06:08:46 +0000 Commit: Mariusz Zaborski CommitDate: 2026-05-21 06:10:49 +0000 ping6: convert receive loop from pselect(2) to ppoll(2) pselect(2) might overflow if the desciptor number is above FD_SETSIZE and silently corrupt the stack. Switch to ppoll(2) so the receive socket fd is no longer constrained by FD_SETSIZE. Reported by: Joshua Rogers of AISLE Research Team Reviewed by: markj MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D56721 --- sbin/ping/ping6.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c index f81de062e59a..b00b00ac8ce1 100644 --- a/sbin/ping/ping6.c +++ b/sbin/ping/ping6.c @@ -111,6 +111,7 @@ #include #include #include +#include #include #include #include @@ -1145,7 +1146,7 @@ ping6(int argc, char *argv[]) struct timespec now, timeout; struct msghdr m; struct iovec iov[2]; - fd_set rfds; + struct pollfd pfd; int n; /* signal handling */ @@ -1154,15 +1155,16 @@ ping6(int argc, char *argv[]) seeninfo = 0; continue; } - FD_ZERO(&rfds); - FD_SET(srecv, &rfds); + pfd.fd = srecv; + pfd.events = POLLIN; + pfd.revents = 0; clock_gettime(CLOCK_MONOTONIC, &now); timespecadd(&last, &intvl, &timeout); timespecsub(&timeout, &now, &timeout); if (timeout.tv_sec < 0) timespecclear(&timeout); - n = pselect(srecv + 1, &rfds, NULL, NULL, &timeout, NULL); + n = ppoll(&pfd, 1, &timeout, NULL); if (n < 0) continue; /* EINTR */ if (n == 1) {