From nobody Sat Aug 26 18:22:34 2023 X-Original-To: dev-commits-src-branches@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 4RY4tM1jCXz4qr45; Sat, 26 Aug 2023 18:22:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RY4tM13mqz4G1c; Sat, 26 Aug 2023 18:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693074155; 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=3/B/Ui7bte5746gchZ/kGpRKNjGQVuxAHVAHOrn20Z0=; b=EMox5uF/uh66Iayr1sYDtHyNTLQkvfip5DbCGQIm4herbEo35iYMmWoIJA4B4HXVlHoolC bQHuStCsydZKqp2l2ZD4lV/uAUAMyiuCd8DTiY5MX451s89NnIfEhPxNP45/NuSykPuoI0 RXrnMyzUU/Nj8teSjqBjwgrLKdBrpAcSpunkZ0+ni7wdNu/z2VqDMUFE264FP6Zq0E2Sf0 zjioUo6QCc3WfbCjic5fhMlI+mDygD0Op5OYL2FofqxoZrgw0npBbAksskICZsvmupuk6V wiwtU3ZaXJvCWDg5+lSYzoHrRMWPNKS9Lyr5zd6wfy+xk2ED3/pjuOrKiKpWow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693074155; 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=3/B/Ui7bte5746gchZ/kGpRKNjGQVuxAHVAHOrn20Z0=; b=MLxTonxsQf0qZFJfDVcWDW27ipeqiXOHyxcvD2yZHhDUOJRD1Glbo9zuZj85pjZa19RYzA +uRcqTEjI5M2TS1lWxdHOi9e+2wntWFZYc2Paa03bZALZrGsaSTMq01vzjdcs4wnsiSGUA 5VfAc+W9y1u1jCt4Bah5qazAOiy9EzXyCArTl/4W2p4qyDbbqhP/9tBhb0pLD4XPeRx12I 7Lg7fLFWWl45yFdYkyfKpMDqhXxuUxmeGl4jRccOji+YPYEcqBEd+6COhoajwoj71YZLX8 WvM/HXipdEV3xvhoBp8uForQeDjSXUriMl9SMu2oTXAuxeHMQc2wWDdJgejNXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693074155; a=rsa-sha256; cv=none; b=gG8iPLAqub/T2avX/8rN/kOfwqOqbqGp8HUO+/Utk4gkerIP8AYAaddvZwmAZKK4u+3ETk y+g2D4GUqQefhpjMrOoe9CH6wxSdoJ51+FiO1ZfguprFch8jXw7rj8npc9+75pHmiYIpf4 DblxMn8H6FotMc1vWxAGJdtMy31zbNXSGytn1oVTYcvnVFOKK6rRUMa2PXA6pw6bZLGd+y AyimKW8kKBpFNWKxzzWVhh+XjstgtGWBDiqsY9MtDPmdoYJgOHhDPcrWIUT62AAUgA924J ggVQZOAZA32L4hPncYdmE8w+/Z+rtO9Aokc+BdsRUXPmrYOETl/OPf+g1zssrQ== 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 4RY4tM06mFzlfT; Sat, 26 Aug 2023 18:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37QIMYXx080394; Sat, 26 Aug 2023 18:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37QIMYc0080391; Sat, 26 Aug 2023 18:22:34 GMT (envelope-from git) Date: Sat, 26 Aug 2023 18:22:34 GMT Message-Id: <202308261822.37QIMYc0080391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: b67a8f006d3c - stable/13 - etc: remove leftover leading empty comments, blank lines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b67a8f006d3c35062c506b2cf575eb55798493b6 Auto-Submitted: auto-generated The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=b67a8f006d3c35062c506b2cf575eb55798493b6 commit b67a8f006d3c35062c506b2cf575eb55798493b6 Author: Mike Karels AuthorDate: 2023-08-22 18:03:28 +0000 Commit: Mike Karels CommitDate: 2023-08-26 18:20:25 +0000 etc: remove leftover leading empty comments, blank lines Remove leftover empty leading comments/blank lines that had been spacers between $FreeBSD$ and the following content in config files in src/etc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D41548 (cherry picked from commit 9d6049d5da8ce70b3f815431bdedcee9c04f60cc) --- etc/group | 1 - etc/mail/Makefile | 2 -- etc/master.passwd | 1 - etc/mtree/Makefile | 1 - etc/mtree/README | 1 - etc/root/dot.k5login | 1 - etc/shells | 1 - 7 files changed, 8 deletions(-) diff --git a/etc/group b/etc/group index c9aa917b99f0..35df51838ae4 100644 --- a/etc/group +++ b/etc/group @@ -1,4 +1,3 @@ -# wheel:*:0:root daemon:*:1: kmem:*:2: diff --git a/etc/mail/Makefile b/etc/mail/Makefile index bbbdc1a96dc6..fd4801b0c336 100644 --- a/etc/mail/Makefile +++ b/etc/mail/Makefile @@ -1,5 +1,3 @@ -# -# # This Makefile provides an easy way to generate the configuration # file and database maps for the sendmail(8) daemon. # diff --git a/etc/master.passwd b/etc/master.passwd index de05fbfca808..11707f401e5a 100644 --- a/etc/master.passwd +++ b/etc/master.passwd @@ -1,4 +1,3 @@ -# root::0:0::0:0:Charlie &:/root:/bin/csh toor:*:0:0::0:0:Bourne-again Superuser:/root: daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin diff --git a/etc/mtree/Makefile b/etc/mtree/Makefile index 1fa51e4a8153..1a70f5fd3a52 100644 --- a/etc/mtree/Makefile +++ b/etc/mtree/Makefile @@ -1,4 +1,3 @@ - .include PACKAGE= mtree diff --git a/etc/mtree/README b/etc/mtree/README index fd4a062552d9..bd813057b5bd 100644 --- a/etc/mtree/README +++ b/etc/mtree/README @@ -1,4 +1,3 @@ - Note: If you modify these files, please keep hier(7) updated! These files are used to create empty file hierarchies for building the diff --git a/etc/root/dot.k5login b/etc/root/dot.k5login index 5721e640fe21..c3b55dfc6f0b 100644 --- a/etc/root/dot.k5login +++ b/etc/root/dot.k5login @@ -1,3 +1,2 @@ -# # user1/root@YOUR.REALM.WHEREVER # user2/root@YOUR.REALM.WHEREVER diff --git a/etc/shells b/etc/shells index a8b2942e1257..0e8674ba884d 100644 --- a/etc/shells +++ b/etc/shells @@ -1,4 +1,3 @@ -# # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. From nobody Sun Aug 27 00:51:27 2023 X-Original-To: dev-commits-src-branches@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 4RYFW35SCcz4rGLN; Sun, 27 Aug 2023 00:51:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYFW34nH2z3PKY; Sun, 27 Aug 2023 00:51:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693097487; 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=j8SUxiME+NndK34D1iFZtq8IWxMs0Jv8BCOLdveK9nw=; b=sJ6jjbFiG9OdIlHy4B3uMnzfev8dGnmLKvNvfULp0TwYRl5r0wGv76GNksXhyuXLuGxjSQ wMxjNdtkUUJ1nbvJOfEWki4eSuHKqrbMb4wZ9/Z/kk6un4Jad1xtVIRoSbs60Jn57HmpTR Pr64KaFg+k/Y+S+AB0MOT2ssIEUoBzxhoiLHtasFTPLvgxgFUdOjjeS/Lau8Cni7iIAAGF OwEmSqENKFrGWyiy5dYJXnoCIxcjEnVjq8CICL3519MptFkNJ/gaq7WC1nRr0Lx2ffb9F6 d/H+uwBagi29TK5gopDXaKVlpdfyutYUvEk4B6LWpl3tohLHsNlt80xzaCYTXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693097487; 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=j8SUxiME+NndK34D1iFZtq8IWxMs0Jv8BCOLdveK9nw=; b=v/MipwSb1eqJa3i8PDyixhcCCbmKXQKRitva6HnEMhV+FLvUfqs5DiLSILVfrx/4yZDjpg 3lNMVyEwKB16xamXhXYVD0+HNna2SA4TUXcs0a770zT06mbFAf9NNxKF2N9bwFoQkROQ2h NG236SOAcf2cgdD6WpTniwOgIL94obuifs2WlRSeT+7d26RxTyjDl4/5m2QjfpQaNjijr0 aQvm04L37qE/VbFB/V+B4eIRey1yx53E0z5aBHFUN/aSBPsIfIl6IIgMt4p+s/FpwhQVOr pkDi/V3iiEBv0WJ4R9X+YZwZZD9+gxTuTWe8Vfv/ZkBq7hY32bBICxWu9ArsIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693097487; a=rsa-sha256; cv=none; b=bQ1Ql0yHFw7lJF46k+yDtKnm0fwSiqRsD05r0j5+u2Sy77meXB4+gD9LFu15xvBugeYzQ+ o09RpCsc+f3YTUyKJF+uJVyYYocMWy1ffxUhjzdys6scfRbbqu0bGahtzBPpohaliG2Vy3 6uvTO1f23TKoN42BsdpIEESdMisFvAa+MMnM+/icZa+QlJkVKuywY+REAgq2P5HvpPziXS N4tlfjNG6soWGPO7ML0RaMvJDkQEV/9EsNkAh1k1sk6OK0sHBK4R/KqB0BsUYMbSoR9imY Hsj/t+dKh6IXjYCS5nNJzf3Wy63X65SB3Npw/f7BNXzX8w6dNzt0IrXoDX8/sw== 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 4RYFW33rlpzwgY; Sun, 27 Aug 2023 00:51:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R0pR4A027427; Sun, 27 Aug 2023 00:51:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R0pRbK027424; Sun, 27 Aug 2023 00:51:27 GMT (envelope-from git) Date: Sun, 27 Aug 2023 00:51:27 GMT Message-Id: <202308270051.37R0pRbK027424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cee16ae06de7 - stable/13 - rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls method List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cee16ae06de7c08cf97c918d73cfac33cc056a2d Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cee16ae06de7c08cf97c918d73cfac33cc056a2d commit cee16ae06de7c08cf97c918d73cfac33cc056a2d Author: Konstantin Belousov AuthorDate: 2023-08-18 19:52:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-27 00:50:17 +0000 rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls method (cherry picked from commit b1d3e2b771552af071bf0964233cc5a76ea25542) --- libexec/rtld-elf/rtld.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index e3f87c6504a5..e8b901bda634 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5943,8 +5943,10 @@ distribute_static_tls(Objlist *list, RtldLockState *lockstate) obj = elm->obj; if (obj->marker || !obj->tls_static || obj->static_tls_copied) continue; + lock_release(rtld_bind_lock, lockstate); distrib(obj->tlsoffset, obj->tlsinit, obj->tlsinitsize, obj->tlssize); + wlock_acquire(rtld_bind_lock, lockstate); obj->static_tls_copied = true; } } From nobody Sun Aug 27 00:51:28 2023 X-Original-To: dev-commits-src-branches@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 4RYFW46HfGz4rGS3; Sun, 27 Aug 2023 00:51:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYFW45lXcz3PL0; Sun, 27 Aug 2023 00:51:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693097488; 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=1EEUMvQtGNvrV2ActBlMdfqLnnE6i6EZ+pBXvn8cklI=; b=TmXNTo/dLqdfmQgNji3LUPJJVaABDl0R0Zu/+tL+GOboG4I+zRKCKOo2iiZ78FTlQBHMCt 6Yt5G8J47qaG1X6ePoA8mkD6jVvPQg5x8J4yrokou3Y6P0nt18TB3jkTnZ1LCvASIR2NJY Nq4/8v658g4GUK1DpWsfK159QDjmlXXEyyIyWTB6x5gi6+ErxviuH/qsiRby0vS03NmwmC Ho2oiefq1keuMej2LOozku7q4v+wPwhxwDpmAOf7NrT0xpimw4VZO11xhC5UzZs1sZRuLz +9qgb4PynvMDuPsKMEbOOqunI0zmsyc5vEICUqQkm5ZU/GN9kI87n1Xo/Z6tHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693097488; 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=1EEUMvQtGNvrV2ActBlMdfqLnnE6i6EZ+pBXvn8cklI=; b=sYhfFPdW7sduSI8eBGs8sgQLr0dWpnwnTjbgn6j+Af/Wb30CMll15pPhxByl6Cg+aF//jo ClW8qD3g4tLcqThqEKqkqxyJCQbwBBbpBS5g9QpcKg4XltYRn58LrsuzpOi1ib3sb1Bd8W pmEet4OB5L4LpL7mUrbgpSTnn2O3VDj1wzB5eCzIX4GGxYhVSYd7jPm18hvEvhBH4GDhKJ oxvEITr7diWfVDLhWw2z98REn+doIp5lWDE5Xy6bBfYlvfOgTXkyjo7O1pzN/rbeLlnHPW cMLDuCreUpsOlqfAnMGXmWTJzcOMpZ8X1e+Tj7lX7MXfu18f7Uk2PcjIv1Hr1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693097488; a=rsa-sha256; cv=none; b=rBj8TLOz9gbTMHQTz2sUy9IY1FV1J6ydfSz51YAREQLHZGQcJ9Thaf3tlfaRe3Vgjye5eh WKv4SzMdGNoGwhFGj7XEsMV2qMuMZVBB1hcqso3ar08R9PRUd7otsFIp43RDNnibLenLfO FDS1FV0nmCpSNKmPGKs2vonqPxyMTcoGKGJ95mKoRODcBJozcMwy956rA/jFLABvck0dZ4 pYese0crUsKfFDGGyHJBt9p0WG435bFdOwsb5cCsEehHXpcdybfpspW3kJZ9/OlxbzM+Jw 3Nv/nGXSHGdvLh1X73TKWsUpXOL3PF+0sSYRxDa+aYXRQpIsaTtYYz5QYX+/GQ== 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 4RYFW44pHSzwLk; Sun, 27 Aug 2023 00:51:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R0pSM3027466; Sun, 27 Aug 2023 00:51:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R0pSCB027463; Sun, 27 Aug 2023 00:51:28 GMT (envelope-from git) Date: Sun, 27 Aug 2023 00:51:28 GMT Message-Id: <202308270051.37R0pSCB027463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c8364bf62ef5 - stable/13 - libc: export pthread_getname_np stub List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8364bf62ef5d3e43643b7be5daa050e3f7e2bf1 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c8364bf62ef5d3e43643b7be5daa050e3f7e2bf1 commit c8364bf62ef5d3e43643b7be5daa050e3f7e2bf1 Author: Minsoo Choo AuthorDate: 2023-08-14 22:21:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-27 00:50:17 +0000 libc: export pthread_getname_np stub (cherry picked from commit 0dc52b72108e321a99022785713c58d278696af2) --- lib/libc/gen/Symbol.map | 1 + lib/libc/gen/_pthread_stubs.c | 13 +++++++++++++ lib/libc/include/libc_private.h | 1 + lib/libthr/thread/thr_info.c | 7 ++++--- lib/libthr/thread/thr_init.c | 1 + lib/libthr/thread/thr_private.h | 1 + 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 9dd7334728a4..bdd659197644 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -426,6 +426,7 @@ FBSD_1.6 { eventfd_write; getlogin_r; memalign; + pthread_getname_np; scandir_b; sigandset; sigisemptyset; diff --git a/lib/libc/gen/_pthread_stubs.c b/lib/libc/gen/_pthread_stubs.c index 6741c6a5ec51..25dfeb2cc270 100644 --- a/lib/libc/gen/_pthread_stubs.c +++ b/lib/libc/gen/_pthread_stubs.c @@ -58,6 +58,7 @@ static int stub_fail(void); static int stub_true(void); static void stub_exit(void); static int stub_esrch(void); +static int stub_getname_np(pthread_t, char *, size_t); #define PJT_DUAL_ENTRY(entry) \ (pthread_func_t)entry, (pthread_func_t)entry @@ -131,6 +132,7 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = { [PJT_MUTEXATTR_SETROBUST] = {PJT_DUAL_ENTRY(stub_zero)}, [PJT_GETTHREADID_NP] = {PJT_DUAL_ENTRY(stub_zero)}, [PJT_ATTR_GET_NP] = {PJT_DUAL_ENTRY(stub_esrch)}, + [PJT_GETNAME_NP] = {PJT_DUAL_ENTRY(stub_getname_np)}, }; /* @@ -289,6 +291,7 @@ STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void *, STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, void, int) STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, void, int) STUB_FUNC2(pthread_attr_get_np, PJT_ATTR_GET_NP, int, pthread_t, pthread_attr_t *) +STUB_FUNC3(pthread_getname_np, PJT_GETNAME_NP, int, pthread_t, char *, size_t) static int stub_zero(void) @@ -337,3 +340,13 @@ stub_esrch(void) { return (ESRCH); } + +static int +stub_getname_np(pthread_t thread, char *buf, size_t len) +{ + if (thread != &main_thread) + return (ESRCH); + if (len >= 1) + buf[0] = '\0'; + return (0); +} diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index dcd9d84eaf87..593d106f3af6 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -184,6 +184,7 @@ typedef enum { PJT_MUTEXATTR_SETROBUST, PJT_GETTHREADID_NP, PJT_ATTR_GET_NP, + PJT_GETNAME_NP, PJT_MAX } pjt_index_t; diff --git a/lib/libthr/thread/thr_info.c b/lib/libthr/thread/thr_info.c index b5b84b733db6..41ab7f0bcf0c 100644 --- a/lib/libthr/thread/thr_info.c +++ b/lib/libthr/thread/thr_info.c @@ -114,9 +114,10 @@ thr_get_name_np(struct pthread *thread, char *buf, size_t len) buf[0] = '\0'; } -__weak_reference(_pthread_getname_np, pthread_getname_np); +__weak_reference(_thr_getname_np, pthread_getname_np); +__weak_reference(_thr_getname_np, _pthread_getname_np); int -_pthread_getname_np(pthread_t thread, char *buf, size_t len) +_thr_getname_np(pthread_t thread, char *buf, size_t len) { struct pthread *curthread; int res; @@ -147,5 +148,5 @@ __weak_reference(_pthread_get_name_np, pthread_get_name_np); void _pthread_get_name_np(pthread_t thread, char *buf, size_t len) { - (void)_pthread_getname_np(thread, buf, len); + (void)_thr_getname_np(thread, buf, len); } diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index ef8c7d59d729..b59678c3f6c3 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -271,6 +271,7 @@ static pthread_func_t jmp_table[][2] = { [PJT_MUTEXATTR_SETROBUST] = {DUAL_ENTRY(_thr_mutexattr_setrobust)}, [PJT_GETTHREADID_NP] = {DUAL_ENTRY(_thr_getthreadid_np)}, [PJT_ATTR_GET_NP] = {DUAL_ENTRY(_thr_attr_get_np)}, + [PJT_GETNAME_NP] = {DUAL_ENTRY(_thr_getname_np)}, }; static int init_once = 0; diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index fba3b78e43c5..3475029f8996 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -1073,6 +1073,7 @@ int _thr_cond_wait(pthread_cond_t *, pthread_mutex_t *); int _thr_detach(pthread_t); int _thr_equal(pthread_t, pthread_t); void _Tthr_exit(void *); +int _thr_getname_np(pthread_t, char *, size_t); int _thr_key_create(pthread_key_t *, void (*)(void *)); int _thr_key_delete(pthread_key_t); int _thr_setspecific(pthread_key_t, const void *); From nobody Sun Aug 27 00:51:29 2023 X-Original-To: dev-commits-src-branches@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 4RYFW604Qqz4rGGn; Sun, 27 Aug 2023 00:51:30 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYFW56hVkz3PfM; Sun, 27 Aug 2023 00:51:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693097489; 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=y5hPCYaE6S/nOPLCeSdTsF8MnC4KwwONarn+XdJPJ1E=; b=lxsvhZR9UaOsV+8Fb4W8fBXc+MataAjdY7vkpz/VwL5lVfUxQSa6zKPOAyEoGboVjO7G23 RXPtBUM8i4/8ErOhbU7TbDMQmuCtjVnpvUt4eRjdV0D07AWhBM+mjdj1mvPut0amwvKC0S VwS3fqGAjrg05RpKXZim2QW4CmEZBD8llxzT2LJiYBgbOpRFu96yOBHmx7iYE00RNGP3XZ arnJQMXifbKXRkFdtqR+uGha8U86FDboYzLfo3B091ik0cTkJLpWpumMb14+cNFNC3hfQE a+s+UtvIanKk9MHsTTyLSP6RVoU5aEA8mHx9uMj2Lf1X8NzB1i04G/3kVadI3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693097489; 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=y5hPCYaE6S/nOPLCeSdTsF8MnC4KwwONarn+XdJPJ1E=; b=RXVNpZeMxfD40mQLYPTq4o+ODH5a6Rv8q7dsbyEqp0JKBJQFgEKmeGEBe7Oy1m+6ofvV00 satn/t1F9CsRq/3uwPtxs+F3uSBz+Gzn7RXbogiZ1/5LCcM55T1W3lfG7Az1pxwTChzHfH /jDRXe4Eas/AUAJ45XAFFSPFAag5trWBNE95u2OaXMb3m0VbY9pIPlBKhoTXuZ7K4jMYx/ h6JNFGqUWez/NIk79czv0CQdag7qU/dDdcFYSgWP9lCNAXhqEF7iiYzCOFNfF6TxAarn5Q BO7XPP9/gMC0tnAb3ypx3zG5vNXBBlUJr89RLch6K5R+nQUonF04RUjQg95bMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693097489; a=rsa-sha256; cv=none; b=fxQDlrkoeAUNnwX1bL+bAAYKDYmr5ziUodw+J5hI/Eqr6dzRef2YWO2AxeQPzRNF2kufBf FmeVgfI7aulYaGvJmmr4VDnVcU7Sw2mEnzpFSnK2jUK+yDT5Khwt5h7nZu19bvtr7Tvbkd j0KpM3O8B8IIUkFkWtYJ3NL1u7x8eLmJEDymidYOCApJuIkmHB7SxHDgIvJml9Ig4IeTaw F5q7JqFNUi2GJVcRFP3ZdfAhPgdI/UOINGjKA9lLkE96CJuIX+nOsABleGsJIdGqmEdJyB Ci+1Tpo9FfiiZdVSRa7oCUNaVwIzE0mUj5txFPYZ+ej3tJS+D5QGdIRWXmNBWg== 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 4RYFW55mVXzwgc; Sun, 27 Aug 2023 00:51:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R0pTUL027512; Sun, 27 Aug 2023 00:51:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R0pTda027510; Sun, 27 Aug 2023 00:51:29 GMT (envelope-from git) Date: Sun, 27 Aug 2023 00:51:29 GMT Message-Id: <202308270051.37R0pTda027510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e00b30ba6e6a - stable/13 - libc/gen/_pthread_stubs.c: Remove stray whitespaces List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e00b30ba6e6a7790a3e311b9fdf77980a69c0b86 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e00b30ba6e6a7790a3e311b9fdf77980a69c0b86 commit e00b30ba6e6a7790a3e311b9fdf77980a69c0b86 Author: Konstantin Belousov AuthorDate: 2023-08-20 22:32:43 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-27 00:50:17 +0000 libc/gen/_pthread_stubs.c: Remove stray whitespaces (cherry picked from commit 89e17c6ea03f27dfe4734b024d807d12840db226) --- lib/libc/gen/_pthread_stubs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/_pthread_stubs.c b/lib/libc/gen/_pthread_stubs.c index 25dfeb2cc270..34e420ec11f5 100644 --- a/lib/libc/gen/_pthread_stubs.c +++ b/lib/libc/gen/_pthread_stubs.c @@ -51,7 +51,7 @@ struct pthread { static struct pthread main_thread; static int stub_main(void); -static void *stub_null(void); +static void *stub_null(void); static struct pthread *stub_self(void); static int stub_zero(void); static int stub_fail(void); @@ -242,7 +242,7 @@ STUB_FUNC2(pthread_mutexattr_getrobust, PJT_MUTEXATTR_GETROBUST, int, void *, int *) STUB_FUNC2(pthread_mutexattr_setrobust, PJT_MUTEXATTR_SETROBUST, int, void *, int) -STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) +STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init, PJT_RWLOCK_INIT, int, void *, void *) STUB_FUNC1(pthread_rwlock_rdlock, PJT_RWLOCK_RDLOCK, int, void *) From nobody Sun Aug 27 07:11:41 2023 X-Original-To: dev-commits-src-branches@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 4RYPxn5WyLz4rb8V; Sun, 27 Aug 2023 07:11:41 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYPxn523Sz4XDQ; Sun, 27 Aug 2023 07:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693120301; 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=W6gKTgunrxiGyvkVneSERxs0DrhGt06eigF5WxoOCzU=; b=AW72FtI2VivOEcKyHzp/qU1opr6Q96B0lLYVTrgzvdlCr8Mvts1CnSVWqTrKx2CNlJXvq1 CwiC9cWIy/36WBjGc86Wf9wuUfUgkqIhr+BsFBaDMo2GEEdcgHkHuMSilofDxvUNMTyKX/ 2GHiMHe4iFhew73e8FyLyUODPjHpiLjgQV11RwC7lIooZ33hOA6mUtK8314YG1+u5wQWph 08xDPdA8P58wVB751R9Hfk8aXcdDF2uMtztrlYE2JPUT87b1TojFX+xgMtYd0/vkZ5PuWp P1MjtNLkwlhZnqCt8yjucTwFtCh+NRQKT+Oj98HPLYMmYGs/9mLOxarkY5HBZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693120301; 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=W6gKTgunrxiGyvkVneSERxs0DrhGt06eigF5WxoOCzU=; b=bY3ui3jTniKkMQpc3ZZIyt2xoa0/dndsmIpwD6EtlUHbzcbF7s0KG5nKXj92Ci1Eb5mM0h bIcI7pYGl362alTNc2msYE85KufZLX4nRrmlg5Eqj14a9ZQhzTBe3UiL7bvffoLMZ6IgWV 2FzLtrZ37rKkIPe9EXB9CDP69K0va3myfIZOTcb8wp2z/YaEQcqGjYZMGhZxp3zN7b7Ube KcsOfTiseUUyKR1udCx7KDFb/pfzB+4dnyLeV7ixfINZJgSRrIcQW2MN+y97cojZ9xaODo iXib1uTNt2Nsl21Py2ee3ZP0mClFO0MXA0452wecgMVCKCR2UhJL9ZsQcNt2tA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693120301; a=rsa-sha256; cv=none; b=TSwRX+AybAvtrAGl8+ao4T395FJwJ1OmZ5kDpPpxm/8FcExvPg1dW5HJHav3PB0eab8rNF VN3UmZSFnf/zwKDpQ/eH7EUY7mQtcuizQS6PQXF5wh1qapWn1HHcfVcGxX2oGF2Q0NSHBH d2DH4VyZ58zko8FxEY2uNM72UV4/64nhO5q9S1XYsmoo7dCqsplkqJICgHRPY5Jk7Dg9Gk lYc7iOBMOrUMltGtdbHyh1TDZAfhwpW95lh2XXQDV7jI9wCJWvp6D71vEoOfexramG+se9 7hDOuenIMzKqCOcmMt4SzR98t9adb07q9TAO4lpsHmRwVSp8mTuj3Ql15CnntA== 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 4RYPxn40R9z2kP; Sun, 27 Aug 2023 07:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7BfVB062834; Sun, 27 Aug 2023 07:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7BfiW062831; Sun, 27 Aug 2023 07:11:41 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:11:41 GMT Message-Id: <202308270711.37R7BfiW062831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 62729a88b85d - stable/12 - libthr: add pshared_destroy() helper List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 62729a88b85d3ab6fb61940594b0882e7062cc32 Auto-Submitted: auto-generated The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=62729a88b85d3ab6fb61940594b0882e7062cc32 commit 62729a88b85d3ab6fb61940594b0882e7062cc32 Author: Konstantin Belousov AuthorDate: 2023-02-01 21:06:04 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-27 07:10:45 +0000 libthr: add pshared_destroy() helper (cherry picked from commit 3cf37d1251bf71b2171e67af8f2ca43cbe3d874d) --- lib/libthr/thread/thr_pshared.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_pshared.c b/lib/libthr/thread/thr_pshared.c index 83714785f9b1..56def22f9ab9 100644 --- a/lib/libthr/thread/thr_pshared.c +++ b/lib/libthr/thread/thr_pshared.c @@ -208,6 +208,17 @@ pshared_clean(void *key, void *val) _umtx_op(NULL, UMTX_OP_SHM, UMTX_SHM_DESTROY, key, NULL); } +static void +pshared_destroy(struct pthread *curthread, void *key) +{ + void *val; + + pshared_wlock(curthread); + val = pshared_remove(key); + pshared_unlock(curthread); + pshared_clean(key, val); +} + void * __thr_pshared_offpage(void *key, int doalloc) { @@ -243,13 +254,9 @@ void __thr_pshared_destroy(void *key) { struct pthread *curthread; - void *val; curthread = _get_curthread(); - pshared_wlock(curthread); - val = pshared_remove(key); - pshared_unlock(curthread); - pshared_clean(key, val); + pshared_destroy(curthread, key); pshared_gc(curthread); } From nobody Sun Aug 27 07:11:42 2023 X-Original-To: dev-commits-src-branches@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 4RYPxp6H2Rz4rZvq; Sun, 27 Aug 2023 07:11:42 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYPxp5p3Kz4XGs; Sun, 27 Aug 2023 07:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693120302; 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=Hkp+jurjM2QgnV9DBvt6zJOoRhHt9C8IKKEzYs5opLw=; b=Blmm4sjXSOvjlJWpi9VGTPGwkDHlf0TYAJL+7jWPzrZ55JwME8Km+LE9UmIk0TAKil4TE1 vJTP3DpbwLLJkHbU2iEN8OCuVLA1LNbGBvlfFxXNB9E2oGM2N+Cjwu14rYXtNQDEnU2gWF TsTmmFvwq7YlmKddjVon9Zj5lkrmnSqXEMORj+U2Wb7aK9+N13a1sCoa3Qoq3vZXWrgEQp FPyDLNqMw4XBNQOByaPO8XX0pn44g/fxuxRxohIQ/7xKroSYW2rGsNaOJKcfQrhdjlg4DN 7nsgrnVxebHIN5TnCOmboNRYlGWwCAHibQCp/rYX8Iq+wPNyNi/rZL0rhTc/aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693120302; 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=Hkp+jurjM2QgnV9DBvt6zJOoRhHt9C8IKKEzYs5opLw=; b=td2ZpUHRNDwtdsqgsEFAUyhfXZH1x3hvReyYDgqtPXIwbezFh/9KRoVNjBimelCA1U2oXH /Zlg9rTPMIa5Kwht+OdvbF5cawOfYP/EDwPl2BZ10jlp7SQetGSSXE/zMZW7IidDTa6wRD 43ALyP6XhSxIxWIbJ8FVHbNqwTaK7jQ3sXDtiAGeufpOcpcCmizr1fEmWUj8Nc6ofEKRr7 i6W0vwpv1+aVlYr/PoVKxd69kpkF9+2T4NF2FeEKfiVDZ/5kxLv83hvcogMvvgAWxjHxxm PiagaTdSSI+K/dVIBMTKPqqmwiizqvGS5gRmUON1AR8NKA7I/trLIAqKxzFslA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693120302; a=rsa-sha256; cv=none; b=mjvyQDczBeieIorRDD5+QwU76wSXmBeYOeBVwmiPNUTqNboBE4wFmbud5eTw6oJ1yTlZ+b +izXvZRmfP0PyzDnKbNMJs95kVCK7rLWMUi3KrHyzRKJvhkcK2hERhuXyYTFiKabJhQSIw RzCNG3HBt+iLgC51AwcGBbUsSRpOBQhbjBcMAq9yZf4CHybn8B4XIJMpoCsQfrCLcek7uD zBuT6pTshbxTiaAla85On0eybjq+F6bOYfwUUNR+Vm5k/RsJOq4/rVX038etEdImXcqk7S 2ZW8UUTxk3iI9FvhZr3mgp8kDoGjt6VJncQKlJ4ajmEsSXhDZ5jh7BeTSqOg+A== 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 4RYPxp4kZvz2pL; Sun, 27 Aug 2023 07:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7BgEg062883; Sun, 27 Aug 2023 07:11:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7Bg7k062880; Sun, 27 Aug 2023 07:11:42 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:11:42 GMT Message-Id: <202308270711.37R7Bg7k062880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e579e7e3281f - stable/12 - libthr pshared: correct a bug in allocation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e579e7e3281f8f096d5a3ca341adcf26bb0df765 Auto-Submitted: auto-generated The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e579e7e3281f8f096d5a3ca341adcf26bb0df765 commit e579e7e3281f8f096d5a3ca341adcf26bb0df765 Author: Konstantin Belousov AuthorDate: 2023-02-01 20:12:45 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-27 07:10:52 +0000 libthr pshared: correct a bug in allocation PR: 269277 (cherry picked from commit 25c862ae503a1c99458f4e055fd50c878fadbea3) --- lib/libthr/thread/thr_pshared.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_pshared.c b/lib/libthr/thread/thr_pshared.c index 56def22f9ab9..3f303d52c2de 100644 --- a/lib/libthr/thread/thr_pshared.c +++ b/lib/libthr/thread/thr_pshared.c @@ -227,11 +227,16 @@ __thr_pshared_offpage(void *key, int doalloc) int fd, ins_done; curthread = _get_curthread(); - pshared_rlock(curthread); - res = pshared_lookup(key); - pshared_unlock(curthread); - if (res != NULL) - return (res); + if (doalloc) { + pshared_destroy(curthread, key); + res = NULL; + } else { + pshared_rlock(curthread); + res = pshared_lookup(key); + pshared_unlock(curthread); + if (res != NULL) + return (res); + } fd = _umtx_op(NULL, UMTX_OP_SHM, doalloc ? UMTX_SHM_CREAT : UMTX_SHM_LOOKUP, key, NULL); if (fd == -1) From nobody Sun Aug 27 07:33:13 2023 X-Original-To: dev-commits-src-branches@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 4RYQQd4Pxsz4rc9d; Sun, 27 Aug 2023 07:33:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYQQd3rHJz4YbT; Sun, 27 Aug 2023 07:33:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121593; 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=uP8EmTw0k/M/JIAzCnYXUfRseH/g3UNjRserb+8kBTk=; b=lveAu0LYmZQTiV3mfa73fVZef5Aemc1lCj83YDvJlYIa/7H+riShhfAuMnxsJsORQ9Vv2L LZbK5yrmea4iJ7bXppn3MlD4+KFT/TPz+o+csZCPFcjVenk7kpr4ASnn5CJQbAQ4jtWSOZ IvGncj4yzUiSdB/HxCEicifZtKIaiPSjQf7qgkEUjueYUVhszfcQ34dsTuVLz4EA9Bn4JW IPW8x8CGwYEDgSqzb1UXvOwUX80HCarn0ZP/UyfxUVMCGvDWlm6t7xDB1VE6EXQsYDcFCD kBMhxAV4hibYaPWmvHJl4A85t+V+4TPemUC8o7al8uFANP0xmyde0IPgDsDPMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121593; 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=uP8EmTw0k/M/JIAzCnYXUfRseH/g3UNjRserb+8kBTk=; b=kPO+T517Lo8JmYbriHJNGR3hsUZIAuUK1Oy089ysfyLZE2M5l6wZ+SncR5S8zuHKbAdro8 v0qZK7VuzIdMhR3FG9NevwCSS2jc8i/AmE2yBzgjZPejZxawffKArRM3TXPY3jTlkytAuS qDEMs3U50UTCinYUID63VW5OlF8f/CYxUB+E4dYxvEsalJfDwlU/pVlSeICSI2KtxNjA8y 1j+x5IF7R3MEwuEZSRE4y7pB/yjLkdIgBdO7fgYPLgOg9LO34Hfbd9sWiY/6b5UplrZas5 168wz7vF8LLtnEDvcLnO55tcbhCkebQIkCFtFGO+YkDzyTDSqKycsWl4Y0tpvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693121593; a=rsa-sha256; cv=none; b=IjQrzI9yBRQOo21aRsbheXriGticfdZp7WoKM6JZj1mY+rKD2++hg4ajS5cn1aYF27RTvO PQTLDfQBPe4Dw+S07OQFIgVGxnJrWfpLnjI26oceJOR1QCqjAWBjRMwjIFvhlKQMsaNaSL yy5Sad4HWrqqVjYzMm1KNJidWp5jJTmB9sMlLhSast3OxZPpnNW587hsTd753XQNUnB+YH m79ayIPyPUI6mgXQxjWlp6COyXbnyfoukInpDIUAwc/55ntcJ4OlFofJ63/xzwCgDtSQZs USUUkvrzY0fRtNGOpwzHkyx91yolVFfoZvgijdh9oGr0B1xoze0VSiMyutNptw== 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 4RYQQd2tqDz3Nv; Sun, 27 Aug 2023 07:33:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7XDu5095922; Sun, 27 Aug 2023 07:33:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7XDoF095919; Sun, 27 Aug 2023 07:33:13 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:33:13 GMT Message-Id: <202308270733.37R7XDoF095919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 33d7da6ba2ab - stable/13 - tests: Add MAP_32BIT flag test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 33d7da6ba2abde7b907d8fa08b349826bb1f20fa Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=33d7da6ba2abde7b907d8fa08b349826bb1f20fa commit 33d7da6ba2abde7b907d8fa08b349826bb1f20fa Author: Dmitry Chagin AuthorDate: 2023-08-01 20:23:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-27 07:32:13 +0000 tests: Add MAP_32BIT flag test Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D41236 MFC after: 1 month (cherry picked from commit 5a7e48dddfb5a668ded4742b79e6f6f88b647e6a) --- tests/sys/vm/Makefile | 8 ++++++ tests/sys/vm/mmap_map_32bit_helper.c | 51 ++++++++++++++++++++++++++++++++++++ tests/sys/vm/mmap_map_32bit_test.sh | 37 ++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) diff --git a/tests/sys/vm/Makefile b/tests/sys/vm/Makefile index 1454b3475f5a..4a08118bd883 100644 --- a/tests/sys/vm/Makefile +++ b/tests/sys/vm/Makefile @@ -8,4 +8,12 @@ ATF_TESTS_C+= mlock_test \ page_fault_signal \ shared_shadow_inval_test +.if ${MACHINE_ARCH} != "i386" && ${MACHINE} != "arm" && \ + (${MACHINE} != "powerpc" || ${MACHINE_ARCH} != "powerpc") + # MAP_32BIT is only available on 64-bit platforms +BINDIR= ${TESTSDIR} +ATF_TESTS_SH+= mmap_map_32bit_test +PROGS+= mmap_map_32bit_helper +.endif + .include diff --git a/tests/sys/vm/mmap_map_32bit_helper.c b/tests/sys/vm/mmap_map_32bit_helper.c new file mode 100644 index 000000000000..47d4b2c53c20 --- /dev/null +++ b/tests/sys/vm/mmap_map_32bit_helper.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2023 Dmitry Chagin + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include +#include +#include +#include + +_Static_assert(sizeof(vm_offset_t) >= 8, "Test is not intended for ILP32"); +#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) + +int +main(void) +{ + size_t pagesize; + void *s32; + int fd; + + if ((pagesize = getpagesize()) <= 0) + err(1, "getpagesize"); + + fd = open("/dev/zero", O_RDONLY); + if (fd <= 0) + err(1, "open failed"); + + s32 = mmap(NULL, pagesize, PROT_READ, MAP_32BIT | MAP_PRIVATE, fd, 0); + if (s32 == MAP_FAILED) + err(1, "mmap MAP_32BIT | MAP_PRIVATE failed"); + if (((vm_offset_t)s32 + pagesize) > MAP_32BIT_MAX_ADDR) + errx(1, "mmap invalid result %p", s32); + + close(fd); + if (munmap(s32, pagesize) != 0) + err(1, "munmap failed"); + + s32 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, + MAP_32BIT | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + if (s32 == MAP_FAILED) + err(1, "mmap MAP_32BIT | MAP_ANONYMOUS | MAP_PRIVATE failed"); + if (((vm_offset_t)s32 + pagesize) > MAP_32BIT_MAX_ADDR) + errx(1, "mmap invalid result %p", s32); + + if (munmap(s32, pagesize) != 0) + err(1, "munmap failed"); + exit(0); +} diff --git a/tests/sys/vm/mmap_map_32bit_test.sh b/tests/sys/vm/mmap_map_32bit_test.sh new file mode 100644 index 000000000000..2df53e78f1b7 --- /dev/null +++ b/tests/sys/vm/mmap_map_32bit_test.sh @@ -0,0 +1,37 @@ +# +# Copyright (c) 2022 Dmitry Chagin +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Simple test of MAP_32BIT flag w/wo ASLR + +map_32bit_w_aslr_head() +{ + atf_set descr "MAP_32BIT with ASLR" + atf_set require.progs proccontrol +} + +map_32bit_w_aslr_body() +{ + atf_check -s exit:0 -x proccontrol -m aslr -s enable \ + $(atf_get_srcdir)/mmap_map_32bit_helper +} + +map_32bit_wo_aslr_head() +{ + atf_set descr "MAP_32BIT without ASLR" + atf_set require.progs proccontrol +} + +map_32bit_wo_aslr_body() +{ + atf_check -s exit:0 -x proccontrol -m aslr -s disable \ + $(atf_get_srcdir)/mmap_map_32bit_helper +} + + +atf_init_test_cases() +{ + atf_add_test_case map_32bit_w_aslr + atf_add_test_case map_32bit_wo_aslr +} From nobody Sun Aug 27 07:33:14 2023 X-Original-To: dev-commits-src-branches@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 4RYQQf5YB2z4rbhP; Sun, 27 Aug 2023 07:33:14 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYQQf4kfZz4YhN; Sun, 27 Aug 2023 07:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121594; 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=RoTv5AXDAQ6URkmdPwtRR1SZV65piyKXe1JtYM054xE=; b=aJuvlRGf0sGevAlOeluRtImLDDN65nmqaGXZ/9dbF3JUQEldPUf9xBje2159+BjCizstT6 hLJ9roS6bIkGQZnrZcjSRNjfEccJsqLB9dQiHYZaLN4VAftjHR7DVo3rrJmaO2ZqerYNXY 7wRJKoTcvdbEcaIC9t35uET45wA1EQwpbx0LSfwN6lCiuD3aMFMNZVeZj2rIkFdoU71Yku et1yGHdZz+R4HMHnuPwVhwNic0O8iUSzLdEMIij/BHqCyP/BInHzPYCRD6loSplBCtr9w5 roj0x9bQ3o96s+Tr/9KXvIHJAMAXtM62MG4N9K/8VQ7p8o8TMta2pLAhrZBBZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121594; 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=RoTv5AXDAQ6URkmdPwtRR1SZV65piyKXe1JtYM054xE=; b=c98E93rwTr8uqs6FuoAgf8Us5zuyEUc0HQ3HJkHbS3D2HZxroKxzW2TVs3F8BFRuk+XJfB ubIk1HMdca9589F/hOkse2lKnw7glinaI3DSXmTmpPgKjRihU2Nlg2z5EGKEb6D2G/+7ZB Trfu4pqdDRwKspPB0gpmoXkHv8eksNrAdUUTP0jRKIY235qxq3W2xppNfBcJ1KdVZ1v9AH blxpA3j246C4l9w5znoOlY03j8WSNLpQPc5of/Iih5e/xj9d/FHRfgAoHehRp+rTrGXLZh IVeO9Wk6EZVHaD1nuKe3ItGopSxcc2Taj8RJaRtE5K63n7QLouFKIGaikQdhJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693121594; a=rsa-sha256; cv=none; b=IvqZbnNZuiGm7F1LI6yUc41vejIPOM4kaBiuqy6J5LxRu5lzM5HhiObn15nLsGgtzQ6a+T Po+qz0erB4I8W67s3YXhfgWsRgzgwgXKj3a0EKWPa8y3xSllxk5IUhGswsmXtp1ZmrdWpO /ifaeGfaykfoi+mEiiYp+0gjtTVmR58b7yo6yqPHatvkCRvd/HJ0iqaBaBo/AbCZxP9/j1 AKGtPnzOAebfHayv4QPuahH3UyfDnO30Sgeg+ZWwPL9awz7HjqnhqFPjKg9861NDy3DmDF LLee+GZ8WtXeP27as5u8PK3LaPwDZG5XluOJft1tCKBL7nSoF4OznJjuqyS2SQ== 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 4RYQQf3rBfz3ck; Sun, 27 Aug 2023 07:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7XEgH095974; Sun, 27 Aug 2023 07:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7XEEo095971; Sun, 27 Aug 2023 07:33:14 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:33:14 GMT Message-Id: <202308270733.37R7XEEo095971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 4b1266f1e9b4 - stable/13 - tests: Also exclude powerpc/powerpcspe from mmap_map_32bit_test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4b1266f1e9b438c848f2b0e816c221ef99d83bb0 Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4b1266f1e9b438c848f2b0e816c221ef99d83bb0 commit 4b1266f1e9b438c848f2b0e816c221ef99d83bb0 Author: Li-Wen Hsu AuthorDate: 2023-08-12 01:24:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-27 07:32:13 +0000 tests: Also exclude powerpc/powerpcspe from mmap_map_32bit_test Sponsored by: The FreeBSD Foundation (cherry picked from commit b231322dbe9559c2dc43698c3bb1e832cd8bbfa9) --- tests/sys/vm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/sys/vm/Makefile b/tests/sys/vm/Makefile index 4a08118bd883..ccae71c72932 100644 --- a/tests/sys/vm/Makefile +++ b/tests/sys/vm/Makefile @@ -9,7 +9,8 @@ ATF_TESTS_C+= mlock_test \ shared_shadow_inval_test .if ${MACHINE_ARCH} != "i386" && ${MACHINE} != "arm" && \ - (${MACHINE} != "powerpc" || ${MACHINE_ARCH} != "powerpc") + (${MACHINE} != "powerpc" || (${MACHINE_ARCH} != "powerpc" && \ + ${MACHINE_ARCH} != "powerpcspe")) # MAP_32BIT is only available on 64-bit platforms BINDIR= ${TESTSDIR} ATF_TESTS_SH+= mmap_map_32bit_test From nobody Sun Aug 27 07:33:15 2023 X-Original-To: dev-commits-src-branches@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 4RYQQg6Tr8z4rbhQ; Sun, 27 Aug 2023 07:33:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYQQg5zzZz4Yj0; Sun, 27 Aug 2023 07:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121595; 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=wnJK6I0zoT/furtGC0B7URodCob31T4BIoJngc/Ux8U=; b=tSM1EG0cHY4Fh6P8UJ7Qm4wMTGujZwNyfjf2hD2YJjaDO49kn0jg+fHr83sixZ+97+KwN9 ca2sugRKoknJ7FW5RA3YQRmh2JcZZVD+e9PHsTlLjNBJ/HemhRHLkAutrdRHpRCkPzHvha +aeikO+sjwVBjAFyN0lbMzcCYHMl7GJWjG3bXNAf3k3JBq3zb0BaSz5uCR6Ds/0LuAnL/E Bq0h4ZAbAalirlyDFN81gMxFQhe3u4DkMWhzzdG3PVu/sUF1XwVNByuhbY3y8cIupuIMli KUKiTfrpjzhoETDjtIjrfGFcsJ+6t8MxfZJXKrHM3pIw51FB/W7L+YqiSGouoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121595; 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=wnJK6I0zoT/furtGC0B7URodCob31T4BIoJngc/Ux8U=; b=k07J85/670JTxgqPsGh2Bl4T+x7dKvizzsUPLQLLYdjqzRppxbv3da3f5fiXwtnUF+hyId YI98MwAlMDe7vE4DtOUj9Yhz2lYUiqm6UFllLAJRySvfEeMB3dnhMmJYVQUmnLXLY75WOD reoJdz1H7YNWcRUgMhEqzAXCMtb8aCyNhgDliut1OMndvhi5UwU+iLNQ1we8Rw7SA2sgAH 94Cpi+KUjc21USLH6OGD9AtbmYKWgOt68AMO4Isd+W4n7gOfKgOVMtlYVXZ1pCZGGJKlvy IHW7NSa/tLrPZ18BOjm++/PKDin0PzbjyE2XXbZWXMfzrkOHnGnBCTemN/Mlww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693121595; a=rsa-sha256; cv=none; b=fhNS2NujMnhRFukJh5QtesJAxQyPOKKFDR9GjW+CSb447QbwCHTiqL4HInnfCcdwkKSLNd M58EXPUnplpH0rrdN8PC4nLxgVocI3DRRKY79f15Tt0dMuwKn2DH6+xIcwjLKZNZ6XthPb uBwlmEwFt7tFRhS9P4HubIiL8JbNBvArDvPV0n8E1zsv9Of42RTdT35g3bQ8cPkbNKi4bY zIDKZM/IQYcn4P1zMB9l1wAE56wVfz2XTQMsdL75KSgwRwW6427WjKHDIaztuFVaBY3Aks +SidCDB9sqSh4Uu6eS0bORTL5NFNpzUSHuDVqVFRptZZGGFDU4VSYPNWCZpj+A== 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 4RYQQg4szJz3Lc; Sun, 27 Aug 2023 07:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7XFea096016; Sun, 27 Aug 2023 07:33:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7XFv1096013; Sun, 27 Aug 2023 07:33:15 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:33:15 GMT Message-Id: <202308270733.37R7XFv1096013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 0234b6d17f50 - stable/13 - tests: Add stack grows tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0234b6d17f50c5c3e89e18e1af778548201ec465 Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=0234b6d17f50c5c3e89e18e1af778548201ec465 commit 0234b6d17f50c5c3e89e18e1af778548201ec465 Author: Dmitry Chagin AuthorDate: 2023-08-08 15:12:09 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-27 07:32:14 +0000 tests: Add stack grows tests Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41320 MFC after: 2 weeks (cherry picked from commit 8920c5f2a1175c22631780bd236026d15e2d3d72) --- etc/mtree/BSD.tests.dist | 2 + tests/sys/vm/Makefile | 5 +++ tests/sys/vm/soxstack/Makefile | 17 +++++++ tests/sys/vm/soxstack/soxstack.c | 51 +++++++++++++++++++++ tests/sys/vm/stack/Makefile | 15 +++++++ tests/sys/vm/stack/stack_dlopen_exec_test.c | 64 +++++++++++++++++++++++++++ tests/sys/vm/stack/stack_dt_need_exec_test.c | 50 +++++++++++++++++++++ tests/sys/vm/stack/stack_mprotect_exec_test.c | 48 ++++++++++++++++++++ 8 files changed, 252 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 9d3d0e99dd7f..fc04b5b02d23 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -878,6 +878,8 @@ vfs .. vm + stack + .. .. vmm .. diff --git a/tests/sys/vm/Makefile b/tests/sys/vm/Makefile index ccae71c72932..98e233ce4370 100644 --- a/tests/sys/vm/Makefile +++ b/tests/sys/vm/Makefile @@ -17,4 +17,9 @@ ATF_TESTS_SH+= mmap_map_32bit_test PROGS+= mmap_map_32bit_helper .endif +SUBDIR= soxstack +TESTS_SUBDIRS+= stack + +SUBDIR_DEPENDS_stack=soxstack + .include diff --git a/tests/sys/vm/soxstack/Makefile b/tests/sys/vm/soxstack/Makefile new file mode 100644 index 000000000000..70a22fd278b1 --- /dev/null +++ b/tests/sys/vm/soxstack/Makefile @@ -0,0 +1,17 @@ +# $FreeBSD$ + +SHLIB= soxstack +SHLIB_NAME= libsoxstack.so +SHLIB_MAJOR= 1 + +WITHOUT_STATIC= +WITHOUT_PROFILE= +WITHOUT_PIC= + +SRCS= soxstack.c +LDFLAGS+= -Wl,-z,execstack +LIBADD+= procstat + +LIBDIR= ${TESTSBASE}/sys/vm/stack + +.include diff --git a/tests/sys/vm/soxstack/soxstack.c b/tests/sys/vm/soxstack/soxstack.c new file mode 100644 index 000000000000..fe3eb1c03a29 --- /dev/null +++ b/tests/sys/vm/soxstack/soxstack.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2023 Dmitry Chagin + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +int checkstack(void); + +#define _STACK_FLAG_GROWS KVME_FLAG_GROWS_UP | KVME_FLAG_GROWS_DOWN +int +checkstack(void) +{ + struct kinfo_vmentry *freep, *kve; + struct kinfo_proc *p; + struct procstat *prstat; + uint64_t stack; + int i, cnt; + + prstat = procstat_open_sysctl(); + assert(prstat != NULL); + p = procstat_getprocs(prstat, KERN_PROC_PID, getpid(), &cnt); + assert(p != NULL); + freep = procstat_getvmmap(prstat, p, &cnt); + assert(freep != NULL); + + stack = (uint64_t)&i; + for (i = 0; i < cnt; i++) { + kve = &freep[i]; + if (stack < kve->kve_start || stack > kve->kve_end) + continue; + if ((kve->kve_flags & _STACK_FLAG_GROWS) != 0 && + (kve->kve_protection & KVME_PROT_EXEC) != 0) + stack = 0; + break; + } + + free(freep); + procstat_freeprocs(prstat, p); + procstat_close(prstat); + return (stack != 0); +} diff --git a/tests/sys/vm/stack/Makefile b/tests/sys/vm/stack/Makefile new file mode 100644 index 000000000000..2d56a6231e24 --- /dev/null +++ b/tests/sys/vm/stack/Makefile @@ -0,0 +1,15 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/vm/stack + +ATF_TESTS_C+= stack_dt_need_exec_test +ATF_TESTS_C+= stack_dlopen_exec_test +ATF_TESTS_C+= stack_mprotect_exec_test + +LDFLAGS.stack_dt_need_exec_test+= -Wl,-rpath,${TESTSDIR} -L${.OBJDIR:H}/soxstack +LDADD.stack_dt_need_exec_test+= -lsoxstack +LDFLAGS.stack_dlopen_exec_test+= -Wl,-rpath,${TESTSDIR} + +.include diff --git a/tests/sys/vm/stack/stack_dlopen_exec_test.c b/tests/sys/vm/stack/stack_dlopen_exec_test.c new file mode 100644 index 000000000000..d4d5fc7c5cf0 --- /dev/null +++ b/tests/sys/vm/stack/stack_dlopen_exec_test.c @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2023 Dmitry Chagin + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include +#include + +static int jumpstack0(void) __noinline; +static int jumpstack1(void) __noinline; + +static int (*socheckstack)(void) = NULL; + +static int +checkstack(void) +{ + void *fh; + + if (socheckstack == NULL) { + fh = dlopen("libsoxstack.so", RTLD_LAZY); + ATF_REQUIRE(fh != NULL); + socheckstack = dlsym(fh, "checkstack"); + ATF_REQUIRE(socheckstack != NULL); + } + return (socheckstack()); +} + +static int +jumpstack0(void) +{ + char stack[SGROWSIZ]; + + explicit_bzero(stack, sizeof(stack)); + return (checkstack()); +} + +static int +jumpstack1(void) +{ + char stack[SGROWSIZ * 2]; + + explicit_bzero(stack, sizeof(stack)); + return (checkstack()); +} + +ATF_TC_WITHOUT_HEAD(dlopen_test); +ATF_TC_BODY(dlopen_test, tc) +{ + + ATF_REQUIRE(jumpstack0() == 0); + ATF_REQUIRE(jumpstack1() == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, dlopen_test); + + return (atf_no_error()); +} diff --git a/tests/sys/vm/stack/stack_dt_need_exec_test.c b/tests/sys/vm/stack/stack_dt_need_exec_test.c new file mode 100644 index 000000000000..8a234abe3da5 --- /dev/null +++ b/tests/sys/vm/stack/stack_dt_need_exec_test.c @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2023 Dmitry Chagin + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include + +extern int checkstack(void); + +static int jumpstack0(void) __noinline; +static int jumpstack1(void) __noinline; + + +static int +jumpstack0(void) +{ + char stack[SGROWSIZ]; + + explicit_bzero(stack, sizeof(stack)); + return (checkstack()); +} + +static int +jumpstack1(void) +{ + char stack[SGROWSIZ * 2]; + + explicit_bzero(stack, sizeof(stack)); + return (checkstack()); +} + +ATF_TC_WITHOUT_HEAD(dt_need_test); +ATF_TC_BODY(dt_need_test, tc) +{ + + ATF_REQUIRE(jumpstack0() == 0); + ATF_REQUIRE(jumpstack1() == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, dt_need_test); + + return (atf_no_error()); +} diff --git a/tests/sys/vm/stack/stack_mprotect_exec_test.c b/tests/sys/vm/stack/stack_mprotect_exec_test.c new file mode 100644 index 000000000000..d12d99ea39ee --- /dev/null +++ b/tests/sys/vm/stack/stack_mprotect_exec_test.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2023 Dmitry Chagin + * + * SPDX-License-Identifier: BSD-2-Clause + * + * PR: 272585 + * Test provided by John F. Carr + */ + +#include +#include +#include + +#include +#include + + +ATF_TC_WITHOUT_HEAD(mprotect_exec_test); +ATF_TC_BODY(mprotect_exec_test, tc) +{ + long pagesize; + char *addr, *guard; + size_t alloc_size; + + pagesize = sysconf(_SC_PAGESIZE); + ATF_REQUIRE(pagesize > 0); + + alloc_size = SGROWSIZ * 2; + addr = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, + MAP_STACK | MAP_PRIVATE | MAP_ANON, -1, 0); + ATF_REQUIRE(addr != MAP_FAILED); + + /* + * Change prot of the last page in the mmaped stack area. + */ + guard = addr + alloc_size - SGROWSIZ; + ATF_REQUIRE(mprotect(guard, pagesize, PROT_NONE) == 0); + + ((volatile char *)guard)[-1]; +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, mprotect_exec_test); + + return (atf_no_error()); +} From nobody Sun Aug 27 07:33:16 2023 X-Original-To: dev-commits-src-branches@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 4RYQQj08v0z4rc5V; Sun, 27 Aug 2023 07:33:17 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYQQh6lRtz4Ycs; Sun, 27 Aug 2023 07:33:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121596; 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=pIGGW8NXuI3FkVd0SuzZHntxfM0pxr06gDwbmHSlrRM=; b=sLBWlO5eKAZwNBfusbNJJVApA8g4JQktsbqvU1fbDVRGrdZZQZscG0LyOumsAJQg5m7eBm obzqWQ7g78w+accWGUm9HkoPuM7NqE9wUp9Xu3At6u7+yqHDyWL3cK5wUGraF26DnLhFkv pI8E9dLVulXyr2pnN9+m2ngDDSD3EqZou2YIVHPFYpJKRXILCWrx3u7SlRKni9kbmX4v98 OIa+uSsOv8o0cfPGOptffxsO29lZJpZQC/ZtbvXjYMsphe/CTsdoFjUjLUbRHw+rHWF0ae 0loHS1CIDZq42G4anweWvCVPTaYyYxkGSAosRgY5Yx24TE2vuJUZqBCirvi7LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121596; 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=pIGGW8NXuI3FkVd0SuzZHntxfM0pxr06gDwbmHSlrRM=; b=s+GzKxgk++lSrrJEhjNcffmMImof8SMBtLEQB5EiQ5BZCqQ6I9dIFmz9XJ22vF57eslUUT 3meJuU5JrvGeC0ndbifHMsgg8WagLvbTZLdql36+K4cqSNk7J1spnLcbGDfr7AU3yx8HxY f3l9GEnl5JkxVBeXtg/BhAEnEd6h8rroySuu6okWi8j0BoNQidy7ffgIui/+Ilfrxuo82l 4bLYj7PnIF9e3k/ZH2DYqWDRKvHrSKgw/x6ko/1mn9yiN4zUidYTTo7QLkI+J8Ki6EtKKc LBlb5Y7Uf7wy1ZqgzfGS1DGyJ70NpW1VVIMvS2nX5p6RmY89+j5VT6jRfm54cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693121596; a=rsa-sha256; cv=none; b=Q/T/RP3pLQXSu6IXkm3msb2rij4X25XdLkJD7sDdFrCCGJ4MAhM3xmwbnIUNaq8aqDzpTt 9cR4GLJwqd0klVMyuH6XCsIBrtRvvq3b4EzXFUzigX2gXoCdwmFB44/tesrk7tFHCXSc8n T1dzP5KiK7sWGsbtQAp68E1/uCkl651CBTt7vQMJRQQY/WW0fdznB+1PpKBkXmbGI9Oeri JYJ8wBl6ziRrneAFHajT15Z12Nl9eKOmO2X0FTN85VQZbrjJYZIt8bW5h2EaAWN7Pl/f+u HzoXkJcsFD55Q1fbC9alX7sqLp0ltJio6b88MDQj284UpSrdjO8OA7MSR29Tww== 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 4RYQQh5sHdz38Z; Sun, 27 Aug 2023 07:33:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7XGRx096059; Sun, 27 Aug 2023 07:33:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7XGgo096056; Sun, 27 Aug 2023 07:33:16 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:33:16 GMT Message-Id: <202308270733.37R7XGgo096056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e2ad9b16813d - stable/13 - tests: Fix build after 8920c5f2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e2ad9b16813dbc269c08cc46380433fa760a7940 Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e2ad9b16813dbc269c08cc46380433fa760a7940 commit e2ad9b16813dbc269c08cc46380433fa760a7940 Author: Dmitry Chagin AuthorDate: 2023-08-08 21:39:35 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-27 07:32:14 +0000 tests: Fix build after 8920c5f2 MFC after: 2 weeks (cherry picked from commit 76f28f656eb5db81b49d6d89e1d43815aeda3128) --- tests/sys/vm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/vm/Makefile b/tests/sys/vm/Makefile index 98e233ce4370..b8412079ddb0 100644 --- a/tests/sys/vm/Makefile +++ b/tests/sys/vm/Makefile @@ -20,6 +20,6 @@ PROGS+= mmap_map_32bit_helper SUBDIR= soxstack TESTS_SUBDIRS+= stack -SUBDIR_DEPENDS_stack=soxstack +SUBDIR_DEPEND_stack=soxstack .include From nobody Sun Aug 27 07:33:17 2023 X-Original-To: dev-commits-src-branches@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 4RYQQk1x1Jz4rcP9; Sun, 27 Aug 2023 07:33:18 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYQQk0QGvz4Yww; Sun, 27 Aug 2023 07:33:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121598; 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=FRZXCZ6qRGtt7GqNw7jRAbXSUMAunKP0upTFvvMJi+c=; b=MioJ+snWr/J7pffaylU8qfR46g82mjLbCSypu3E5lff4y4ZtFDEGeRp3FnP/6PzezZOY0C AX6oGpPnG8xMoJdxO5XJz5gJ7LQT7sVTk3uUGjj0W5wyPQnl7/scFjrtlrFMAvqcI7f9Lf n53Z/4xqjym8Hy+7IQgDX1SeNR9Gi0o1/+whuxbVvn+lzK0Lcn6abiAuNkaY85lPfTUKQZ 5jz3HNlS+fa1Md8D/rxhz4+FbA4jnLDuLRW7ASPh5fgJs/eIzvcHgZuu922WQuNNRKAg8A fPFUGj3TNvOf461BWxPhvbi5AcarVX67ZJouF+xtTGPDfBvD1IknC7EKQb1MHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121598; 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=FRZXCZ6qRGtt7GqNw7jRAbXSUMAunKP0upTFvvMJi+c=; b=UAxsCbTp8zVWTQclPyuMZHUAC9CVXRgs8rc9JUm2odRGN4RUHvELGJxLGRkap0LKtNtbG+ nvhvU6JSt/+jgFH07wllXmlZu40QydZhPM4A1dN8SwAmkAiNwXbw6nFQ/pwA3uoNAPWGEQ VH0npwm+cXcUXJxMjzdv3Gp7Yv8550jS+AEmD1m0syD9Y54jb1XI/C2Y4ku1cUVnBaWPEC 8Ma95jO6kYJb+7nx+4SamFLMjwAeTpVFDWn48QmtEy4x/QdPWxtVksNHF1AuFmD0z+ns/l MubDHzug2frnV6mwKHjrrP1B3nnKewlJXqb/N09sycM5brpxSmki1nkL1E+l9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693121598; a=rsa-sha256; cv=none; b=vsbaD/QjugzYFVIie0BAiGbZ1q9MDIz85MKNY50iDI4/esISJnAiW8tJaKno/x+8P7kpor 32/+UzKHMUySkWICc4ozsWyR4pcVJ/1IcJpbDi5hUQiomWlE6Ms4iFZ79lH5b13TRSUIlB /YkI/HX+XNmShm9SdSL+iLv8blJ+n3Du63UEK/zgMa1Bw7IN79oiIA754Jv1is2gp6maEs 3OnLkwCYCHweIMO5qv5wFBSjNSAj9Y+evd9WhW19G6pITxCtcTjSgQQKjy6tM5R1uix8vq M8UPsXIXao2aHNNIiF0bd/w8HS/ylgaM8BI42Y8XQzhu82K5wCvb5vRw7TkX7w== 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 4RYQQj6cVFz2wK; Sun, 27 Aug 2023 07:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7XHZ0096098; Sun, 27 Aug 2023 07:33:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7XHf7096095; Sun, 27 Aug 2023 07:33:17 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:33:17 GMT Message-Id: <202308270733.37R7XHf7096095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 265a3b49d017 - stable/13 - soxstack: silence GCC warning List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 265a3b49d017a07070d6e5bc18c66e30e01c908a Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=265a3b49d017a07070d6e5bc18c66e30e01c908a commit 265a3b49d017a07070d6e5bc18c66e30e01c908a Author: Ed Maste AuthorDate: 2023-08-09 01:13:20 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-27 07:32:14 +0000 soxstack: silence GCC warning Add parens around _STACK_FLAG_GROWS expression to fix GCC warning about arithmetic in operand of '|'. Sponsored by: The FreeBSD Foundation (cherry picked from commit 07d3738b82b6e064288cb1d630a3bde611e30819) --- tests/sys/vm/soxstack/soxstack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/vm/soxstack/soxstack.c b/tests/sys/vm/soxstack/soxstack.c index fe3eb1c03a29..ac7c9cf03746 100644 --- a/tests/sys/vm/soxstack/soxstack.c +++ b/tests/sys/vm/soxstack/soxstack.c @@ -16,7 +16,7 @@ int checkstack(void); -#define _STACK_FLAG_GROWS KVME_FLAG_GROWS_UP | KVME_FLAG_GROWS_DOWN +#define _STACK_FLAG_GROWS (KVME_FLAG_GROWS_UP | KVME_FLAG_GROWS_DOWN) int checkstack(void) { From nobody Sun Aug 27 07:33:18 2023 X-Original-To: dev-commits-src-branches@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 4RYQQl1nTTz4rbrB; Sun, 27 Aug 2023 07:33:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYQQl13Ycz4YwL; Sun, 27 Aug 2023 07:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121599; 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=mfESIL++YtRW5O+UQPmUsZF+TVdiznBLUrNztWUoWKo=; b=T3OINgE7L+thg9AkaxlR/kKAnoHCVRov4SfdEB6hJRz0R2yHOsWLi6lWgtCkB1KseqH6Vz JutvHoWBiXNVNTn8rI6hlocGywVAIIhnr0emzV6GEjxOFSN9u3UcDXTTvIWIAq47VTguk5 Os+q/rcmhv9EbMFSULXueyC+s1PO0eWZcKUIRYVSjdTvCUylgSEzWbxw94HtZzreT8yFQy o/TpjuaDM10D8f7jeVjLgw+CrXSLSsEVwppgPPzvqHnUpTQAbQS0+OGn0lroif3ucfllhJ 4Uvd1WehP7+5IFr4mO7dXyWHgfzAOlWVb38BgT02SgaUNamst43pAEdDhR0hRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693121599; 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=mfESIL++YtRW5O+UQPmUsZF+TVdiznBLUrNztWUoWKo=; b=L6e+qLOEY6cQX2Yr2P2pFn67j8EeuSkFBpn6I5LeZdlz2o/IbhQoDPMZK7YE+6RLZBxHjl +ev/PLGDGURVUxp3T00yr3j2nJWdhD9oCwkGcuVO9mvZK/etQpdJauU3oStmQkJLYQBVOw HjTsNHa3XmL9MYEG9AvpkwBccicTz0hahh7ms4Mmvp/AeaLqaYOBw2IytVdtjvIp/MvhG5 1RNy7+Rv/QbAvBzSvoJs6rPWqWX9gJV2N4ekHpCOjQNXRAz+IAYyL5f4YsgFk00c271gUT Pq9vbNJaf1xAlAw6q+7v6DS/jUVIOWRJKQrUGQt3q68uDXBz4M1a1DVC7KuCOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693121599; a=rsa-sha256; cv=none; b=KB89WZ7ecMlPyvmcwC9K+3Qenmmi2Kaj/lFwOCxF2Gp/H6efQbe3DmwgsxJ+k3VEgv7u+r sIIV+m8JAOoFTKSQ0v8BsiUtN/syIRG1QzJAiTzLDf7pKzAt+bQ03WCxm98FqSmogcidpo qF2eJOA8G+iclxgFWwW04ODjG+fmJpgjzxCsksLRT2uDIXNlOhnts0nAGXDjNwa78OaAIa IhZjXR4GH0h55hpkZ8er7XVJfnZuEr0PBuukxcq/NRWLsad2aLdd/XzpD4ghdibDcbRL0X k1BeJddMy3vx0y9DEl3icvX8rCR3ezy7i/UlDrIzJMYhEENWK+4dmkmv352pCQ== 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 4RYQQl09Gmz3Ld; Sun, 27 Aug 2023 07:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37R7XIf8096157; Sun, 27 Aug 2023 07:33:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37R7XIPl096154; Sun, 27 Aug 2023 07:33:18 GMT (envelope-from git) Date: Sun, 27 Aug 2023 07:33:18 GMT Message-Id: <202308270733.37R7XIPl096154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 2837c79aed1b - stable/13 - tests: Handle SIGSEGV in the vm stack mprotect exec test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2837c79aed1b5f14609aa354bf730f9fbfa70e1c Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2837c79aed1b5f14609aa354bf730f9fbfa70e1c commit 2837c79aed1b5f14609aa354bf730f9fbfa70e1c Author: Dmitry Chagin AuthorDate: 2023-08-24 18:02:52 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-27 07:32:29 +0000 tests: Handle SIGSEGV in the vm stack mprotect exec test To exit gracefully handle SIGSEGV and mark the test as failed. MFC after: 3 days (cherry picked from commit f8bc606aad35daf9853e3198f14d4a7baba36fcb) --- tests/sys/vm/stack/stack_mprotect_exec_test.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/sys/vm/stack/stack_mprotect_exec_test.c b/tests/sys/vm/stack/stack_mprotect_exec_test.c index d12d99ea39ee..ba5a1d5cb859 100644 --- a/tests/sys/vm/stack/stack_mprotect_exec_test.c +++ b/tests/sys/vm/stack/stack_mprotect_exec_test.c @@ -12,8 +12,15 @@ #include #include +#include #include +static void +sigsegv_handler(int sig __unused) +{ + + atf_tc_fail("Invalid stack protection mode after grows"); +} ATF_TC_WITHOUT_HEAD(mprotect_exec_test); ATF_TC_BODY(mprotect_exec_test, tc) @@ -22,6 +29,8 @@ ATF_TC_BODY(mprotect_exec_test, tc) char *addr, *guard; size_t alloc_size; + signal(SIGSEGV, sigsegv_handler); + pagesize = sysconf(_SC_PAGESIZE); ATF_REQUIRE(pagesize > 0); From nobody Sun Aug 27 17:52:09 2023 X-Original-To: dev-commits-src-branches@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 4RYh8n3ltJz4rT4H; Sun, 27 Aug 2023 17:52:09 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYh8n3KThz4XwJ; Sun, 27 Aug 2023 17:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693158729; 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=6qH93K6HSJc1FxVB8nG4rAmpOLtSpyApAbPrTGXs4fk=; b=N3jq8WflgumFtPoOw3zO17FDPP/qC2b1NxQ/pNHVPwPL3GglgtuFiUSUyCu2fEZOBvANaj PnN3ANr1beC3iC14+JiLp8EUEdx1/2A85AKS4saG8/oACnAf5HVRqDdJkyUPCxGxpyQYjr VKxHxByXm/+HOMQ4SZW8bVsJarkG3wnOtcVVoxOAcqIWl8+F+HndIUnMmDjps4bhS1Ox57 vTE8YjeM4dwLToUpgr2aGhLv2z2+5qLylYbvtE92rmaPu8ek1LXuFG+yfE/nieWThjQAN2 XCdQox72YhQyOskHQAllpzYvyBHNEu81YetsO7/xiY2bJW1jIoSALrMpSVZWrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693158729; 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=6qH93K6HSJc1FxVB8nG4rAmpOLtSpyApAbPrTGXs4fk=; b=o9dtehzunkNlWX1z9EGubzlad+q6b+B/VBK/JEEI+MXARBdAUOrFjhHOtiUTUkR9Imt583 +A3/FK56V4QJBV78PVZIr6yZlsohIa7jMY2eDGeXPICwZ84ooxh9OQ89hq1q8ALNsFSsPC +ezLBQN34V/TbXQ2dIJbJb4MQ3thxa3/PWLPT3ZOl4LxZJp31/FFt+S6TCldHpZSuDvcCE qbqXanTS4AuVRy5jf5ZWayn8YIbsaDQaCIFenxvYo3/a+h1+/WHclCXDojncWhP/udkyUs VeT9Ajsm62FSEpWuYZyRe42smcXy6a8HgnvwtD2Jnd73/hjPb8GHvb7tp8DhUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693158729; a=rsa-sha256; cv=none; b=trTFjO2TuJJS0QtSg4dV9+1jkOY19xHnvm4ggG8P2dnExCPqyzSuSVoUdgQ+gfJs5ZFZ+B frPkJ/ekA53FnqODasX5/93IfENShrJ/7sWYezr4wUrBLr0Lu1YBghaCoqRurL+i6jN0zb 5edN/44Ef5EZQJx3uLz7SUfmPIeX8nOyV3bJQzLZzeZVo6wOoQZax77/tR7U/3o9AEFDFW eeDKFSV6s6cSnwmpx6Br2UTexPm/m5PnBKk8FTEZIEGr9ywm94luy5ENZFZJeNvIFFQifY f8Btz9mz3K6bXyWxuls1vZtvxcVpUXOApIrenm6VwG5QOqdOPIx7JUcVnsb4Mg== 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 4RYh8n2Pd2zc5N; Sun, 27 Aug 2023 17:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37RHq92K021495; Sun, 27 Aug 2023 17:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37RHq9Mt021492; Sun, 27 Aug 2023 17:52:09 GMT (envelope-from git) Date: Sun, 27 Aug 2023 17:52:09 GMT Message-Id: <202308271752.37RHq9Mt021492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 15ebbf9033c3 - stable/13 - tests: Fix build on mips after 33d7da6b List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15ebbf9033c3f4754822206282468ffa3f6642bb Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=15ebbf9033c3f4754822206282468ffa3f6642bb commit 15ebbf9033c3f4754822206282468ffa3f6642bb Author: Dmitry Chagin AuthorDate: 2023-08-27 17:51:49 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-27 17:51:49 +0000 tests: Fix build on mips after 33d7da6b --- tests/sys/vm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/vm/Makefile b/tests/sys/vm/Makefile index b8412079ddb0..3cb3f78fae28 100644 --- a/tests/sys/vm/Makefile +++ b/tests/sys/vm/Makefile @@ -8,7 +8,7 @@ ATF_TESTS_C+= mlock_test \ page_fault_signal \ shared_shadow_inval_test -.if ${MACHINE_ARCH} != "i386" && ${MACHINE} != "arm" && \ +.if ${MACHINE_ARCH} != "i386" && ${MACHINE} != "arm" && ${MACHINE} != "mips" && \ (${MACHINE} != "powerpc" || (${MACHINE_ARCH} != "powerpc" && \ ${MACHINE_ARCH} != "powerpcspe")) # MAP_32BIT is only available on 64-bit platforms From nobody Sun Aug 27 22:45:15 2023 X-Original-To: dev-commits-src-branches@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 4RYpg00thRz4rkcL; Sun, 27 Aug 2023 22:45:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYpg00MD1z3Pry; Sun, 27 Aug 2023 22:45:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693176316; 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=kkDBT1h9L0lWiRTN0ynGXJKK01jB51S32/2Ssr8ATRk=; b=J+1JmLb+pNEO5lqxVbmaR1FWgtFThUO0CbHcgXj27+IC8FqhUN47/lIRg8tI58UztacEf1 wW5A2qVWidZ8I80xaNNamDE2PsqF7HKvioEt0xX9ccQhod7Yt1/yaXmUm48P1I2P8Tty8s zJk/BJZml+6tob3mqHoHMVXcjycELMYOSUADiM2hKLeV5r54POAsjZ/jO457JpqabLLLvt xZU7E/iCkjA5sK1526HSkr+ovJ9Is8jDSoohM6JvkXPfPFKg4b11fq4v2xFCxjUyVnc4+S HKM5oaxah3E7r004K0FiKan7JMJieM/yeN3sVFJev8r8uiLBY1cMq8wwls0WyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693176316; 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=kkDBT1h9L0lWiRTN0ynGXJKK01jB51S32/2Ssr8ATRk=; b=tLeEpss+tx6LneGIMenkiQnrlOSqLfpQURSDfbdilLgXm+ER9E2+BfvcgqD+UPw4g78V5E yqCC52cpKvCcWDYiA55+9kIIK+VCQP4bXyk1Ito4NtBZEJtctxMgIiWN1B8RfkXzdFxpP8 Dn7E8qvols9n1Ok9hoae3jO3sfsf0pFGV8LjRX3xnGmUeEGxNXx2/M7wthGKwFCok3fReB CWOMrJ2BGpg2WpxSCB68vfqSthvAV4K6AdG6d3ebrYV7sU8Zvc076yuQ2S0CLkgQSJ/1Lt pkGMfx76Qvsa3esnpGYvwcwzbg8hxiGcBEYnkqBHZncaCF7JvLrWBoVQabLARQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693176316; a=rsa-sha256; cv=none; b=RSY9SS5obUQYIgC7dymxHVLtZQdXiFwmyU32K//PcVjt+LCEGHQ7fG4FpBqYoN4XKF74EA GEuxCP2Lrx9O3obXBnQFkRIPKYJ8IVRNHmV4vm8qT22K/uPdrEsjSwe9+Zt2waolUdMuvV PC1faii6ByP0jkApmV3uWZpPD8QyVxzZxyJTrablus5H/RbhwxhXkF3Km9af1NBcL5fUQh PYRIVyUcI1t6MalwrYg1v0PuabaI5d0DPtV2ymJmVCMz7oLTmZemF6aZW9yGTwuovP1ek5 tHuiauJDsYOvHvuzLku+YODgjBXrM/NmZin5t2wMLCmCWDXl2t/ZmmFUt1XRWw== 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 4RYpfz6WJVzl0W; Sun, 27 Aug 2023 22:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37RMjFNv003050; Sun, 27 Aug 2023 22:45:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37RMjFqw003047; Sun, 27 Aug 2023 22:45:15 GMT (envelope-from git) Date: Sun, 27 Aug 2023 22:45:15 GMT Message-Id: <202308272245.37RMjFqw003047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: b18ab4f29540 - stable/13 - vfs: trylock vnode requeue List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b18ab4f2954019f70b5f8cf879e76675f3d4425b Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b18ab4f2954019f70b5f8cf879e76675f3d4425b commit b18ab4f2954019f70b5f8cf879e76675f3d4425b Author: Mateusz Guzik AuthorDate: 2023-03-21 04:23:15 +0000 Commit: Mateusz Guzik CommitDate: 2023-08-27 22:44:12 +0000 vfs: trylock vnode requeue The quasi-LRU still gets in the way for example when doing an incremental bzImage build, with vnode_list lock being at the top of the profile. Further damage control the problem by trylocking. Note the entire mechanism desperately wants to be reaped out in favor of something(tm) which both scales in a multicore setting and provides sensible replacement policy. With this change everything vfs almost disappears from the on CPU flamegraph, what is left is tons of contention in the VM. (cherry picked from commit 138a5dafba312ff39ce0eefdbe34de95519e600d) --- sys/kern/vfs_subr.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5cdefca60e7c..c1c474b6724d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3533,17 +3533,25 @@ vdbatch_process(struct vdbatch *vd) MPASS(curthread->td_pinned > 0); MPASS(vd->index == VDBATCH_SIZE); - mtx_lock(&vnode_list_mtx); critical_enter(); - for (i = 0; i < VDBATCH_SIZE; i++) { - vp = vd->tab[i]; - TAILQ_REMOVE(&vnode_list, vp, v_vnodelist); - TAILQ_INSERT_TAIL(&vnode_list, vp, v_vnodelist); - MPASS(vp->v_dbatchcpu != NOCPU); - vp->v_dbatchcpu = NOCPU; + if (mtx_trylock(&vnode_list_mtx)) { + for (i = 0; i < VDBATCH_SIZE; i++) { + vp = vd->tab[i]; + vd->tab[i] = NULL; + TAILQ_REMOVE(&vnode_list, vp, v_vnodelist); + TAILQ_INSERT_TAIL(&vnode_list, vp, v_vnodelist); + MPASS(vp->v_dbatchcpu != NOCPU); + vp->v_dbatchcpu = NOCPU; + } + mtx_unlock(&vnode_list_mtx); + } else { + for (i = 0; i < VDBATCH_SIZE; i++) { + vp = vd->tab[i]; + vd->tab[i] = NULL; + MPASS(vp->v_dbatchcpu != NOCPU); + vp->v_dbatchcpu = NOCPU; + } } - mtx_unlock(&vnode_list_mtx); - bzero(vd->tab, sizeof(vd->tab)); vd->index = 0; critical_exit(); } From nobody Sun Aug 27 22:45:16 2023 X-Original-To: dev-commits-src-branches@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 4RYpg12ZBHz4rkf3; Sun, 27 Aug 2023 22:45:17 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYpg11LmXz3QDW; Sun, 27 Aug 2023 22:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693176317; 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=WxzW0dXz4G2PJIhCRLyeN8X22UCtfo2BVwY2VcGmKwk=; b=v4Ri4+Po5235H8fWYfpAESdAStaFItgfBUJmEVWd/hmqKJyepN/cUz2HrQtm4rkuCk/DOC 8eYUxJhGfGsB/eVxvoZFIuDKrbHNJVfQli3rmXgGbLepc+4tYJ6jHxwM9y6f7IecG+feH0 9J/Yxpmr69NbEs4LXxARESOJp52r3lCcr1ZAFBsQGwX0SSh9J5aGNK0ovMMWYJuq5HyNY0 WUh5/SBkk0Je94d8T0u+9gb41UJet3Pi06yP7xYIuLkuGu/JizRPGXnYfGICUgqAer3Y+E 1sdDBnpuKF1B9yoOLdCOkvsggGubF/fWf2VLE8DVpfNaTw9L4Td7D7EgFQm81Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693176317; 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=WxzW0dXz4G2PJIhCRLyeN8X22UCtfo2BVwY2VcGmKwk=; b=q02D2JoWelSGp+kRjtUepWAjjVkfwkU0GONEEZtAGhsa2Xf+Ni+XnMz7EbHdH+zRPMZe50 XcZLSnQ6IFYuQdDZUU8MGKlEPkv/tLiEYAp/pgK7TJy6x+3fqJ1hGd6YoBDNMZqJhFR5et ELtoSpzgaH7i73NvhiVLYbmGBxc7dcbt0HAwYVDiw+xJ/HSeUtw/74NPyOe7fWe5ayk1Yq 6J20CXpvevcnMrk4r6ldEJPy55JnFwyvTSMUAMIk6sxBEKxsx1FUoaqXtHd0x/T4X8MgwE gei+X5/vMPX0Hp0rpypsV14ONmWsiJm3mvMbe3gSeL+ijnbfZKdioc9iSe02jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693176317; a=rsa-sha256; cv=none; b=Dzl8E31bkdAZCkClNbeLZWy9kSIvUmGsD6ZDf773tpynq5NfUr/Ee6+eMmOipqqGisMvb9 FefD8TfZKYloOzGXAb8COiHWANIFTZQVwswR7PtBkO9pQLGpm8CIVVoJJ0Ek6qdBaaR2jo bkFNAMKhKhOhSPaM9FZiFUaXkckau5jAIH60xyO5cgFQ4MLGHv6ReeoVAc10kJEPcIB6Ne MQdcih76VrYx36AgBGD7WbmKgsvzKhl5Q5vIWEy72G8Rl1PzvYVH2ZSTocWH3cmSBzDjJr El1+p20tWCfzvbO2OcglAWdlv5LBtcRXszHMabhaEfaM45XujllQFxI+2ipYHg== 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 4RYpg10RNpzl9v; Sun, 27 Aug 2023 22:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37RMjGXH003105; Sun, 27 Aug 2023 22:45:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37RMjG6Y003102; Sun, 27 Aug 2023 22:45:16 GMT (envelope-from git) Date: Sun, 27 Aug 2023 22:45:16 GMT Message-Id: <202308272245.37RMjG6Y003102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: a521cee3322f - stable/13 - vfs: try harder to find free vnodes when recycling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a521cee3322f979b1caade7ec000bf4f7509246b Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a521cee3322f979b1caade7ec000bf4f7509246b commit a521cee3322f979b1caade7ec000bf4f7509246b Author: Mateusz Guzik AuthorDate: 2023-08-24 05:34:08 +0000 Commit: Mateusz Guzik CommitDate: 2023-08-27 22:44:12 +0000 vfs: try harder to find free vnodes when recycling The free vnode marker can slide past eligible entries. Artificially reducing vnode limit to 300k and spawning 104 workers each creating a million files results in all of them trying to recycle, which often fails when it should not have to. Because of the excessive traffic in this scenario, the trylock to requeue is virtually guaranteed to fail, meaning nothing gets pushed forward. Since no vnodes were found, the most unfortunate sleep for 1 second is induced (see vn_alloc_hard, the "vlruwk" msleep). Without the fix the machine is mostly idle with almost everyone stuck off CPU waiting for the sleep to finish. With the fix it is busy creating files. Unrelated to the above problem the marker could have landed in a similarly problematic spot for because of any failure in vtryrecycle. Originally reported as poudriere builders stalling in a vnode-count restricted setup. Fixes: 138a5dafba31 ("vfs: trylock vnode requeue") Reported by: Mark Millard (cherry picked from commit c1d85ac3df82df721e3d33b292579c4de491488e) --- sys/kern/vfs_subr.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c1c474b6724d..484ad75b243e 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -195,6 +195,10 @@ static counter_u64_t recycles_free_count; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles_free, CTLFLAG_RD, &recycles_free_count, "Number of free vnodes recycled to meet vnode cache targets"); +static counter_u64_t vnode_skipped_requeues; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, vnode_skipped_requeues, CTLFLAG_RD, &vnode_skipped_requeues, + "Number of times LRU requeue was skipped due to lock contention"); + static u_long deferred_inact; SYSCTL_ULONG(_vfs, OID_AUTO, deferred_inact, CTLFLAG_RD, &deferred_inact, 0, "Number of times inactive processing was deferred"); @@ -724,6 +728,7 @@ vntblinit(void *dummy __unused) vnodes_created = counter_u64_alloc(M_WAITOK); recycles_count = counter_u64_alloc(M_WAITOK); recycles_free_count = counter_u64_alloc(M_WAITOK); + vnode_skipped_requeues = counter_u64_alloc(M_WAITOK); /* * Initialize the filesystem syncer. @@ -1268,11 +1273,13 @@ vnlru_free_impl(int count, struct vfsops *mnt_op, struct vnode *mvp) struct vnode *vp; struct mount *mp; int ocount; + bool retried; mtx_assert(&vnode_list_mtx, MA_OWNED); if (count > max_vnlru_free) count = max_vnlru_free; ocount = count; + retried = false; vp = mvp; for (;;) { if (count == 0) { @@ -1280,6 +1287,24 @@ vnlru_free_impl(int count, struct vfsops *mnt_op, struct vnode *mvp) } vp = TAILQ_NEXT(vp, v_vnodelist); if (__predict_false(vp == NULL)) { + /* + * The free vnode marker can be past eligible vnodes: + * 1. if vdbatch_process trylock failed + * 2. if vtryrecycle failed + * + * If so, start the scan from scratch. + */ + if (!retried && vnlru_read_freevnodes() > 0) { + TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); + TAILQ_INSERT_HEAD(&vnode_list, mvp, v_vnodelist); + vp = mvp; + retried++; + continue; + } + + /* + * Give up + */ TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); TAILQ_INSERT_TAIL(&vnode_list, mvp, v_vnodelist); break; @@ -3533,6 +3558,17 @@ vdbatch_process(struct vdbatch *vd) MPASS(curthread->td_pinned > 0); MPASS(vd->index == VDBATCH_SIZE); + /* + * Attempt to requeue the passed batch, but give up easily. + * + * Despite batching the mechanism is prone to transient *significant* + * lock contention, where vnode_list_mtx becomes the primary bottleneck + * if multiple CPUs get here (one real-world example is highly parallel + * do-nothing make , which will stat *tons* of vnodes). Since it is + * quasi-LRU (read: not that great even if fully honoured) just dodge + * the problem. Parties which don't like it are welcome to implement + * something better. + */ critical_enter(); if (mtx_trylock(&vnode_list_mtx)) { for (i = 0; i < VDBATCH_SIZE; i++) { @@ -3545,6 +3581,8 @@ vdbatch_process(struct vdbatch *vd) } mtx_unlock(&vnode_list_mtx); } else { + counter_u64_add(vnode_skipped_requeues, 1); + for (i = 0; i < VDBATCH_SIZE; i++) { vp = vd->tab[i]; vd->tab[i] = NULL; From nobody Sun Aug 27 22:45:18 2023 X-Original-To: dev-commits-src-branches@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 4RYpg237Mqz4rkWs; Sun, 27 Aug 2023 22:45:18 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYpg22Nnmz3Q8f; Sun, 27 Aug 2023 22:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693176318; 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=1egRBo2A3FRMcFIdMKztlYqGkv+CefdguJ0PTnfYqWU=; b=JVZeqMFP4d3CTyJW3gNwyJsnRzwKoSriJEG91lJLBdCmEKnyAHSjC/wKQFo4IqoRvSnIIJ hzNetoPANyvCCevDoxVox/Sz2HajrU/V2XRQqS0s1TmA5dQ9vbpAoIPcmhQvXi+IlXK1/U YZFwjQKQR46U0hlwVYnxDjdmAWh0VEsK/3zSHkjWt2/ejjuxKbryMQP244/ZDCXhnhqkDl DwzlKjQeGO7cf7/7mpHTOQCF2htNBp6uQOC4usvyKY3IhVgZeyZRLMI5SAGYC/OuMGgkBa UVAdfX1UieqxzSIPz7MfTglhA9sBt8Y2TiKtFvMz+0IeGXAtNNw+22DO1ZEefA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693176318; 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=1egRBo2A3FRMcFIdMKztlYqGkv+CefdguJ0PTnfYqWU=; b=HYb/y32GETw8GLEgAHVwH1mRTXNLOGVnBy130kwOYS+8P/3UVWuhC3ModcTFAnlbmTSTg6 qF/JsREUz6gPkGGznt57izI1TKd/lFDSSRcVOClRvggWDKM95lIdoYoP0ktTwUu9sjipQ/ tR7jiLZHr2Sm+2LGkGAeweIbQx3FD1lAmGrz5Zsk3j9ilZWjbLfAi0kjkwf78nPSKZ4sXd B11dI5mToSJsgAq6+Wi1p0THSsXeBYWbPnBJ0tk+wfSe1ORYgVH5mRiSEesdmhQ8MOvrnr zVJ162eTJ7xsJG7CHoaOP50D8P1H0VuZ0iPr3Zg3BPG8+JLdjAYbR+Me2qzJ8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693176318; a=rsa-sha256; cv=none; b=CZGb2SsfIDQjMFUutSBWD1N4f0U9w6+mrejqaSODvEHTM6bPK8QFr98gUQ3/Rn/tqUsJGt N+gpvMmGTeLTMJDxPnl17R9FLtgBoqVdNdK0Ch/jVkXcxh1GpBAIafNKDT5mFdsXSXoYEe VNb9I8Xo4EYZhPBgsWynTGu8u5PXLjGTe84s7Q6amLgMlkUSfYiv9bUqATo8P6LOvXBsUj 2N+ssdwgAoexKG+S7ScKekXWqRpw+NRNmUx4V7vn/opv4F8GTI8kvZ2UTd8MwXy6p6IX+3 c5jQTTItoyJOHlWBCCaGWX3S19DTsS7vKCkEb+fKVillXsVDlOtZYBvuobpcsQ== 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 4RYpg21VM7zkVt; Sun, 27 Aug 2023 22:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37RMjIHg003159; Sun, 27 Aug 2023 22:45:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37RMjIOj003156; Sun, 27 Aug 2023 22:45:18 GMT (envelope-from git) Date: Sun, 27 Aug 2023 22:45:18 GMT Message-Id: <202308272245.37RMjIOj003156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: edfae4b4d2b5 - stable/13 - vfs: retried++ -> retried = true for the boolean List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: edfae4b4d2b5b5d930c1d175561b722286154dd6 Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=edfae4b4d2b5b5d930c1d175561b722286154dd6 commit edfae4b4d2b5b5d930c1d175561b722286154dd6 Author: Mateusz Guzik AuthorDate: 2023-08-24 22:49:47 +0000 Commit: Mateusz Guzik CommitDate: 2023-08-27 22:44:12 +0000 vfs: retried++ -> retried = true for the boolean No real changes. Noted by: rpokala (cherry picked from commit 712806fc4b5470eb7d9ce537e3cdf3b386455d86) --- sys/kern/vfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 484ad75b243e..209d6ac37cda 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1298,7 +1298,7 @@ vnlru_free_impl(int count, struct vfsops *mnt_op, struct vnode *mvp) TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); TAILQ_INSERT_HEAD(&vnode_list, mvp, v_vnodelist); vp = mvp; - retried++; + retried = true; continue; } From nobody Mon Aug 28 00:28:21 2023 X-Original-To: dev-commits-src-branches@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 4RYrxx3Brlz4rpt7; Mon, 28 Aug 2023 00:28:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYrxx2Xwbz3Xr8; Mon, 28 Aug 2023 00:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182501; 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=sSpu6TIaIXxllmbTLyAmIdJVD6bRWLi1t24HOlHbSzY=; b=TA6TMM4vFJxvS+uRmXDl/EOqo2det4/BeWpcxhMFsFnJgp9yy7BCvz0IMWnWr5i6sJsswR u5rFFtYwUmcKAmQ1IF2982R5sWDs7wSvlJIkS4CniuBAT5LnjUWCBq4uJ0ruce92NeEAi6 02e00mh3Ep2WZdSsa/+QnEQgT+X9BwY+kAgelLugcU62c5j3wJW+rtMFbesUrhTohYz7Fg 7nJr0ElvTYG5cy0CZhSQ1JYM19fjGBit3AseorvJCopu/A7ciQdxBFrl/18fS5r/GY7mbY O4/Abt9j7208XQ9QdInt86XE8s8WDawuf7Eag12UadbZV1RAZvu7+o/rR4PLaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182501; 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=sSpu6TIaIXxllmbTLyAmIdJVD6bRWLi1t24HOlHbSzY=; b=VOhBY5LQhOlbdq4Q3SjD5hjtXdzC+OegXZkY2SYbz4RCatdU6sGDmLXsFZz7zv6yj6U/Un Bv4uabxSLNAN1a6hsYcVE73fhWSJ8zKpl99TqjY5cmn+0S4+MzHqD6imfuBaF0L6H/KGDR o0zhig66fT4PXmRIiS2+MdbQIeXWKB/S7eFqH3ljPwCG7UoqYK0S9/geygU2N8O1bzZ3NN V0W/9Iw3HrPfigkU54+hYKeTXQvKXDY9NWlX3qc+JccroAPoQ/W0z4qeauz5FbPvnJN5cn IpZZ3EjAENn4L8E9P/foO6YXIIO0Pqo4jFHXnUaND4kogD3RVurN8BOQf4eZug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693182501; a=rsa-sha256; cv=none; b=OE44TR/wmWFxGOxkxpMcmBkGiAD4/C7kyacrsLroWyMSSSgyoBZCUzKlgKTjpY3e1GIpbL LztWCdnUTxAjxisjECfUoR9lEe+NTC/h4AMjQRrKA969FhjgdFUViJXnmeM4d0F20HejD5 Xq1harmX4qMk6Yy+9LagR1p2qxnTkFI0OwqJUkRn83JRDa6Nsw3gixUUaiLA8CwYXqshAm jjrbqflVmIPQLnbNhLT433BZykkEMYxX4X5ErG+FbDLuT1RzyJ2zUggO8uAj5NI4PQxGm6 HuBWnL9l0k63zlhkecxL3DjTLojS0B4jEngPZIYcsKWK3vX+H/N0n5NVkfd1+g== 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 4RYrxx1bSMznjX; Mon, 28 Aug 2023 00:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37S0SLkl069651; Mon, 28 Aug 2023 00:28:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37S0SLt4069648; Mon, 28 Aug 2023 00:28:21 GMT (envelope-from git) Date: Mon, 28 Aug 2023 00:28:21 GMT Message-Id: <202308280028.37S0SLt4069648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b03535a3b559 - stable/13 - hwpmc: on process exit, ensure that the owned log is closed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b03535a3b5591f460fe49256aa28313c9e17b37b Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b03535a3b5591f460fe49256aa28313c9e17b37b commit b03535a3b5591f460fe49256aa28313c9e17b37b Author: Konstantin Belousov AuthorDate: 2023-08-13 13:42:49 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-28 00:27:48 +0000 hwpmc: on process exit, ensure that the owned log is closed (cherry picked from commit 3c872a70b883e4e2b38135bd6bd114ac9d2ea579) --- sys/dev/hwpmc/hwpmc_mod.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 714e1f550144..c402c764d0a9 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -5078,13 +5078,13 @@ pmc_process_exit(void *arg __unused, struct proc *p) pmclog_process_sysexit(po, p->p_pid); PMC_EPOCH_EXIT(); - if (!is_using_hwpmcs) - return; - PMC_GET_SX_XLOCK(); PMCDBG3(PRC,EXT,1,"process-exit proc=%p (%d, %s)", p, p->p_pid, p->p_comm); + if (!is_using_hwpmcs) + goto out; + /* * Since this code is invoked by the last thread in an exiting * process, we would have context switched IN at some prior @@ -5222,6 +5222,8 @@ pmc_process_exit(void *arg __unused, struct proc *p) * memory. */ if ((po = pmc_find_owner_descriptor(p)) != NULL) { + if ((po->po_flags & PMC_PO_OWNS_LOGFILE) != 0) + pmclog_close(po); pmc_remove_owner(po); pmc_destroy_owner_descriptor(po); } From nobody Mon Aug 28 00:28:22 2023 X-Original-To: dev-commits-src-branches@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 4RYrxy4V5hz4rpfJ; Mon, 28 Aug 2023 00:28:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYrxy3kVqz3XlW; Mon, 28 Aug 2023 00:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182502; 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=gEqtruxBCThEz3RjCO35wB17be3ztyycDm9vh9TnPHM=; b=kTz6FQKcJSAwnMSuAdsCTgmC1VfweS1CJyqndBjNVLDN0CzgSayy4CpXFfdcp8FJLEWup6 IkRwZoFh8wogt3aY9+QpeCL8oiU2YcsTSPu/0CHadLx3tV1wvBMRetT8JW+EQU58lGJlLO Hk1YSseKMcaGVh1EY0EkADvBub3BZnEwA7B0lcEgv2sMGTXFfm/jW9ZUgECqbJ+JI5E71i 2ye0p0kfCmeHglldDy94lGvdBPw5HKQZFliJNlz59YRl/wuH0oJSLUJXXyloZP2k2V+iOX vrNUQr+gR/XuXsCShIKceE5Jhxny1qEnTx2IFIYMHnsN/bImIhMJRY4muR978A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182502; 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=gEqtruxBCThEz3RjCO35wB17be3ztyycDm9vh9TnPHM=; b=JErhtw8Ho1obNvUDbVaT4lBInep+dVWPUuIqjTHhH6LatCYxlfxaOJ2wFSpGRjCGXJSL34 d5IoXwaFPJUOQ42rCoBApQEShvNpLL1UT5aV0z3xARNXoMKyz796+N6eISOmveJS7SgMU8 sqahlNl36T7G1FmoUvcZBCRVKhs/cxFEeHqhIS6Xr9Q3Qq/rXy8Q6djjHu0sc01nEBp/6h hR7406wo5oOqG+eWg15wgq0C3zfTarZEtQA3u9df7gL6M8HIkfcDVmszeiK7jfWh+JF+4u nMYZ0AFic5OW1ZWm8tWU6N6uQ5vIHf1yoBAtSAB9BlAeEEevWp1TzXcqrF2ZXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693182502; a=rsa-sha256; cv=none; b=gKEhf+qJcmOG1KzAaLvqGNUiJ3A/hR0fvxd4jBCBII85AemoYI9KnFLe4q9Rds23Kj85ZB oLB6gU6aSV8gnr29ibBAnVMP8E6lUvxrHGjiKPAMiAptpdR/jJBbhmjpDaXYuhnsdmsHju YynasXypEruPGxQiSg8EbS61hrRMU1Tu49m/QauUVWVPc/M+8FEjix5SfJvQgXr/bsBMCW X64VyK4g03pjkvYO6X4PiSX7Y80adW67vCYttkLPahlCVwvgJ9eR1ydkV2U4mEjdRq6p9t ou1nt4P2Hjpnc81lZ7F7bUOm4Y2mCgvTab/GdaOfPqQIEr3G02P5u8nzun1d6w== 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 4RYrxy2ZlDzng9; Mon, 28 Aug 2023 00:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37S0SMoj069705; Mon, 28 Aug 2023 00:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37S0SMSf069702; Mon, 28 Aug 2023 00:28:22 GMT (envelope-from git) Date: Mon, 28 Aug 2023 00:28:22 GMT Message-Id: <202308280028.37S0SMSf069702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8925d38da3a7 - stable/13 - rtld_malloc.c: change return type of cp2op() to void List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8925d38da3a70733b1c40717560dc58caf39e0c0 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8925d38da3a70733b1c40717560dc58caf39e0c0 commit 8925d38da3a70733b1c40717560dc58caf39e0c0 Author: Konstantin Belousov AuthorDate: 2023-07-30 01:58:01 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-28 00:27:48 +0000 rtld_malloc.c: change return type of cp2op() to void (cherry picked from commit 6bb7f05850efceb01a7050e3c0fd86f9539c0071) --- libexec/rtld-elf/rtld_malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index 3437f638d339..1246238b3941 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -106,10 +106,10 @@ static int pagesz; /* page size */ * increasing order. */ -static union overhead * +static void * cp2op(void *cp) { - return ((union overhead *)((caddr_t)cp - sizeof(union overhead))); + return (((caddr_t)cp - sizeof(union overhead))); } void * From nobody Mon Aug 28 00:28:23 2023 X-Original-To: dev-commits-src-branches@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 4RYrxz538Kz4rpQ0; Mon, 28 Aug 2023 00:28:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYrxz4NZkz3Y3q; Mon, 28 Aug 2023 00:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182503; 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=RWgMH72T3OAEBrh1abMqZl3i0Z1M7ZC2xvKLn8YpSVA=; b=sLvDaUGYNHwoHD1EczMCZ8yhi2xUl4b4+uXAmWlh71KZByaSSwZaofcDbwl1+eOxkyBLig 3wLQbwqGWp3Nlt8+mRDALlBD6Rt1A7IG3py774SRHUd06x4wCL88Qn+exEnMkHsbEuLY8j jAJHBCbnDf+wvSXR36NnyUxqpvj9yUZnc5GmCrUuMyJdMoNqFW1d6OoPLyyfoE+ZGGqXq8 na/e8xGX0SmVxjCfViNRfZTZ/jjxJScIGjERN7DiR4s+MMtDyWcCZ/Apy0YeuNngkXf3DC pn+kQ2ldKc+Z0XnvijNk2t7xnIcjk+YmTYHcTlo3kX5/S13Heyj9Cd9EB+Q3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182503; 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=RWgMH72T3OAEBrh1abMqZl3i0Z1M7ZC2xvKLn8YpSVA=; b=t5yt4cgvE8Ra1QO+rp3+HSCpOynMISYpoahwOOCFjkLBsqhya3Byu5N9pwz3LfBBKuDi5v ++zd3ARb+Lne5odtNEJV1bhlvliOOwPyh+8TRVRoEMdN473nkGOcs9qltsnBW95UtKzRuF mxy8r+K/bsNkdM0E7s2Qg+HmyHyy5NRNzpq+ZY5In+GBVWa2hA8LHSEoiQi2/HRN6oJUFh 4O/QO/zskUJJgAtkWT2YQYRlbuwWV3qW9Jr6cgNurEuUVFRLeNv8n0FjzIbd2d2Fhr+wxx lSx4Z9t4hlIQChv11f4Auh9csh6noYd8CNvwOz3Lkj7hUicArh4LNOmwO1iS9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693182503; a=rsa-sha256; cv=none; b=SAn/WvVxVzJ+g/2uwR2dxfufl/rSOPWUlesinhaQhsJ3LmwIhVLhNmIAEUJ9E3Kr/o6nQH nmlIaVDddYnRG5PlkZjZsrsxKN75GflL9idVu/dA+sEygbnU5XqmdBQ0ieC53HSSrmpsSy ZRPcQXjDA0563bf+CHCe07B4UF7YUpFtsH7/9ha8nSyaOEnyrbqUeGdLHwY5Im5y0GQqRM x53R64yHEVvuHAV2hHrzV+TVDcgMUwEgbJtKRFTWUXcxUssqGPX8ctNklMbCfRG4CWUx29 BXpIoJEAAQX2+ewxBNnv/B8kKVjpVNasopDIVvUTJUl2f20gAkVspksqlkSjZw== 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 4RYrxz3SxDzn1g; Mon, 28 Aug 2023 00:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37S0SNJW069751; Mon, 28 Aug 2023 00:28:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37S0SNa5069748; Mon, 28 Aug 2023 00:28:23 GMT (envelope-from git) Date: Mon, 28 Aug 2023 00:28:23 GMT Message-Id: <202308280028.37S0SNa5069748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0c8823bad5fe - stable/13 - rtld_malloc: increase overhead index to uint16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0c8823bad5fed948d5c551ac0f48de96fe7653b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0c8823bad5fed948d5c551ac0f48de96fe7653b1 commit 0c8823bad5fed948d5c551ac0f48de96fe7653b1 Author: Konstantin Belousov AuthorDate: 2023-07-25 12:54:45 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-28 00:27:48 +0000 rtld_malloc: increase overhead index to uint16 (cherry picked from commit d60130bf32a3c35417f276507dcdfa569397dae3) --- libexec/rtld-elf/rtld_malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index 1246238b3941..ac8af4d6b6e1 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -75,8 +75,8 @@ static caddr_t pagepool_start, pagepool_end; union overhead { union overhead *ov_next; /* when free */ struct { - u_char ovu_magic; /* magic number */ - u_char ovu_index; /* bucket # */ + uint16_t ovu_index; /* bucket # */ + uint8_t ovu_magic; /* magic number */ } ovu; #define ov_magic ovu.ovu_magic #define ov_index ovu.ovu_index From nobody Mon Aug 28 00:28:24 2023 X-Original-To: dev-commits-src-branches@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 4RYry067WMz4rpQ4; Mon, 28 Aug 2023 00:28:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYry05Q94z3YF3; Mon, 28 Aug 2023 00:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182504; 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=00EYOtNI52v+h021hT/dN9AQAEXKL87v/1bqa2vs44Q=; b=WvtI+iBnILNMnl/efMjmR2w4q/GHTwWs3fnr21vXHO8wFTb3BgM+wmJ/Rb9WoWrhBLDVFM FTAmwEcbJ9ejubpEm+KWAtSA7pV4ZXSmc+bPsqaIgf+LkAa2Vwgz5ooptGr1nnvV5zwtu0 6tQOVaz+HchyeWLzmxL12yGzZPjW9Oj157rMeprMRjyTKOjsZecAkIZ5ZpjVHv/mOiDxXs A6DUVSyvw+l2/LGh9MFUL0l4wiLtKLMs8NoGCC2miig7kQXaPz+g8ur/j4qqT4RSc3nq0B yJ/mp1S72RnyNS7jL1HwdCw6fgGVt0ILmV/GOJYRpY0jiM8FMwBsDBdSL/KuxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182504; 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=00EYOtNI52v+h021hT/dN9AQAEXKL87v/1bqa2vs44Q=; b=qjGLMy5xkEB2V488asjeznmsZ/QXKyFOZmXH9M/V1XKFnSd2etps2U3PHLeaWNqJD9cnnb m8vE/h54D/UpJgbrc937djCv+0988EM3/c8KlmD09Eq4KkNL+aX6bd8qimXYq1th52wpnJ +NqLFmBpfH35NT+a9QE3mWC84CEcAs4LRqDomD1Ko1HO8kSzrLWfj1w6YBlIYrBtZQsnkl D79tr8QvhCn+lvXhas4VHL2w7Xswu8C3LDxGbbhke67jsgUqGae1he/8Y19OlKqdoaPmvM zXlLrQ3x3ajl/c7HuiBvzMQUDi7QMVLJ1fTNWvUjeEjBHxTnHBDnfTHppxu0nQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693182504; a=rsa-sha256; cv=none; b=q2xBn8KMBsr32PnxDXTQziPPY8jTeeE66pa0Edby/uu4xtp3cHGn2lDEvNq1ATC/kUd0mW ZdJnwZQ2R/EINytb0hQN5+T5+5u1tWcVS3Yhbg3PfPUL4BoxqPl5J29gp1CZoVs4tQJY9X EKVSxjtc29NTwcbcL73fyhS6tEjVR1v5ohbwP9w9ipdPfEjTuybLXLP4a5czATsQe7nM43 L1Wk0jmlYVUaFY4om7frWEUHGVilRf5xMaIXRkJAcO2sRA5jrVCxwlCgwI1YprdPHHRvEa wrCPXWre0i0q9TTdUNjEYFBxlRads03QxumVAou22Fwb1lXADcHC46iU4aD/GA== 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 4RYry04Rm1zn1h; Mon, 28 Aug 2023 00:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37S0SOmO069787; Mon, 28 Aug 2023 00:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37S0SOqp069784; Mon, 28 Aug 2023 00:28:24 GMT (envelope-from git) Date: Mon, 28 Aug 2023 00:28:24 GMT Message-Id: <202308280028.37S0SOqp069784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a3a71ddc77c2 - stable/13 - rtld_malloc: add __crt_aligned_alloc_offset() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3a71ddc77c214ed712507cb6e0dc9684feaef35 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a71ddc77c214ed712507cb6e0dc9684feaef35 commit a3a71ddc77c214ed712507cb6e0dc9684feaef35 Author: Konstantin Belousov AuthorDate: 2023-07-22 04:21:45 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-28 00:27:48 +0000 rtld_malloc: add __crt_aligned_alloc_offset() (cherry picked from commit c29ee08204ce4106d4992474005c5f2fb7d5fbf1) --- libexec/rtld-elf/rtld_malloc.c | 34 +++++++++++++++++++++++++++++++--- libexec/rtld-elf/rtld_malloc.h | 1 + 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index ac8af4d6b6e1..6e011e88ba5a 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -86,13 +86,15 @@ static void morecore(int bucket); static int morepages(int n); #define MAGIC 0xef /* magic # on accounting info */ +#define AMAGIC 0xdf /* magic # for aligned alloc */ /* * nextf[i] is the pointer to the next free block of size * (FIRST_BUCKET_SIZE << i). The overhead information precedes the data * area returned to the user. */ -#define FIRST_BUCKET_SIZE 8 +#define LOW_BITS 3 +#define FIRST_BUCKET_SIZE (1U << LOW_BITS) #define NBUCKETS 30 static union overhead *nextf[NBUCKETS]; @@ -169,6 +171,28 @@ __crt_calloc(size_t num, size_t size) return (ret); } +void * +__crt_aligned_alloc_offset(size_t align, size_t size, size_t offset) +{ + void *mem, *ov; + union overhead ov1; + uintptr_t x; + + if (align < FIRST_BUCKET_SIZE) + align = FIRST_BUCKET_SIZE; + offset &= align - 1; + mem = __crt_malloc(size + align + offset + sizeof(union overhead)); + if (mem == NULL) + return (NULL); + x = roundup2((uintptr_t)mem + sizeof(union overhead), align); + x += offset; + ov = cp2op((void *)x); + ov1.ov_magic = AMAGIC; + ov1.ov_index = x - (uintptr_t)mem - sizeof(union overhead); + memcpy(ov, &ov1, sizeof(ov1)); + return ((void *)x); +} + /* * Allocate more memory to the indicated bucket. */ @@ -210,12 +234,16 @@ morecore(int bucket) void __crt_free(void *cp) { + union overhead *op, op1; + void *opx; int size; - union overhead *op; if (cp == NULL) return; - op = cp2op(cp); + opx = cp2op(cp); + memcpy(&op1, opx, sizeof(op1)); + op = op1.ov_magic == AMAGIC ? (void *)((caddr_t)cp - op1.ov_index) : + opx; if (op->ov_magic != MAGIC) return; /* sanity */ size = op->ov_index; diff --git a/libexec/rtld-elf/rtld_malloc.h b/libexec/rtld-elf/rtld_malloc.h index f9780c552821..247726b9f470 100644 --- a/libexec/rtld-elf/rtld_malloc.h +++ b/libexec/rtld-elf/rtld_malloc.h @@ -32,6 +32,7 @@ #ifndef RTLD_MALLOC_H #define RTLD_MALLOC_H +void *__crt_aligned_alloc_offset(size_t align, size_t size, size_t offset); void *__crt_calloc(size_t num, size_t size); void __crt_free(void *cp); void *__crt_malloc(size_t nbytes); From nobody Mon Aug 28 00:28:25 2023 X-Original-To: dev-commits-src-branches@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 4RYry16vCzz4rpc7; Mon, 28 Aug 2023 00:28:25 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYry16Q5Tz3YL4; Mon, 28 Aug 2023 00:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182505; 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=foPCN1SsGyuY7leOl6OFBgxwvPqMtOWXKi7/W1kCTBI=; b=wpIGG3jO/20+rQSEHMlHHkdHjFbLTeBtcgCy4He4BUeolCCSplmAIqVkolKr+icxiHgUl2 z2DfGVAgft4Ptem8GE21eH1t0EGve2LRcf00dPRxmgqp6b40TE8wZVwOSjF8c3K1SUJ6Zk aBwQZJ0WbCvaaylw7N3GoEC++3tn19lNTdaXhPKHGDEt3S78ZI+gMmlR4AkYB615VaTE5V 1O7/Tv5axpScDxqF9e0/RQ3biXL04DgLkwefv9lMIiLgrwV/4XrHU4+LaVhVVoV04+/8QF eUzY2zxbDpycnxNAAA9S9T4+Ix4WwsyZ8vJHbK9c7zF1JY2W9JrCRenI1Bh3DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693182505; 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=foPCN1SsGyuY7leOl6OFBgxwvPqMtOWXKi7/W1kCTBI=; b=Kr8VZFktbod8eauvN09Cr6ET7hks/AL+tluDT32/txZAT7ige2A2rRe8M4jX2Mish5ULOo 8Kok1y2hbF93u2aeDoI+tedllh8j3PmTF5u+W2mNSyDxYZB0De7E+bqBZTe24JOrkpneQ+ CeHAhSj+KiwLj/oSKbDSHh840RPZCJ7k+W6T8fCE4lLvZYtTW+7GE9eShaV/0Nqvc7jiOZ j/znblpKQrn6FZcbIgbx7Gy2KpfwKwJeRdZeZlJypribllqPNuPJ0quCaQwcPb2llLvHw3 bXZIWXIvftOKEu3zybaXjinY48pof2BFxyiRXXWNkWHdZm9fk4zayzPRCoVdOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693182505; a=rsa-sha256; cv=none; b=T3V31dEShoo3pcfRGv/JegojpebXpErwLBJf4+mW8Q6lRr2DFh+WAVrMIGuQVQNdFFYIem 3ziaTrP3t9yeB5HR/ZLdhyCAlH7ddkitH8One2u7yBCj+FmjaQZ0O/Z5QSAyJ4sObRvd0X Ovmfqpu0aQmlzJOxqwY4KuDCu32hiMej2gShl/gG0Bw6pd+oeBbPYnQqd/PngT8O4Y4IPo UZNBg39fiJiGI+VK1R56LGYswwww0dbh+zgU4zhK7+27wyzCmjT9eJ9CxNTe6luPGzyF8w osGyctrW3tgSTbv/kuxfiMtfThl8gJXO8E++XB5TxgBYU1W1vyo8jelieppRtg== 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 4RYry15RkczngB; Mon, 28 Aug 2023 00:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37S0SP4G069832; Mon, 28 Aug 2023 00:28:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37S0SPlD069829; Mon, 28 Aug 2023 00:28:25 GMT (envelope-from git) Date: Mon, 28 Aug 2023 00:28:25 GMT Message-Id: <202308280028.37S0SPlD069829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0a12bf23325d - stable/13 - rtld: switch from malloc_aligned() to __crt_aligned_alloc() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0a12bf23325da9cb479ef844869200ff1b0255cf Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0a12bf23325da9cb479ef844869200ff1b0255cf commit 0a12bf23325da9cb479ef844869200ff1b0255cf Author: Konstantin Belousov AuthorDate: 2023-07-30 01:51:52 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-28 00:27:48 +0000 rtld: switch from malloc_aligned() to __crt_aligned_alloc() (cherry picked from commit feaae6ba1ace0091384ac371423976cd15e59e5a) --- libexec/rtld-elf/rtld.c | 14 +++++++------- libexec/rtld-elf/rtld.h | 3 +-- libexec/rtld-elf/xmalloc.c | 30 +++++++----------------------- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index e8b901bda634..888586cf876d 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5300,13 +5300,13 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) tls_block_size += pre_size + tls_static_space - TLS_TCB_SIZE - post_size; /* Allocate whole TLS block */ - tls_block = malloc_aligned(tls_block_size, maxalign, 0); + tls_block = xmalloc_aligned(tls_block_size, maxalign, 0); tcb = (Elf_Addr **)(tls_block + pre_size + extra_size); if (oldtcb != NULL) { memcpy(tls_block, get_tls_block_ptr(oldtcb, tcbsize), tls_static_space); - free_aligned(get_tls_block_ptr(oldtcb, tcbsize)); + free(get_tls_block_ptr(oldtcb, tcbsize)); /* Adjust the DTV. */ dtv = tcb[0]; @@ -5370,7 +5370,7 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) } } free(dtv); - free_aligned(get_tls_block_ptr(tcb, tcbsize)); + free(get_tls_block_ptr(tcb, tcbsize)); } #endif /* TLS_VARIANT_I */ @@ -5396,7 +5396,7 @@ allocate_tls(Obj_Entry *objs, void *oldtls, size_t tcbsize, size_t tcbalign) size = roundup(tls_static_space, ralign) + roundup(tcbsize, ralign); assert(tcbsize >= 2*sizeof(Elf_Addr)); - tls = malloc_aligned(size, ralign, 0 /* XXX */); + tls = xmalloc_aligned(size, ralign, 0 /* XXX */); dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); segbase = (Elf_Addr)(tls + roundup(tls_static_space, ralign)); @@ -5475,11 +5475,11 @@ free_tls(void *tls, size_t tcbsize __unused, size_t tcbalign) for (i = 0; i < dtvsize; i++) { if (dtv[i + 2] != 0 && (dtv[i + 2] < tlsstart || dtv[i + 2] > tlsend)) { - free_aligned((void *)dtv[i + 2]); + free((void *)dtv[i + 2]); } } - free_aligned((void *)tlsstart); + free((void *)tlsstart); free((void *)dtv); } @@ -5516,7 +5516,7 @@ allocate_module_tls(int index) obj->tls_dynamic = true; - p = malloc_aligned(obj->tlssize, obj->tlsalign, obj->tlspoffset); + p = xmalloc_aligned(obj->tlssize, obj->tlsalign, obj->tlspoffset); memcpy(p, obj->tlsinit, obj->tlsinitsize); memset(p + obj->tlsinitsize, 0, obj->tlssize - obj->tlsinitsize); return (p); diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 522638a5b1d9..e2fb3de470c3 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -367,8 +367,7 @@ Obj_Entry *map_object(int, const char *, const struct stat *); void *xcalloc(size_t, size_t); void *xmalloc(size_t); char *xstrdup(const char *); -void *malloc_aligned(size_t size, size_t align, size_t offset); -void free_aligned(void *ptr); +void *xmalloc_aligned(size_t size, size_t align, size_t offset); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */ extern bool ld_bind_not; diff --git a/libexec/rtld-elf/xmalloc.c b/libexec/rtld-elf/xmalloc.c index 80246f36dd26..5f7c1b5ba10a 100644 --- a/libexec/rtld-elf/xmalloc.c +++ b/libexec/rtld-elf/xmalloc.c @@ -75,34 +75,18 @@ xstrdup(const char *str) } void * -malloc_aligned(size_t size, size_t align, size_t offset) +xmalloc_aligned(size_t size, size_t align, size_t offset) { - char *mem, *res; - uintptr_t x; + void *res; offset &= align - 1; if (align < sizeof(void *)) align = sizeof(void *); - mem = xmalloc(size + 3 * align + offset); - x = roundup((uintptr_t)mem + sizeof(void *), align); - x += offset; - res = (void *)x; - x -= sizeof(void *); - memcpy((void *)x, &mem, sizeof(mem)); + res = __crt_aligned_alloc_offset(align, size, offset); + if (res == NULL) { + rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); + _exit(1); + } return (res); } - -void -free_aligned(void *ptr) -{ - void *mem; - uintptr_t x; - - if (ptr == NULL) - return; - x = (uintptr_t)ptr; - x -= sizeof(void *); - memcpy(&mem, (void *)x, sizeof(mem)); - free(mem); -} From nobody Mon Aug 28 02:45:29 2023 X-Original-To: dev-commits-src-branches@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 4RYw0B29Frz4rwqp; Mon, 28 Aug 2023 02:45:30 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYw0B1V0Rz4FcS; Mon, 28 Aug 2023 02:45:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693190730; 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=GdpGoHCLTH5/D+7c/Jj2Ys4mybDjKVMZBn6RpeTDIfU=; b=lyuach/gbQVpMNP+RS+ksOfYHpJzGgc37FNNV7+0X0iokpG5nJPkzJHsNlgu0gN5z7b/4S bjfDueijgsQq8VSIIuMObvh3OU95X5cFakUp6FxH2V98Amntc44oWZUJAcrAXz0I68/Bi4 A3HJzGwz5/NxakiSeah4IJK3wzzSlFWJZQ+6eMaBm54k1AwE2jB1GFnG3h1xvY0E3fIrgI BqdQ+K1OYUeg4iRMmruDD2Px9HS79pNeLWzFdJt7FggpyadmiRPLZcfFTJTZK8Pp4mdKK7 J0+2qqFh9DWX07rYAml6Rb6n1gxiMMSkfGtGmNTsrr3m+2+vzZJxKs7jxy4rWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693190730; 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=GdpGoHCLTH5/D+7c/Jj2Ys4mybDjKVMZBn6RpeTDIfU=; b=E/9MSxWrP4zIsDbsJo5jXo4oneWk0SKcr/zgweQCHZ1yFoITe7A0pf9vakicdBaIdkaBDW rTEqZS9NKKNWrsTSGdcvTuAF+u9Snj8i/J9Xob1qfoUUT0yE6GbCfwjrOXn7o733LP85i4 8ociz55PdMrSJJm61d3ny68ZjQlxQRkIPlVXO8Z5mj+jlYqmxXcm8GxUE4MoGZoPCPKgMj mN7cUmJu40ROKKDDAN+0vzWMZ0fUbjAZGsW6XLZMtDwF9t2HmdjbpMUM7z/66q7myAesAr rt9ZSU658QzW2Aa1S4SvOubK0YDAcCgcLzHbtlSMMnJs3UWf+AfLED0gygLCpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693190730; a=rsa-sha256; cv=none; b=chUC0yXHxT1H/qipsmxkp0EhpX+B+L4I0VNiyP4vElflYj2O3aGYf5Hvaz8xPP08vrVUdH zAmAfQIqgupBLYcJ1me8Ylp62slO6KyJP6ZfVJ2tXxByPs2LJ3qm+ulexkp7o+sKe+3DlK zByOriVj/brVoEOlQvWbV9dJXT1TLLWSgmICZcXbtTOVISI2f0LeuxWOQcIJma08M3AJW0 OQ5wPoJHp/To+RYzrcwCKS/S9LkWHsKaHE7K+UuMpExJfRgRXFGH0cB+z9DQ7W3Yoz8Ovp WMLDf1LV2liDife3FtJ6iGT0b4bww5h7Rzov5qzbPc1K39+s4q5NvIPWcAoMWg== 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 4RYw0B0YRMzrZq; Mon, 28 Aug 2023 02:45:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37S2jTMv001139; Mon, 28 Aug 2023 02:45:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37S2jTCa001136; Mon, 28 Aug 2023 02:45:29 GMT (envelope-from git) Date: Mon, 28 Aug 2023 02:45:29 GMT Message-Id: <202308280245.37S2jTCa001136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 876ef0c56853 - stable/13 - Fix mis-merge List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 876ef0c568535f3e4aac0a8ce911e7e24202182b Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=876ef0c568535f3e4aac0a8ce911e7e24202182b commit 876ef0c568535f3e4aac0a8ce911e7e24202182b Author: Konstantin Belousov AuthorDate: 2023-08-28 02:44:29 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-28 02:44:50 +0000 Fix mis-merge --- sys/dev/hwpmc/hwpmc_mod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index c402c764d0a9..0ef8fe949bca 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -5216,7 +5216,7 @@ pmc_process_exit(void *arg __unused, struct proc *p) } else critical_exit(); /* pp == NULL */ - +out: /* * If the process owned PMCs, free them up and free up * memory. From nobody Mon Aug 28 05:15:29 2023 X-Original-To: dev-commits-src-branches@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 4RYzKF74Kqz4qr05; Mon, 28 Aug 2023 05:15:29 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RYzKF6dt5z4TTD; Mon, 28 Aug 2023 05:15:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693199729; 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=jDdfl4e7ZiiM11VRq8c/cFytf7AAHeeKmSo8G6Pb0f0=; b=pVOgk7+XNzlsPgZ5HKMnKz6zOSVhUNq/cB6FGCJn31+jGH911hLX7mTlppj9gPfCXGdkIe rkIn6rmot533BECbgvYT4Fp62tG+CFsKKtmlSChh8WjEppbMNXpARNqh132bzEZLQfWo/A U6MTep8lVqtv8rouWcctsVBtEeqZQ8DHIHOsChKVxsxB3EOMNn+kH3zzlLn8L/J8auGkgY zmuaifoN2D2GMCSDikPZ8FLkB54ZC5nymPaUOtUS1NqjpEvaCoYfYxXi447PHGCSmkZk98 6JiFBjo+F6K/mTOvUd+/UIOxeSfaBLEZ+hKHaSFxT/3q63YEVI8ExCbfBo39cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693199729; 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=jDdfl4e7ZiiM11VRq8c/cFytf7AAHeeKmSo8G6Pb0f0=; b=RXYH57jmZPFJea0Ah2pguf0crj3OqyQICn8IHHe033NezchEK5zMroij3dKSAdlczB3umT dyyy9q1UPaeyYFPwzacS2YVt7FuGdifawVPK/bNCcmz4vjxXFDIMJtWNGYKSn+ZWNcaZsx WUsv1ggZ9Lz2o+JfOaFIBR1mywOtsvORGG8NFC1kG6exxP2YPMmwxaawxkD0r77ygXQ2x6 Z5hXueRj5hdekV8ShBoHS+zd8Ee5L2m4xabuX8goL+OaedQ6OKb8GtPArJ2Qe71/iwInHL SGpntpsBRwiE8K38dY+h6JBwCRfLwYc4bB6kFysn4hsGWPoqaaIJxOzC4IHINQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693199729; a=rsa-sha256; cv=none; b=ippQQr6bYS40v/+oM0e4eKiKUNSf6PTUSJ74mWi2FV6aIveyBvv4vk23WlapnERmda54Ta oxjtUN1EMHPcCex0MJogrtrlY1CuBqU8SQx3DS5X4jxjRqcB8Cp+c371P68cL/NrHqy2zT 5ykp8/Uv/SZDL+daD5hBBTAmB4taD/4k3kZUf/T1MfJuQ5JQslrEcCEJqMMw5Hp7rOas4N F3IG6GzQgZVImNBhBDSCS9FUtGqhPsqHmDGGgnjtm54Y7DP3XupPC2ZGAe2G0E5BDtSDY0 SmZ0uogThMHFAlJEumK3AYR9tDrEE8dFbX1Tsq6QqlBPI4RayEi3Y/66rBZc+Q== 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 4RYzKF5hYdzw12; Mon, 28 Aug 2023 05:15:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37S5FTmY052027; Mon, 28 Aug 2023 05:15:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37S5FTch052024; Mon, 28 Aug 2023 05:15:29 GMT (envelope-from git) Date: Mon, 28 Aug 2023 05:15:29 GMT Message-Id: <202308280515.37S5FTch052024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 472f6bfcae18 - stable/13 - MFC: MFV: less v643. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 472f6bfcae188be8686c2a4ddf8384199a105786 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=472f6bfcae188be8686c2a4ddf8384199a105786 commit 472f6bfcae188be8686c2a4ddf8384199a105786 Author: Xin LI AuthorDate: 2023-08-13 07:13:31 +0000 Commit: Xin LI CommitDate: 2023-08-28 05:15:15 +0000 MFC: MFV: less v643. (cherry picked from commit f80a33ea416e408c490a1f1f031a6abbccbae085) --- contrib/less/NEWS | 38 +++++++++++++++++++++++++++++++++ contrib/less/ch.c | 2 ++ contrib/less/command.c | 5 +++-- contrib/less/edit.c | 2 +- contrib/less/forwback.c | 8 +++---- contrib/less/funcs.h | 1 + contrib/less/help.c | 2 +- contrib/less/less.h | 9 ++++++++ contrib/less/less.nro | 15 ++++++++++---- contrib/less/lessecho.nro | 2 +- contrib/less/lesskey.nro | 15 ++++++++++---- contrib/less/optfunc.c | 8 +++---- contrib/less/os.c | 44 +++++++++++++++++++++++++++++++-------- contrib/less/screen.c | 53 +++++++++++++++++++++++++++++++++++++---------- contrib/less/search.c | 2 ++ contrib/less/version.c | 14 ++++++++++++- contrib/less/xbuf.c | 8 +++---- usr.bin/less/defines.h | 18 ++++++++-------- 18 files changed, 191 insertions(+), 55 deletions(-) diff --git a/contrib/less/NEWS b/contrib/less/NEWS index 468f59441b28..b1f8771c6c31 100644 --- a/contrib/less/NEWS +++ b/contrib/less/NEWS @@ -9,6 +9,44 @@ Report bugs, suggestions or comments at https://github.com/gwsw/less/issues. +====================================================================== + + Major changes between "less" versions 633 and 643 + +* Fix problem when a program piping into less reads from the tty, + like sudo asking for password (github #368). + +* Fix search modifier ^E after ^W. + +* Fix bug using negated (^N) search (github #374). + +* Fix bug setting colors with -D on Windows build (github #386). + +* Fix reading special chars like PageDown on Windows (github #378). + +* Fix mouse wheel scrolling on Windows (github #379). + +* Fix erroneous EOF when terminal window size changes (github #372). + +* Fix compile error with some definitions of ECHONL (github #395). + +* Fix crash on Windows when writing logfile (github #405). + +* Fix regression in exit code when stdin is /dev/null and + output is a file (github #373). + +* Add lesstest test suite to production release (github #344). + +* Change lesstest output to conform with + automake Simple Test Format (github #399). + +====================================================================== + + Major changes between "less" versions 632 and 633 + +* Fix build on systems which have ncurses/termcap.h or + ncursesw/termcap.h but not termcap.h. + ====================================================================== Major changes between "less" versions 608 and 632 diff --git a/contrib/less/ch.c b/contrib/less/ch.c index b297e7483e7b..fd53b2d66e38 100644 --- a/contrib/less/ch.c +++ b/contrib/less/ch.c @@ -406,6 +406,8 @@ public void sync_logfile(void) BLOCKNUM block; BLOCKNUM nblocks; + if (logfile < 0) + return; nblocks = (ch_fpos + LBUFSIZE - 1) / LBUFSIZE; for (block = 0; block < nblocks; block++) { diff --git a/contrib/less/command.c b/contrib/less/command.c index 88c0cb49ee77..c1003d55fada 100644 --- a/contrib/less/command.c +++ b/contrib/less/command.c @@ -181,7 +181,7 @@ static void mca_search1(void) { if (search_type & SRCH_SUBSEARCH(i)) { - char buf[8]; + char buf[INT_STRLEN_BOUND(int)+8]; SNPRINTF1(buf, sizeof(buf), "Sub-%d ", i); cmd_putstr(buf); } @@ -558,6 +558,7 @@ static int mca_search_char(int c) case CONTROL('E'): /* ignore END of file */ if (mca != A_FILTER) flag = SRCH_PAST_EOF; + search_type &= ~SRCH_WRAP; break; case '@': if (less_is_more) @@ -571,7 +572,7 @@ static int mca_search_char(int c) flag = SRCH_NO_MOVE; break; case CONTROL('S'): { /* SUBSEARCH */ - char buf[32]; + char buf[INT_STRLEN_BOUND(int)+24]; SNPRINTF1(buf, sizeof(buf), "Sub-pattern (1-%d):", NUM_SEARCH_COLORS); clear_bot(); cmd_putstr(buf); diff --git a/contrib/less/edit.c b/contrib/less/edit.c index 1896694456e5..3ca5e4cc7d31 100644 --- a/contrib/less/edit.c +++ b/contrib/less/edit.c @@ -975,7 +975,7 @@ loop: /* * Overwrite: create the file. */ - logfile = creat(filename, 0644); + logfile = creat(filename, CREAT_RW); break; case 'A': case 'a': /* diff --git a/contrib/less/forwback.c b/contrib/less/forwback.c index 6faec94d225b..b020fe5d85eb 100644 --- a/contrib/less/forwback.c +++ b/contrib/less/forwback.c @@ -232,7 +232,7 @@ public void forw(int n, POSITION pos, int force, int only_last, int nblank) (forw_scroll >= 0 && n > forw_scroll && n != sc_height-1); #if HILITE_SEARCH - if (hilite_search == OPT_ONPLUS || is_filtering() || status_col) { + if (pos != NULL_POSITION && (hilite_search == OPT_ONPLUS || is_filtering() || status_col)) { prep_hilite(pos, pos + 4*size_linebuf, ignore_eoi ? 1 : -1); pos = next_unfiltered(pos); } @@ -408,8 +408,8 @@ public void back(int n, POSITION pos, int force, int only_last) squish_check(); do_repaint = (n > get_back_scroll() || (only_last && n > sc_height-1) || header_lines > 0); #if HILITE_SEARCH - if (hilite_search == OPT_ONPLUS || is_filtering() || status_col) { - prep_hilite((pos < 3*size_linebuf) ? 0 : pos - 3*size_linebuf, pos, -1); + if (pos != NULL_POSITION && (hilite_search == OPT_ONPLUS || is_filtering() || status_col)) { + prep_hilite((pos < 3*size_linebuf) ? 0 : pos - 3*size_linebuf, pos, -1); } #endif while (--n >= 0) @@ -492,7 +492,7 @@ public void forward(int n, int force, int only_last) { back(1, position(TOP), 1, 0); pos = position(BOTTOM_PLUS_ONE); - } while (pos == NULL_POSITION); + } while (pos == NULL_POSITION && !ABORT_SIGS()); } } else { diff --git a/contrib/less/funcs.h b/contrib/less/funcs.h index 071e80b050a7..1c9b181c0459 100644 --- a/contrib/less/funcs.h +++ b/contrib/less/funcs.h @@ -36,6 +36,7 @@ public int apply_at_specials(int attr); public void putbs(void); public int win32_kbhit(void); public char WIN32getch(void); +public void WIN32ungetch(int ch); public void WIN32setcolors(int fg, int bg); public void WIN32textout(char *text, int len); public void match_brac(char obrac, char cbrac, int forwdir, int n); diff --git a/contrib/less/help.c b/contrib/less/help.c index 363b7eccddf2..423e0393e383 100644 --- a/contrib/less/help.c +++ b/contrib/less/help.c @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 17:26 on 2023/4/6 */ +/* This file was generated by mkhelp.pl from less.hlp at 22:43 on 2023/7/20 */ #include "less.h" constant char helpdata[] = { '\n', diff --git a/contrib/less/less.h b/contrib/less/less.h index 4a4f26d83f05..2ba8c353deeb 100644 --- a/contrib/less/less.h +++ b/contrib/less/less.h @@ -273,6 +273,15 @@ typedef off_t LINENUM; #endif #endif +/* + * Flags for creat() + */ +#if MSDOS_COMPILER +#define CREAT_RW (S_IREAD|S_IWRITE) +#else +#define CREAT_RW 0644 +#endif + /* * Set a file descriptor to binary mode. */ diff --git a/contrib/less/less.nro b/contrib/less/less.nro index c0ef536db8a3..ab0ea975df45 100644 --- a/contrib/less/less.nro +++ b/contrib/less/less.nro @@ -1,5 +1,5 @@ '\" t -.TH LESS 1 "Version 632: 06 Apr 2023" +.TH LESS 1 "Version 643: 20 Jul 2023" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -120,7 +120,7 @@ while it is being viewed. (The behavior is similar to the "tail \-f" command.) To stop waiting for more data, enter the interrupt character (usually \(haC). On systems which support -.BR poll (1) +.BR poll (2) you can also use \(haX or the character specified by the \-\-intr option. If the input is a pipe and the \-\-exit-follow-on-close option is in effect, .B less @@ -210,6 +210,8 @@ Search forward in the file for the N-th line containing the pattern. N defaults to 1. The pattern is a regular expression, as recognized by the regular expression library supplied by your system. +By default, searching is case-sensitive (uppercase and lowercase +are considered different); the \-i option can be used to change this. The search starts at the first line displayed (but see the \-a and \-j options, which change this). .sp @@ -489,10 +491,10 @@ so it may be necessary to use the R or F command to see more data. The \-\-intr option can be used to specify a different character to use instead of \(haX. This command works only on systems that support the -.BR poll (1) +.BR poll (2) function. On systems without -.BR poll (1), +.BR poll (2), the interrupt character (usually \(haC) can be used instead. . .SH OPTIONS @@ -720,6 +722,11 @@ CHAR_INFO.Attributes values .nh https://docs.microsoft.com/en-us/windows/console/char-info-str). .hy +.PP +On MS-DOS only, the \-Da option may be used to specify strict parsing of +ANSI color (SGR) sequences when the \-R option is used. +Without this option, sequences that change text attributes +(bold, underline, etc.) may clear the text color. .RE .IP "\-e or \-\-quit-at-eof" Causes diff --git a/contrib/less/lessecho.nro b/contrib/less/lessecho.nro index 6637cb947173..bd9c6b4f91c7 100644 --- a/contrib/less/lessecho.nro +++ b/contrib/less/lessecho.nro @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 632: 06 Apr 2023" +.TH LESSECHO 1 "Version 643: 20 Jul 2023" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS diff --git a/contrib/less/lesskey.nro b/contrib/less/lesskey.nro index 2f7c4864dc2f..324710547a3e 100644 --- a/contrib/less/lesskey.nro +++ b/contrib/less/lesskey.nro @@ -1,5 +1,5 @@ '\" t -.TH LESSKEY 1 "Version 632: 06 Apr 2023" +.TH LESSKEY 1 "Version 643: 20 Jul 2023" .SH NAME lesskey \- customize key bindings for less .SH "SYNOPSIS (deprecated)" @@ -48,7 +48,7 @@ Customizes line-editing key bindings. .IP #env Defines environment variables. .PP -Blank lines and lines which start with a pound sign (#) are ignored, +Blank lines and lines which start with a hash mark (#) are ignored, except as noted below. . .SH "COMMAND SECTION" @@ -108,7 +108,7 @@ l l. A backslash followed by any other character indicates that character is to be taken literally. Characters which must be preceded by backslash include -caret, space, tab and the backslash itself. +caret, space, tab, hash mark and the backslash itself. .PP An action may be followed by an "extra" string. When such a command is entered while running @@ -361,6 +361,11 @@ the same variable's original definition (with an = line), without any intervening definitions of other variables. It can append only to a variable defined earlier in the file; it cannot append to a variable in the system environment. +The string is appended literally, without any extra whitespace added, +so if whitespace is desired, +it should be appended to the end of the preceding line. +(It cannot be added to the beginning of the += string because space after +the equals sign is ignored, as noted above.) . .SH CONDITIONAL CONFIGURATION If a line begins with #version followed by a relational operator and a version number, @@ -410,7 +415,9 @@ is run and, on version 595 and higher, adds a \-\-color option. .sp .nf #env - LESS = \-i\ \-S + ## (Note that there must be a space at the end of the next line, + ## to separate the --color option from the -S option.) + LESS = \-i\ \-S\ #version\ >=\ 595\ \ LESS\ +=\ \-\-color=Hkc .fi . diff --git a/contrib/less/optfunc.c b/contrib/less/optfunc.c index da7e54c3d60a..974a6f6c8c8b 100644 --- a/contrib/less/optfunc.c +++ b/contrib/less/optfunc.c @@ -196,7 +196,7 @@ public void opt_j(int type, char *s) error("Position target at screen line %d", &parg); } else { - char buf[24]; + char buf[INT_STRLEN_BOUND(long)+2]; SNPRINTF1(buf, sizeof(buf), ".%06ld", jump_sline_fraction); len = (int) strlen(buf); while (len > 2 && buf[len-1] == '0') @@ -213,7 +213,7 @@ public void calc_jump_sline(void) { if (jump_sline_fraction < 0) return; - jump_sline = muldiv(sc_height, jump_sline_fraction, NUM_FRAC_DENOM); + jump_sline = (int) muldiv(sc_height, jump_sline_fraction, NUM_FRAC_DENOM); } /* @@ -256,7 +256,7 @@ public void opt_shift(int type, char *s) error("Horizontal shift %d columns", &parg); } else { - char buf[24]; + char buf[INT_STRLEN_BOUND(long)+2]; SNPRINTF1(buf, sizeof(buf), ".%06ld", shift_count_fraction); len = (int) strlen(buf); while (len > 2 && buf[len-1] == '0') @@ -273,7 +273,7 @@ public void calc_shift_count(void) { if (shift_count_fraction < 0) return; - shift_count = muldiv(sc_width, shift_count_fraction, NUM_FRAC_DENOM); + shift_count = (int) muldiv(sc_width, shift_count_fraction, NUM_FRAC_DENOM); } #if USERFILE diff --git a/contrib/less/os.c b/contrib/less/os.c index 56e3bf32ec9e..046270e68fc4 100644 --- a/contrib/less/os.c +++ b/contrib/less/os.c @@ -48,6 +48,7 @@ static int use_poll = TRUE; #endif #if USE_POLL #include +static int any_data = FALSE; #endif /* @@ -88,10 +89,10 @@ extern char *ttyin_name; public void init_poll(void) { - char *delay = lgetenv("LESS_DATA_DELAY"); - int idelay = (delay == NULL) ? 0 : atoi(delay); - if (idelay > 0) - waiting_for_data_delay = idelay; + char *delay = lgetenv("LESS_DATA_DELAY"); + int idelay = (delay == NULL) ? 0 : atoi(delay); + if (idelay > 0) + waiting_for_data_delay = idelay; #if USE_POLL #if defined(__APPLE__) /* In old versions of MacOS, poll() does not work with /dev/tty. */ @@ -113,6 +114,15 @@ static int check_poll(int fd, int tty) { struct pollfd poller[2] = { { fd, POLLIN, 0 }, { tty, POLLIN, 0 } }; int timeout = (waiting_for_data && !(scanning_eof && follow_mode == FOLLOW_NAME)) ? -1 : waiting_for_data_delay; + if (!any_data) + { + /* + * Don't do polling if no data has yet been received, + * to allow a program piping data into less to have temporary + * access to the tty (like sudo asking for a password). + */ + return (0); + } poll(poller, 2, timeout); #if LESSTEST if (ttyin_name == NULL) /* Check for ^X only on a real tty. */ @@ -193,6 +203,11 @@ start: sigmask(~0); #endif #endif +#endif +#if !MSDOS_COMPILER + if (fd != tty && !ABORT_SIGS()) + /* Non-interrupt signal like SIGWINCH. */ + return (READ_AGAIN); #endif return (READ_INTR); } @@ -207,7 +222,7 @@ start: * available, because that makes some background programs * believe DOS is busy in a way that prevents those * programs from working while "less" waits. - * {{ This code was added 12 Jan 2007; still needed? }} + * {{ This code was added 12 Jan 2007; still needed? }} */ fd_set readfds; @@ -234,11 +249,18 @@ start: } #else #if MSDOS_COMPILER==WIN32C - if (win32_kbhit() && WIN32getch() == intr_char) + if (win32_kbhit()) { - sigs |= S_INTERRUPT; - reading = 0; - return (READ_INTR); + int c; + + c = WIN32getch(); + if (c == intr_char) + { + sigs |= S_INTERRUPT; + reading = 0; + return (READ_INTR); + } + WIN32ungetch(c); } #endif #endif @@ -282,6 +304,10 @@ start: #endif return (READ_ERR); } +#if USE_POLL + if (fd != tty && n > 0) + any_data = TRUE; +#endif return (n); } diff --git a/contrib/less/screen.c b/contrib/less/screen.c index 6b389d7b0df0..8b15b7fdd8de 100644 --- a/contrib/less/screen.c +++ b/contrib/less/screen.c @@ -68,9 +68,17 @@ extern int fd0; #endif #endif +#if HAVE_NCURSESW_TERMCAP_H +#include +#else +#if HAVE_NCURSES_TERMCAP_H +#include +#else #if HAVE_TERMCAP_H #include #endif +#endif +#endif #ifdef _OSK #include #endif @@ -141,6 +149,8 @@ static WORD curr_attr; static int pending_scancode = 0; static char x11mousebuf[] = "[M???"; /* Mouse report, after ESC */ static int x11mousePos, x11mouseCount; +static int win_unget_pending = FALSE; +static int win_unget_data; static HANDLE con_out_save = INVALID_HANDLE_VALUE; /* previous console */ static HANDLE con_out_ours = INVALID_HANDLE_VALUE; /* our own */ @@ -160,8 +170,8 @@ static void win32_deinit_term(); #define MAKEATTR(fg,bg) ((WORD)((fg)|((bg)<<4))) #define APPLY_COLORS() { if (SetConsoleTextAttribute(con_out, curr_attr) == 0) \ error("SETCOLORS failed", NULL_PARG); } -#define SET_FG_COLOR(fg) { curr_attr |= (fg); APPLY_COLORS(); } -#define SET_BG_COLOR(bg) { curr_attr |= ((bg)<<4); APPLY_COLORS(); } +#define SET_FG_COLOR(fg) { curr_attr &= ~0x0f; curr_attr |= (fg); APPLY_COLORS(); } +#define SET_BG_COLOR(bg) { curr_attr &= ~0xf0; curr_attr |= ((bg)<<4); APPLY_COLORS(); } #define SETCOLORS(fg,bg) { curr_attr = MAKEATTR(fg,bg); APPLY_COLORS(); } #endif @@ -321,7 +331,7 @@ static void set_termio_flags( #ifdef ECHOK | ECHOK #endif -#if ECHONL +#ifdef ECHONL | ECHONL #endif ); @@ -1694,7 +1704,7 @@ static void ltputs(char *str, int affcnt, int (*f_putc)(int)) #endif /* MSDOS_COMPILER */ /* - * Configure the termimal so mouse clicks and wheel moves + * Configure the terminal so mouse clicks and wheel moves * produce input to less. */ public void init_mouse(void) @@ -2791,7 +2801,7 @@ public int win32_kbhit(void) INPUT_RECORD ip; DWORD read; - if (keyCount > 0) + if (keyCount > 0 || win_unget_pending) return (TRUE); currentKey.ascii = 0; @@ -2896,6 +2906,13 @@ public int win32_kbhit(void) /* * Read a character from the keyboard. + * + * Known issues: + * - WIN32getch API should be int like libc (with unsigned char values or -1). + * - The unicode code below can return 0 - incorrectly indicating scan code. + * - UTF16-LE surrogate pairs don't work (and return 0). + * - If win32_kbhit returns true then WIN32getch should never block, but it + * will block till the next keypress if it's numlock/capslock scan code. */ public char WIN32getch(void) { @@ -2904,6 +2921,12 @@ public char WIN32getch(void) static int utf8_size = 0; static int utf8_next_byte = 0; + if (win_unget_pending) + { + win_unget_pending = FALSE; + return (char) win_unget_data; + } + // Return the rest of multibyte character from the prior call if (utf8_next_byte < utf8_size) { @@ -2919,19 +2942,18 @@ public char WIN32getch(void) } do { - while (win32_kbhit() == FALSE) + while (!win32_kbhit()) { Sleep(20); if (ABORT_SIGS()) return ('\003'); - continue; } - keyCount --; + keyCount--; // If multibyte character, return its first byte - if (currentKey.ascii != currentKey.unicode) + if (currentKey.unicode > 0x7f) { - utf8_size = WideCharToMultiByte(CP_UTF8, 0, ¤tKey.unicode, 1, &utf8, sizeof(utf8), NULL, NULL); - if (utf8_size == 0 ) + utf8_size = WideCharToMultiByte(CP_UTF8, 0, ¤tKey.unicode, 1, (LPSTR) &utf8, sizeof(utf8), NULL, NULL); + if (utf8_size == 0) return '\0'; ascii = utf8[0]; utf8_next_byte = 1; @@ -2948,6 +2970,15 @@ public char WIN32getch(void) return ascii; } + +/* + * Make the next call to WIN32getch return ch without changing the queue state. + */ +public void WIN32ungetch(int ch) +{ + win_unget_pending = TRUE; + win_unget_data = ch; +} #endif #if MSDOS_COMPILER diff --git a/contrib/less/search.c b/contrib/less/search.c index 758e4491f1ce..98f01e5fcedd 100644 --- a/contrib/less/search.c +++ b/contrib/less/search.c @@ -944,6 +944,8 @@ static void hilite_line(POSITION linepos, char *line, int line_len, int *chpos, do { char *lep = sp[0]; int i; + if (sp[0] == NULL || ep[0] == NULL) + break; for (i = 1; i < nsp; i++) { if (sp[i] == NULL || ep[i] == NULL) diff --git a/contrib/less/version.c b/contrib/less/version.c index b0e4e6668da3..8c20787bfd4e 100644 --- a/contrib/less/version.c +++ b/contrib/less/version.c @@ -981,6 +981,18 @@ v629 2/26/23 Delay "waiting for data" message for 500 ms. v630 3/18/23 Add LESS_DATA_DELAY. v631 3/26/23 Fix input of dead keys on Windows. v632 4/6/23 Make lesstest work on MacOS; minor fixes. +v633 5/3/23 Fix build on systems with ncurses/termcap.h or ncursesw/termcap.h. +v634 5/29/23 Allow program piping into less to access tty; + fix search modifier ^E after ^W. +v635 6/2/23 Fix crash with ! search modifier. +v636 6/18/23 Fix -D in MS-DOS build; fix mouse wheel in MS-DOS build. +v637 6/28/23 Fix early EOF when SIGWINCH is received. +v638 6/29/23 Fix compile error with ECHONL. +v639 6/29/23 Fix SIGWINCH while reading tty. +v640 7/10/23 Add lesstest to release. +v641 7/10/23 Fix release. +v642 7/10/23 Fix release. +v643 7/20/23 Fix crash on Windows with -o. */ -char version[] = "632"; +char version[] = "643"; diff --git a/contrib/less/xbuf.c b/contrib/less/xbuf.c index 1ed369e175f2..92076764d314 100644 --- a/contrib/less/xbuf.c +++ b/contrib/less/xbuf.c @@ -93,7 +93,7 @@ static int help_fixup(void *r, uintmax val, int rsize, int rsigned) int *pr = r; if (INT_MAX < val) return TRUE; - *pr = val; + *pr = (int) val; #ifdef LLONG_MAX } else if (rsize == sizeof (long long)) { @@ -114,19 +114,19 @@ static int help_fixup(void *r, uintmax val, int rsize, int rsigned) long *pr = r; if (LONG_MAX < val) return TRUE; - *pr = val; + *pr = (long) val; } } else { if (rsize == sizeof (unsigned)) { unsigned *pr = r; if (UINT_MAX < val) return TRUE; - *pr = val; + *pr = (unsigned) val; } else if (rsize == sizeof (unsigned long)) { unsigned long *pr = r; if (ULONG_MAX < val) return TRUE; - *pr = val; + *pr = (unsigned long) val; #ifdef ULLONG_MAX } else if (rsize == sizeof (unsigned long long)) { long long *pr = r; diff --git a/usr.bin/less/defines.h b/usr.bin/less/defines.h index e6087d63f3eb..018d98a48162 100644 --- a/usr.bin/less/defines.h +++ b/usr.bin/less/defines.h @@ -262,12 +262,15 @@ /* Define HAVE_LOCALE if you have locale.h and setlocale. */ #define HAVE_LOCALE 1 -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - /* Define to 1 if you have the `nanosleep' function. */ #define HAVE_NANOSLEEP 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSESW_TERMCAP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_TERMCAP_H */ + /* Define HAVE_OSPEED if your termcap library has the ospeed variable. */ #define HAVE_OSPEED 1 @@ -451,14 +454,11 @@ /* Define to 1 if the `S_IS*' macros in do not work properly. */ /* #undef STAT_MACROS_BROKEN */ -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ From nobody Mon Aug 28 12:03:18 2023 X-Original-To: dev-commits-src-branches@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 4RZ8Mp3JQmz4rT8s; Mon, 28 Aug 2023 12:03:18 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZ8Mp2MLCz3dDD; Mon, 28 Aug 2023 12:03:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224198; 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=JA3VcQReQg7MwfV0VI14qFaGsYm86bvZksP9UdGuSaU=; b=F2PrZFTZA8uKyReO+XszcsQUvZxDBICfV7zpT7zSaKPjVnTTx3zRnUfQGVt8ltAfEA8MbQ ZFqvtgC99psxveQOofJPIdx8ypLNrk6R8S07VeS4bCNP92p5pipQ8kRJ+bw9AZkKqeRsGr 39WbdX2gdD20+sUhQdHLYwiFhlelz/VRWJonQs9TxlrCgn9f2OzBPzgyFwKmSXx/1YoEeq pAbqbCgy3YZjMDmPIr0AzIyfXe450N7p5FIbspJMjYbDnmBBJksP5zXwbt5gAPn8mfBeRp bw+Bn6kM8xiovuLDorXeRH+N7Mt6dllKWEKJSyVWW5wFUlPa1dU2cynxa1bzvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224198; 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=JA3VcQReQg7MwfV0VI14qFaGsYm86bvZksP9UdGuSaU=; b=S5pkGbRQMozlAiDmDdVx2ZlRrZzLNUL9+2WzMAiNpsLZjzWzcr9EZpQ7fXCPYSsLLHSYiq Mcy/kIAv4xxoEYjfb9OIQOfIA0zcoB2uU8jzlcuVTGIQlTzZOVYN2+Znh7IKItefUjwtby 5PO2lsh53diWqjiX0DJHVD6sqza8HR1PlnVA/PjF0j5NQAtL99rsn+zAEXBD4tFFGwzMgj lUZPVyj9cVDBJ5GP72p32UKRC/fCkK/YAJxUYy9SCKgaOdGjZwcYGd8RYcFH/97sP9iZgq K5o9b8KnNQGVj8z4RPFINVIBsfOTmi+UjcK/aOlOeEpaqHppKjL0736qL+D69g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693224198; a=rsa-sha256; cv=none; b=MBZ1q1gJ29z5jVeVwsJTNK5P8ddVodzo7ENSSDycAbT1YNF0leMF26WKFahbxIDQNyTZXg jutEKfffA1NQaeDUPdPz7nBpeeNmCYlPVEG56eMzhBQ4i3B0FSb0y8p4/Pvi4n3Bdm3eeM KkQxPpxptZeYPcgvUvuI69XcFvp5IC8syRBU0VAbKvJ3PEe6n1fqer6wrYImlhvxxQkwNc amYt4v11KEDpXcOr7YzyzeUM8LAKxARLX6NP1tsRrJktbhbAeOx64rzdJFsYkB8cqs2VSN KGdXQC313kvRHS/v8Sfz1O74MWdq8/TcwB2afVbqzPNno26zthPu2Iiob9SxyQ== 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 4RZ8Mp1QJVz16qg; Mon, 28 Aug 2023 12:03:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SC3Ito030342; Mon, 28 Aug 2023 12:03:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SC3I9L030339; Mon, 28 Aug 2023 12:03:18 GMT (envelope-from git) Date: Mon, 28 Aug 2023 12:03:18 GMT Message-Id: <202308281203.37SC3I9L030339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: fa0c6b66dc77 - stable/13 - pf: expose syncookie active/inactive status List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa0c6b66dc77704fadc29832a8fea3d3d63c52ff Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fa0c6b66dc77704fadc29832a8fea3d3d63c52ff commit fa0c6b66dc77704fadc29832a8fea3d3d63c52ff Author: Kristof Provost AuthorDate: 2022-09-24 12:47:17 +0000 Commit: Kristof Provost CommitDate: 2023-08-28 08:17:17 +0000 pf: expose syncookie active/inactive status When syncookies are in adaptive mode they may be active or inactive. Expose this status to users. Suggested by: Guido van Rooij Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 444a77ca85c78d02c19622a83a2798d0c5c2117b) --- lib/libpfctl/libpfctl.c | 1 + lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/pfctl_parser.c | 2 ++ sys/netpfil/pf/pf_ioctl.c | 2 ++ 4 files changed, 6 insertions(+) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 2205e1da9c1d..ae0e63818335 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -224,6 +224,7 @@ pfctl_get_status(int dev) status->hostid = ntohl(nvlist_get_number(nvl, "hostid")); status->states = nvlist_get_number(nvl, "states"); status->src_nodes = nvlist_get_number(nvl, "src_nodes"); + status->syncookies_active = nvlist_get_bool(nvl, "syncookies_active"); strlcpy(status->ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 544dba4e07a3..bcf8644d112c 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -54,6 +54,7 @@ struct pfctl_status { uint64_t src_nodes; char ifname[IFNAMSIZ]; uint8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; + bool syncookies_active; struct pfctl_status_counters counters; struct pfctl_status_counters lcounters; diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index a1760b5a65c4..c850056216ec 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -620,6 +620,8 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts) assert(cookies->mode <= PFCTL_SYNCOOKIES_ADAPTIVE); printf(" %-25s %s\n", "mode", PFCTL_SYNCOOKIES_MODE_NAMES[cookies->mode]); + printf(" %-25s %s\n", "active", + s->syncookies_active ? "active" : "inactive"); } } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index b0b5a361eb61..bd005893f7c8 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -4972,6 +4972,8 @@ pf_getstatus(struct pfioc_nv *nv) nvlist_add_number(nvl, "hostid", V_pf_status.hostid); nvlist_add_number(nvl, "states", V_pf_status.states); nvlist_add_number(nvl, "src_nodes", V_pf_status.src_nodes); + nvlist_add_bool(nvl, "syncookies_active", + V_pf_status.syncookies_active); /* counters */ error = pf_add_status_counters(nvl, "counters", V_pf_status.counters, From nobody Mon Aug 28 12:03:19 2023 X-Original-To: dev-commits-src-branches@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 4RZ8Mq3kCMz4rTVJ; Mon, 28 Aug 2023 12:03:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZ8Mq381Vz3dBM; Mon, 28 Aug 2023 12:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224199; 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=j1u93JvXuo11Ayvag6q5pX+WtUytmpopAVLXUELewnc=; b=R8Q9oURCbGBIxtYHcEvfCAzm9wPi6+/5Mr+vqLUN9+U9Tivv9BnRGq7zK8xZqo1zeDAvOC K4CVfHNOzwGW5h3annqDkzbLB5MXWMbKMnyLuZ8kjKeQM6NIUKe1kRKb2hQySuZMVLTeBm XvKmFKegzxSH+baZdNP5Nl/BwqURgp0zoQwcOaK1n0+4/afXC2jS3fuxhDufwF2bqY8+CZ 2xsSUQbZGvAwwHr5kkNSfKDnhb4jCv8jl/RV9Qx7ZG8/C1zStlXFn1daxIoKY4k6bRWmrH Qq/mPO7dbPW525sUEUptwBMuR07jspNY06fizljq81grgBfL6XxAAs7+DCf9oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224199; 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=j1u93JvXuo11Ayvag6q5pX+WtUytmpopAVLXUELewnc=; b=TO4O+LHvBANcpCrIkKoEijUTkqOnKUVU9/RiDPyN7LPce72eYf1xeD5BDBeVG1TW7iS0GL qXZsQspz3KXtSY1xk4sjVG/nMxf1hlsgK2bo9S41jOSawhxJakcG1d8MJns7teNWY/EnyR 8QNLJmg/MLKCGYwTAPsUoj6Y65zO0qsJYJG8iQ/Ivbr5juWD+Rf4dpKIxVzPJJlVMEIJf+ KKOPWGbErb7qZVGMU13OeH6RzeQz1LIebiSCU7AaccK7PALZaqbSXkvmFxBRi3oDLOIwlQ E2TyThWezyL8+l8IimT/3iFPBPSIALN3X5EXMKFouqX+rVcEmWReah1rFIGDAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693224199; a=rsa-sha256; cv=none; b=Zkm52FXAbz6O/6EcZwwr+qkSSx9qpxot7jzlsLzdOTyTiZpK8ts+qIAU74WWZw+2xQmc+X MTYYwAocmAfkrny2LugB+a0nNeZ3EqWPiEcPfqF4ZlD+Bw+bljb4sYeGEVCTTwWkV5WzTW pCX8Q/RB5Dpq5idhWc0SlxaR5roUPCahJy+w5sY9qJjuKLY92HbJ417F3HqtmxfvlmbjKS 353riCYPcvZCykl1n7C67LHmWrgD61LAWj8i0ACvKZtCxAMZWsrA8UJoTbc2eGV8Mil9A/ guDwehjBPJVOA4vjFcDxrYvGRqBgKxXZfewceaq2v5PzZZEaGZVOkwiuK1ZpIw== 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 4RZ8Mq2CQkz16vr; Mon, 28 Aug 2023 12:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SC3J5s030390; Mon, 28 Aug 2023 12:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SC3J7H030387; Mon, 28 Aug 2023 12:03:19 GMT (envelope-from git) Date: Mon, 28 Aug 2023 12:03:19 GMT Message-Id: <202308281203.37SC3J7H030387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b1b8f5a15fc0 - stable/13 - pf tests: verify syncookie status report List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1b8f5a15fc0fde1aea5eea5d1ecb7cfbee89d19 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b1b8f5a15fc0fde1aea5eea5d1ecb7cfbee89d19 commit b1b8f5a15fc0fde1aea5eea5d1ecb7cfbee89d19 Author: Kristof Provost AuthorDate: 2022-10-31 11:15:58 +0000 Commit: Kristof Provost CommitDate: 2023-08-28 08:17:18 +0000 pf tests: verify syncookie status report Verify that pfctl -si -v correctly shows syncookies to be active/inactive. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b0bf4303109a76eb4224015b9abebf88e96116ef) --- tests/sys/netpfil/pf/syncookie.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh index eb9f8c737476..290b61817471 100644 --- a/tests/sys/netpfil/pf/syncookie.sh +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -28,6 +28,14 @@ common_dir=$(atf_get_srcdir)/../common +syncookie_state() +{ + jail=$1 + + jexec $jail pfctl -si -v | grep -A 2 '^Syncookies' | grep active \ + | awk '{ print($2); }' +} + atf_test_case "basic" "cleanup" basic_head() { @@ -62,6 +70,14 @@ basic_body() then atf_fail "Failed to connect to syncookie protected echo daemon" fi + + + # Check that status shows syncookies as being active + active=$(syncookie_state alcatraz) + if [ "$active" != "active" ]; + then + atf_fail "syncookies not active" + fi } basic_cleanup() @@ -195,12 +211,26 @@ adaptive_body() # Sanity check atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + # Check that status shows syncookies as being inactive + active=$(syncookie_state alcatraz) + if [ "$active" != "inactive" ]; + then + atf_fail "syncookies active when they should not be" + fi + # Now syn flood to create many states ${common_dir}/pft_synflood.py \ --sendif ${epair}a \ --to 192.0.2.2 \ --count 100 + # Check that status shows syncookies as being active + active=$(syncookie_state alcatraz) + if [ "$active" != "active" ]; + then + atf_fail "syncookies not active" + fi + # Adaptive mode should kick in and stop us from creating more than # about 10 states states=$(jexec alcatraz pfctl -ss | grep tcp | wc -l) From nobody Mon Aug 28 12:03:20 2023 X-Original-To: dev-commits-src-branches@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 4RZ8Mr5wgpz4rTlX; Mon, 28 Aug 2023 12:03:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZ8Mr4TZ8z3dbR; Mon, 28 Aug 2023 12:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224200; 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=Yl9LtXkrqTEqC0PAsWkbuMBowwfijzqBsi5cqNxTWe0=; b=mSXi1uMeuE4kj/h67clcNiqOThZDdxzivmCPur/di9T0sf3IzJ1ShKfTpMiSYvgu6jVoJA +DgtRhc+A0/odwDxsdI4PBE7gIDbG0S5XZjrcWmjJbr+SXmm9r0gURYCPPLe9ZdKbWpzA/ VlAGoBoH0iuv0hcYTrHmUhpqy2KousyletkrdaHmITkudl9bIzVYtb/HTpDN5nMRpEt7CE r/XkXdvP1poFRkHqp6aTBLz1aJqXiZh7AmL7K1Ty6MYePSl6pOviwAzmME8iXIJBCWN3D2 2t7CdzzAhlVug5jb7q2TFaYPqqNF4/6fwFeOsVWLmMHUF7D4zhqPOQr3x+irSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224200; 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=Yl9LtXkrqTEqC0PAsWkbuMBowwfijzqBsi5cqNxTWe0=; b=LTmnaWeRmoVHnY5bFIM/tLllpOINbLVqfkir7XcnN+zGVatLCETS2s2SXks31EmjD2wfxh Nm1Bc20i+LwKXRaq3ubzEl3SXD42nGyMNDibVQAQRxujtVzu5sVZjciab6gjbckxuoWbMv IsmxTx3ai3tUEKNPytmRp/LNL5faM7ij+n5vcgNLdj0+cNmk2HHNChmfJXB1ZEkqS3hQT+ WQU19kHb8VS7zHsHxnqkRPKiIpk8Yo+bMNhMjn60qWrMTy8N79SvuoVr7BXRi8HXBFJeiX XpWJ5gLItlmaD5FbM3UTlSQMf7zpb5OMt6IC4boyIxuSz+dLFSQ/eQgS0tQuTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693224200; a=rsa-sha256; cv=none; b=p2JXJrfzGoXouLfPD51PGvjt9SCYsyzs3do6LUh/hjq1M5xywJkDjlrVcwAAZ+eSevFiFs 1fCM1Ei8dAHd6fR4qM6YsaQ1DX7QmdR8JHX/K6uaJMCCxtD6eaXspKLayD9/YGV9jVkXXj kgTJtAmb1Lmts1ra57TDGEBDkNOujIiE8Uv914c520FAEwk4Vkg0QBTUBYl3ScFkrISoAw //9V3/q0piZWQMVRBiBYYipJZxRw1iu3s82ojsHq9hTvANefHR9cRA2OvIF8qvo/O7/c+s sHp5+swcCaTWW5y7z2MBUVEFGmxzKLXCa+E8TJKAQobhy7blqZ+6UdcK79D77g== 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 4RZ8Mr39pkz17MT; Mon, 28 Aug 2023 12:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SC3KSF030433; Mon, 28 Aug 2023 12:03:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SC3KuO030430; Mon, 28 Aug 2023 12:03:20 GMT (envelope-from git) Date: Mon, 28 Aug 2023 12:03:20 GMT Message-Id: <202308281203.37SC3KuO030430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ed3875392697 - stable/13 - pf: reduce indentation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed38753926973fbd84135523efefcfcb887064ee Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ed38753926973fbd84135523efefcfcb887064ee commit ed38753926973fbd84135523efefcfcb887064ee Author: Kajetan Staszkiewicz AuthorDate: 2023-08-21 05:59:49 +0000 Commit: Kristof Provost CommitDate: 2023-08-28 08:17:18 +0000 pf: reduce indentation Early-return to reduce syncookie-related indentation. No functional change. MFC after: 1 week Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D41502 (cherry picked from commit 9642d948c08d80a41679f2eaab26e85a8b9e3080) --- sys/netpfil/pf/pf.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0717c0ac0992..9c1d11952a90 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6729,8 +6729,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * pd.dir == PF_IN) { struct mbuf *msyn; - msyn = pf_syncookie_recreate_syn(h->ip_ttl, - off,&pd); + msyn = pf_syncookie_recreate_syn(h->ip_ttl, off, + &pd); if (msyn == NULL) { action = PF_DROP; break; @@ -6738,29 +6738,22 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * action = pf_test(dir, pflags, ifp, &msyn, inp); m_freem(msyn); + if (action != PF_PASS) + break; - if (action == PF_PASS) { - action = pf_test_state_tcp(&s, dir, - kif, m, off, h, &pd, &reason); - if (action != PF_PASS || s == NULL) { - action = PF_DROP; - break; - } - - s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) - - 1; - s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) - - 1; - pf_set_protostate(s, PF_PEER_SRC, - PF_TCPS_PROXY_DST); - - action = pf_synproxy(&pd, &s, &reason); - if (action != PF_PASS) - break; + action = pf_test_state_tcp(&s, dir, + kif, m, off, h, &pd, &reason); + if (action != PF_PASS || s == NULL) { + action = PF_DROP; + break; } + + s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) - 1; + s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) - 1; + pf_set_protostate(s, PF_PEER_SRC, PF_TCPS_PROXY_DST); + action = pf_synproxy(&pd, &s, &reason); break; - } - else { + } else { action = pf_test_rule(&r, &s, dir, kif, m, off, &pd, &a, &ruleset, inp); } From nobody Mon Aug 28 12:03:21 2023 X-Original-To: dev-commits-src-branches@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 4RZ8Ms5YH0z4rTRb; Mon, 28 Aug 2023 12:03:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZ8Ms53JMz3dYJ; Mon, 28 Aug 2023 12:03:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224201; 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=GCkRauaOMaJhI3VbByjEX5NQ7SmeGxy1LVNtbN/wcyw=; b=R4tKGh1tLo9F7cYp97dRiItGjNDPCg8nUzNDYAXe/Pb5Joc08tXkr7i9bXocYTRani+CXt 0R3XvMrfV7kA4u2p9sqsaOjpENdbq+RRZR02HGJcOdJgg2LzTEXLmpwtDieJQzgbBGFSeY sOk/5B5hIXipbzrwdBck0/+8E90MuVhxuJFY+phKfHjV2LDtmpjRTp7zNY4mX22hHxsPZi RgL0h/PorHmyU+Zj9pdTGWWATWdmbO0nTXarNFVMET3V+8UKY8PeD1FlQhv8gbVhqHEnAT g6NeFbuQIge8L6KFd/ed3CvXeLyjlDn1gu+z0GYYR2rBRsNEyRdactL3awfwLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224201; 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=GCkRauaOMaJhI3VbByjEX5NQ7SmeGxy1LVNtbN/wcyw=; b=JMWVQBF0kqKZFKAFJdQ/IDJgSmgGWAItcbNYsWn7a8PPR70i+sUweAy6W2uhUfbAhqfsYW NUPREZq2Hu00qxfHi+gw9LbLYLml+NRa4T9RrLw7OcXmbykZ5QNYA3lETcQWGG4AupBvq1 ZYiLH2SpF/qGU/n9GxffIVtHrszJWwsRMAYnkJp95/h6AbwgojRqMp3quoBRMN3HUjtjxr bN7VQsFyb2q8l15cqnyI6+9ARV0JWiCH2U3DC3mRScGbrDBy0iUYLgCvo7466eHftUsUzX SVVJQm29bTn7EjAdV+YriKaFXzbi2vz6b8W+17DgOCZFBEX5/ZxWXIR+PzRIlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693224201; a=rsa-sha256; cv=none; b=BvdaL5/jzTeR0woCecst4oj+/zRo1ia2MNGBbsb4HocWwCiWfpE3tu45tMc3/JIkcZYihu t4zEJ8nKjjKa13Us1YjVSyGSNvHmdyDZCA1lhpxrANg+37gVr7B9Y9gcYSWTjRKTHvwKDT 1xrnPtE/Um02609ByHGi+j+PuhHAOVs75JcECBlcsLnAtnx5gO7YJakaS32oB3WhJnI1f6 QM6NRNIxnH7QcRJZtfEFXSutz0DfiXkdXlaT8uI4ymr8SgwIIqhMOAqkqCYndSddAfRaEM nNscQsz2qLmJ3stxEk88mIs8qJHYORDdNlkhdK+w4YcP6TVUR/XrWzj4hckiXw== 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 4RZ8Ms3q6Vz16tV; Mon, 28 Aug 2023 12:03:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SC3Lp6030482; Mon, 28 Aug 2023 12:03:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SC3LRO030479; Mon, 28 Aug 2023 12:03:21 GMT (envelope-from git) Date: Mon, 28 Aug 2023 12:03:21 GMT Message-Id: <202308281203.37SC3LRO030479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ae0512bb02cc - stable/13 - pf: enable the syncookie feature for IPv6 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae0512bb02ccd3d878b1d0cf6ee5c77942120a21 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ae0512bb02ccd3d878b1d0cf6ee5c77942120a21 commit ae0512bb02ccd3d878b1d0cf6ee5c77942120a21 Author: Kajetan Staszkiewicz AuthorDate: 2023-08-21 06:01:29 +0000 Commit: Kristof Provost CommitDate: 2023-08-28 08:17:18 +0000 pf: enable the syncookie feature for IPv6 When syncookie support was added to pf the relevant work was only done in pf_test(), not pf_test6(). Do this now. MFC after: 1 week Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D41502 (cherry picked from commit 92d4152295bc670b80352b5fbe102565de99a4eb) --- sys/netpfil/pf/pf.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9c1d11952a90..99fca2d6fabf 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7220,6 +7220,17 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb goto done; } pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); + pd.sport = &pd.hdr.tcp.th_sport; + pd.dport = &pd.hdr.tcp.th_dport; + + /* Respond to SYN with a syncookie. */ + if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == TH_SYN && + pd.dir == PF_IN && pf_synflood_check(&pd)) { + pf_syncookie_send(m, off, &pd); + action = PF_DROP; + break; + } + action = pf_normalize_tcp(dir, kif, m, 0, off, h, &pd); if (action == PF_DROP) goto done; @@ -7230,10 +7241,44 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; - log = s->log; - } else if (s == NULL) - action = pf_test_rule(&r, &s, dir, kif, m, off, &pd, - &a, &ruleset, inp); + } else if (s == NULL) { + /* Validate remote SYN|ACK, re-create original SYN if + * valid. */ + if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == + TH_ACK && pf_syncookie_validate(&pd) && + pd.dir == PF_IN) { + struct mbuf *msyn; + + msyn = pf_syncookie_recreate_syn(h->ip6_hlim, + off, &pd); + if (msyn == NULL) { + action = PF_DROP; + break; + } + + action = pf_test6(dir, pflags, ifp, &msyn, inp); + m_freem(msyn); + if (action != PF_PASS) + break; + + action = pf_test_state_tcp(&s, dir, kif, m, off, h, + &pd, &reason); + if (action != PF_PASS || s == NULL) { + action = PF_DROP; + break; + } + + s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) - 1; + s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) - 1; + pf_set_protostate(s, PF_PEER_SRC, PF_TCPS_PROXY_DST); + + action = pf_synproxy(&pd, &s, &reason); + break; + } else { + action = pf_test_rule(&r, &s, dir, kif, m, off, &pd, + &a, &ruleset, inp); + } + } break; } From nobody Mon Aug 28 12:03:22 2023 X-Original-To: dev-commits-src-branches@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 4RZ8Mt6WDfz4rTVP; Mon, 28 Aug 2023 12:03:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZ8Mt5m1Rz3dtH; Mon, 28 Aug 2023 12:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224202; 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=th4B5cetEyF6xnbYxOL59VAPK7Xd1fbs2f1lyC4f9wE=; b=qmYi0bHMruXAUDobqKTdkxYoQG0KAmSQL0j4TyN7fhlh1uwedYpjrBNadvZOp8cUKls26G TDiQ87QBiMGNnque2FHWhGmAGM6WyHsWcJHrKVfmFLwvazNsvRLF0EppJ+U36PRjQ4pej3 vSgNZmOsRQUuTNEii7MU9m3GLl4UFrhLHmlBfMwZqVSLYL4qVybNLbbz8xncMv3hmuNzF/ 9kMwAQ6rcaMnf66OQhyMUc3IaBlTqqIp+Uemx7wiwmbJMNyjro2ionI1uBySFR8WchhUfJ D28Sp0Su3vw3qr3wC3Rx6AJCmqfZl9tgTHEx/H9KyrBzBAYL0iOeWxQPqUjC+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224202; 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=th4B5cetEyF6xnbYxOL59VAPK7Xd1fbs2f1lyC4f9wE=; b=q3mvulL8SV4gCmehHqf5estP1TYX2SNBInDpDUr4a6PdLxMYeIy6R0SIUXgPm7/+laBA+/ 5l76fp8oVKUkefcgcJyovIEbCTBKuTdTbbhP1rmSpSKRoRsPAVjLrqi/fixhXeoB4zde87 T8uFMw7VYW01uFi2prv5r2tXEjty9bnY8trlL2Q3zuZHQBHXzxJUMvHZMMGbKk2UbCeIK6 t9FZY4J09VEUuOC5s4xgOTkL2BG6GjSow8uluAs8o/2KZ8PGkMKiQ7E0ETMSifbIWeY6y7 Mk6ek1M9M6GBe5lhQIukcTrEIN/TOuiZIXTiQ9bSr6SRIiBB+ZXmEcNWZxiJmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693224202; a=rsa-sha256; cv=none; b=t4iGm0EN+RAIwd2VLpvR5Co/MJdwqwOOFLsFWYhVEaeeJMM8Y+eXPnXlJTL59OOrCTyKBz 3nPgEY9mrp9Wm+l7rGaNhoCLHoAQl+sy07HIsURVte8SvH74m6SVgmNbqIU0fWhWgWAJ5u +myUl+aDEqhO+P5OVxRmHRp8x6djN7lqj1cRdhpyeErsd0Dx6smCdS/M6SeLK/ErhnNigb hVe0YoQeUtXJy1QTQB0Y71Irba4rGlin92/924Rl1y7BDyn+pMWM/By5yxsw0SwyWf9iiG cprlQPI1gYcNdJqCucKbBcIe9LJZBv0msGItYnk1mb/99xfAitER86GJD9+JKA== 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 4RZ8Mt4pyxz17MV; Mon, 28 Aug 2023 12:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SC3MDE030527; Mon, 28 Aug 2023 12:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SC3MNq030524; Mon, 28 Aug 2023 12:03:22 GMT (envelope-from git) Date: Mon, 28 Aug 2023 12:03:22 GMT Message-Id: <202308281203.37SC3MNq030524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 89437732d361 - stable/13 - pf tests: test syncookies on IPv6 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 89437732d361d9b761660021cefc3f362c9ca672 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=89437732d361d9b761660021cefc3f362c9ca672 commit 89437732d361d9b761660021cefc3f362c9ca672 Author: Kristof Provost AuthorDate: 2023-08-21 06:06:50 +0000 Commit: Kristof Provost CommitDate: 2023-08-28 08:17:18 +0000 pf tests: test syncookies on IPv6 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 1fd8c845b8b77f208f481901823fb87df04f8add) --- tests/sys/netpfil/common/pft_synflood.py | 8 +- tests/sys/netpfil/pf/syncookie.sh | 151 ++++++++++++++++++++++++++++++- 2 files changed, 157 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/common/pft_synflood.py b/tests/sys/netpfil/common/pft_synflood.py index 67a5bba0def7..f73caa1b6aa6 100644 --- a/tests/sys/netpfil/common/pft_synflood.py +++ b/tests/sys/netpfil/common/pft_synflood.py @@ -35,7 +35,10 @@ def syn_flood(args): # Set a src mac, to avoid doing lookups which really slow us down. ether = sp.Ether(src='01:02:03:04:05') - ip = sp.IP(dst=args.to[0]) + if args.ip6: + ip = sp.IPv6(dst=args.to[0]) + else: + ip = sp.IP(dst=args.to[0]) for i in range(int(args.count[0])): tcp = sp.TCP(flags='S', sport=1+i, dport=22, seq=500+i) pkt = ether / ip / tcp @@ -44,6 +47,9 @@ def syn_flood(args): def main(): parser = argparse.ArgumentParser("pft_synflood.py", description="SYN flooding tool") + parser.add_argument('--ip6', + action='store_true', + help='Use IPv6 rather than IPv4') parser.add_argument('--sendif', nargs=1, required=True, help='The interface through which the packet(s) will be sent') diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh index 290b61817471..814593adbf98 100644 --- a/tests/sys/netpfil/pf/syncookie.sh +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -71,7 +71,6 @@ basic_body() atf_fail "Failed to connect to syncookie protected echo daemon" fi - # Check that status shows syncookies as being active active=$(syncookie_state alcatraz) if [ "$active" != "active" ]; @@ -86,6 +85,55 @@ basic_cleanup() pft_cleanup } +atf_test_case "basic_v6" "cleanup" +basic_v6_head() +{ + atf_set descr 'Basic syncookie IPv6 test' + atf_set require.user root +} + +basic_v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set syncookies always" \ + "pass in" \ + "pass out" + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8::1 + + reply=$(echo foo | nc -N -w 5 2001:db8::1 7) + if [ "${reply}" != "foo" ]; + then + atf_fail "Failed to connect to syncookie protected echo daemon" + fi + + # Check that status shows syncookies as being active + active=$(syncookie_state alcatraz) + if [ "$active" != "active" ]; + then + atf_fail "syncookies not active" + fi +} + +basic_v6_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + atf_test_case "forward" "cleanup" forward_head() { @@ -137,6 +185,57 @@ forward_cleanup() pft_cleanup } +atf_test_case "forward_v6" "cleanup" +forward_v6_head() +{ + atf_set descr 'Syncookies for forwarded hosts' + atf_set require.user root +} + +forward_v6_body() +{ + pft_init + + epair_in=$(vnet_mkepair) + epair_out=$(vnet_mkepair) + + vnet_mkjail fwd ${epair_in}b ${epair_out}a + vnet_mkjail srv ${epair_out}b + + jexec fwd ifconfig ${epair_in}b inet6 2001:db8::1/64 up no_dad + jexec fwd ifconfig ${epair_out}a inet6 2001:db8:1::1/64 up no_dad + jexec fwd sysctl net.inet6.ip6.forwarding=1 + + jexec srv ifconfig ${epair_out}b inet6 2001:db8:1::2/64 up no_dad + jexec srv route -6 add default 2001:db8:1::1 + jexec srv /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + ifconfig ${epair_in}a inet6 2001:db8::2/64 up no_dad + route -6 add -net 2001:db8:1::/64 2001:db8::1 + + jexec fwd pfctl -e + pft_set_rules fwd \ + "set syncookies always" \ + "pass in" \ + "pass out" + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:1::2 + + reply=$(echo foo | nc -N -w 5 2001:db8:1::2 7) + if [ "${reply}" != "foo" ]; + then + atf_fail "Failed to connect to syncookie protected echo daemon" + fi +} + +forward_v6_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + atf_test_case "nostate" "cleanup" nostate_head() { @@ -183,6 +282,53 @@ nostate_cleanup() pft_cleanup } +atf_test_case "nostate_v6" "cleanup" +nostate_v6_head() +{ + atf_set descr 'Ensure that we do not create until SYN|ACK' + atf_set require.user root + atf_set require.progs scapy +} + +nostate_v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set syncookies always" \ + "pass in" \ + "pass out" + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8::1 + + # Now syn flood to create many states + ${common_dir}/pft_synflood.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --count 20 + + states=$(jexec alcatraz pfctl -ss | grep tcp) + if [ -n "$states" ]; + then + echo "$states" + atf_fail "Found unexpected state" + fi +} + +nostate_v6_cleanup() +{ + pft_cleanup +} + atf_test_case "adaptive" "cleanup" adaptive_head() { @@ -305,8 +451,11 @@ port_reuse_cleanup() atf_init_test_cases() { atf_add_test_case "basic" + atf_add_test_case "basic_v6" atf_add_test_case "forward" + atf_add_test_case "forward_v6" atf_add_test_case "nostate" + atf_add_test_case "nostate_v6" atf_add_test_case "adaptive" atf_add_test_case "port_reuse" } From nobody Mon Aug 28 17:46:13 2023 X-Original-To: dev-commits-src-branches@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 4RZHzT2NxYz4rn57; Mon, 28 Aug 2023 17:46:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZHzT1lMGz3Rfg; Mon, 28 Aug 2023 17:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693244773; 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=1qWxLFDdtD8uEjr+P6vLUTTYPB+4nlkGkxTRgO8y950=; b=NzZl9XRd7un8bH1H32PSGWOL2NxJZWaWF799iJQfxJpolY44hPZvk1iEzSHszqzo47U8oF sIJjdixTPEBfsvlhJtIVFiifb3EMi3d7zXs5twEEbkoZPrC63e7UFKwx9ILdK2nP9PuovV PylzVjE+sxvcjRIjvSfcjXMD3PGMnp0FDyWS1450Pb379ZszGL2G+J3pE3MpAyTzuWvZRH 96ZjLCnUbW9DVEqNK6zH7ZXzTMkCp5fHEboZF0rdahlFXfxUqLUor8xgKZzUU0Ye944uQe x1KWC43W4VkQD4rOl0i7j7L4Yf3qiKjl+ZDU4U61b4L13hR1VMvmZA+ughsn6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693244773; a=rsa-sha256; cv=none; b=lF11x5k7VcfI/IhoDap8xHx0oVoNOFGlwj0KDB/a8lJSb4mHKekVDZjzWzYZMhvxlTuiW9 BEH/5J90MkQ0mQNU3A8QNXG5PaloLhXeXrltav+xVVRBK7HMYE80WkEQEssDWblpINJ7To U9okBg8z+RcwLx5rSAiKYWo8eKgcgO3EveoejqLZFR3IzCfR+Fr+Ay+tkUhAE/QtvwEJXH hX1Yk/85sLcGeW3RzMoColbc5ZP32YiS4RyKflqzCGUesmmvKnbB8+bQ+m7N4p1CzHyRIQ 4vVi/qwJm0/F7zX2f29lMoT7Kuq9YUDQk+QtfPM1sMxbkaxZbwhRH8uIXljiDQ== 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=1693244773; 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=1qWxLFDdtD8uEjr+P6vLUTTYPB+4nlkGkxTRgO8y950=; b=C73wIKdu9xKtHSL0rOutJclrf9/08hEMhc8+g1HGug5sEvXg25fQK0xqCr37QNVUXEbsII XyPVl+DKLMwlpBmGUaUmdwqK94nQLqIF8e5Rc+CBaCZZ0Wifo3N8jskptcLTUYH3O7qxpE Tvgck5dPLLSAQOCy0Z7aNLSEJIsOfZBcAoQoqqrrHIWRV9fW7lwzonI1P4TIWIoMrcIOsZ sOBPY8NwDJCBV/Rsid0QZcOLHMCyxgx9/QEdzc9ztba68e2IF9LQaHrgiijhvLFXF4yArC 593Q1SAAcGXUm6kwwPTyt/xkPEeVJQwsLykMMbsyxiz5yByCYoxiAsGd9zBjyQ== 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 4RZHzT0V2zz3mf; Mon, 28 Aug 2023 17:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SHkD8F095260; Mon, 28 Aug 2023 17:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SHkDrx095257; Mon, 28 Aug 2023 17:46:13 GMT (envelope-from git) Date: Mon, 28 Aug 2023 17:46:13 GMT Message-Id: <202308281746.37SHkDrx095257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 8b81116755b4 - stable/14 - lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b81116755b46c3f651bf873ee25f83f8758bd2b Auto-Submitted: auto-generated The branch stable/14 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=8b81116755b46c3f651bf873ee25f83f8758bd2b commit 8b81116755b46c3f651bf873ee25f83f8758bd2b Author: Robert Clausecker AuthorDate: 2023-08-25 16:22:22 +0000 Commit: Robert Clausecker CommitDate: 2023-08-28 17:45:51 +0000 lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code When the buffer is immediately preceeded by the character we are looking for and begins with one higher than that character, and the buffer is misaligned, a match was errorneously detected in the first character. Fix this by changing the way we prevent matches before the buffer from being detected: instead of removing the corresponding bit from the 0x80..80 mask, set the LSB of bytes before the buffer after xoring with the character we look for. The bug only affects amd64 with ARCHLEVEL=scalar (cf. simd(7)). The change comes at a 2% performance impact for short strings if ARCHLEVEL is set to scalar. The default configuration is not affected. os: FreeBSD arch: amd64 cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz │ strchrnul.scalar.0.out │ strchrnul.scalar.2.out │ │ sec/op │ sec/op vs base │ Short 57.89µ ± 2% 59.08µ ± 1% +2.07% (p=0.030 n=20) Mid 19.24µ ± 0% 19.73µ ± 0% +2.53% (p=0.000 n=20) Long 11.03µ ± 0% 11.03µ ± 0% ~ (p=0.547 n=20) geomean 23.07µ 23.43µ +1.53% │ strchrnul.scalar.0.out │ strchrnul.scalar.2.out │ │ B/s │ B/s vs base │ Short 2.011Gi ± 2% 1.970Gi ± 1% -2.02% (p=0.030 n=20) Mid 6.049Gi ± 0% 5.900Gi ± 0% -2.47% (p=0.000 n=20) Long 10.56Gi ± 0% 10.56Gi ± 0% ~ (p=0.547 n=20) geomean 5.045Gi 4.969Gi -1.50% MFC to: stable/14 MFC after: 3 days Approved by: mjg (blanket, via IRC), re (gjb) Sponsored by: The FreeBSD Foundation (cherry picked from commit 3d8ef251aa9dceabd57f7821a0e6749d35317db3) --- lib/libc/amd64/string/strchrnul.S | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/libc/amd64/string/strchrnul.S b/lib/libc/amd64/string/strchrnul.S index 9aa9591b07ca..0e70b02311d7 100644 --- a/lib/libc/amd64/string/strchrnul.S +++ b/lib/libc/amd64/string/strchrnul.S @@ -52,22 +52,25 @@ ARCHENTRY(__strchrnul, scalar) movabs $0x0101010101010101, %r8 mov (%rdi), %rax # load first word imul %r8, %rsi # replicate char 8 times - movabs $0x8080808080808080, %r9 /* * Unaligned input: align to 8 bytes. Then proceed the same - * way as with aligned input, but ignore matches before the - * beginning of the string. This is achieved by shifting r9 - * into r10 to have 0x00 bytes before the string begins. + * way as with aligned input, but prevent matches before the + * beginning of the string. This is achieved by oring 0x01 + * into each byte of the buffer before the string */ shl $3, %ecx - mov %r9, %r10 + mov %r8, %r10 add $8, %rdi - shl %cl, %r10 # 0x80 where the string is + shl %cl, %r10 # 0x01 where the string is + xor %r8, %r10 # 0x01 where it is not neg %r8 # negate 01..01 so we can use lea + movabs $0x8080808080808080, %r9 mov %rsi, %rcx xor %rax, %rcx # str ^ c + or %r10, %rax # str without NUL bytes before it + or %r10, %rcx # (str ^ c) without matches before it lea (%rax, %r8, 1), %rdx # str - 0x01..01 lea (%rcx, %r8, 1), %r11 # (str ^ c) - 0x01..01 not %rax # ~str @@ -75,7 +78,7 @@ ARCHENTRY(__strchrnul, scalar) and %rdx, %rax # (str - 0x01..01) & ~str and %r11, %rcx # ((str ^ c - 0x01..01) & ~(str ^ c) or %rcx, %rax # matches for both - and %r10, %rax # not including junk bytes or bytes before the string + and %r9, %rax # not including junk bytes jnz 1f /* main loop unrolled twice */ From nobody Mon Aug 28 20:05:53 2023 X-Original-To: dev-commits-src-branches@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 4RZM4d4jT3z4rvQy; Mon, 28 Aug 2023 20:05:53 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZM4d49w1z3gnW; Mon, 28 Aug 2023 20:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693253153; 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=dIkVJsrHvMI/4CckfGZhkVOIz6UoN2bpbeDAfhwDPqs=; b=WT+FSo0w7Mcrw5X10hsySIlAfMDcyRWNl0dFX2ttmXmiSYO8G7kAHyOxRNhnHnjzfTD52D YoJP5YxYMMxtCaNhA/Y7CqTi5I5uHBxExxatj1+XO0T7n3svarjJpo6Y6551j+d8iaKLxb S5kFP0/kivmtfX0qtCcxsNqzVivtxXQzyPGLclzGZmLXTRayeLRws1OC4RrGyNGZ2sEigB a99rLl6E3WFruYwDSxl3QeSubQF1zX5xaETcDaWK7kbGhYqWwq9yjbBuOnXD9UgVWg7hG9 1HidxV/HkHs4Nk253GlEkGaz8UNt6XAzBXcL1Qth/CvCV1bXO2t9dFvRGPvPoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693253153; a=rsa-sha256; cv=none; b=Cz4GhOSse9+yennI+BRF2yBtV/xFibCvujRMjGK+Hu6dwtTnxfBlHa+5dxCwVet8FHvDis oP3+PPmoYWl1n2z+0vIP2cpckANdfiY0UaaOhWiYvM9pl3xnscxkfF20rbgh8OR/txIGnC czhPnmmJB+5jRuMPnTsreHTmeE3ku9hxQ+0iLqUdrfC03OrqwBDb2jOAxRnSNDiOX1KhRv cvovJbguRWVNXdODM4XiQoBsVs2v/J0GB37imIGhRiWpufC5MBv/6E5HuxQh7NeKCF8To1 UqOouXlONd+yE2ACr4hYHHE22elfdbxuJl4YbU9pUeQyDl93AMYQQU/rrxIzLQ== 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=1693253153; 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=dIkVJsrHvMI/4CckfGZhkVOIz6UoN2bpbeDAfhwDPqs=; b=esLbjoHPHjPUKLa6dbz01yj5VoFN5oFCoEqmDdOvUp9kC3Y0qKgT0sG/4vsiY9cz2UrvG8 KGuuLaZfNHQ3Uyx5gnszl5fmUVWhrbG9SJc4wdzRIx64R/htta2O8dAhKUI0v5YrMtChxc duEdKP3JLAhZa54j0m57CYnoxEibbAR3Ql/nb16wCeqS8OCurnHmKTQnQhA8cqbL/8128k np+1gdUyA5lvR8s0KaI13j4CHcxC5dQYiD0Tdux2m6U+H4w8nGDxl5Ux9JAkyrKKjnCsYF NP/QYcOxvvFWW6mGkeoxOVhtcV4vXOHmOGBxzO2RhBSffA46cXOvAy0WeS+qrg== 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 4RZM4d39Rnz7MR; Mon, 28 Aug 2023 20:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SK5rO6029707; Mon, 28 Aug 2023 20:05:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SK5rji029704; Mon, 28 Aug 2023 20:05:53 GMT (envelope-from git) Date: Mon, 28 Aug 2023 20:05:53 GMT Message-Id: <202308282005.37SK5rji029704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b5a5a06fc012 - stable/13 - iir: prevent negative offsets in ioctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b5a5a06fc012d27c6937776bff8469ea465c3873 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b5a5a06fc012d27c6937776bff8469ea465c3873 commit b5a5a06fc012d27c6937776bff8469ea465c3873 Author: Ed Maste AuthorDate: 2023-08-28 03:38:30 +0000 Commit: Ed Maste CommitDate: 2023-08-28 19:37:09 +0000 iir: prevent negative offsets in ioctl Direct commit to stable/13 as this driver has been removed from main in commit 399188a2c60c ("iir: Remove"). PR: 273328 Reported by: ChenHao Lu Sponsored by: The FreeBSD Foundation --- sys/dev/iir/iir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iir/iir.c b/sys/dev/iir/iir.c index d030227c6dd6..15c8db856d0e 100644 --- a/sys/dev/iir/iir.c +++ b/sys/dev/iir/iir.c @@ -1853,7 +1853,7 @@ int gdt_read_event(int handle, gdt_evt_str *estr) eindex = handle; estr->event_source = 0; - if (eindex >= GDT_MAX_EVENTS) { + if (eindex < 0 || eindex >= GDT_MAX_EVENTS) { mtx_unlock(&elock); return eindex; } From nobody Wed Aug 30 10:10:12 2023 X-Original-To: dev-commits-src-branches@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 4RbKmP0wh9z4rxsD; Wed, 30 Aug 2023 10:10:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RbKmP0P5Kz3YVr; Wed, 30 Aug 2023 10:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693390213; 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=ZKMxYE3p7xnCsU2xw776HZ77NDYAV7+tKhcGSfXB7mc=; b=kI2P//q3OgbImenUcHI4Sqt9TtnvUOxIvDIoWKgED+ag8AJosR+xLlCssENvIuXGjvzXv7 oKgXFub20LXVFwk3FSArriHbAVodrWDU7BRaZ+wcoyFgpPaL33UdWPglLDvrQghJBGi/Sw KnnTrIzaCL2m6iI7AIUo9hwdJBJuqzk9TfnnlODWJC9CvMBz74Y1u4C5nB+51qkr18C5tA nKnQzGN9qjI4ELWr+gJ97uCvCXpS3sqdiEchCrNh3jBU9geE9puXDD18EH2VqN+T/rFap1 daq3UEq5pduwJ6ccYNwe6sOQTl+eDN9AgwGOZreMeIvGuMLOZzq/Qcb31q9l4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693390213; a=rsa-sha256; cv=none; b=iK50Wdbl9NW9fartj+eLPgr44bTO/Y5VCXbHkaZUnqQ9dTFgIcbE9YV7ro03RXzsGN7hl9 /ryCNTZYE3ejMpEOQZlNOtnRUL2IAelb+5+poLjnj/4UmM2qrBdjkGHHF1yyHCRWoPgiL0 YgWD4v4/NTHlb4L3Q3w0kF1zS/dvcFA64iXw12bSjoCcjFYFgHw5ofqnxlHbXZkEGEgKX3 KOEsM/8YVqm9FrvAfzDxMWiVoBCkdfjR0VIYV2B9ZhmSCcNyDCuDNPIJhxPKLHyiP4Mjjt kLZx6rEA2WU94D7MoAvb+hWAw65ZAbCA4Xo2tFSR9eO6t0Vzh5UNIK+dF1ZC3w== 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=1693390213; 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=ZKMxYE3p7xnCsU2xw776HZ77NDYAV7+tKhcGSfXB7mc=; b=dac33K6qGR3usdsuVhRIswgpZz/eIbgCsnZ+Gz9hGT3Io0Kh3T7gOwl7nqYEXEg5dSuMCq KUjkkPC+dfR102LmJJf6DVbcXR9yYt12E0X3VDgWp3NLOi8NH2Vqqd2bH57X2ag8Erg27P krmssDZK320fDXHQ6WHH8QJCG/6AxJzIah+RHtXjMmw2UTJ3jnKm7JhS3Hu556rHMWKaac O0LeNqTosM7c5KThM46NZKmhZbvWGX89OWBVG1JHBuaLoi0PvHNqHaLoanErb2LA4+y/Rv Xvd6voHwCsSD/jqLAZ+6suTxPvLOfcsW/KlioefPCz3qJ0ENGQ5L649iASHUAA== 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 4RbKmN6SWYzW9q; Wed, 30 Aug 2023 10:10:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37UAAC5i021439; Wed, 30 Aug 2023 10:10:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37UAACGk021430; Wed, 30 Aug 2023 10:10:12 GMT (envelope-from git) Date: Wed, 30 Aug 2023 10:10:12 GMT Message-Id: <202308301010.37UAACGk021430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 96c4b704ec16 - stable/13 - net: Do not overwrite if_vlan's PCP List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 96c4b704ec169044aa98867965e046a4728bcba1 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=96c4b704ec169044aa98867965e046a4728bcba1 commit 96c4b704ec169044aa98867965e046a4728bcba1 Author: Zhenlei Huang AuthorDate: 2023-08-23 09:48:12 +0000 Commit: Zhenlei Huang CommitDate: 2023-08-30 10:09:25 +0000 net: Do not overwrite if_vlan's PCP In commit c7cffd65c5d8 the function ether_8021q_frame() was slightly refactored to use pointer of struct ether_8021q_tag as parameter qtag to include the new option proto. It is wrong to write to qtag->pcp as it will effectively change the memory that qtag points to. Unfortunately the transmit routine of if_vlan parses pointer of the member ifv_qtag of its softc which stores vlan interface's PCP internally, when transmitting mbufs that contains PCP the vlan interface's PCP will get overwritten. Fix by operating on a local copy of qtag->pcp. Also mark 'struct ether_8021q_tag' as const so that compilers can pick up such kind of bug. PR: 273304 Reviewed by: kp Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D39505 (cherry picked from commit 838c8c47860a0203130bd558d507a0565a2eba8f) --- sys/net/ethernet.h | 2 +- sys/net/if_ethersubr.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index b935c024541c..7a763c15ff26 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -448,7 +448,7 @@ void ether_vlan_mtap(struct bpf_if *, struct mbuf *, void *, u_int); struct mbuf *ether_vlanencap_proto(struct mbuf *, uint16_t, uint16_t); bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, - struct ifnet *p, struct ether_8021q_tag *); + struct ifnet *p, const struct ether_8021q_tag *); void ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr); static __inline struct mbuf *ether_vlanencap(struct mbuf *m, uint16_t tag) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 64cca2452871..87faf9f26df4 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1355,11 +1355,12 @@ SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW, bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, - struct ether_8021q_tag *qtag) + const struct ether_8021q_tag *qtag) { struct m_tag *mtag; int n; uint16_t tag; + uint8_t pcp = qtag->pcp; static const char pad[8]; /* just zeros */ /* @@ -1392,7 +1393,7 @@ ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, * If PCP is set in mbuf, use it */ if ((*mp)->m_flags & M_VLANTAG) { - qtag->pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); + pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); } /* @@ -1406,7 +1407,7 @@ ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, MTAG_8021Q_PCP_OUT, NULL)) != NULL) tag = EVL_MAKETAG(qtag->vid, *(uint8_t *)(mtag + 1), 0); else - tag = EVL_MAKETAG(qtag->vid, qtag->pcp, 0); + tag = EVL_MAKETAG(qtag->vid, pcp, 0); if ((p->if_capenable & IFCAP_VLAN_HWTAGGING) && (qtag->proto == ETHERTYPE_VLAN)) { (*mp)->m_pkthdr.ether_vtag = tag; From nobody Wed Aug 30 12:11:27 2023 X-Original-To: dev-commits-src-branches@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 4RbNSJ13WNz4s3Wn; Wed, 30 Aug 2023 12:11:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RbNSJ0YxSz4M5H; Wed, 30 Aug 2023 12:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693397488; 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=2oJIKO2DkJNkYJS0hBfICtXhdTHtc6uhqKzfduXDdug=; b=XqJJt1hZ/sAkJQM1OUe5V3d1lIdNqyQERq7jBTZh0J4h2uS7dOI7hOEw3C/8gmZld2BE1Z 6xqWRhqdMHDB75uraM1QvdjWgIKoNZU5kIIi/0bBHacehI2cxNRcRepuARDhkmz+aXXX/P mnjQTcvRGEy4FGdOqSMuEaAxsm+zLCSm/lWQBFnk4aFJ3WGzkDSLnggO6WQHCVGHxkBSV3 ehKVMFxhQu+cj3Bx9/0mPhnYk9jEtEqEq4L/zo1NjX4mf4mIvJkbzQ2xrecmHkzYGwQjR9 tN4HaJGVucUQdDGXOWVSPynf6u7TylJ6DFEtPNo13vxN7s8kY++3wiBuEqyuMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693397488; a=rsa-sha256; cv=none; b=XaFxeUP2tp08EcyPJ/i8CwKyhh46VJ/2Ke03pRDST2T8QouhPDgAPvWAUjJGx5lS2QWRG9 7XBuKUv49lYRvjptEX75MbAFluevkFhxgL8u5+jwRizFmr05B5/iM2jGa17lSs0Bp4fbu7 sTqif6pDMt2LLohm7XBw4zfmetrcNcv6xMQB9Mb5TELmma4Q2i7lzmfs3awm41kXN7asCh gAZoiLCT6m/fGIOmT5G1lXB4OEenvp7brFh7Fac0BKb59GOYCOGVS1ozviVYLxfNuN27pA FV+42o6Bl9VjV9YK+eGGrHHRTKyKK/xjpk580nW/hzO9O/KvMWAIq1KGf6hBxA== 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=1693397488; 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=2oJIKO2DkJNkYJS0hBfICtXhdTHtc6uhqKzfduXDdug=; b=PjsgcTAqGcLw1UANo+QzGfo3NPf0DLLsSE+fSYbUpNegfnrnjvzmA7fNGsEJHR/5kHOB72 /o4v6WATD1Sc09LzbymUoRhmYcAzoJf/sJdwNTEuDkvBFMTK7Fu5KMGtHqKWhp2DCmZGD9 sE9cvNdsn9aluPo4UY+bRkzQjhpOBLCuYIfvamvmaMqa0NFbug+0eSNP3FsafyU23EdkkP 83SGb7UreeT5h35OzOzgWncpiDNwpOTvhQWP+TrZgMUpcIAhUZ1d248qyq1+ARlmD7iL3v z6BNo2gmVm9N0rMTQSi8SGKUueQ2o/aS73MjwryxiJIuR9Gz8mJz0k710OGAJg== 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 4RbNSH6lSVzZ4B; Wed, 30 Aug 2023 12:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37UCBR0W026513; Wed, 30 Aug 2023 12:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37UCBRbL026510; Wed, 30 Aug 2023 12:11:27 GMT (envelope-from git) Date: Wed, 30 Aug 2023 12:11:27 GMT Message-Id: <202308301211.37UCBRbL026510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: e8deaa3c6b8b - stable/13 - rc.d/routing: Correct setting default gateway for each FIB List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e8deaa3c6b8b98f435a07b47aaf3c546e7e876d5 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e8deaa3c6b8b98f435a07b47aaf3c546e7e876d5 commit e8deaa3c6b8b98f435a07b47aaf3c546e7e876d5 Author: Andrew Fengler AuthorDate: 2023-06-26 18:40:21 +0000 Commit: Zhenlei Huang CommitDate: 2023-08-30 12:06:51 +0000 rc.d/routing: Correct setting default gateway for each FIB There was a mistake in the previous commit, it used the incorrect spelling of the FIB variable name and was not functional Also corrects an issue with the IPv6 default route variable name. Fixes: 30659d1dcbcc ("Add support for adding default routes for other FIBs") Sponsored-by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D37685 (cherry picked from commit f81be7a8318b178e406c12d98f78cfa2a4229af7) --- libexec/rc/rc.d/routing | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/routing b/libexec/rc/rc.d/routing index ae1aa18973db..9b906f69b354 100755 --- a/libexec/rc/rc.d/routing +++ b/libexec/rc/rc.d/routing @@ -170,7 +170,7 @@ static_inet() ;; *) static_routes="${static_routes} _default_fib${_fibnum}" - eval route__default_fib${fibnum}="'default ${_fib_gw} -fib ${_fibnum}'" + eval route__default_fib${_fibnum}="'default ${_fib_gw} -fib ${_fibnum}'" ;; esac done @@ -246,8 +246,8 @@ static_inet6() [Nn][Oo] | '') ;; *) - ipv6_static_routes="${static_routes} _default_fib${_fibnum}" - eval ipv6_route__default_fib${fibnum}="'default ${_fib_gw} -fib ${_fibnum}'" + ipv6_static_routes="${ipv6_static_routes} _default_fib${_fibnum}" + eval ipv6_route__default_fib${_fibnum}="'default ${_fib_gw} -fib ${_fibnum}'" ;; esac done From nobody Thu Aug 31 13:55:36 2023 X-Original-To: dev-commits-src-branches@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 4Rc2k04njSz4sCFy; Thu, 31 Aug 2023 13:55:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rc2k042Wgz3YmW; Thu, 31 Aug 2023 13:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693490136; 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=OJAPupifObEsI0fN5nn9dovCsfK/zBwdqpgTMIIOCQI=; b=Ur2XBqcPruDGalhM/X0lo8gtK25dpQafAJ4ykdbtztpAKAqFX+gaMObJAU5JFkUFlQUq2k TL+1c0QlUDScAGPdxtHuoe9cC6mZZMNzJTfsGgd4D6+Z7T0WWpw+RTpPNcZQx5Y8BuoOE3 4wii2MynZTu/OVMwR7nb5MgofKVmkEQAKyGShd2Qm718EOEqYpqkIg6H75h298ifgAb0jj iGpDo50q2XtA8tOWpE2RfzDoTChdaeKXn3CnWZItIYONubHuGlQ+BTx+8S0hoGSKyHDyvK bFVQy55MYUBZUnuF+90b5FhOLJqIRITq60i9FcbOlVrm76H3BNm8jiC84AiVeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693490136; a=rsa-sha256; cv=none; b=JiXOre5de8dDgs5gzyg7nub6JE4O09jxUUtW7hhm2pmrpJRVmIS31spw5uuztM2YaYWQd/ X/v07/xmMO3sIvPA907JZFflEBewLJTH9oStYoN/+f1+9HTZf+wDE8RvDq0a4Eay098HiY qm7lDJ+hfWmG9IqZ1eb4IUX3X0vMDr55KTOhS3E3o9T4/hiuo4wj+pHrjlZ7nHJ2ZO27ym WvBp6lTrEBqtl2n09ZCeVTpCJref/qRQRI22IWnKcVXcEMJx6WoNCrPmPZHoNQStDRxc4Y 0hLoeGvxeCoZxSq2uTJANDZm0ZmZV98ZRQ+yGY/pEQTrNeu9NGt3O+/9nOKgpA== 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=1693490136; 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=OJAPupifObEsI0fN5nn9dovCsfK/zBwdqpgTMIIOCQI=; b=bjO4o4TxRWRfy3Y5XHVuCIO1934djqF0SNBUmkdz5LKAWGAVdcicLA6DBjzEKpfsjZxkI2 Ae2syjJo5KS81Z0N4KG2Kgo7K6P3ZPQ560hDYYIf5pSAJNRsMOF/GtKjdVG5h9RuDBz5Nc 8Rxl78/dpv0a2E1XeocOSCCC66fD3Y4brFYjFwewutPlWlQBHJl5QY9zXKogNkDNvLbHFi nBPjMH3x9Y1IlTQ29Ri/8NCLvsN9IQWgPdn/kxaRMYiOpu3dhu1tZfVYFZQOamLPD07vEC s1xxeUKu+Y+pvlFAiCmDiFzdvB5/EZCVb1HhDn2cTPcUmJoXWij2ZuparZZAKA== 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 4Rc2k035zzz5lR; Thu, 31 Aug 2023 13:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37VDta0j083299; Thu, 31 Aug 2023 13:55:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37VDtarr083296; Thu, 31 Aug 2023 13:55:36 GMT (envelope-from git) Date: Thu, 31 Aug 2023 13:55:36 GMT Message-Id: <202308311355.37VDtarr083296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b5f0f20e9bd1 - stable/13 - intr: merge interrupt table uses of MAXCOMLEN into INTRNAME_LEN List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b5f0f20e9bd1999d9c606f2a20a08a54c7f5ccfe Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b5f0f20e9bd1999d9c606f2a20a08a54c7f5ccfe commit b5f0f20e9bd1999d9c606f2a20a08a54c7f5ccfe Author: Elliott Mitchell AuthorDate: 2023-01-20 02:24:32 +0000 Commit: Mark Johnston CommitDate: 2023-08-31 13:24:05 +0000 intr: merge interrupt table uses of MAXCOMLEN into INTRNAME_LEN The repeated uses of `MAXCOMLEN + 1` seem a bit hazardous. If there was a future need to change the size, the repeats will be troublesome. Merge everything into `#define INTRNAME_LEN` (matches the name used by INTRNG). Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38455 (cherry picked from commit 5ad59b91535f2df176c132be10e344c4a302f619) --- sys/powerpc/powerpc/intr_machdep.c | 9 +++++---- sys/x86/x86/intr_machdep.c | 13 +++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index 605f436804d4..c314a2c928bc 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -129,6 +129,7 @@ static u_int nirqs = 0; /* Allocated IRQs. */ #endif static u_int stray_count; +#define INTRNAME_LEN (MAXCOMLEN + 1) u_long *intrcnt; char *intrnames; size_t sintrcnt = sizeof(intrcnt); @@ -154,8 +155,8 @@ static void intrcnt_setname(const char *name, int index) { - snprintf(intrnames + (MAXCOMLEN + 1) * index, MAXCOMLEN + 1, "%-*s", - MAXCOMLEN, name); + snprintf(intrnames + INTRNAME_LEN * index, INTRNAME_LEN, "%-*s", + INTRNAME_LEN - 1, name); } static void @@ -179,10 +180,10 @@ intr_init_sources(void *arg __unused) #endif intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTR, M_WAITOK | M_ZERO); - intrnames = mallocarray(nintrcnt, MAXCOMLEN + 1, M_INTR, M_WAITOK | + intrnames = mallocarray(nintrcnt, INTRNAME_LEN, M_INTR, M_WAITOK | M_ZERO); sintrcnt = nintrcnt * sizeof(u_long); - sintrnames = nintrcnt * (MAXCOMLEN + 1); + sintrnames = nintrcnt * INTRNAME_LEN; intrcnt_setname("???", 0); intrcnt_index = 1; diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c index b89af6c4c2a1..d7c325c82399 100644 --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -95,6 +95,7 @@ u_int num_io_irqs; static int assign_cpu; #endif +#define INTRNAME_LEN (MAXCOMLEN + 1) u_long *intrcnt; char *intrnames; size_t sintrcnt = sizeof(intrcnt); @@ -189,10 +190,10 @@ intr_init_sources(void *arg) #endif intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTR, M_WAITOK | M_ZERO); - intrnames = mallocarray(nintrcnt, MAXCOMLEN + 1, M_INTR, M_WAITOK | + intrnames = mallocarray(nintrcnt, INTRNAME_LEN, M_INTR, M_WAITOK | M_ZERO); sintrcnt = nintrcnt * sizeof(u_long); - sintrnames = nintrcnt * (MAXCOMLEN + 1); + sintrnames = nintrcnt * INTRNAME_LEN; intrcnt_setname("???", 0); intrcnt_index = 1; @@ -430,8 +431,8 @@ static void intrcnt_setname(const char *name, int index) { - snprintf(intrnames + (MAXCOMLEN + 1) * index, MAXCOMLEN + 1, "%-*s", - MAXCOMLEN, name); + snprintf(intrnames + INTRNAME_LEN * index, INTRNAME_LEN, "%-*s", + INTRNAME_LEN - 1, name); } static void @@ -444,14 +445,14 @@ intrcnt_updatename(struct intsrc *is) static void intrcnt_register(struct intsrc *is) { - char straystr[MAXCOMLEN + 1]; + char straystr[INTRNAME_LEN]; KASSERT(is->is_event != NULL, ("%s: isrc with no event", __func__)); mtx_lock_spin(&intrcnt_lock); MPASS(intrcnt_index + 2 <= nintrcnt); is->is_index = intrcnt_index; intrcnt_index += 2; - snprintf(straystr, MAXCOMLEN + 1, "stray irq%d", + snprintf(straystr, sizeof(straystr), "stray irq%d", is->is_pic->pic_vector(is)); intrcnt_updatename(is); is->is_count = &intrcnt[is->is_index]; From nobody Thu Aug 31 13:55:37 2023 X-Original-To: dev-commits-src-branches@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 4Rc2k15vN4z4sC09; Thu, 31 Aug 2023 13:55:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rc2k15KWDz3YsF; Thu, 31 Aug 2023 13:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693490137; 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=nVXhHfJWwvsCragnb8diTCg3X0BZyZki5d5tMv74qLg=; b=tM2RVyCVXrhs+H4iGHxpU//AiY/ba/bpHn6e6HNgjHU9fB9HhfHvHMmsoskjSPDUaRClaC cAkvFESRDUfn4H0SkwhFSn4zvZZ2mU0bRVHc55polTVlBo4ZJ9OXMAReEsNmoU5VAkRv5D qDaW7nUPyW87JUkMLduVPLhRM0bhoNEI3/Yf6EFPf2yflY6JBSzlRErWzyXPkH1nnK1KN7 bqBCS0SpY5cGT3Zo5P77oCapl0OpPFPt2Vtv9Svqtd9Bh6Fvjor6eOYahg+ea8pV3q9KdW J8nu3cMG97ZkhEi+jVrGgwu1w/RYIHHv45M7ggRi26GyEfBAY9TEezvMrdb48g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693490137; a=rsa-sha256; cv=none; b=MMQlg0XSgbIaRJUA29FFVDriBLsyhSK9UzYHSoGhtnLh4XqW4N0keonW7UMYcpofmbGcr2 ZLiHWorxjulja4PYNPrP+vuhoU/6afL3jhnXHEiVm66HAiB3+1zAfa6h+5+3pcBK86Tkj3 XxyCCMnA1JTDVa7+kgHlvB/hlg2jSYAZd02HmJlkaBK1cAG0RP9nn1lTpahjoTqSPMOT1h t99FX1YsiGSeIGrKtR680rHqzU5jD8dXy8kTo7nas5e83wrf2gBTD33m9NkH7BYQUbzle6 pkfx+74mwKwU9PHbi5mXRUKck7Ebusw3Pt2LqS4j7NCcRsV+G4JLdF1TjK1ZjA== 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=1693490137; 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=nVXhHfJWwvsCragnb8diTCg3X0BZyZki5d5tMv74qLg=; b=U8WQMYmqDU0ty57YthUbeFwxGr5h4d+WY6cADjEYX7/2SbC/BOH/AZEikT2Vlqvhf/UEUd KGuh3JcAZXNRaNXCKOSTECyR4UI1mLmjvt6RbxdffNLFzKyAR+kIOSdpfUmYLsN/pU6Q96 LV/xYsl3VAUYY8uaYgtcrNfvgQlKZCBz87R/hsk7h5VWkHfKhQaezeoownPwm6RVfkjhKT 8iunnNaKqkUd+2I0xH6gMbyI4N8pDMA5bB4dY5HKEer+lMUg4E1nk2MoK1PGLrr098h4jm no8cEKKvun1yKfasbTYUtDXdlq/kPzY7VSlZI/srUv6vAnvppZ5wi0yoGAeSvQ== 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 4Rc2k14N38z5td; Thu, 31 Aug 2023 13:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37VDtbmZ083344; Thu, 31 Aug 2023 13:55:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37VDtbLP083341; Thu, 31 Aug 2023 13:55:37 GMT (envelope-from git) Date: Thu, 31 Aug 2023 13:55:37 GMT Message-Id: <202308311355.37VDtbLP083341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 77740df27c10 - stable/13 - syslogd: Add some basic regression tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 77740df27c10c6ae7f51de7c80f1c597716952f3 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=77740df27c10c6ae7f51de7c80f1c597716952f3 commit 77740df27c10c6ae7f51de7c80f1c597716952f3 Author: Jake Freeland AuthorDate: 2023-06-22 21:19:51 +0000 Commit: Mark Johnston CommitDate: 2023-08-31 13:55:19 +0000 syslogd: Add some basic regression tests Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41403 (cherry picked from commit fcace2906ddfae6bee6064b63a6df44be1bdf04b) --- etc/mtree/BSD.tests.dist | 2 + usr.sbin/syslogd/Makefile | 3 + usr.sbin/syslogd/tests/Makefile | 3 + usr.sbin/syslogd/tests/syslogd_test.sh | 299 +++++++++++++++++++++++++++++++++ 4 files changed, 307 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index fc04b5b02d23..39d1e7801619 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1153,6 +1153,8 @@ .. sa .. + syslogd + .. .. .. diff --git a/usr.sbin/syslogd/Makefile b/usr.sbin/syslogd/Makefile index 8bdc107dd1c1..803ec8c93056 100644 --- a/usr.sbin/syslogd/Makefile +++ b/usr.sbin/syslogd/Makefile @@ -44,4 +44,7 @@ PPPPACKAGE= ppp CFLAGS+= -I${SRCTOP}/usr.bin/wall +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.sbin/syslogd/tests/Makefile b/usr.sbin/syslogd/tests/Makefile new file mode 100644 index 000000000000..9f7e151a3938 --- /dev/null +++ b/usr.sbin/syslogd/tests/Makefile @@ -0,0 +1,3 @@ +ATF_TESTS_SH+= syslogd_test + +.include diff --git a/usr.sbin/syslogd/tests/syslogd_test.sh b/usr.sbin/syslogd/tests/syslogd_test.sh new file mode 100644 index 000000000000..e4927868e47f --- /dev/null +++ b/usr.sbin/syslogd/tests/syslogd_test.sh @@ -0,0 +1,299 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2021, 2023 The FreeBSD Foundation +# +# This software was developed by Mark Johnston under sponsorship from +# the FreeBSD Foundation. +# +# This software was developed by Jake Freeland under sponsorship from +# the FreeBSD Foundation. +# + +# Tests to-do: +# actions: hostname, users + +readonly SYSLOGD_UDP_PORT="5140" +readonly SYSLOGD_CONFIG="${PWD}/syslog.conf" +readonly SYSLOGD_LOCAL_SOCKET="${PWD}/log.sock" +readonly SYSLOGD_PIDFILE="${PWD}/syslogd.pid" +readonly SYSLOGD_LOCAL_PRIVSOCKET="${PWD}/logpriv.sock" + +# Start a private syslogd instance. +syslogd_start() +{ + syslogd \ + -b ":${SYSLOGD_UDP_PORT}" \ + -C \ + -d \ + -f "${SYSLOGD_CONFIG}" \ + -H \ + -p "${SYSLOGD_LOCAL_SOCKET}" \ + -P "${SYSLOGD_PIDFILE}" \ + -S "${SYSLOGD_LOCAL_PRIVSOCKET}" \ + $@ \ + & + + # Give syslogd a bit of time to spin up. + while [ "$((i+=1))" -le 20 ]; do + [ -S "${SYSLOGD_LOCAL_SOCKET}" ] && return + sleep 0.1 + done + atf_fail "timed out waiting for syslogd to start" +} + +# Simple logger(1) wrapper. +syslogd_log() +{ + atf_check -s exit:0 -o empty -e empty logger $* +} + +# Make syslogd reload its configuration file. +syslogd_reload() +{ + pkill -HUP -F "${SYSLOGD_PIDFILE}" +} + +# Stop a private syslogd instance. +syslogd_stop() +{ + pid=$(cat "${SYSLOGD_PIDFILE}") + if pkill -F "${SYSLOGD_PIDFILE}"; then + wait "${pid}" + rm -f "${SYSLOGD_PIDFILE}" "${SYSLOGD_LOCAL_SOCKET}" \ + "${SYSLOGD_LOCAL_PRIVSOCKET}" + fi +} + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr "Messages are logged via supported transports" +} +basic_body() +{ + logfile="${PWD}/basic.log" + printf "user.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start + + syslogd_log -p user.debug -t basic -h "${SYSLOGD_LOCAL_SOCKET}" \ + "hello, world (unix)" + atf_check -s exit:0 -o match:"basic: hello, world \(unix\)" \ + tail -n 1 "${logfile}" + + # Grab kernel configuration file. + sysctl kern.conftxt > conf.txt + + # We have INET transport; make sure we can use it. + if grep -qw "INET" conf.txt; then + syslogd_log -4 -p user.debug -t basic -h 127.0.0.1 -P "${SYSLOGD_UDP_PORT}" \ + "hello, world (v4)" + atf_check -s exit:0 -o match:"basic: hello, world \(v4\)" \ + tail -n 1 "${logfile}" + fi + # We have INET6 transport; make sure we can use it. + if grep -qw "INET6" conf.txt; then + syslogd_log -6 -p user.debug -t basic -h ::1 -P "${SYSLOGD_UDP_PORT}" \ + "hello, world (v6)" + atf_check -s exit:0 -o match:"basic: hello, world \(v6\)" \ + tail -n 1 "${logfile}" + fi +} +basic_cleanup() +{ + syslogd_stop +} + +atf_test_case "reload" "cleanup" +reload_head() +{ + atf_set descr "SIGHUP correctly refreshes configuration" +} +reload_body() +{ + logfile="${PWD}/reload.log" + printf "user.debug\t/${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start + + syslogd_log -p user.debug -t reload -h "${SYSLOGD_LOCAL_SOCKET}" \ + "pre-reload" + atf_check -s exit:0 -o match:"reload: pre-reload" tail -n 1 "${logfile}" + + # Override the old rule. + truncate -s 0 "${logfile}" + printf "news.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_reload + + syslogd_log -p user.debug -t reload -h "${SYSLOGD_LOCAL_SOCKET}" \ + "post-reload user" + syslogd_log -p news.debug -t reload -h "${SYSLOGD_LOCAL_SOCKET}" \ + "post-reload news" + atf_check -s exit:0 -o not-match:"reload: post-reload user" cat ${logfile} + atf_check -s exit:0 -o match:"reload: post-reload news" cat ${logfile} +} +reload_cleanup() +{ + syslogd_stop +} + +atf_test_case "prog_filter" "cleanup" +prog_filter_head() +{ + atf_set descr "Messages are only received from programs in the filter" +} +prog_filter_body() +{ + logfile="${PWD}/prog_filter.log" + printf "!prog1,prog2\nuser.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start + + for i in 1 2 3; do + syslogd_log -p user.debug -t "prog${i}" -h "${SYSLOGD_LOCAL_SOCKET}" \ + "hello this is prog${i}" + done + atf_check -s exit:0 -o match:"prog1: hello this is prog1" cat "${logfile}" + atf_check -s exit:0 -o match:"prog2: hello this is prog2" cat "${logfile}" + atf_check -s exit:0 -o not-match:"prog3: hello this is prog3" cat "${logfile}" + + # Override the old rule. + truncate -s 0 ${logfile} + printf "!-prog1,prog2\nuser.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_reload + + for i in 1 2 3; do + syslogd_log -p user.debug -t "prog${i}" -h "${SYSLOGD_LOCAL_SOCKET}" \ + "hello this is prog${i}" + done + atf_check -s exit:0 -o not-match:"prog1: hello this is prog1" cat "${logfile}" + atf_check -s exit:0 -o not-match:"prog2: hello this is prog2" cat "${logfile}" + atf_check -s exit:0 -o match:"prog3: hello this is prog3" cat "${logfile}" +} +prog_filter_cleanup() +{ + syslogd_stop +} + +atf_test_case "host_filter" "cleanup" +host_filter_head() +{ + atf_set descr "Messages are only received from hostnames in the filter" +} +host_filter_body() +{ + logfile="${PWD}/host_filter.log" + printf "+host1,host2\nuser.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start + + for i in 1 2 3; do + syslogd_log -p user.debug -t "host${i}" -H "host${i}" \ + -h "${SYSLOGD_LOCAL_SOCKET}" "hello this is host${i}" + done + atf_check -s exit:0 -o match:"host1: hello this is host1" cat "${logfile}" + atf_check -s exit:0 -o match:"host2: hello this is host2" cat "${logfile}" + atf_check -s exit:0 -o not-match:"host3: hello this is host3" cat "${logfile}" + + # Override the old rule. + truncate -s 0 ${logfile} + printf "\-host1,host2\nuser.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_reload + + for i in 1 2 3; do + syslogd_log -p user.debug -t "host${i}" -H "host${i}" \ + -h "${SYSLOGD_LOCAL_SOCKET}" "hello this is host${i}" + done + atf_check -s exit:0 -o not-match:"host1: hello this is host1" cat "${logfile}" + atf_check -s exit:0 -o not-match:"host2: hello this is host2" cat "${logfile}" + atf_check -s exit:0 -o match:"host3: hello this is host3" cat "${logfile}" +} +host_filter_cleanup() +{ + syslogd_stop +} + +atf_test_case "prop_filter" "cleanup" +prop_filter_head() +{ + atf_set descr "Messages are received based on conditions in the propery based filter" +} +prop_filter_body() +{ + logfile="${PWD}/prop_filter.log" + printf ":msg,contains,\"FreeBSD\"\nuser.debug\t${logfile}\n" \ + > "${SYSLOGD_CONFIG}" + syslogd_start + + syslogd_log -p user.debug -t "prop1" -h "${SYSLOGD_LOCAL_SOCKET}" "FreeBSD" + syslogd_log -p user.debug -t "prop2" -h "${SYSLOGD_LOCAL_SOCKET}" "freebsd" + atf_check -s exit:0 -o match:"prop1: FreeBSD" cat "${logfile}" + atf_check -s exit:0 -o not-match:"prop2: freebsd" cat "${logfile}" + + truncate -s 0 ${logfile} + printf ":msg,!contains,\"FreeBSD\"\nuser.debug\t${logfile}\n" \ + > "${SYSLOGD_CONFIG}" + syslogd_reload + + syslogd_log -p user.debug -t "prop1" -h "${SYSLOGD_LOCAL_SOCKET}" "FreeBSD" + syslogd_log -p user.debug -t "prop2" -h "${SYSLOGD_LOCAL_SOCKET}" "freebsd" + atf_check -s exit:0 -o not-match:"prop1: FreeBSD" cat "${logfile}" + atf_check -s exit:0 -o match:"prop2: freebsd" cat "${logfile}" + + truncate -s 0 ${logfile} + printf ":msg,icase_contains,\"FreeBSD\"\nuser.debug\t${logfile}\n" \ + > "${SYSLOGD_CONFIG}" + syslogd_reload + + syslogd_log -p user.debug -t "prop1" -h "${SYSLOGD_LOCAL_SOCKET}" "FreeBSD" + syslogd_log -p user.debug -t "prop2" -h "${SYSLOGD_LOCAL_SOCKET}" "freebsd" + atf_check -s exit:0 -o match:"prop1: FreeBSD" cat "${logfile}" + atf_check -s exit:0 -o match:"prop2: freebsd" cat "${logfile}" + + truncate -s 0 ${logfile} + printf ":msg,!icase_contains,\"FreeBSD\"\nuser.debug\t${logfile}\n" \ + > "${SYSLOGD_CONFIG}" + syslogd_reload + + syslogd_log -p user.debug -t "prop1" -h "${SYSLOGD_LOCAL_SOCKET}" "FreeBSD" + syslogd_log -p user.debug -t "prop2" -h "${SYSLOGD_LOCAL_SOCKET}" "freebsd" + syslogd_log -p user.debug -t "prop3" -h "${SYSLOGD_LOCAL_SOCKET}" "Solaris" + atf_check -s exit:0 -o not-match:"prop1: FreeBSD" cat "${logfile}" + atf_check -s exit:0 -o not-match:"prop2: freebsd" cat "${logfile}" + atf_check -s exit:0 -o match:"prop3: Solaris" cat "${logfile}" +} +prop_filter_cleanup() +{ + syslogd_stop +} + +atf_test_case "pipe_action" "cleanup" +pipe_action_head() +{ + atf_set descr "The pipe action evaluates provided command in sh(1)" +} +pipe_action_body() +{ + logfile="${PWD}/pipe_action.log" + printf "\"While I'm digging in the tunnel, the elves will often come to me \ + with solutions to my problem.\"\n-Saymore Crey" > ${logfile} + + printf "!pipe\nuser.debug\t| sed -i '' -e 's/Saymore Crey/Seymour Cray/g' \ + ${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start + + syslogd_log -p user.debug -t "pipe" -h "${SYSLOGD_LOCAL_SOCKET}" \ + "fix spelling error" + atf_check -s exit:0 -o match:"Seymour Cray" cat "${logfile}" +} +pipe_action_cleanup() +{ + syslogd_stop +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" + atf_add_test_case "reload" + atf_add_test_case "prog_filter" + atf_add_test_case "host_filter" + atf_add_test_case "prop_filter" + atf_add_test_case "pipe_action" +} From nobody Thu Aug 31 23:32:34 2023 X-Original-To: dev-commits-src-branches@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 4RcHWl1LZCz4rlqv; Thu, 31 Aug 2023 23:32:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcHWk73RMz3T8y; Thu, 31 Aug 2023 23:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693524755; 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=4QJMQg2+VnbCBsXxnSTl8eW4KJuiuwHqQCksLhVqwIg=; b=DhTWaxY4tgjuOocrm6Wyox2KGBUFegAviRbpxDOKz1wTFC30exf44fBf4NG2JQkjriH605 gtkwIUxtmVld9WQRxhHJPLg+1Qn2triljdgzqJslrMudT+UfTPSp/NXfjBL13utF9ExrPf x9C+EY4KuXkyKKkNgHKEAMgolnj9Nxb/VQQLGG2UiliG2FXk+3PjdmYOBFEosgmVFRKhIX cnIDXOCbOEPudqlOBhQl7gTvUTl0tmYCC1QYxLJiI+UaS7yxM2XKE6EEKybq+r9wDz4rAq X/Zn56L/NHxwJdlHqC9a1qLXYkmTvQM+mlsASbU5cfV+JIcvRjY/6hymarmK5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693524755; a=rsa-sha256; cv=none; b=PWyNup4wrjFIcDqv0rbLtK1F/ATaxgI8GLvUriSclJv+m47QdkRxPpm4SSkQjN92EIvC27 JeqJIdbyuZniX29JrYgxmfyT51qDN7nhIYd6ukt122uDfegLhsO1flhx3+U5WUZbMtyCYL OSP8gVf50LZqzZp2F8j9EF4xqO3rJgAusL5IahX0rU4+Qv2aiyTQo9aEnDK+kWyTgR5hbE 9mfCz28iXAZKfgAyZmW0wWEU4IO2v3i3Q/PygJ+Cj4SAkpYzb2aBUY0YOBrcckY+lYes46 y3J+h5dYjF2pEYnAFQsLyUfqpHVmqPiI+JE5YtiF06jhgjPnf/MswCJeSpi1xg== 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=1693524755; 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=4QJMQg2+VnbCBsXxnSTl8eW4KJuiuwHqQCksLhVqwIg=; b=J28mJqkGGjQrrC6TTh+d+jNGyjoYAHRynYjc0hlAXdkaMLoJpWkMHWj+ue++fCOQ6E9CQ7 06PfArSLsu9MfHDdXmdDMRWHLdA5Hz/GPxvcM5jtKMuZrweGlrXD6/CCKVxmyDgw67OVCN D8nCBrThfR+P5fupUZEBV/TJIxw7ate+g3W3WY20vMMQcxJKDws8dkywfMggFofA965E43 GtGcI8iK6KDylU0nLMMQxQkw0/vhRP5zuClsk5buW2sJdYHQKQ3UAAGdlkWB5kdr8eleJr IEnBZbkUO+tWzLni5RcPxziRL496wD8oyGoeBfiMiF9OxVUPvc5/3VuyOUq8tw== 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 4RcHWk5vkyzd0k; Thu, 31 Aug 2023 23:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37VNWYPq043905; Thu, 31 Aug 2023 23:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37VNWYiB043902; Thu, 31 Aug 2023 23:32:34 GMT (envelope-from git) Date: Thu, 31 Aug 2023 23:32:34 GMT Message-Id: <202308312332.37VNWYiB043902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: ad4f4146ef30 - stable/14 - MFC jail: make jail(8) man page more readable and more correct List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ad4f4146ef30b52890593a5f00ff151be75d729b Auto-Submitted: auto-generated The branch stable/14 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=ad4f4146ef30b52890593a5f00ff151be75d729b commit ad4f4146ef30b52890593a5f00ff151be75d729b Author: Jamie Gritton AuthorDate: 2023-08-31 23:31:25 +0000 Commit: Jamie Gritton CommitDate: 2023-08-31 23:31:25 +0000 MFC jail: make jail(8) man page more readable and more correct The synopsis section of jail(8) is fine at showing everything that could be on the command line, but doesn't make much sense. Add some sub- sections for the different uses of the command. Also fix up the paragraph about command-line parameter specification, including removing some clearly erroneous information. Approved by: re (gjb) Reviewed by: dvl Differential Revision: https://reviews.freebsd.org/D41606 (cherry picked from commit dab7fc49e7a65379a0050e8cab0b50afacdc0fc5) (cherry picked from commit db08e8ba0e7bebbd1af1ee91f0235cd36c9bb7d3) --- usr.sbin/jail/jail.8 | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index ef071aae863e..0e98914795a2 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -23,32 +23,45 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 12, 2023 +.Dd August 26, 2023 .Dt JAIL 8 .Os .Sh NAME .Nm jail .Nd "manage system jails" .Sh SYNOPSIS +.Ss From Configuration File .Nm -.Op Fl dhilqv -.Op Fl J Ar jid_file -.Op Fl u Ar username -.Op Fl U Ar username -.Op Fl cmr -.Ar param Ns = Ns Ar value ... -.Op Cm command Ns = Ns Ar command ... -.Nm +.Op Fl cm .Op Fl dqv .Op Fl f Ar conf_file .Op Fl p Ar limit -.Op Fl cmr .Op Ar jail .Nm +.Op Fl r .Op Fl qv .Op Fl f Ar conf_file +.Op Fl p Ar limit +.Op Cm * | Ar jail ... +.Ss Without Configuration File +.Nm +.Op Fl cm +.Op Fl dhilqv +.Op Fl J Ar jid_file +.Op Fl u Ar username +.Op Fl U Ar username +.Ar param Ns = Ns Ar value ... +.Op Cm command Ns = Ns Ar command ... +.Nm .Op Fl rR +.Op Fl qv .Op Cm * | Ar jail ... +.Ss Show Parameters +.Nm +.Op Fl f Ar conf_file +.Fl e +.Ar separator +.Ss Backward Compatibility .Nm .Op Fl dhilqv .Op Fl J Ar jid_file @@ -58,10 +71,6 @@ .Op Fl s Ar securelevel .Ar path hostname ip Ns Op Cm \&, Ns Ar ... .Ar command ... -.Nm -.Op Fl f Ar conf_file -.Fl e -.Ar separator .Sh DESCRIPTION The .Nm @@ -238,10 +247,10 @@ would apply to jails with names like and .Dq foo.bar.baz . .Pp -A jail may be specified with parameters directly on the command line. -In this case, the -.Xr jail.conf 5 -file will not be used. +A jail may also be specified via parameters directly on the command line in +.Dq name=value +form, ignoring the contents of +.Xr jail.conf 5 . For backward compatibility, the command line may also have four fixed parameters, without names: .Ar path , @@ -249,11 +258,6 @@ parameters, without names: .Ar ip , and .Ar command . -This mode will always create a new jail, and the -.Fl c -and -.Fl m -options do not apply (and must not be present). .Ss Jail Parameters Parameters in the .Xr jail.conf 5 From nobody Fri Sep 1 00:01:14 2023 X-Original-To: dev-commits-src-branches@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 4RcJ8q1Clbz4rnCL; Fri, 1 Sep 2023 00:01:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcJ8q0gNXz3Z4M; Fri, 1 Sep 2023 00:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693526475; 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=biczQVF60zE3XqYIuoXPPxNAWaR7RhUh0q8JXUJ7Bg4=; b=DwNt8Uc32SI8iQWryWfOHsfS2MkSBT1uYo0CIf1rN0aJ+Xlfa+sZglqG+052IS09OaDArA XW7JFC/QK2Q+v79bXBFGiQgmS4JBWs3zNrQ+3JcwfGTa80V07qUgxDH52EqbUx9s3J9t50 SOz4mFvvcBYEhdmKOT1utTWsbz9UhLsFFtdbfv+KmfNB35IcHZrotN8BZVmpmDvbAZzw4z byLEfNHzYn9XXwgrgwbDcKNwDfMoLxnzDx2kCl6VO8yJFczd1KIUyVEkdhMe27m3Jg3n/7 Di383cVDnJL8XJoPQt0NkfMDhLsbICvAQhTcfQSM3owVlgqCjt31I+KTc0gkbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693526475; a=rsa-sha256; cv=none; b=fuGlZkn5MH9dtEvevRRJHrg0Gmuju1EVl0ou1cfL08k7crZwWyAmqRnP0pY7QIIZue7fwL SuVTDRbW+mVwDeoC5rPX7XQlUlfxFJv1sbEwW0raIpkZ+JDkBLY6PQgAMcpOirN2LZYc12 v74VqCkz4GzvoAmb+KVOYJf7My7FLL9lT4cePFS9d+UtsHZst5uOv5i565x6VQDhNI0vYQ nnCi6q3WzPzbMwgrBl1sUwBY5OUdW2s2pA/z3RkUf20eiC/NjG3HsXXHNkcWYgc4iYFzoh AsANM1Ho8rVOfH9GMzTyeelADqJEkqkWO5Y5K+5YmdXgWUWC18/mb8FmyqPv3A== 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=1693526475; 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=biczQVF60zE3XqYIuoXPPxNAWaR7RhUh0q8JXUJ7Bg4=; b=qxyEgEyMVcqAMHb5JxlrtaQAApdRh8GjuBv/IuMDXETXSJQz5uroddJoBopN1WN2G08peQ vt6JUUR8LjnaK6Ak/L+Depy2Nrt5ID3h+sPY3O0Q4qnN5YhaHQRNdTRlkEWggGOA5X/zTd wqF2yfAVzckKxLbSMR5mWL6Pw2OWtofJec/sQFeyj5iJwMajvQNK9KugjtZkMk09FxYCDP pnAaV5NuTUuRQlDRWQWjOmSoB6EP6gOnIyVXZT9zYQDdNpHU1V4nLSqFkbj7JOsmlzla6T +oSuqn/ZvHihevq/6eu1lynDYOS5QKMoJ1V8qbkARIiT7iK1s7hdcKla4LE2ZQ== 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 4RcJ8p6qlnzfLm; Fri, 1 Sep 2023 00:01:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38101EFT091336; Fri, 1 Sep 2023 00:01:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38101Esl091333; Fri, 1 Sep 2023 00:01:14 GMT (envelope-from git) Date: Fri, 1 Sep 2023 00:01:14 GMT Message-Id: <202309010001.38101Esl091333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 4c3f144478d4 - stable/14 - release: update stable/14 to ALPHA4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4c3f144478d4e7ab00258042db6365caedbffef3 Auto-Submitted: auto-generated The branch stable/14 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=4c3f144478d4e7ab00258042db6365caedbffef3 commit 4c3f144478d4e7ab00258042db6365caedbffef3 Author: Glen Barber AuthorDate: 2023-08-31 23:57:10 +0000 Commit: Glen Barber CommitDate: 2023-08-31 23:57:10 +0000 release: update stable/14 to ALPHA4 Approved by: re (implicit) Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 401ff0e50edb..efd3afa16515 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.0" -BRANCH="ALPHA3" +BRANCH="ALPHA4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Sep 1 08:59:05 2023 X-Original-To: dev-commits-src-branches@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 4RcX5Q3Nlmz4sGmC; Fri, 1 Sep 2023 08:59:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcX5Q1NY8z3RPJ; Fri, 1 Sep 2023 08:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693558746; 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=stMfDboGV9a4OklapZBIIHgzK2ffakLYGZaKLnMuFA0=; b=B1lZK6ZXVrIbvbjqfsUJdYiPZHV5L4uFCp0NXUMJLS7gg+i85OgaJZeKR4oYrm9kf9zyPP bf1snto6Pvq18rZ5ohRIcMJMokahr7W33cZeOV7xDSeuGDEY7yZWABwXmiGwd5YHsMsnFo tQz/V+rNfEnLxECR9Cr51GiuDfVkux7VpOQHKHcxSiQwNB1YT3GI5JyFpMW8zxZ5ZBBDmR 0M7DU1rI83oKuQaLIbVb2q1bJQo4eUovO42lj/FPcF8F3i7pKYNMGThhpm+ShRMsxxDhAn bCkzgw/719Gs6MGCAbOB71ae4x/HZ526RZEk8DHprdJHcjjHY1KcZPBaS8uTUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693558746; a=rsa-sha256; cv=none; b=olUubP3O//Fnz5kzxjwvBrLa1D5ABh0RmrA4sAYCaP8MPrqglrJDPDi2t+uTO0IQ0f++Hd YbgNdLH9s8JspWkB5xZSh+rutsvDHTf/OZn5IKoOAnRoHoBnEtgiRRni4TBDhJbcwqt26V RTxDL51Qa2TEY26+F710gzR23DF+aHbu3MzJu3ykcm6tRGk6Ywk+5or27eI3gaA7DAvHGJ cwwTm9iGVBIVJ29pCEcJ+/aAl3bfnSQKCt1IvAXMULe798NflAx0xPSTL8RQkL25N1gnMB 7hBhhCW6Um9GpHMjmwL28AVtnuzyqD3Njpa/tnA21ZxI+rjlVXf80rb9SQDcdQ== 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=1693558746; 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=stMfDboGV9a4OklapZBIIHgzK2ffakLYGZaKLnMuFA0=; b=ACb1nzSpu4EvLMiExQs457tt+fAGLkMBeaczXd9aNUGC/JdReNRMFL7HSamlzhakXYTbcn bLd5H37UacZxCLJkVefazKu7llgETVzMKfjdQKuVDLQGp2ATAY6aHvwX4HVnDAg5QEQ/u0 utonpacJ863leBTcFr/QNUVjHub8KEcm7b8KTM6ygBKMVebOzX8++Czwk6Dul0eSmGYz/H VQZZ+kUUT8uLAZ2S8VS1cBJCSpxo/EWbfu4ykO16MZpJ20rRW7j+XKIsMsMnaine9dPeGL q0Gb2gXiE49ZOUn70/bYvFCCqTxfS69s6+6wgFesfZNxhVRMz/eLDypBHKZluw== 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 4RcX5Q0SsgzvHs; Fri, 1 Sep 2023 08:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3818x5CQ075746; Fri, 1 Sep 2023 08:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3818x50m075743; Fri, 1 Sep 2023 08:59:05 GMT (envelope-from git) Date: Fri, 1 Sep 2023 08:59:05 GMT Message-Id: <202309010859.3818x50m075743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 672b3df113b7 - stable/13 - carp: delete interface routes on link loss. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 672b3df113b7df88eb99d7d9922c4229a82ceee7 Auto-Submitted: auto-generated The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=672b3df113b7df88eb99d7d9922c4229a82ceee7 commit 672b3df113b7df88eb99d7d9922c4229a82ceee7 Author: Andrey V. Elsukov AuthorDate: 2023-08-02 07:40:34 +0000 Commit: Andrey V. Elsukov CommitDate: 2023-09-01 08:58:06 +0000 carp: delete interface routes on link loss. Obtained from: Yandex LLC MFC after: 10 days Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D41290 (cherry picked from commit 600bf006d3f15f170b9209d5d3a37437bfe0850e) --- sys/netinet/ip_carp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 7ef198f0b42f..dc3914c6f77a 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -2095,6 +2095,7 @@ carp_sc_state(struct carp_softc *sc) #endif carp_set_state(sc, INIT, "hardware interface down"); carp_setrun(sc, 0); + carp_delroute(sc); if (!sc->sc_suppress) carp_demote_adj(V_carp_ifdown_adj, "interface down"); sc->sc_suppress = 1; From nobody Fri Sep 1 09:07:15 2023 X-Original-To: dev-commits-src-branches@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 4RcXGq4Ky8z4sHDJ; Fri, 1 Sep 2023 09:07:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcXGq3rzNz3S35; Fri, 1 Sep 2023 09:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693559235; 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=9Gyws+Sh+5YJfKS4itjHChhgYnmVlItVq4R143ztskM=; b=xSuJh0vJ1wkSlbh+VC1me9bzBZ2r0SnzCJBGDjaeIliCfnK+u7VpfXi6ynalUTsXlb6PBm QZ0mu02+OpC+NRQVMJYSuqwiu69Y90oZ0Q6PSsFpfjKA8YlxF0qL1jDvN4Vz9uM35jUSq0 /rzZ9rWeL9L1c9MR+y+yh70yWQqZFJdGYeBIVtMVpwOeui8biFXi8QzKvyei/qbtAZu5hX 2V6w5rlk/dxNIFip2aYT1SDUTwd/ip+nUBLNp++liEKLzagrc4G+IGKGri+tI9H6bG5k0Q 6OvY+JO+OUu4HCQB9PDXSTD0M2NZB7GYzn7NCOHMgbE6iomJ9TZM92e1P06F8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693559235; a=rsa-sha256; cv=none; b=piX+iiR6enVozLnc3UtPmD9j0xiPogU1nrpZUL/fVNyGNkYDUg8C0pUttCcmXVBpCQnfMM TXeFJkJIMpSpzeJC3C4plfitrndkPf5ceZhbR76ZQlxasi5m/AvSnCRNveCcsD9t8HA/nn 9S2C8UAVt652psLwG6DZAc4K8MjAwp0cRv4AhQUXL7AsNBavZzBsCLrVDeZDUzsYbU3//0 DEEm2O1gkQFwzEx4hNEfy+nVT/s4noK1j2SAA3JIvD46UREjBkP1RRMOe8edKdU+S5jpyV M/v6R2xB5HgbmoHlthmUfAIGk4o9tNHpDQa1rQNDFuwCRB4XCQB20APeqKXgsA== 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=1693559235; 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=9Gyws+Sh+5YJfKS4itjHChhgYnmVlItVq4R143ztskM=; b=Na8B9RM1frys06hiqUXJJ8XzZqMP/5MUIEMC4dDbS8Tu0q5sazujzO36RSEJBtiFDBuwuv zvFaytsBbzmlv+mRXBsz1LX6zeuTNuYTNx1aOVZTnop22oNiUHnkh7mykcuRKFS5oT8t3Q 9V1OeLNqlWz5ZVoXkP0HRrnGzwv6fU1TzDyKZLf+I8G3maW+KBELiWovh6Z2RhWguPIzHO HrVCqPyICueR9UW6PgMOfKGd2QeIlv/QbYuiZL3lEcuXJMRdIsj/LpfmxHgg+Wfn+fTp18 6D51ynQTAihSGQgRbpazWChTN4bVvV3YtjdvSHjTrsOrO4tI+ItjITOibmEf4g== 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 4RcXGq2x15zvX9; Fri, 1 Sep 2023 09:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38197FCn092973; Fri, 1 Sep 2023 09:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38197FTf092970; Fri, 1 Sep 2023 09:07:15 GMT (envelope-from git) Date: Fri, 1 Sep 2023 09:07:15 GMT Message-Id: <202309010907.38197FTf092970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: de114db0fe90 - stable/12 - carp: delete interface routes on link loss. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: de114db0fe90b45cd1a49ce3dcdc8c68051565ba Auto-Submitted: auto-generated The branch stable/12 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=de114db0fe90b45cd1a49ce3dcdc8c68051565ba commit de114db0fe90b45cd1a49ce3dcdc8c68051565ba Author: Andrey V. Elsukov AuthorDate: 2023-08-02 07:40:34 +0000 Commit: Andrey V. Elsukov CommitDate: 2023-09-01 09:02:23 +0000 carp: delete interface routes on link loss. Obtained from: Yandex LLC MFC after: 10 days Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D41290 (cherry picked from commit 600bf006d3f15f170b9209d5d3a37437bfe0850e) --- sys/netinet/ip_carp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index acf819df694a..544e9e640c2c 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -2074,6 +2074,7 @@ carp_sc_state(struct carp_softc *sc) #endif carp_set_state(sc, INIT, "hardware interface down"); carp_setrun(sc, 0); + carp_delroute(sc); if (!sc->sc_suppress) carp_demote_adj(V_carp_ifdown_adj, "interface down"); sc->sc_suppress = 1; From nobody Fri Sep 1 10:09:15 2023 X-Original-To: dev-commits-src-branches@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 4RcYfM3gPxz4sKhH; Fri, 1 Sep 2023 10:09:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcYfM38Mkz3c52; Fri, 1 Sep 2023 10:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693562955; 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=eTltSS265PGo7G7z+99RKwVDdHv5Zwla85QLGC340CE=; b=dk2Cdjw2WPhhFCm2gYDXALxWtDiPfL6E0kkhjgOBOBh6LP5GpQcMrvGeEkbtVSdtqNriMo puzBsR8PINVsuLK0RPnoIjBH0ACaMvg315hK7PYGwqUUjKv7I7fUp5Jl2zyawO7kFhilDh ze/MmP/PvG7TcffJOyhlNoh0u86xp9ExFtsJ94FcJXEhBuX2v6G7l4AUQaL7xJGJsBAuz/ dMzARE1jovONagCTFsQUYPBU4fQIhJqcSvOfqhkvFAsb1f7CvOI0ztqpCdb4GY1GHCQgs+ gn5mZcPUZw6cJQDySY/jPfUVQVk1eKoym/bkVlEuVi5UMgmrKIAMKO2ptC/bRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693562955; a=rsa-sha256; cv=none; b=bxKuxqL3O797wmXyQabY7eVf0CbTEgkPELl5Y2G0/WqAwgN1P+73hfGg7ktQQfZ7J8Brc2 hjCkpArLKVnmOgA3wJvPiQOYLUpLPgQno9yu9tW/IsNlWbfi3knS5vrqS3OwYpC/FUhnVH KXpxMEzFHudMXZgLotXJaUKiz94fnltrZE8C3f3Co3fLEO5inNp9AjtoGg0/eMlOoKL8D8 c5Bb3StLvHnJUEIUFVoNJQPCC/dmXvcgWXApNxVvWxGhdlKSFagxRJVJLq1olpJX3p9zO1 WNktxCSWXFyWGBw4kzz4geAyN+qlIlY6kwmfsYHblGjF0hhRtVc6tSoII2LfuA== 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=1693562955; 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=eTltSS265PGo7G7z+99RKwVDdHv5Zwla85QLGC340CE=; b=KZruYJnCdCF8l3wtJsvGIdPZQZ6U5QT1TX+T3zN9LObyNW7usGIRMqgD9LYKz6Lxeo7eX0 5/UnMY+OOLmrlJPziso7Hb/zEZIRJpNHNqv7XzpGL86Hs+qIXBMsHlGeA7D28krKXUOz6O 7LMhJzqPQbP4ojwdFM2pBwtzpZfDBu8NUgSRMwHcykGB7RKT0vcIrnTIkT/Ken3kqsAbYM 5AtUYOGE/jXJ8QrprchAScbAS6CFFrLGXPaZa7mVOLIaa/tRZqLuCHF4HXRBSNm6u7myQ9 NtFdwLvYLyNmQolDRixtaBVrhmhXKx26X90HLEt17mtqGfQog49QBOQzXRBJHA== 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 4RcYfM2BKNzwtQ; Fri, 1 Sep 2023 10:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 381A9Fr1092913; Fri, 1 Sep 2023 10:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 381A9F0P092910; Fri, 1 Sep 2023 10:09:15 GMT (envelope-from git) Date: Fri, 1 Sep 2023 10:09:15 GMT Message-Id: <202309011009.381A9F0P092910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 5a3f517110ef - stable/13 - bridge.4: Document the net.link.bridge.log_mac_flap sysctl variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a3f517110ef2d076274ca0cc41668740d62e9c7 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5a3f517110ef2d076274ca0cc41668740d62e9c7 commit 5a3f517110ef2d076274ca0cc41668740d62e9c7 Author: Zhenlei Huang AuthorDate: 2023-04-10 10:07:04 +0000 Commit: Zhenlei Huang CommitDate: 2023-09-01 10:08:13 +0000 bridge.4: Document the net.link.bridge.log_mac_flap sysctl variable It was introduced in 2d3614fb132b (bridge: Log MAC address port flapping). Reviewed by: gbe (manpages) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39465 (cherry picked from commit 3fdb40d1befe7b561e7e5fa0b5c80aac41adc50d) --- share/man/man4/bridge.4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 2b977c4578a4..06255b85e1a8 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -33,7 +33,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 17, 2021 +.Dd April 10, 2023 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -116,6 +116,15 @@ interfaces that are part of the bridge. For unicast traffic, the bridge learns which MAC addresses are associated with which interfaces and will forward the traffic selectively. .Pp +By default the bridge logs MAC address port flapping to +.Xr syslog 3 . +This behavior can be disabled by setting the +.Xr sysctl 8 +variable +.Va net.link.bridge.log_mac_flap +to +.Li 0 . +.Pp All the bridged member interfaces need to be up in order to pass network traffic. These can be enabled using .Xr ifconfig 8 From nobody Fri Sep 1 10:11:12 2023 X-Original-To: dev-commits-src-branches@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 4RcYhd1sHfz4sKpr; Fri, 1 Sep 2023 10:11:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcYhd1R4sz3cMx; Fri, 1 Sep 2023 10:11:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693563073; 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=quYVC59Z2xGEMbXMSX+FVuVzduIWy2cYo8zGDqejouw=; b=Nilz2w7KBJCHALrn/pDok79rqIyIRy3e5JPaJvTMCavj4zFwdjfwazt7ovg/tebKsRBRaJ yZGTOt41k0Z8UKvIQHjnbv435LSXfGUZmrmzAiImayFJd+u94iCdowR9zdZpvxFRHg0oJK hkRP/ZFMCvRyIiFxdCVQdUhVqrAAOkJVYbRlseUhRYD9jLdex/y4gTo4oaXJbqJgdb7u3Z 6/ZNtIPbr+JFNyFwBCBtKUjbRM4W6NVeos/s/uF7LAlqkxX8LPfSjJj0j8XLAkRoCsVRRj i+jCH6nXLXXw/VvEFU6FccbbSd0G6Q6KRmrLCrTtcOMzYmbQNbgPOhnFg9zYXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693563073; a=rsa-sha256; cv=none; b=WPjxL90SPc/l+x0mAtzrbkhLT0tH+MJyNwaEqC/NqF/RolfHj6deybFnVIAkUYYugfVPF5 XKqEIfv2Yh3+JvHMClX1gBiwsFFapKBDD48hpgkiWIrDKvjr53y+IrMVM6nkyeTcmIK6yK UfAG96wZ5UJZYWTAFwE0S39zwDiFuffk0U6IvXU/TmLQRE1R27jDfU0J2aTg6JPDZT8PUz 5BIDsyMmyV3zcWOdDXOuuZXjT7pKUHV24zZ1UQcaVyorj5T9cObvi3C4htRQujrxJN/drQ 0d+rjlWro2yA6FdeIqA8tGyHeZfcMy9wIP8ltr3AgESNMM02YJnO9tvHGganRQ== 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=1693563073; 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=quYVC59Z2xGEMbXMSX+FVuVzduIWy2cYo8zGDqejouw=; b=fWICUWn4JZNCr4cGN5tm+5FVpFSVg/8aiZNrupkMrueajajdbKkzFgJUeJqvl1uuT0bOhO erCdg6iPtF7mos7zglvbOXy5zPNfBmndxc9nJRDkRp7dturfJQrDYeYNTB+4pGrU1tRgAI ETKO4L7mFSo+CqR6GSuXTKVqyUfBVc2m5mKZp8Bd8/I/YDBqkxGsfqieXhoQMYNeYPPQOf LVscnpRt1lm75BFlh+6y1eo8Or5zeaDGWqAwljDC0APXtKwOc4rPxxelc7ZgP1CGrAo74p zWsq5YKCydo0lFUj/ljQjSuvMgr2CJ19AXjJGZ2baxrCRIxBKq0/4IyIeuRtJQ== 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 4RcYhd0Tzzzx7h; Fri, 1 Sep 2023 10:11:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 381ABCX6003810; Fri, 1 Sep 2023 10:11:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 381ABCTP003807; Fri, 1 Sep 2023 10:11:12 GMT (envelope-from git) Date: Fri, 1 Sep 2023 10:11:12 GMT Message-Id: <202309011011.381ABCTP003807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: dddf410362b9 - stable/12 - bridge.4: Document the net.link.bridge.log_mac_flap sysctl variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: dddf410362b9eaf8ae9fe13f5edd9fd67f24046e Auto-Submitted: auto-generated The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=dddf410362b9eaf8ae9fe13f5edd9fd67f24046e commit dddf410362b9eaf8ae9fe13f5edd9fd67f24046e Author: Zhenlei Huang AuthorDate: 2023-04-10 10:07:04 +0000 Commit: Zhenlei Huang CommitDate: 2023-09-01 10:10:40 +0000 bridge.4: Document the net.link.bridge.log_mac_flap sysctl variable It was introduced in 2d3614fb132b (bridge: Log MAC address port flapping). Reviewed by: gbe (manpages) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39465 (cherry picked from commit 3fdb40d1befe7b561e7e5fa0b5c80aac41adc50d) (cherry picked from commit 5a3f517110ef2d076274ca0cc41668740d62e9c7) --- share/man/man4/bridge.4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index d787db1aa141..6b32da22efce 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2017 +.Dd April 10, 2023 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -118,6 +118,15 @@ interfaces that are part of the bridge. For unicast traffic, the bridge learns which MAC addresses are associated with which interfaces and will forward the traffic selectively. .Pp +By default the bridge logs MAC address port flapping to +.Xr syslog 3 . +This behavior can be disabled by setting the +.Xr sysctl 8 +variable +.Va net.link.bridge.log_mac_flap +to +.Li 0 . +.Pp All the bridged member interfaces need to be up in order to pass network traffic. These can be enabled using .Xr ifconfig 8 From nobody Fri Sep 1 18:23:15 2023 X-Original-To: dev-commits-src-branches@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 4RcmcM2LM7z4s1Xx; Fri, 1 Sep 2023 18:23:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcmcM1t1Gz4Hc6; Fri, 1 Sep 2023 18:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693592595; 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=bTYvtTtBfm6xncYZiMMCbj+Dhy1iclveZchqg2Jh8HU=; b=NkKnM7cz1TXwyYP2GDPDlAxJshot20080BT1bpts9ryn6PTusvPJgdca7wO6cK8UFhLS5x oTRsthRyAMa1nZe8bmsmvjE/Z2E2320/0G+LUWA6DGBqjFTwT8RVhJuAStsqyy2OHrHOpX j+Jj11z148mNIHC7LYonI6d1lPyTt7GbBOAzNPR2LY9yY+9oxDcjr59A4e7wo4rwNW24nX LOmFGyiXMNyvs8jLmmMh8mc5mB/aoxoSnd4UJTYf4xGDpmydc0Jt82gaT9LfeO6dfIZ7uj 4SsFQtKEomtwd6KbxgRVvvi/V1scj31iBgtKfqQ3OVsh1SxUQdJjr27agfihow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693592595; a=rsa-sha256; cv=none; b=SxYylhs5cx/JMZL+ZEX2Fk5sRZh/tAMUOsRZGbcJAjVIbdst4ZFmgttvgXHxYjXCn+QAaE N3w7MzUAt7XsJUvJsBj9zcVPE8U7lA44QPIB5W4lRjHxmIlBG4zOk/fQtoIGPz5/mPGz/Q 7sNQ7x2eDPQVrjv4Be141O1QYrj/bGEZUuJwDVs2S5lgoA8ip+QHt2rPfrKALoi1eJU7j3 HPYBQ4+gTjV9JbhBYIvvA3P+pm913R/nI1LFmV7aYum1PD04Wu9XNVtTEuuX3kBup5l0we 9OiCDeDx9BYTXmAiaoIS2QOUMadf22BeagCrAYLH7ac38UlCMbjcYNv1q+AYkA== 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=1693592595; 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=bTYvtTtBfm6xncYZiMMCbj+Dhy1iclveZchqg2Jh8HU=; b=l+RdA+rTWBUxTc7UbdYRGjtNZAmmL+s2RKDzAedjwfIFoTQSWGT//SgNIsem0zNfjSeyss XMFFot22+1TjNKVeP8rvFEZJ8Bn54QCflNLGew08KM4yZ93ZBo8I4rHbFMcSt4xvOKNqcH zCU8Q9r3XgBlpbYcnKvnU7HBKfnrz5N0nBDDsfxAeGgkV3M+VOzH+/4N6+V9ymLmJMM4FD YN0IxTDeJ+DdlYD6RvF+8UAeytx7QLl7OjK5nSBl5poWxxbiItTts8ROy635expgl/oKp2 1qM62Bue4qW/wyFbQRdBTUp1b7kX4MuUn17yzHI/XaSm4UKHTeQkeg2xrDnpYQ== 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 4RcmcM0x7Tz1B7W; Fri, 1 Sep 2023 18:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 381INFOr020894; Fri, 1 Sep 2023 18:23:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 381INFAP020891; Fri, 1 Sep 2023 18:23:15 GMT (envelope-from git) Date: Fri, 1 Sep 2023 18:23:15 GMT Message-Id: <202309011823.381INFAP020891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: 1a0824ec9438 - stable/13 - clk_fixed: reduce and clarify messages due to missing clk-frequency List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a0824ec9438ead5e61e1fa64785efc9465fab5e Auto-Submitted: auto-generated The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=1a0824ec9438ead5e61e1fa64785efc9465fab5e commit 1a0824ec9438ead5e61e1fa64785efc9465fab5e Author: Mike Karels AuthorDate: 2023-08-25 20:11:46 +0000 Commit: Mike Karels CommitDate: 2023-09-01 18:22:49 +0000 clk_fixed: reduce and clarify messages due to missing clk-frequency The current dts for Raspberry 3B+ and 4B have 2 disabled fixed-clock nodes which have no clock-frequency value. Such nodes are non-standard. This results in about 150 messages during autoconfiguration: clk_fixed2: disabled on ofwbus0 clk_fixed2: Cannot FDT parameters. device_attach: clk_fixed2 attach returned 6 Defensively check for clock-frequency in the probe routine, and if none, return an error with a more direct error message (1 line per occurrence, 50 lines total): clk_fixed2: clock-fixed has no clock-frequency Based on a patch by manu. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D41594 (cherry picked from commit b4ef09b9eb117d622bb274448e5cffcae0ba3488) --- sys/dev/extres/clk/clk_fixed.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/extres/clk/clk_fixed.c b/sys/dev/extres/clk/clk_fixed.c index 7c71f04eac0d..6a26effb73a2 100644 --- a/sys/dev/extres/clk/clk_fixed.c +++ b/sys/dev/extres/clk/clk_fixed.c @@ -153,6 +153,11 @@ clk_fixed_probe(device_t dev) clk_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; switch (clk_type) { case CLK_TYPE_FIXED: + if (OF_hasprop(ofw_bus_get_node(dev), "clock-frequency") == 0) { + device_printf(dev, + "clock-fixed has no clock-frequency\n"); + return (ENXIO); + } device_set_desc(dev, "Fixed clock"); return (BUS_PROBE_DEFAULT); case CLK_TYPE_FIXED_FACTOR: From nobody Sat Sep 2 11:01:26 2023 X-Original-To: dev-commits-src-branches@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 4RdBm70Hw3z4rgHX; Sat, 2 Sep 2023 11:01:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RdBm66v37z4TDr; Sat, 2 Sep 2023 11:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693652487; 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=YQK9M6feFmvR6rlLKuT8oszRhdGVo59xxAl3xNxlKD0=; b=rlg+uD8Pcam1UQuHtVMCZd8QJAKuPGX6l8T1JxejFDKDdULLxCyP2TPkKf8gZUZus77WgQ vwcsI7PzbFg9Drrg/TcDnoJt66zR1C6pOO4dAA/u0fBICRnMrJt3pZ/yPpTA4U9mAuwGPC bE5WNBUEHmAQpQqa2p1PxSKmLeyvVeMHw/KQTdsrM234+lR8O0qstHVDx2DTkDDY5ODnam yi4r+a58UCgcgVNP360XJ3waYYp2+zBnv2sX9Amu5oDjyShK2Cd9G7UBQDjiD8ZWCiQ/mC P2OZqS0Pgw7AJwKuIHbWoy2AybcCwfuqg0ScB4FD5dmUmzLIokCCCrz6VOE7Ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693652487; a=rsa-sha256; cv=none; b=wceGGUl/vnPBg24IMYwxiJtxRtsPkvsjfqW7EEpAvK0rMEM8z8g9NIX+o82eU4NZG5/HW2 j9Firj9xTcvZTFNlFqro46JpEYwk5BeYseGzWnG6RtC/Z0ok/+yil44pAS8DNja2e3dD38 vkYd0i4IGx5CGKodgdLdo8u+a9mqMcKPLR+IqSwCNYbnFsbEnFFHHlqW+8QOoN+bkSC/4d Uv1qqV7UVo8cH5n+cZ9UXb0yf3Zr+rhkYhOoe5SFbtOcv69lCkC9KX+F1YPyjEkZqhSrbt OesDq2egBUCvloXHNyaI1z7vQKx/oT2pRzUNWYnCXopxHH+vvYL9/jgTcsR3aA== 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=1693652487; 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=YQK9M6feFmvR6rlLKuT8oszRhdGVo59xxAl3xNxlKD0=; b=A0Yf+b9szlz8zUiJy5ZibQxNeN05sgXuEYx5oZz0iuVw3QGv+0eND9R7ZAoVyP1qlnAGBG eLM5r+02B/CumLzfbge0dh5zqljbydOU09x8UdxJKFQ3HjEfvX+pPJxb22bJmxT287NCbV 9t8iDrs52pvzlGUk/smnybyH17XFBbFPiG07ErxexN2Xs1qI92GTku1zQQb2Bj6CkEh7AE OWORGr5Xs9UN3i7WEhZP9dHHYc+SD4hK9gD7xxCTdzH6r2wSu0aQnQ3qoLPc1klTCsYwTy r7D5REQ4RTUOTiRO/32dK6TnTXRSje0lGIiRH/nkxZ1JjT/+J/GMg0ViL5f8lg== 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 4RdBm65xvkzgCj; Sat, 2 Sep 2023 11:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 382B1Q12079118; Sat, 2 Sep 2023 11:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 382B1QV8079115; Sat, 2 Sep 2023 11:01:26 GMT (envelope-from git) Date: Sat, 2 Sep 2023 11:01:26 GMT Message-Id: <202309021101.382B1QV8079115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: 153a0e6b038c - stable/13 - netstat(1): teach netstat to attach to jails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 153a0e6b038ceb85d731ebb2ab269e9f783da28b Auto-Submitted: auto-generated The branch stable/13 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=153a0e6b038ceb85d731ebb2ab269e9f783da28b commit 153a0e6b038ceb85d731ebb2ab269e9f783da28b Author: Doug Rabson AuthorDate: 2023-08-14 08:01:28 +0000 Commit: Doug Rabson CommitDate: 2023-09-02 08:08:49 +0000 netstat(1): teach netstat to attach to jails Add -j flag to netstat(1) to allow access to network information from a jail. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41446 (cherry picked from commit 182e8ae26d7cad119bcfce7cc788c1f5cb06e226) --- usr.bin/netstat/Makefile | 5 +++ usr.bin/netstat/main.c | 57 +++++++++++++++++++++++++++-------- usr.bin/netstat/netstat.1 | 77 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 13 deletions(-) diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index 1b999831c160..7888344cbf51 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -62,4 +62,9 @@ LIBADD+= netgraph CFLAGS+=-DNETGRAPH .endif +.if ${MK_JAIL} != "no" && !defined(RESCUE) +CFLAGS+= -DJAIL +LIBADD+= jail +.endif + .include diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 5b05582ca990..a1727d7b7b58 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -44,6 +44,9 @@ static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94"; #include #include #include +#ifdef JAIL +#include +#endif #include #include #include @@ -58,6 +61,9 @@ static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94"; #include #include #include +#ifdef JAIL +#include +#endif #include #include #include @@ -231,6 +237,9 @@ int interval; /* repeat interval for i/f stats */ char *interface; /* desired i/f for stats, or NULL for all i/fs */ int unit; /* unit number for above */ +#ifdef JAIL +char *jail_name; /* desired jail to operate in */ +#endif static int af; /* address family */ int live; /* true if we are examining a live system */ @@ -243,6 +252,9 @@ main(int argc, char *argv[]) int fib = -1; char *endptr; bool first = true; +#ifdef JAIL + int jid; +#endif af = AF_UNSPEC; @@ -250,7 +262,7 @@ main(int argc, char *argv[]) if (argc < 0) exit(EXIT_FAILURE); - while ((ch = getopt(argc, argv, "46AaBbCcdF:f:ghI:iLlM:mN:nOoPp:Qq:RrSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbCcdF:f:ghI:ij:LlM:mN:nOoPp:Qq:RrSTsuWw:xz")) != -1) switch(ch) { case '4': @@ -338,6 +350,15 @@ main(int argc, char *argv[]) case 'i': iflag = 1; break; + case 'j': +#ifdef JAIL + if (optarg == NULL) + usage(); + jail_name = optarg; +#else + errx(1, "Jail support is not compiled in"); +#endif + break; case 'L': Lflag = 1; break; @@ -434,6 +455,16 @@ main(int argc, char *argv[]) } #endif +#ifdef JAIL + if (jail_name != NULL) { + jid = jail_getid(jail_name); + if (jid == -1) + errx(1, "Jail not found"); + if (jail_attach(jid) != 0) + errx(1, "Cannot attach to jail"); + } +#endif + /* * Discard setgid privileges if not the running kernel so that bad * guys can't print interesting stuff from kernel memory. @@ -888,24 +919,24 @@ static void usage(void) { (void)xo_error("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-46AaCcLnRSTWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-j jail] [-46AaCcLnRSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -i | -I interface [-46abdhnW] [-f address_family]\n" +" netstat [-j jail] -i | -I interface [-46abdhnW] [-f address_family]\n" " [-M core] [-N system]", -" netstat -w wait [-I interface] [-46d] [-M core] [-N system]\n" +" netstat [-j jail] -w wait [-I interface] [-46d] [-M core] [-N system]\n" " [-q howmany]", -" netstat -s [-46sz] [-f protocol_family | -p protocol]\n" +" netstat [-j jail] -s [-46sz] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -i | -I interface -s [-46s]\n" +" netstat [-j jail] -i | -I interface -s [-46s]\n" " [-f protocol_family | -p protocol] [-M core] [-N system]", -" netstat -m [-M core] [-N system]", -" netstat -B [-z] [-I interface]", -" netstat -r [-46AnW] [-F fibnum] [-f address_family]\n" +" netstat [-j jail] -m [-M core] [-N system]", +" netstat [-j jail] -B [-z] [-I interface]", +" netstat [-j jail] -r [-46AnW] [-F fibnum] [-f address_family]\n" " [-M core] [-N system]", -" netstat -rs [-s] [-M core] [-N system]", -" netstat -g [-46W] [-f address_family] [-M core] [-N system]", -" netstat -gs [-46s] [-f address_family] [-M core] [-N system]", -" netstat -Q"); +" netstat [-j jail] -rs [-s] [-M core] [-N system]", +" netstat [-j jail] -g [-46W] [-f address_family] [-M core] [-N system]", +" netstat [-j jail] -gs [-46s] [-f address_family] [-M core] [-N system]", +" netstat [-j jail] -Q"); xo_finish(); exit(1); } diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 1ea45f608550..d347b31d68d9 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -37,18 +37,21 @@ .Bk -words .Bl -tag -width "netstat" .It Nm +.Op Fl j Ar jail .Op Fl -libxo .Op Fl 46AaCLnPRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl i | I Ar interface +.Op Fl j Ar jail .Op Fl -libxo .Op Fl 46abdhnW .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl w Ar wait +.Op Fl j Ar jail .Op Fl -libxo .Op Fl I Ar interface .Op Fl 46d @@ -56,46 +59,55 @@ .Op Fl N Ar system .Op Fl q Ar howmany .It Nm Fl s +.Op Fl j Ar jail .Op Fl -libxo .Op Fl 46sz .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl i | I Ar interface Fl s +.Op Fl j Ar jail .Op Fl -libxo .Op Fl 46s .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl m +.Op Fl j Ar jail .Op Fl -libxo .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl B +.Op Fl j Ar jail .Op Fl -libxo .Op Fl z .Op Fl I Ar interface .It Nm Fl r +.Op Fl j Ar jail .Op Fl -libxo .Op Fl 46nW .Op Fl F Ar fibnum .Op Fl f Ar address_family .It Nm Fl rs +.Op Fl j Ar jail .Op Fl -libxo .Op Fl s .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl g +.Op Fl j Ar jail .Op Fl -libxo .Op Fl 46W .Op Fl f Ar address_family .It Nm Fl gs +.Op Fl j Ar jail .Op Fl -libxo .Op Fl 46s .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl Q +.Op Fl j Ar jail .Op Fl -libxo .El .Ek @@ -114,6 +126,7 @@ depending on the options for the information presented. .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Display a list of active sockets @@ -252,6 +265,8 @@ See .Sx GENERAL OPTIONS . .It Fl N Use an alternative kernel image. +.It Fl j Ar jail +Run inside a jail. See .Sx GENERAL OPTIONS . .El @@ -263,6 +278,7 @@ See .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Show the state of all network interfaces or a single @@ -324,6 +340,10 @@ Filter by .Ar protocol_family . See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -334,6 +354,7 @@ See .Op Fl M Ar core .Op Fl N Ar system .Op Fl q Ar howmany +.Op Fl j Ar jail .Ek .Xc At intervals of @@ -382,6 +403,10 @@ See Exit after .Ar howmany outputs. +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -391,6 +416,7 @@ outputs. .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Display system-wide statistics for each network protocol. @@ -427,6 +453,10 @@ See Use an alternative kernel image See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -436,6 +466,7 @@ See .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Display per-interface statistics for each network protocol. @@ -470,6 +501,10 @@ See Use an alternative kernel image See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -477,6 +512,7 @@ See .Fl m .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Show statistics recorded by the memory management routines @@ -491,6 +527,10 @@ See Use an alternative kernel image See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -498,6 +538,7 @@ See .Fl B .Op Fl z .Op Fl I Ar interface +.Op Fl j Ar jail .Ek .Xc Show statistics about @@ -534,6 +575,10 @@ For more information about these flags, please refer to .Bl -tag -width indent .It Fl z Reset statistic counters after displaying them. +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -544,6 +589,7 @@ Reset statistic counters after displaying them. .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Display the contents of routing tables. @@ -628,6 +674,10 @@ See Use an alternative kernel image See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -636,6 +686,7 @@ See .Op Fl s .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Display routing statistics. @@ -652,6 +703,10 @@ See Use an alternative kernel image See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -661,6 +716,7 @@ See .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Display the contents of the multicast virtual interface tables, @@ -696,6 +752,10 @@ See Use an alternative kernel image See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words @@ -705,6 +765,7 @@ See .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system +.Op Fl j Ar jail .Ek .Xc Show multicast routing statistics. @@ -734,11 +795,16 @@ See Use an alternative kernel image See .Sx GENERAL OPTIONS . +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .It Xo .Bk -words .Nm .Fl Q +.Op Fl j Ar jail .Ek .Xc Show @@ -749,6 +815,10 @@ The flags field shows available ISR handlers: .It Li C Ta Dv NETISR_SNP_FLAGS_M2CPUID Ta "Able to map mbuf to cpu id" .It Li D Ta Dv NETISR_SNP_FLAGS_DRAINEDCPU Ta "Has queue drain handler" .It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id" +.It Fl j Ar jail +Run inside a jail. +See +.Sx GENERAL OPTIONS . .El .El .Ss GENERAL OPTIONS @@ -808,6 +878,13 @@ Wider output; expand address fields, etc, to avoid truncation. Non-numeric values such as domain names may still be truncated; use the .Fl n option if necessary to avoid ambiguity. +.It Fl j Ar jail +Perform the actions inside the +.Ar jail . +This allows network state to be accessed even if the +.Cm netstat +binary is not available in the +.Ar jail . .El .Sh EXAMPLES Show packet traffic information (packets, bytes, errors, packet drops, etc) for From nobody Sat Sep 2 11:01:27 2023 X-Original-To: dev-commits-src-branches@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 4RdBm83132z4rgMs; Sat, 2 Sep 2023 11:01:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RdBm80yCQz4TWN; Sat, 2 Sep 2023 11:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693652488; 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=RruADnYp4M2a8mW2+Ijtco7gCWxxlrG0HLi5/XcFUXk=; b=Lwgo7B3UWFhxzhnHxywB3z5SjNtZM5IjffTQ7ga/kEstAIMkHFelGG1gk+vJoUDfhA2/Dq I4ba23l0Gc4Y1DjzoJ32CqT4HlExNuHPT0Te9+F6H/5yu3BbjpU9PQpfUJQSgAhUJEN03n Bm7g4ZSX+18lbtR4oShjjgo++X4fsIzy7AHYxb/qesOpzwVI76jONaNuocZ5en/PsSB6QW Hlob+2IFn44E0sGQqJXI/xV5Zn8xm/VWcjJRy6BbvUZZyX/ZMxeSbbQV7uxRYEi8aA//FQ fmdWghXtwFqx0LQiP7gZFFL9M0mtmQR/xqmJ21qYhbzrN8dBrkVk6FXeBuL3KQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693652488; a=rsa-sha256; cv=none; b=k/bsSoSb4sF9K7LAkAYpSz9IvtmMbnWY5Z0pBbc3M3QqEvLvL2qDW8KS5dEW5hsFn7/ma4 YoUFOsspuL2YIxLn009VdqfvGYg9ENQDdIy10ygdjZcHiLPgpvptXvEAzV4PFsInrT/7f+ s6L80v095nYb2XubrTKrD7cOgeauxdtUY1aht7lEtL1iEcbv6zaFtrwpwlVD54nBFAwVYT 6Hem3MxJqFQqEgbKYZKFuQgB2i/oz0yWLtkqZR5HjF62OOLMkIXP2BfrxaBg5YoYc9qzcs wCGVKG/fUnl4q2QZ9WVYccnW2dH83LRHbFKe81PwhO+ocyNRinfVBq72HFWZxQ== 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=1693652488; 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=RruADnYp4M2a8mW2+Ijtco7gCWxxlrG0HLi5/XcFUXk=; b=BWsYD4QmtsYao0HwJRLWmRmzkYV7ZVm0Kwf12BqPqULb2KBqkXy4iUvSW7KoTqxP3lL1cD pbKx7PSszr8VFni4K53lc91AOZ/sDafueqMh6652z6b3VP39TXWXBjhiIxcThjcy3RujTO 9qp3sPEpbstpSk0SVOgIPN1tIjeDa3ZRI6dQ1OLVq2njZTD1YQufOsH3qgQeKog0tbyEXC 1kc2ZqUV1FN+9J8QDJRYKNujcPCr7SH0Jzwi17qhwefRspLwYjSKXAvmvrBBE8HV4yoJyQ YL99PahhihqDb4+q+ZG4v1rp67CxoDSZMjj2+aCj4RfBAKQBz5yTUiXJymzk6A== 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 4RdBm76jGnzg6Z; Sat, 2 Sep 2023 11:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 382B1Rmw079157; Sat, 2 Sep 2023 11:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 382B1RB5079154; Sat, 2 Sep 2023 11:01:27 GMT (envelope-from git) Date: Sat, 2 Sep 2023 11:01:27 GMT Message-Id: <202309021101.382B1RB5079154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: 973e6a6572d3 - stable/13 - netstat(1): fix manpage date List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 973e6a6572d3bfbd4c6a28cd130ce756bd6f0f6a Auto-Submitted: auto-generated The branch stable/13 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=973e6a6572d3bfbd4c6a28cd130ce756bd6f0f6a commit 973e6a6572d3bfbd4c6a28cd130ce756bd6f0f6a Author: Doug Rabson AuthorDate: 2023-08-16 14:13:31 +0000 Commit: Doug Rabson CommitDate: 2023-09-02 08:08:49 +0000 netstat(1): fix manpage date MFC after: 1 week (cherry picked from commit 3af3571ca5b82a56ae88654ec5cb35acfbe5d12c) --- usr.bin/netstat/netstat.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index d347b31d68d9..97e7c854711d 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -27,7 +27,7 @@ .\" .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" -.Dd September 25, 2020 +.Dd August 14, 2023 .Dt NETSTAT 1 .Os .Sh NAME