From nobody Tue Aug 5 00:32:03 2025 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 4bwvWR5nn3z63k0h; Tue, 05 Aug 2025 00:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwvWR4rwXz3gmq; Tue, 05 Aug 2025 00:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754353923; 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=sE4ovCYhfIoOovGi7NZj1K+eUx4KSuUPAUGIoF6bT6g=; b=QjRciQQexCm7X6ZFqdVf/rtCyHm0dv4apsZwM9MbH7fmuL8lgalqQM9r/Ji1v/2Dh84Hrv GRxXYJRvnNbrsEOwMNLjJ+zAzfULZMuRaJmY+xrQlkSgW7//v3ONCMcOAGVKx7ZkmcZv9k i5k+iUQNS/l7hsJ4xvU6y6+xjCR/muU52EjnJxvMmrI3vKYQu0V80beaP0LfiLC2BdnOKc N45y3Vh0LrEgXKHwg06Yl4fsMtfTHAXANPW7ijYVoFoXPV/5fWRP121CfYr8fuiW/z681c xBO+BpuW1OyFGH3fkyUWq2VENyXvgDwH/v1GouOUU1u+Mktbykj+ckXsCv5kxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754353923; 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=sE4ovCYhfIoOovGi7NZj1K+eUx4KSuUPAUGIoF6bT6g=; b=tYMbCum3QdMgu1fmFYcsXzV4+z7UBHPIDSIIKP84AVRoohyj30SstsVatujv9OVNut1Wel 7W3jme+XbEs1BSzB2qR4Tjw4eGiEKOlQmwmDG22hiHvjd9sUBPUljBGgN0TiqcRDbYiVIU C3OCoK5RW5k3HS/UzWEb4+lP5R2a+A/NW9zkp9r5JLPz/S7YSdaAhCE+5K1gchDzfNbYME ofWtoYii6w+8wc30bL+RhJIyz5GOn5+Ym+yxJAMkVkEV0Im4JnEKVXw64C2IjcnXeocRwR cSj3pUULhj/iqiv9ger4bCQ2n/PJy5FoylO0XJ2fqb57IEfIDAEEiUb0Ni//dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754353923; a=rsa-sha256; cv=none; b=nPMqOR3IRuQHVRq41HbR/rjAMxXKkW1ovIQWe0CB/TIuVO7TMS3NrtBlsYxsHPgc4GgZVg RlD0t9cZCiqF6xY9065wFWrBytxavp3j+ia+iSI+7tcjTUklAUDerMix1Ff8LASq9rCyjK mRgnSYTID70s2opPd03F04kVlVy3Kix3kGdmpnlqEOJgFJm5Af7FB9Kd1puWdSnKMvu6Zd x4ffdnJuWAh5C6s0HIyDPlGEgUyi1MkJ3uYywpvJy80F3NtbND/SSyk6LY07vw7NfZqYgp TQanT7IB8iQelXc7Ag/OqibKlARSp9M5729LvqABG7xqvSRo0KYOJgeUcUyRVQ== 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 4bwvWR4Qlbz1BS1; Tue, 05 Aug 2025 00:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5750W3dF044206; Tue, 5 Aug 2025 00:32:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5750W3or044203; Tue, 5 Aug 2025 00:32:03 GMT (envelope-from git) Date: Tue, 5 Aug 2025 00:32:03 GMT Message-Id: <202508050032.5750W3or044203@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: 4434ecb939f1 - stable/14 - sys_swapon: reject too small devices 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 4434ecb939f17c7a228cb176b690fcca331717b3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4434ecb939f17c7a228cb176b690fcca331717b3 commit 4434ecb939f17c7a228cb176b690fcca331717b3 Author: Konstantin Belousov AuthorDate: 2025-07-29 16:30:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-05 00:30:28 +0000 sys_swapon: reject too small devices (cherry picked from commit aa42e4984997c9d3aa5d30534bdaf760e613e97b) --- sys/vm/swap_pager.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index c23f8bc1f966..ee810ad1c9d5 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -68,7 +68,6 @@ * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 */ -#include #include "opt_vm.h" #include @@ -2404,7 +2403,7 @@ swapon_check_swzone(void) } } -static void +static int swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strategy, sw_close_t *close, dev_t dev, int flags) { @@ -2419,6 +2418,8 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, */ nblks &= ~(ctodb(1) - 1); nblks = dbtoc(nblks); + if (nblks == 0) + return (EINVAL); sp = malloc(sizeof *sp, M_VMPGDATA, M_WAITOK | M_ZERO); sp->sw_blist = blist_create(nblks, M_WAITOK); @@ -2460,6 +2461,8 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, swp_sizecheck(); mtx_unlock(&sw_dev_mtx); EVENTHANDLER_INVOKE(swapon, sp); + + return (0); } /* @@ -3005,10 +3008,10 @@ swapongeom_locked(struct cdev *dev, struct vnode *vp) return (error); } nblks = pp->mediasize / DEV_BSIZE; - swaponsomething(vp, cp, nblks, swapgeom_strategy, + error = swaponsomething(vp, cp, nblks, swapgeom_strategy, swapgeom_close, dev2udev(dev), (pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 ? SW_UNMAPPED : 0); - return (0); + return (error); } static int @@ -3097,9 +3100,9 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) if (error != 0) return (error); - swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close, + error = swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close, NODEV, 0); - return (0); + return (error); } static int From nobody Tue Aug 5 00:32:04 2025 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 4bwvWT0Dk4z63kDk; Tue, 05 Aug 2025 00:32:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwvWS5mbTz3h6V; Tue, 05 Aug 2025 00:32:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754353924; 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=kWvqGfSRHEosrXZrmiD3m5PtKCowrpjQti2o1Fih1s8=; b=RIpt/vOnf4GPeTQELq8oKrZiQKkejElUlBdB8mfGEf9U7cP2vGTg1fzQLPBOlOOOER3TzL sLI4Kuhyjh7fdv7RJfeZbeVJE00QuLbxivv5NBnjskJTXG0OkM2Iy+vL++4rvS08u28v8B zZ++6W43mRxn14W4cKx6mmHrtT6oStvJmgFVzV/A2eM3xNMikSwqsmark9hXVq2oGzBgJN KbbAB3pV65Akr4NbYywHpmkjyRtxkH3KnUVn+OqAodCdpL+ww8yq7oIHaasyFjbWQYoLlk kQS67D0XeweB63iu4LiiR/HmQvpNVIvKyTRsnQdkDuC7+jv8abas4lUtYcw0wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754353924; 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=kWvqGfSRHEosrXZrmiD3m5PtKCowrpjQti2o1Fih1s8=; b=fSWb60wvu7X5qzThe0m20iFdYGi1gLiOGpqi9O9Zo8CYnpljg/IgYbpHJcBQbDwQSsKGbe yI3eEnDCCFYPgcxNJIWnVvnglUNrbhZSBXVWWQsKq3RutOlPFYTgoXPOTOxHs+1Xz4pTZI 5ULLc+xJdCGh1vhGBbklQuxyrB0lUpfXCaSnZI/ebx722YNL2SQ83ZnZBHzhcsq3kWiHMI 63yn/ULR7dbHAiFfWarbTL/NpLyIbRPMciPUnMlMmfyoCprtXrM+VwKqbqppVp5Gx0SUtv 1lUfsLtMFVpw0yl2s1u0483BNVnaFVtPxRKf1wzAW1eQydZH0ggfwiP1EYfBkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754353924; a=rsa-sha256; cv=none; b=vS3EjcjEKK6OSLM+Dnn5aK8vMnDm2K4d9YN4mQJsSQJhtNv1Lxq8th13P8EVU791HuPmmS C/MPLeG06bq0qWIm6RFFrR0tfVW5B2KX8v7prM8UImXDXkF0h79WhYO9mBU57tm5N7GlO1 Lw0lOIstVsvOL3/3z3SmWXwavvazVKGZMdSlYOExqn4MPfs+eAHZLWlxTzZaO88AQ7/AVa +B+2VOo4ADlYqXszlLqRc/p28sukk556wQFHyWZMWjCRSw/RLY6k7p/PP+WC0iPITE9f7H 0fGEkfQ+suZy/3kl8CLIBkm1sgLgmZdGzIPnFGKym2iiuuefCzIsYeg4lv4hBw== 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 4bwvWS5Mxhz1BVS; Tue, 05 Aug 2025 00:32:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5750W4g2044241; Tue, 5 Aug 2025 00:32:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5750W4d3044238; Tue, 5 Aug 2025 00:32:04 GMT (envelope-from git) Date: Tue, 5 Aug 2025 00:32:04 GMT Message-Id: <202508050032.5750W4d3044238@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: 246f5b4136c3 - stable/14 - swapongeom: destroy consumer/close vnode in case swaponsomething failed 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 246f5b4136c39a26898e97b85d243d9b89f5d13f Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=246f5b4136c39a26898e97b85d243d9b89f5d13f commit 246f5b4136c39a26898e97b85d243d9b89f5d13f Author: Konstantin Belousov AuthorDate: 2025-07-30 15:00:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-05 00:30:28 +0000 swapongeom: destroy consumer/close vnode in case swaponsomething failed (cherry picked from commit 2e3fa9395fc67e7369fda8d8b5c6613142d2a57d) --- sys/vm/swap_pager.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index ee810ad1c9d5..f5815d615e16 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2995,6 +2995,7 @@ swapongeom_locked(struct cdev *dev, struct vnode *vp) cp->index = 1; /* Number of active I/Os, plus one for being active. */ cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; g_attach(cp, pp); + /* * XXX: Every time you think you can improve the margin for * footshooting, somebody depends on the ability to do so: @@ -3002,15 +3003,19 @@ swapongeom_locked(struct cdev *dev, struct vnode *vp) * set an exclusive count :-( */ error = g_access(cp, 1, 1, 0); + + if (error == 0) { + nblks = pp->mediasize / DEV_BSIZE; + error = swaponsomething(vp, cp, nblks, swapgeom_strategy, + swapgeom_close, dev2udev(dev), + (pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 ? SW_UNMAPPED : 0); + if (error != 0) + g_access(cp, -1, -1, 0); + } if (error != 0) { g_detach(cp); g_destroy_consumer(cp); - return (error); } - nblks = pp->mediasize / DEV_BSIZE; - error = swaponsomething(vp, cp, nblks, swapgeom_strategy, - swapgeom_close, dev2udev(dev), - (pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 ? SW_UNMAPPED : 0); return (error); } @@ -3102,6 +3107,8 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) error = swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close, NODEV, 0); + if (error != 0) + VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); return (error); } From nobody Tue Aug 5 05:53:51 2025 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 4bx2fl48TDz643T6; Tue, 05 Aug 2025 05:53:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bx2fl3MT5z3GTB; Tue, 05 Aug 2025 05:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754373231; 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=zIqfQuj23jjS3PE3eSd6ghYsZlYYPIkdWc4yrU+ZGPk=; b=QwuIKst4dFiHnCE3cmzADyYISLbdccecj7TCmoJACSu2Qb2fnnLkZbau00jYXy+IGwgtc8 l9zUwfOPOFTQ4B8mLyRdDXyXI6SNiy1uFMtCKEe1Ec6fkXT+6UnUPJu3u/WYECJJ4lWUm0 WfWN6wGwrC4M924hp69jEP6S3zzMU/A1Vwp42YJ8o1iPe3Ms9yBXtgGuSsj98DjO9gb5Em Ea0+D4Z10G0/Nn2BgGXZIkvjivKiyhSAkOb9ykgnUScN4wMIXD5MqmwtclIYG/OEZ5nFa9 +HrE32G42i04EMFTvCa32cJiZnEGR1g8Eab+a2mp3hWhKesi8YGcU+3v+UBRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754373231; 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=zIqfQuj23jjS3PE3eSd6ghYsZlYYPIkdWc4yrU+ZGPk=; b=JYjMAWtuGwdLT96Mc8JjdXZ2k0hDZ3poSJnuzUeeMB78pjhWegif6fd5YOwCTSmF4GTR98 NRRUZM8vhHJFQFfxYQwMwq1X1P0q1lPNNMmjaQitOsuhlcyar3jrFypFSHTwvkGGTrVJml 4URHSOMRpn5PPN2S1geUDRgrKlmoDzNDderGx9U8wvDK3PEkLeQJeYcueIHO2xyzMRsLA2 wWeVI51qx6UuihWyMCaIKYCZlHN91HBT7GF6gHJlLTTdg0HDsvtG4s9BzlL03VlkQAOa7N 8Ei0Ydk4VyGCzMvxXwJrkL5f2BEE8vPsW+gjJFd0zantn7t7WrVhwxde4RcrTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754373231; a=rsa-sha256; cv=none; b=qA3k8N/u5U9rBY892GwfIzrFdAwkTzJB5A9ecrhG90dQbQoDsVtwr1a1p4j67Db8Y+6m0g HJpiZSFthCHiOrMAu4cXG3b3jDr2hoJQbF8Ta+iZEC35Z9cygJYWFvqlXFeUTsEwDpKBqO /b9Atus+hVfaGi8CeyNuIvQHXTPaM+p9ZRBRTKFet2mOZbVj6CRAUdZf6PQ4hCUHa0rhj0 qgeT0Iq4xRuKgtJo63bbGI4RERQF8EcbnccdI0LN7COtv0wBJVNNmZwPcQEuhquLoyKt7g Yx7mkWkQsEuWnKUdiLdI9+7bLDEhJjFL6cGROAGo2vf0cdR+shzfr/3iel6jOA== 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 4bx2fl2kzpz72Q; Tue, 05 Aug 2025 05:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5755rp09046876; Tue, 5 Aug 2025 05:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5755rpu6046873; Tue, 5 Aug 2025 05:53:51 GMT (envelope-from git) Date: Tue, 5 Aug 2025 05:53:51 GMT Message-Id: <202508050553.5755rpu6046873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Morozovsky Subject: git: bb56c0ecf93e - stable/14 - extend description of net.inet.ip.fw.one_pass 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marck X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bb56c0ecf93e4643da6920822538707eaa108f19 Auto-Submitted: auto-generated The branch stable/14 has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=bb56c0ecf93e4643da6920822538707eaa108f19 commit bb56c0ecf93e4643da6920822538707eaa108f19 Author: Dmitry Morozovsky AuthorDate: 2025-07-22 12:32:34 +0000 Commit: Dmitry Morozovsky CommitDate: 2025-08-05 05:52:16 +0000 extend description of net.inet.ip.fw.one_pass Description of net.inet.ip.fw.one_pass tunable refers only to dummynet(4), while in reality is applicable on any divert-like packet action like in-kernel nat, netgraph, reass, or similar. Reviewed by: ae MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51436 --- sys/netpfil/ipfw/ip_fw2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index e43d1a8fbbff..0e0ecd3c6b20 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -197,7 +197,7 @@ SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Firewall"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, one_pass, CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_one_pass), 0, - "Only do a single pass through ipfw when using dummynet(4)"); + "Only do a single pass through ipfw when using dummynet(4), ipfw_nat or other divert(4)-like interfaces"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, "Rule number auto-increment step"); From nobody Tue Aug 5 05:53:57 2025 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 4bx2ft2N4Yz643F6; Tue, 05 Aug 2025 05:53:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bx2ft0cpVz3GsD; Tue, 05 Aug 2025 05:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754373238; 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=Nb3QntmmZlCDOMODGGUN+AOkOqgNplFo6pcAuWZzx0w=; b=tMNz+zAWtHaCLFal4PP3bdFlbCVA/daOUwQrcIqCwx9z/qxhhtnggabhIfCkNMZUa+corf LQOGjV0BoBx10APIP3tW7jFca6TM2oUqxe3ms61CJFu/q8BZYo4wZLjFqfzBpR/T9lVygE g7frcmFGiXlgDZLze+WWbCOHPZkeiqzffzQKyoco2AosgpCrwtUujuQfCaxf5VGinUcejH l32sxDZS0cIySk8CEG7Qe68WVe2PshmCFy9QeK2yKjkZMp2gku/wqx51KzK24kDn8gPxRM R8PILBfeoifSKbm/m3mIKOLg0GizzLJskd6fK8iC766OMV2Iqz1iY319/2FhoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754373238; 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=Nb3QntmmZlCDOMODGGUN+AOkOqgNplFo6pcAuWZzx0w=; b=xkjVDHPje7jZTNGdVifit0GgIMDZh6U3tRDNXGjr8T5R259cE/tzwhbkOWWxzzoMS9GQTV vhmN/lpUvVAkJofPyDWSGN3ROicVF5iq16GqYDStkpKVsawQWzaG2mZIc+DHYgWW87fDk+ 59mzBuLoC9rVY0BbBqjqzdPn6ZuNR3XL8qNxbo9pSTsDX9qxzK+X3owbX9JehgYnPemUik L7IGW1wA3btl7bIAQycP9KAiSs6GMpHAYPZqR0evlZ5YbPOqcbGCjlO70r4JWNLI6yDzO4 /md/Dk1y6RAmVu6KkUlkYvKMM3T+c0zs46AF0Ex2ly0FK75QTm/h8VBAyZVSkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754373238; a=rsa-sha256; cv=none; b=RjSFkcd3+MRJpGaMGbxJYCgVkUGcf0LsaJp7Amg2I81+x1EaJWPmrIbWP+Cj7RqqGA7ac6 2raragl9w+VjUuEN/Klh+JJ/4G2Cu3EYXsIRi2/ryRqEoWnlaEpQPguJ7syMmwkMpXAtqU md4eMwxkvJ9VNPlIEZSyKYr1HmFOYuOZBEK3odZOck52Yzg96yjZ99Mxk2ONjjuj1uLul6 EOxCGa3EbHavHZ2LrxIJ4cbBtYqurQluPUjFe2KGYvYHt7K3edtojWa9pT/1eFNndjJzif UnX/Ox+67Ib3OKRFlIIdGeR6slhCBU9mQYCdzkS9bjhfZMtHgPE6+V9R2Uugeg== 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 4bx2fs742Vz72R; Tue, 05 Aug 2025 05:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5755rvuQ047037; Tue, 5 Aug 2025 05:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5755rvFM047034; Tue, 5 Aug 2025 05:53:57 GMT (envelope-from git) Date: Tue, 5 Aug 2025 05:53:57 GMT Message-Id: <202508050553.5755rvFM047034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Morozovsky Subject: git: d91839d3e366 - stable/13 - extend description of net.inet.ip.fw.one_pass 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marck X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d91839d3e3664681e9dbed83c751bb16b1500764 Auto-Submitted: auto-generated The branch stable/13 has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=d91839d3e3664681e9dbed83c751bb16b1500764 commit d91839d3e3664681e9dbed83c751bb16b1500764 Author: Dmitry Morozovsky AuthorDate: 2025-07-22 12:32:34 +0000 Commit: Dmitry Morozovsky CommitDate: 2025-08-05 05:53:06 +0000 extend description of net.inet.ip.fw.one_pass Description of net.inet.ip.fw.one_pass tunable refers only to dummynet(4), while in reality is applicable on any divert-like packet action like in-kernel nat, netgraph, reass, or similar. Reviewed by: ae MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51436 --- sys/netpfil/ipfw/ip_fw2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index 5a96872f9c4f..2e306d9e291c 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -195,7 +195,7 @@ SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Firewall"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, one_pass, CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_one_pass), 0, - "Only do a single pass through ipfw when using dummynet(4)"); + "Only do a single pass through ipfw when using dummynet(4), ipfw_nat or other divert(4)-like interfaces"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, "Rule number auto-increment step"); From nobody Tue Aug 5 11:51:51 2025 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 4bxBbr1VqJz64NVJ; Tue, 05 Aug 2025 11:51:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBbr0wCpz3scD; Tue, 05 Aug 2025 11:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394712; 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=61uPysZVgxKYyJQgdaU1qxDP7lpI/zj/d5x/h44D2A0=; b=neQMnN8PHb406cRvtgastTWrRsWhQMmcvZS3VWFLOtKH9MsSTsbByYsMptER9Ll+V06jjX OFQZz/OK+8zUi3kDZRYkaL/n7rw7zSmf6EEFVUZ9703K8lGmXQAQrtRYtDrfs5KmmV297D 96CkNRaGGH5LfF0E3Po5BwDbAk9f/LehH/azf4yO68s+nhogB5X7Tpe3n+VWAKOifD8ykj JLj+SL0T5TRam3Phneee7lsohj2roUYh1pN/cDgoNq8r3eYHIJakl6sH8B+Xl2sTZCNlTg bGp4wmdjN7vRtcjaJ9ezokzKEaatDBs03/KatRr06zieAaeIhVWXu/fggrDB5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394712; 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=61uPysZVgxKYyJQgdaU1qxDP7lpI/zj/d5x/h44D2A0=; b=X/9uQ2ng5s+5T2iHRlpDw2wBtTYWHFk4YmZEBAFloP1jGBXKbxRjqOYm/OtuA+0/O/tsad BL5QLUDTKrxClFKoMxQKk021ahqWcycBSIYktbOodg3SKYEmUoBLuWy20aHkwrJgEicMiI q1cvQHVsJoyLox1SMRePkbo9CXRvT8nkYlqfJZxUpDLK/b9phhv/qEfMmyBhthy8y6jdw5 p1I00glZr2bVHen+An7hrRTVbv9QfadWnCEsfExOPiTqZi9TxBG+JcqsAoSzMSpcFMmW35 q2jP3f7oFgcxMlwD/xqW5M1geEYWWvCFhBE5DJOpU/RQohopAUjlPDTjIti7kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394712; a=rsa-sha256; cv=none; b=DUbgPrYw09QSX2D3I7j/JaUBofJZgJkpeiycOtQ//7/9DrU7d1jfEXYmgH5b0DktCvVC+y DLZV05BU6LMlA6COrIYgVi+bZR8VLMXwz/CYznhd2LjhQqSJmfmMkHzdcxzUE60CmouR8R KSMCzrlKsVROfPEu3Cj2v+82zNXKgJO1pfNE/bCLeGliFIgjuP/Kivka6RPbEMJOsaCGzA 0n3Onk6kyA4/EOHgil3P9U7XNbAEd9CeTwgHIMZgiKYji37bQZZ2DQklCCb701FhjK4Qr4 6rv83/a+gNZzvsL1Di5KCwg0CqOWRcrfUgSUswGsM+Ywogrr+6M6AndLz+mihw== 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 4bxBbr0SHDzZX4; Tue, 05 Aug 2025 11:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575BppaO023043; Tue, 5 Aug 2025 11:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575Bppv6023040; Tue, 5 Aug 2025 11:51:51 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:51:51 GMT Message-Id: <202508051151.575Bppv6023040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e3d875b79ddc - stable/14 - rc.d: Fix mountd service script. 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e3d875b79ddc9801b9c9ff738a050a52d8834952 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e3d875b79ddc9801b9c9ff738a050a52d8834952 commit e3d875b79ddc9801b9c9ff738a050a52d8834952 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-24 13:00:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 09:29:36 +0000 rc.d: Fix mountd service script. This script references variables beloning to the nfsd and zfs services, therefore it needs to load their configurations. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51473 (cherry picked from commit aa183bc7f96fdd51c4a6ead5586a1cb1ecec6bb2) --- libexec/rc/rc.d/mountd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/rc/rc.d/mountd b/libexec/rc/rc.d/mountd index 39b16d604321..0c35d9ff1e9f 100755 --- a/libexec/rc/rc.d/mountd +++ b/libexec/rc/rc.d/mountd @@ -68,4 +68,7 @@ mountd_precmd() } load_rc_config $name +load_rc_config nfsd +load_rc_config zfs + run_rc_command "$1" From nobody Tue Aug 5 11:51:53 2025 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 4bxBbs4393z64N9T; Tue, 05 Aug 2025 11:51: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBbs2NXqz3sWM; Tue, 05 Aug 2025 11:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394713; 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=t7h1fLj4k+wAdS/lFaVyNXFFwPp6P+nEf7naK0P2zzs=; b=xKtoWKC28He+wPZH+/vlrU8jM2qOI5dohgcXzlRr3BmYOrhlmbJBjfoN1t1TI/nOsFnD/e VsK9EsciZujgYeGnXa1Zp1XA6bxzBlS6GvMBF3EyW18fOkzgFqcMeupxVXHKXtnAqrfr0T bdcTNduRnGAmUC2wwIaT2b2n5qn+Ohf2Ku7w1wBrNZK0UgY/cIdA9JHazjYFINPcGiROG5 0to84/OV+gNrQzj4u3WGLcQpdDFTWoaYutFbhXWj3j7B2NSNJEV4g+408q0oi0vHwhfnfd PFA+ScCBAnreLrhsMr0Qpl15sRio3DO/eGRK0Ub/au7L/9lRow+GmAYGkEJvSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394713; 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=t7h1fLj4k+wAdS/lFaVyNXFFwPp6P+nEf7naK0P2zzs=; b=V0h/mm/92El1S3zH3fm71S41R2qwEnPp1Kbek5mCQ2MK0qgU/6GGbbzBhDF+A2p164ZnKS Y6VhDLlaJnSu+CPc7uvFdeSrxz53wRqoAKXDAKEHPFTnTbfk7dn60RXo50Hb/rCPJm9oKq HAEMmJDAlDPfYJth9AqIJiZkYj6qCa4CeKY+itDSuFg653QAjh0wetkzEWIMOcK8XWAr2b WSK6/lMa7TAessRY7/x8Hi/IA5isR9y3XJ6Y4qBMaAI7wqPjga7m32GMRWDS8LLQLEDfmH q4lXhbFl87HleT1B/E6Qu0JxCFiQdrCK+Q087dAYTILdH/JkcCTWCDgw6/jBZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394713; a=rsa-sha256; cv=none; b=mXPdSShvgN02WmF+Enm2kLVhUtXwvosn7Vfo0lT1kpWLipU8Nh/B8EJWx3K2K9webgt5qI 3bD9lME9j6dGEcOV7MzlAVVadiumrXpSGAbUe0OHSQmWGhPjW5qBpEErTXz5VRZy4lD+j6 SUkzxQoT+Bt0pT38ksvDo2omGn50e40sfkyGjQuDdcSKfj1IZXGzhb0kfiogMw5la7u4Ry otpHTo6K/dXTwphMAIAheGczuF+FJqhaLgll/S2VUY6XbCJQJJUx7WvQoDO9mhB6xiEtar nc6RPvdT6FldWIKktTO9I0VMWg2cN6Bt4xL56/m7S1KA18RR8WRMagJoj/XViw== 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 4bxBbs1Yf7zZX5; Tue, 05 Aug 2025 11:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575Bpr4H023081; Tue, 5 Aug 2025 11:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575BprId023078; Tue, 5 Aug 2025 11:51:53 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:51:53 GMT Message-Id: <202508051151.575BprId023078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b1e5e3b668e5 - stable/14 - xargs: Limit -n to {ARG_MAX} 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b1e5e3b668e587cce59e03c080432d920b23e255 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b1e5e3b668e587cce59e03c080432d920b23e255 commit b1e5e3b668e587cce59e03c080432d920b23e255 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-26 16:44:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 09:30:01 +0000 xargs: Limit -n to {ARG_MAX} Since it's not possible to pass more than {ARG_MAX} bytes on the command line, it's also not possible to pass more than {ARG_MAX} individual arguments. Therefore, {ARG_MAX} is a reasonable upper bound for the -n option. This resolves both the arithmetic overflow issue and the CI OOM issue, so we can safely re-enable the test. Fixes: eab91d008165 Fixes: 2682a1552724 MFC after: 1 week Reviewed by: jlduran, emaste Differential Revision: https://reviews.freebsd.org/D51536 (cherry picked from commit a7fa987abe1fb0b25a7dd83dc81f14f64a82efc9) --- ObsoleteFiles.inc | 3 +++ usr.bin/xargs/tests/Makefile | 2 +- .../xargs/tests/{regress.n2147483647.out => regress.nargmax.out} | 0 usr.bin/xargs/tests/regress.sh | 8 ++++---- usr.bin/xargs/xargs.c | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 8edc2a281ae9..249eb2b127bc 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250805: Test case renamed +OLD_FILES+=usr/tests/usr.bin/xargs/regress.n2147483647.out + # 20250728: Machine versions of 'runq.h' do not exist anymore OLD_FILES+=usr/include/machine/runq.h diff --git a/usr.bin/xargs/tests/Makefile b/usr.bin/xargs/tests/Makefile index 50545c11f90e..3cbdbbe5af17 100644 --- a/usr.bin/xargs/tests/Makefile +++ b/usr.bin/xargs/tests/Makefile @@ -18,7 +18,7 @@ ${PACKAGE}FILES+= regress.R-1.out ${PACKAGE}FILES+= regress.in ${PACKAGE}FILES+= regress.n1.out ${PACKAGE}FILES+= regress.n2.out -${PACKAGE}FILES+= regress.n2147483647.out +${PACKAGE}FILES+= regress.nargmax.out ${PACKAGE}FILES+= regress.n2P0.out ${PACKAGE}FILES+= regress.n3.out ${PACKAGE}FILES+= regress.normal.out diff --git a/usr.bin/xargs/tests/regress.n2147483647.out b/usr.bin/xargs/tests/regress.nargmax.out similarity index 100% rename from usr.bin/xargs/tests/regress.n2147483647.out rename to usr.bin/xargs/tests/regress.nargmax.out diff --git a/usr.bin/xargs/tests/regress.sh b/usr.bin/xargs/tests/regress.sh index 9b4839d2a8ec..e65a5a703505 100644 --- a/usr.bin/xargs/tests/regress.sh +++ b/usr.bin/xargs/tests/regress.sh @@ -1,5 +1,5 @@ -echo 1..21 +echo 1..23 REGRESSION_START($1) @@ -12,9 +12,8 @@ REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % <${SRCDIR}/regress.in' REGRESSION_TEST(`R-1', `xargs -I% -R-1 echo The % % % %% % % <${SRCDIR}/regress.in') REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in') -# This test may consume a large amount of memory, making it unsuited to CI -# environments. Disable it for now. -#REGRESSION_TEST(`n2147483647', `xargs -n2147483647 <${SRCDIR}/regress.in') +argmax=$(sysctl -n kern.argmax) +REGRESSION_TEST(`nargmax', `xargs -n$argmax <${SRCDIR}/regress.in') REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in | sort') REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in') @@ -28,5 +27,6 @@ REGRESSION_TEST_FREEFORM(`parallel1', `echo /var/empty /var/empty | REGRESSION_TEST_FREEFORM(`parallel2', `echo /var/empty /var/empty/nodir | xargs -n1 -P2 test -d; [ $? = 1 ]') REGRESSION_TEST_FREEFORM(`parallel3', `echo /var/empty/nodir /var/empty | xargs -n1 -P2 test -d; [ $? = 1 ]') REGRESSION_TEST_FREEFORM(`parallel4', `echo /var/empty/nodir /var/empty/nodir | xargs -n1 -P2 test -d; [ $? = 1 ]') +REGRESSION_TEST_FREEFORM(`ntoobig', `seq 42 | xargs -n$((argmax+1)); [ $? = 1 ]') REGRESSION_END() diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c index 51f42ba2c842..9becf6cf9ba1 100644 --- a/usr.bin/xargs/xargs.c +++ b/usr.bin/xargs/xargs.c @@ -178,7 +178,7 @@ main(int argc, char *argv[]) break; case 'n': nflag = 1; - nargs = (int)strtonum(optarg, 1, INT_MAX, &errstr); + nargs = (int)strtonum(optarg, 1, arg_max, &errstr); if (errstr) errx(1, "-%c %s: %s", ch, optarg, errstr); break; From nobody Tue Aug 5 11:51:54 2025 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 4bxBbt4JJQz64N9V; Tue, 05 Aug 2025 11:51:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBbt2Xh0z3sWQ; Tue, 05 Aug 2025 11:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394714; 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=dc/0I0F8zAP0Aun7Bdcfb8sTFeiHxlmUVdOVXd1+dhA=; b=Soyf3A4ejD3ryUS+Y2mJ9m8lgxa6mjWO+UpO+Xy0UQzbO85Xx1POuHrTSG+7/q9zS7LRJ+ eLz4JvCiP72DpdKLRjlhL+AGj97iEgoxXtG33B/mOsDGzstftC4SmtbCV0Wc8yaVBWp42D M5StlJJksitcYKmO37ZY/9bqmfFeJZQKa/9Aey62aihnOIdAaQ1xApizOO/fh6DxlYPtRF bMGVCYA/Ohx61ZadY+lJajwsNZKAJDSWz6fdLPkNEaCG8IJbhl1bIXbbktfjBF/CzxKa8V tM3A1mcDMTyVj4pLK/WrO6HIvjxIR5cEZ6GswcPGy2xpnJZuXf22SyKB7+VqfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394714; 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=dc/0I0F8zAP0Aun7Bdcfb8sTFeiHxlmUVdOVXd1+dhA=; b=fGwWLZJJz4Zsr7zPDxSoMHnyzPGVVk0eSFs2p7Gz99qY/3zSS7c5jyHCscS5tv1lpElCYw h+8IA41kTB5oGPDHOGuEfBAb1gPt/q7PRowP5wpnQu7d79RCLW3X8Yt2PQNPIVlVOWMvQg yVfHZpvRJntwdXEVNFAQKI7k7uMPSS/F8SVkA/LYQwqdMtb6EIobChsbPB6kUVncGjcpDQ j8GtwCwUkGKXhxAea+I8HFhF4ohz6pwMhSTrTenxjfWYrA+LQ06BkGpjuRFHowrj6uzX3R VY9pXYU8GMNsspTZcEL2aS1C2sKFxO/LoGGZXs7FuxB0W9bcspE8qYDnUogDmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394714; a=rsa-sha256; cv=none; b=sJNQe67OUqTnwBdvrgCOfUYLvSCmNxLu9RFDeUBKBl8TcCHgo5yWgYqzyYD28U9kaTJdT2 VW/IpjUHFiJGYI2k7rayQJjy7fnJCSp7uH41HmLopuMl21cEdSeuQqA38McvA+gp9fcE+h 1a57t5DjOpWV9jojMc4IA0fYc/AKxHadSiFkrtG5T+p5Gy332XhMChQ+9qAzSzcxvrtm/g x/Up8ZpE0hjIJCnQgnChngJZz3TfPyR5BcIPKCMYC+80Qkt1ao5bLqzTmLll2cRIBqN7ar d7vJweKwefAOUh4EJzO9g/eqvBZLmxTd4fhLJoGPBq2E02Xx3nIX6PtdcDgGfA== 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 4bxBbt25BLzZX7; Tue, 05 Aug 2025 11:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575BpsR0023973; Tue, 5 Aug 2025 11:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575BpsZW023959; Tue, 5 Aug 2025 11:51:54 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:51:54 GMT Message-Id: <202508051151.575BpsZW023959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4406fe5f2203 - stable/14 - comsat: Don't read arbitrary files 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4406fe5f220357223978de58d3c1f9847dfa9d1b Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4406fe5f220357223978de58d3c1f9847dfa9d1b commit 4406fe5f220357223978de58d3c1f9847dfa9d1b Author: Dag-Erling Smørgrav AuthorDate: 2025-07-28 15:28:26 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 09:30:02 +0000 comsat: Don't read arbitrary files When processing a notification, instead of accepting any file name that doesn't begin with a slash, accept only file names that don't contain any slashes at all. This makes it possible to notify a user about a mailbox that doesn't bear their name, as long as they are permitted to read it, but prevents comsat from reading files outside the mail spool. PR: 270404 MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51580 (cherry picked from commit 4a4338d94401f0012380d4f1a4d332bd6d44fa8e) --- libexec/comsat/comsat.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index 2358336be61a..294e725b4e37 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -125,29 +125,24 @@ mailfor(char *name) char *file; off_t offset; int folder; - char buf[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; - char buf2[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; + char buf[MAXPATHLEN]; - if (!(cp = strchr(name, '@'))) + if ((cp = strchr(name, '@')) == NULL) return; *cp = '\0'; offset = strtoll(cp + 1, NULL, 10); - if (!(cp = strchr(cp + 1, ':'))) - file = name; - else - file = cp + 1; - sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utp->ut_user), - name); - if (*file != '/') { - sprintf(buf2, "%s/%.*s", _PATH_MAILDIR, - (int)sizeof(utp->ut_user), file); - file = buf2; + if ((cp = strchr(cp + 1, ':')) != NULL && + strchr((file = cp + 1), '/') == NULL) { + snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, file); + folder = 1; + } else { + snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, name); + folder = 0; } - folder = strcmp(buf, file); setutxent(); while ((utp = getutxent()) != NULL) if (utp->ut_type == USER_PROCESS && !strcmp(utp->ut_user, name)) - notify(utp, file, offset, folder); + notify(utp, buf, offset, folder); endutxent(); } @@ -171,8 +166,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) utp->ut_line); return; } - (void)snprintf(tty, sizeof(tty), "%s%.*s", - _PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line); + (void)snprintf(tty, sizeof(tty), "%s%s", _PATH_DEV, utp->ut_line); if (stat(tty, &stb) == -1 || !(stb.st_mode & (S_IXUSR | S_IXGRP))) { dsyslog(LOG_DEBUG, "%s: wrong mode on %s", utp->ut_user, tty); return; @@ -201,24 +195,18 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) setuid(p->pw_uid) == -1) return; - switch (stb.st_mode & (S_IXUSR | S_IXGRP)) { - case S_IXUSR: - case (S_IXUSR | S_IXGRP): + if (stb.st_mode & S_IXUSR) { (void)fprintf(tp, "%s\007New mail for %s@%.*s\007 has arrived%s%s%s:%s----%s", cr, utp->ut_user, (int)sizeof(hostname), hostname, folder ? cr : "", folder ? "to " : "", folder ? file : "", cr, cr); jkfprintf(tp, file, offset); - break; - case S_IXGRP: + } else if (stb.st_mode & S_IXGRP) { (void)fprintf(tp, "\007"); (void)fflush(tp); (void)sleep(1); (void)fprintf(tp, "\007"); - break; - default: - break; } (void)fclose(tp); _exit(0); From nobody Tue Aug 5 11:51:55 2025 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 4bxBbv6W8Sz64N9W; Tue, 05 Aug 2025 11:51:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBbv4YfVz3sZN; Tue, 05 Aug 2025 11:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394715; 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=j9clyF5Sod48XNPY3VPgPUmQq0RslIJgmcUFF/BqJdE=; b=VDFXfdTKBndIU9NDhVC/dm/fVzKNHTE46DXoI1v4GWHw13mXkAul6nBBfBtJNOaBRlZ7j9 ag9A1RlrLcLEBPO7dT2+Kg7Ev8BxrSKA+m48JA6km0pBBisMdGBmuNj7i8puVv0YYdi1ez h9bkVxvR81a1ok0HzIiUvHSRWQybPqKwxNNmG46ijoDk29Ts5NJpq5DdMo00jiZKMjHKel oc8XGtsCRRfc9657R574QILhcZvUMuMTB2VG9chpv6mlic++hErmQbEA/tGyI+PMNPrkHh vF6q3GW4ClcwVoGmVJa11TpaJBgE1739WvRuMDQFV4kwJzKdTqmRmqxb+DPHHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394715; 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=j9clyF5Sod48XNPY3VPgPUmQq0RslIJgmcUFF/BqJdE=; b=UDCpvtp7Y41g+zWRjBQm3v6VVI966kYszk8xUU7WJxM4dbu7XaXHdyvNqP3Sc08voYAryG PLczaQj0eZJMGJ8Nu6VuyOiDe6FTAxNVzqa2KXI8ZYiWPyl3FYXlAllC/3ySiJK8/6/vGe /97aPE/9wWKIUqCDZZg1aZ4l0RXVG6Le6PkgZ/Vbvpt0hpfgZuNmtl5eWhBkgkOiUrFSvL X7ywTxwXbq7WW1dGfuXgLny0+0cEGbHNZz1X9j0X498cPwDAbhTQb37npipQzjUEv/EkmH t9yP3Om0hGfrEiFRLmZ07l0ouOwRttH3kpufmCBZz1SMnmuSB/o2OLnka3JCUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394715; a=rsa-sha256; cv=none; b=x3U7h81z7Yz2DwPHDW0s2cHRNMYO3KuUJaCiMD8c/CxL/no4+tDUyrORqEHgywDA+oxmbN Amuir9VdqbqYeMFIiOn1msyPG1jMdIIOiceYC9uKTPY+UaLDDrs2XlxZ06kHGE4n/pYzqL purm/baPvebTUBngT7Y4/4LidKqwAUHNqq9tO7DcWUST0FzxGzclPt32AvBM711kcBRYQj YnoTAqS41GMaogmRw0+GPi1cvohmC9euLcgKhU/6O87l13nqQgy79o7A/co1VZrgb3H7kq HqI4JtMVLbKvcMDxiKPWHfwhF4vEiIHxBBJwP7+XT6ZsEHe0+YrivBBv4wE7Ww== 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 4bxBbv2kRgzZX8; Tue, 05 Aug 2025 11:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575BptBr024107; Tue, 5 Aug 2025 11:51:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575BptSW024104; Tue, 5 Aug 2025 11:51:55 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:51:55 GMT Message-Id: <202508051151.575BptSW024104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: bba73c02879d - stable/14 - comsat: Don't return from the child 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bba73c02879d11933ae29e8ef1a8b065cec2918e Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=bba73c02879d11933ae29e8ef1a8b065cec2918e commit bba73c02879d11933ae29e8ef1a8b065cec2918e Author: Dag-Erling Smørgrav AuthorDate: 2025-07-28 15:28:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 09:30:03 +0000 comsat: Don't return from the child Fixes: 91629228e3df MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51581 (cherry picked from commit e40a2c4927a8068d7b6adee69c90ae3be8efc4df) --- libexec/comsat/comsat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index 294e725b4e37..f40123a5ef09 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -193,7 +193,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) initgroups(p->pw_name, p->pw_gid) == -1 || setgid(p->pw_gid) == -1 || setuid(p->pw_uid) == -1) - return; + _exit(1); if (stb.st_mode & S_IXUSR) { (void)fprintf(tp, From nobody Tue Aug 5 11:52:45 2025 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 4bxBct1QZDz64N7c; Tue, 05 Aug 2025 11:52:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBct0vj5z3tWJ; Tue, 05 Aug 2025 11:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394766; 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=sYq1m3O//8eyFPBFEiCag7FmNrFp0t73jULQUHBRSwo=; b=lQ8HIton0CnOoImK5YQU1aljwu7zzVL2hAENshVP0Iiz+A7M0XgFTcsTUahBDo/K9wnjPO niW9p5mTOZUSS0A8jx/Fkns5ttmA0I9CUxZgEIe4skYjl+zup2cE9NFG0ytVA2TDbTaCCM XVgjPyPEU+9LnSOfmyJaFW1P+mzzQ+6TSSBc1TJpIE/Jxv070sSVZepGXgN1jZySOpbNqu JPg9oXpglxEV2TToBWy9YO6E9xvYv0iPVKtazQgD82vqbJkevP2kt0lWQtlEUfXxSd4dCi cTxIBFvfIZFmnpuZooTc/lK9KSeqMahtokpY39mvD9hR7nmNSRBLe5TxrNZ/HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394766; 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=sYq1m3O//8eyFPBFEiCag7FmNrFp0t73jULQUHBRSwo=; b=dUNbehOWCseVmrcWIlJyaCdPVCCdrmiatMPPpSGGXkA3Z+q7HqTZ/rQ8ZUXzS54VjgHqbp 0GUeJhb/Sha+gfWmsIkfVY/y3+zSRA+8rvcQLgnfc25MC0aKPFx8cF5IwyRuaLQa0PYcSK X3c98ge2ZkhM9EuW/WO+4R1yGwzb73glfjQI0/GmUrxlHYkx9ROq0pX1zZ50bmvssPkeMK QYm8LMrM+CkMMWAzFjm7fBcsMbbTrmTDlhAww7hbqVDnRVNny/u/FP80hsCGBWu7UR/XVu mq5quFOC5yMOlKfA+ugCjbQmNZpbjChdbC9IRvw1nvIeohpCaGq3QtlwmEnF8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394766; a=rsa-sha256; cv=none; b=yHFxvkDGDXmHibbgHQlwL2i1wcAre/7UMTCigg3HX70Kl41770telIP8jmiU5jaf4kudiG wY0wGpwArANw71ysBcKz9xTqVqaizWWW50tiZSC4MUd8ecolaT4i1fjRkEa90I5eCBTnHS Q49nhTP/mQGi0iTN+CVbNYMX4yGfuMFOIOUg/eOSN7qApPpPuadvjRPc8PWT84DFsOTdfM XmJkjm9BytwO5dvCAcRQTqweutP4EbKr+QBy/8fz3uM+jkHp9P0lZ0LeCf4evWs0pqXEQ2 2Vi2OWPqdigfavtS+rt0XxiO4Zw4ziW5JeMC8dziDntK0B3+BTv3NLoPYtz9NQ== 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 4bxBct0W1nzZxc; Tue, 05 Aug 2025 11:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575BqjQa024511; Tue, 5 Aug 2025 11:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575BqjPR024508; Tue, 5 Aug 2025 11:52:45 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:52:45 GMT Message-Id: <202508051152.575BqjPR024508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a42bf0da8d58 - stable/13 - rc.d: Fix mountd service script. 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a42bf0da8d584063d610e1b233e7404d1892ba35 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a42bf0da8d584063d610e1b233e7404d1892ba35 commit a42bf0da8d584063d610e1b233e7404d1892ba35 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-24 13:00:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 09:32:41 +0000 rc.d: Fix mountd service script. This script references variables beloning to the nfsd and zfs services, therefore it needs to load their configurations. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51473 (cherry picked from commit aa183bc7f96fdd51c4a6ead5586a1cb1ecec6bb2) --- libexec/rc/rc.d/mountd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/rc/rc.d/mountd b/libexec/rc/rc.d/mountd index 39b16d604321..0c35d9ff1e9f 100755 --- a/libexec/rc/rc.d/mountd +++ b/libexec/rc/rc.d/mountd @@ -68,4 +68,7 @@ mountd_precmd() } load_rc_config $name +load_rc_config nfsd +load_rc_config zfs + run_rc_command "$1" From nobody Tue Aug 5 11:52:47 2025 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 4bxBcv3RVSz64NSg; Tue, 05 Aug 2025 11:52:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBcv2JGkz3tdl; Tue, 05 Aug 2025 11:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394767; 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=pNSx4giRnJAQlaut2QO5EqgKWZb9A8kzKpnzgNCRcA8=; b=CtZg4hPJWy6Hy+vA1UwAzBhRkPRkx+2wd1sluIH6l5DQf9rLTf6wcjnVHlYkNeXBp4PAR4 7yXFeUyLsLPRX3vDoB0nIaeZ0L9NjTtpgac2LVxO2M7b223CK5EfA5sBF/nbOsvfHeJH/6 u62qlmTruTrkp+ex6H11A72bKmm68F67GXx/pX+8GXVs+2PFLATqZbgh16XvmRMroXYGZn cLv3+PZFQKLlcsPIYG7l87zJMVNJxcIZQ8w3tnmcF/5KOY55ZZ/grwW4x33+zz7gA95iEu ZQ1nc3vB0bJm/SJ1C4zSNZ0kWG2rjAjE3jyGs0g3413kg+/gOsothEhkM/flQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394767; 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=pNSx4giRnJAQlaut2QO5EqgKWZb9A8kzKpnzgNCRcA8=; b=UVW+3naP2dOzO6coXT7KjgKqvlPqqRoA0LiIKOtUlNN5j1pT+hNkRBaM9D/e3hmGJurUOk UP8HrFl1cyr3aSsfQQXM01zGAo/Edyt2YyOXepE8ul7mRaSvFDAf8YlFjvG2Sf7x2bBmhT SEBzL8rG0GEjMx0U0RLhbWovHaiplRmA1cEBOYgQIbZXbf/RirbbP4NZ6Ve8vYlXiLL3Ds nD4BHqGII8M5Lp/u7JuIdUqK/OgrMh7zrkdburzhGD7MsfH+Ar6XH1aRi5iMOM39hidPNV HKcOL1i9gowLPSkZUeECCXgFZCa9s0+T/dftwp/4lJy4yfVUgoZRUnqmQcioEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394767; a=rsa-sha256; cv=none; b=EX53zqWeYe112j8q+J3B7KcSS87jOjoIgbAfHw6rp5Y5BtevNrs9h6zNZiuo6/kAXi8Vvx ZrFXt8UK8uRIixNbudAEMrSg0ZzjYkNtxtWVyMR4cvLdA7li0qAReaSjgu0JgYZqcjjmTb xoUHv1+ucjav8VanP8r8U2LN3u5WgRBKgF7HJ9okn4aXQkxUchGRThN7zGdxyGpMcwOUMp GL+2Z5n66bzXyzCO3/A3HT8XQZcZobIhc0m/zI8HdOZF110Akp9o5LonAHW1bOaZD8gkqv 7TaH9w5T4u5L394xv7MjFIY0tnVBY2KWwkvke11uoHOr2Zq4lYQu7AtJ+WmDBA== 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 4bxBcv1Z1Mzb09; Tue, 05 Aug 2025 11:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575BqlSb024554; Tue, 5 Aug 2025 11:52:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575Bqlk6024551; Tue, 5 Aug 2025 11:52:47 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:52:47 GMT Message-Id: <202508051152.575Bqlk6024551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 39bc7081b8a9 - stable/13 - xargs: Limit -n to {ARG_MAX} 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 39bc7081b8a9c2f013d90a3d054bff7c1c6fe303 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=39bc7081b8a9c2f013d90a3d054bff7c1c6fe303 commit 39bc7081b8a9c2f013d90a3d054bff7c1c6fe303 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-26 16:44:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 09:33:12 +0000 xargs: Limit -n to {ARG_MAX} Since it's not possible to pass more than {ARG_MAX} bytes on the command line, it's also not possible to pass more than {ARG_MAX} individual arguments. Therefore, {ARG_MAX} is a reasonable upper bound for the -n option. This resolves both the arithmetic overflow issue and the CI OOM issue, so we can safely re-enable the test. Fixes: eab91d008165 Fixes: 2682a1552724 MFC after: 1 week Reviewed by: jlduran, emaste Differential Revision: https://reviews.freebsd.org/D51536 (cherry picked from commit a7fa987abe1fb0b25a7dd83dc81f14f64a82efc9) --- ObsoleteFiles.inc | 3 +++ usr.bin/xargs/tests/Makefile | 2 +- .../xargs/tests/{regress.n2147483647.out => regress.nargmax.out} | 0 usr.bin/xargs/tests/regress.sh | 8 ++++---- usr.bin/xargs/xargs.c | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1b24771e6f94..305c1707ce49 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250805: Test case renamed +OLD_FILES+=usr/tests/usr.bin/xargs/regress.n2147483647.out + # 20250524: don't install zoneinfo version OLD_FILES+=usr/share/zoneinfo/version diff --git a/usr.bin/xargs/tests/Makefile b/usr.bin/xargs/tests/Makefile index 50545c11f90e..3cbdbbe5af17 100644 --- a/usr.bin/xargs/tests/Makefile +++ b/usr.bin/xargs/tests/Makefile @@ -18,7 +18,7 @@ ${PACKAGE}FILES+= regress.R-1.out ${PACKAGE}FILES+= regress.in ${PACKAGE}FILES+= regress.n1.out ${PACKAGE}FILES+= regress.n2.out -${PACKAGE}FILES+= regress.n2147483647.out +${PACKAGE}FILES+= regress.nargmax.out ${PACKAGE}FILES+= regress.n2P0.out ${PACKAGE}FILES+= regress.n3.out ${PACKAGE}FILES+= regress.normal.out diff --git a/usr.bin/xargs/tests/regress.n2147483647.out b/usr.bin/xargs/tests/regress.nargmax.out similarity index 100% rename from usr.bin/xargs/tests/regress.n2147483647.out rename to usr.bin/xargs/tests/regress.nargmax.out diff --git a/usr.bin/xargs/tests/regress.sh b/usr.bin/xargs/tests/regress.sh index 9b4839d2a8ec..e65a5a703505 100644 --- a/usr.bin/xargs/tests/regress.sh +++ b/usr.bin/xargs/tests/regress.sh @@ -1,5 +1,5 @@ -echo 1..21 +echo 1..23 REGRESSION_START($1) @@ -12,9 +12,8 @@ REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % <${SRCDIR}/regress.in' REGRESSION_TEST(`R-1', `xargs -I% -R-1 echo The % % % %% % % <${SRCDIR}/regress.in') REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in') -# This test may consume a large amount of memory, making it unsuited to CI -# environments. Disable it for now. -#REGRESSION_TEST(`n2147483647', `xargs -n2147483647 <${SRCDIR}/regress.in') +argmax=$(sysctl -n kern.argmax) +REGRESSION_TEST(`nargmax', `xargs -n$argmax <${SRCDIR}/regress.in') REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in | sort') REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in') @@ -28,5 +27,6 @@ REGRESSION_TEST_FREEFORM(`parallel1', `echo /var/empty /var/empty | REGRESSION_TEST_FREEFORM(`parallel2', `echo /var/empty /var/empty/nodir | xargs -n1 -P2 test -d; [ $? = 1 ]') REGRESSION_TEST_FREEFORM(`parallel3', `echo /var/empty/nodir /var/empty | xargs -n1 -P2 test -d; [ $? = 1 ]') REGRESSION_TEST_FREEFORM(`parallel4', `echo /var/empty/nodir /var/empty/nodir | xargs -n1 -P2 test -d; [ $? = 1 ]') +REGRESSION_TEST_FREEFORM(`ntoobig', `seq 42 | xargs -n$((argmax+1)); [ $? = 1 ]') REGRESSION_END() diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c index 51f42ba2c842..9becf6cf9ba1 100644 --- a/usr.bin/xargs/xargs.c +++ b/usr.bin/xargs/xargs.c @@ -178,7 +178,7 @@ main(int argc, char *argv[]) break; case 'n': nflag = 1; - nargs = (int)strtonum(optarg, 1, INT_MAX, &errstr); + nargs = (int)strtonum(optarg, 1, arg_max, &errstr); if (errstr) errx(1, "-%c %s: %s", ch, optarg, errstr); break; From nobody Tue Aug 5 11:52:48 2025 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 4bxBcx06J9z64N2x; Tue, 05 Aug 2025 11:52:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBcw2n21z3tQc; Tue, 05 Aug 2025 11:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394768; 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=YhhFNt8+Kc7VJvG8Fu0HoXgDpw3p4n7mucAO2usFWXs=; b=ZOYFvZK6icYhyqOsxMjpnMN+SUErhnGgGbg+vm/GoynH0hA2JwDTMYEHqZ8HLxdQgiInrr bbQwH4mBu131VhhmeHa+bFr5BUnfr9jpbCBMsVpZ2JnI8VjMDwn/ufvHQZN927uQ3CMJAO HrDTzWoutIitT0h2Z5M0tV32vbLIDhO1K2uAKZmKgbXFppOYFaetZ9DhPbIpnY5OkcarLO XoTEZMP18ko1uqZS2CZZx2M/CUfuw4wWb//4nfobeMzupLNhTuJJiCXCnkDQGEFDX3JzN2 rs/UooVAQgF3cNoU+yzm5wjynRYME0rqihshY543xXypQoZOinCrQJOWuoB2Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394768; 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=YhhFNt8+Kc7VJvG8Fu0HoXgDpw3p4n7mucAO2usFWXs=; b=X5chbj5erUP6eM7srZEcKhkzptj7wVTdgTdTdkSqlA8AMLUuF5I+CwgdBm5n6ShedAyyBA cvhrjWhrSU+kG4KSHZq/H0ZsQElVOcr4QAuWP0rFmRLxtjNwphD7BmiXuCiiFYuvvfre+9 5Ttg0AxTZJdAxBQNZWkNVLu/DNLPM7kXbepBJIkChvGrPGBSoG3vnqRK0sgSurUGVQMfmG 4q6vaCq4UeMPYzheRw4TX/pppmOsBPVB6v6CNqYqnAB7ocY2R16JD8sGv5DBd4/VEsvizB hom+uMl824AfnmMNgH1S8HvIj8Cu6WaaGxQ+sFbyO96PdQxVDsNvdBfZEr1Etg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394768; a=rsa-sha256; cv=none; b=iIx1iV5/NEWPoc9K3djixq+EgKQI3oKqJvZBLhdFlu1g/MfQLhIlU2WKjzgDaKz7eoGnZu yC1Qf1jXkLT60qQZjNtZwt0Jl59NcbuB5fbKhtwS1CicfgHz25EIwLPlDU9r6gYxpsCmSk vlt4+xW9C3aQ5VAQ1FSDjl08eZ1330L23zDPQlSp3MgRCjKfKgniNm05KPOCrQY0EVqSLf HR87FHIkORUl4LPQcu2Pj6uHSJP75TENQ4KTDvOxBNqkXlny3csyXn4cmPG0IRQ0rz7CvY IoVm9L4IYTMvw9qu1FUm/QRoD0Mz7cLfDbSFqVla6DfBL7YWHum0OuU5xQtt2g== 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 4bxBcw2KYvzZXX; Tue, 05 Aug 2025 11:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575BqmXW024590; Tue, 5 Aug 2025 11:52:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575Bqm73024587; Tue, 5 Aug 2025 11:52:48 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:52:48 GMT Message-Id: <202508051152.575Bqm73024587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 1501ecebf5af - stable/13 - comsat: Improve use of setuid() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1501ecebf5af7b47fde0020b888cfb4e4df1074e Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1501ecebf5af7b47fde0020b888cfb4e4df1074e commit 1501ecebf5af7b47fde0020b888cfb4e4df1074e Author: Ed Maste AuthorDate: 2024-11-27 20:36:46 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 11:52:26 +0000 comsat: Improve use of setuid() Just return from jkfprintf if either (a) user lookup fails (that is, getpwnam fails) or (b) setuid() to the user's uid fails. If comsat is invoked from inetd using the default of tty:tty we will now return due to setuid() failing rather than fopen() failing. PR: 270404 Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47823 (cherry picked from commit 062b69ba045dc0fef3d9b8d73365d2798c05a480) comsat: Use initgroups and setgid not just setuid PR: 270404 Reviewed by: jlduran Obtained from: NetBSD Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47828 (cherry picked from commit d4dd9e22c13896e6b5e2a6fc78dad4f8496cc14d) comsat: move uid/gid setting earlier It's good to reduce privilege as early as possible. Suggested by: jlduran Reviewed by: jlduran Obtained from: NetBSD Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47869 (cherry picked from commit 91629228e3df14997df12ffc6e7be6b9964e5463) --- libexec/comsat/comsat.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index 138881db9e4a..2358336be61a 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -71,7 +71,7 @@ static int debug = 0; static char hostname[MAXHOSTNAMELEN]; -static void jkfprintf(FILE *, char[], char[], off_t); +static void jkfprintf(FILE *, char[], off_t); static void mailfor(char *); static void notify(struct utmpx *, char[], off_t, int); static void reapchildren(int); @@ -159,6 +159,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) FILE *tp; struct stat stb; struct termios tio; + struct passwd *p; char tty[20]; const char *s = utp->ut_line; @@ -192,6 +193,14 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) } (void)tcgetattr(fileno(tp), &tio); cr = ((tio.c_oflag & (OPOST|ONLCR)) == (OPOST|ONLCR)) ? "\n" : "\n\r"; + + /* Set uid/gid/groups to user's in case mail drop is on nfs */ + if ((p = getpwnam(utp->ut_user)) == NULL || + initgroups(p->pw_name, p->pw_gid) == -1 || + setgid(p->pw_gid) == -1 || + setuid(p->pw_uid) == -1) + return; + switch (stb.st_mode & (S_IXUSR | S_IXGRP)) { case S_IXUSR: case (S_IXUSR | S_IXGRP): @@ -200,7 +209,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) cr, utp->ut_user, (int)sizeof(hostname), hostname, folder ? cr : "", folder ? "to " : "", folder ? file : "", cr, cr); - jkfprintf(tp, utp->ut_user, file, offset); + jkfprintf(tp, file, offset); break; case S_IXGRP: (void)fprintf(tp, "\007"); @@ -216,18 +225,13 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) } static void -jkfprintf(FILE *tp, char user[], char file[], off_t offset) +jkfprintf(FILE *tp, char file[], off_t offset) { unsigned char *cp, ch; FILE *fi; int linecnt, charcnt, inheader; - struct passwd *p; unsigned char line[BUFSIZ]; - /* Set effective uid to user in case mail drop is on nfs */ - if ((p = getpwnam(user)) != NULL) - (void) setuid(p->pw_uid); - if ((fi = fopen(file, "r")) == NULL) return; From nobody Tue Aug 5 11:52:49 2025 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 4bxBcx5Vmwz64ND9; Tue, 05 Aug 2025 11:52:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxBcx3Xfbz3tT9; Tue, 05 Aug 2025 11:52:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394769; 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=GtjDALwcAFI7nEPyc0yFQUmbxeDMNAo4+RMjAebkCdg=; b=cQqcJV346W80C72tfV0DMs3FKFFVCMANaO+Dh9mWlMYAGeTxcXEMDDWUBxowVwTauAE5SG KHPZyllAzr4VplId3NqVT5HWggpInicAMFbKQlc+HgVe6nyR1kekcjykT3RPyMQ8sFeDRj /oV2XD+bMyFb0iBex5inihOFPijqtx6esQOb4Q3KdHsPXNQ21BD8y3Ai6YXTuuCszgKzA2 cZDLbfl0aoSl+zZZMrg5rxFW7JPD13u6Vs5j4k1+6SmymYYDNKltLwdXsO+1/LyQ8j8DRc C2WZL921cwLLyksk+XKMxOVuF8mwmTX94p8mbVe8+OKxv7SwWjI2xTAEnQJGKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754394769; 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=GtjDALwcAFI7nEPyc0yFQUmbxeDMNAo4+RMjAebkCdg=; b=CiXvhlpE+Ae4RwrZFI0A7z27WBofmDq6DGOKDxlFcAJwDt4VUJJeNJZaFegP5SbpIKulHr Z/pU/FY5ITRFDpbGutn966UF5CiBdHED9Mt3kKDI8IZ8E/d+dmhN/uLJy9xPWrh8WIvDVF Ad7yV6NNfPN22DC4F49acmpuUXNOkC462uW9FJPiOaZ8GhEor8FZJe2FIB0FNPb0XPEBkC NK9nIBiNbwwqECazELDtL/3pys2Zh+99XDzeSIwLTDY3UYsT0611M3dlQ5qEYslldy8ClM m3+OVCK6vaKut+UzY7muyDh+An0HcW96EYX5BIrTMq/JeRITC6El8gR647vNKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754394769; a=rsa-sha256; cv=none; b=putnEvMKrN79Icf+7jDFYPLnoVBR3/OQ0i0r8SFg884xwOFG3hYRFdDFZvT3sxeEQuzoX6 fCQjjjBAGJzuI0/RgeJl/YMq6/gfqHVPqGOoIKOtun/GPoRmYOZY4iBIX4QjHnbzLHHQd/ FBnmM6oFYPoc+22s0op62J57+fef3mJMJpuw9n+4ZlgsHXSHlH4Idd3GSiOs+heMD2ZY4Q j5mobgOWL5XQnhLrI4rG4p81oULtm4lkTWdPtUWqhqAaWOAKs5o082KV26WkpTjveViYF1 ART10gl1On2DfE4AiOGugXqa5JRvU4/JB6VFppJjhR8d0cKY/S8gH3tlpaFrmw== 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 4bxBcx30fCzZZ0; Tue, 05 Aug 2025 11:52:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575Bqnu5024626; Tue, 5 Aug 2025 11:52:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575Bqnui024623; Tue, 5 Aug 2025 11:52:49 GMT (envelope-from git) Date: Tue, 5 Aug 2025 11:52:49 GMT Message-Id: <202508051152.575Bqnui024623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 6ca3734e928c - stable/13 - comsat: Don't read arbitrary files 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ca3734e928cc82f2f91b991be28c9900b2b4a07 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6ca3734e928cc82f2f91b991be28c9900b2b4a07 commit 6ca3734e928cc82f2f91b991be28c9900b2b4a07 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-28 15:28:26 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-05 11:52:28 +0000 comsat: Don't read arbitrary files When processing a notification, instead of accepting any file name that doesn't begin with a slash, accept only file names that don't contain any slashes at all. This makes it possible to notify a user about a mailbox that doesn't bear their name, as long as they are permitted to read it, but prevents comsat from reading files outside the mail spool. PR: 270404 MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51580 (cherry picked from commit 4a4338d94401f0012380d4f1a4d332bd6d44fa8e) comsat: Don't return from the child Fixes: 91629228e3df MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51581 (cherry picked from commit e40a2c4927a8068d7b6adee69c90ae3be8efc4df) --- libexec/comsat/comsat.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index 2358336be61a..f40123a5ef09 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -125,29 +125,24 @@ mailfor(char *name) char *file; off_t offset; int folder; - char buf[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; - char buf2[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; + char buf[MAXPATHLEN]; - if (!(cp = strchr(name, '@'))) + if ((cp = strchr(name, '@')) == NULL) return; *cp = '\0'; offset = strtoll(cp + 1, NULL, 10); - if (!(cp = strchr(cp + 1, ':'))) - file = name; - else - file = cp + 1; - sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utp->ut_user), - name); - if (*file != '/') { - sprintf(buf2, "%s/%.*s", _PATH_MAILDIR, - (int)sizeof(utp->ut_user), file); - file = buf2; + if ((cp = strchr(cp + 1, ':')) != NULL && + strchr((file = cp + 1), '/') == NULL) { + snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, file); + folder = 1; + } else { + snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, name); + folder = 0; } - folder = strcmp(buf, file); setutxent(); while ((utp = getutxent()) != NULL) if (utp->ut_type == USER_PROCESS && !strcmp(utp->ut_user, name)) - notify(utp, file, offset, folder); + notify(utp, buf, offset, folder); endutxent(); } @@ -171,8 +166,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) utp->ut_line); return; } - (void)snprintf(tty, sizeof(tty), "%s%.*s", - _PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line); + (void)snprintf(tty, sizeof(tty), "%s%s", _PATH_DEV, utp->ut_line); if (stat(tty, &stb) == -1 || !(stb.st_mode & (S_IXUSR | S_IXGRP))) { dsyslog(LOG_DEBUG, "%s: wrong mode on %s", utp->ut_user, tty); return; @@ -199,26 +193,20 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) initgroups(p->pw_name, p->pw_gid) == -1 || setgid(p->pw_gid) == -1 || setuid(p->pw_uid) == -1) - return; + _exit(1); - switch (stb.st_mode & (S_IXUSR | S_IXGRP)) { - case S_IXUSR: - case (S_IXUSR | S_IXGRP): + if (stb.st_mode & S_IXUSR) { (void)fprintf(tp, "%s\007New mail for %s@%.*s\007 has arrived%s%s%s:%s----%s", cr, utp->ut_user, (int)sizeof(hostname), hostname, folder ? cr : "", folder ? "to " : "", folder ? file : "", cr, cr); jkfprintf(tp, file, offset); - break; - case S_IXGRP: + } else if (stb.st_mode & S_IXGRP) { (void)fprintf(tp, "\007"); (void)fflush(tp); (void)sleep(1); (void)fprintf(tp, "\007"); - break; - default: - break; } (void)fclose(tp); _exit(0); From nobody Tue Aug 5 13:59:17 2025 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 4bxFQt19sFz64Tt9; Tue, 05 Aug 2025 13:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxFQt08lYz49VT; Tue, 05 Aug 2025 13:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402358; 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=KhNBLOunfMP91izVXPwlbjktMpfgTUPXRZbfJFLEybM=; b=fBLKYo/3vzWJkn4toedkQ6s6N3PuCF3uBfM3n7YJ5QI5NNr7qjq1lGzWKs4ePJblZY9wL5 wv2R2ClHVIIfZnaboKNuitiXeJGE6oB5PaHlCb0vGphiZyu6+AREWYLEMAALj6qY3biUsI 18RuPFL/Y04TuLBkT+oAqp4XDzo1Lys5VZLJQj+G5cTtrAGHUyjMg1hkF8eXte4cqpLC9r KOPvpaIprmN3wJ2kO6ZtKznNy9aSiPWBbzj24CBFEez4O7EstWPU4WdYMnN8Y0Q+jefiZK 1wmTzNohGQVVrLMOnP0q8dV1CBcXnPPVvDeLbK1cT0GAvudfBgtaWJIklJ/RPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402358; 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=KhNBLOunfMP91izVXPwlbjktMpfgTUPXRZbfJFLEybM=; b=jhKtefa4Xpfmhx/5kTvgRg1MQFhPLToQgwAMpASrbehowgtetJ+6vIlOKUUhjkDXa4wJkx ecV7Y5/Mhyz9eJUI6Fswam7bmCJ/SK0S3fEmzs8ihJvto/PP2kUhSS8V7HpJS4gZMxgVgS lcVvyFZVIfavW+4AiQy4ItbPmO6dYA+id/iuRKaQEOCULAxEZW2/0LjRk3tGt0nzdlI+ag 16S6gmo9gemTyl9gtFb/dXAwn3pj+TebN8+W8XL1Pafij2Dx6hnuQj65XDmaJK+c/j9eUp IpA0amJG3Dx8YUjhrUHDVcWjrRHbXlASn+G9XUOG6sSMdmIMkcndeTMZLDAKBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754402358; a=rsa-sha256; cv=none; b=deLXND2cARArgbi3gVoM0xiDyC9tQ7zhP0vl5DVpvt6Socpt+ilmS+cBw1FIF8ECiLepVH 7miB3nqqEGTIfW+lSyXCmwiy7BenJjhXvmBchto48M6VjPVbHfsbxivyNg/bVXjvxmgmRZ nUQNEy6GY4F0ZG2x0ROZiOg1702IqSX7NkR7/6e+bVNUriIEm71y01BwHym18hSHCwI/wr jphjtVCefFEfDSxiG9t3eEGK4exTRFmNcGPt5A+gCkaT2IaRGnFoxhFwcjremo3pNXfGXd yaOXU6c8MO6A2QDEcmm8qUxeVgiBv+k9T8M/txNVpvEvyFosOpSIfM4Bpgm3DA== 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 4bxFQs6sQ9zdv9; Tue, 05 Aug 2025 13:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575DxHCf052865; Tue, 5 Aug 2025 13:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575DxHsU052862; Tue, 5 Aug 2025 13:59:17 GMT (envelope-from git) Date: Tue, 5 Aug 2025 13:59:17 GMT Message-Id: <202508051359.575DxHsU052862@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: ed7856cdf03f - stable/14 - if_ovpn: Remove an unused field from struct ovpn_kkey_dir 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: ed7856cdf03f3d85d98e175410626e463ddf8087 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ed7856cdf03f3d85d98e175410626e463ddf8087 commit ed7856cdf03f3d85d98e175410626e463ddf8087 Author: Mark Johnston AuthorDate: 2025-07-25 13:12:45 +0000 Commit: Mark Johnston CommitDate: 2025-08-05 13:59:11 +0000 if_ovpn: Remove an unused field from struct ovpn_kkey_dir No functional change intended. Reviewed by: kp MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51493 (cherry picked from commit 3d3add7d43adb891ec054ec3f1c3d6d20b78dca8) --- sys/net/if_ovpn.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 879cc0636db7..0db4c8a8ab86 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -79,7 +79,6 @@ #include "if_ovpn.h" struct ovpn_kkey_dir { - int refcount; uint8_t key[32]; uint8_t keylen; uint8_t nonce[8]; From nobody Tue Aug 5 13:59:18 2025 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 4bxFQv3rQzz63GBf; Tue, 05 Aug 2025 13:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxFQv1309z49VV; Tue, 05 Aug 2025 13:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402359; 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=i8i5GAj461c9isPTodgbAHr7mjetvqPUxd6Ug4o/nr8=; b=H/Z71DT/T1y70KIh27xJzflfSvDAuniYlttjQCQiXL23Zdnjv/l1GKxZ3RyT0lVAvqqHfW u39U4bfoh6ipbn7GbV++BWpcinr7WvDdTBV8xxsuKrGlwLVU+RV7jPPUgYC6am8rPTXyhm IcsQ8avR04BCu8dWUj8qqiZYsNsmpGqpvCdd6PXg489defzkYOxUS8TXn2JsLInlXTOdAr 0PgtlCfbMZZTxdUZTHkUjMCcYQlMvXSMePl6OBRhE7Ink/S8bCkSQNrj0ZXTsQnpHxSzNi D3Vwkm+ocL+5FVzVXJM1H7VzDOefL3Y50zDuPaqdLjlseCyQfgmzzFRx6VT65A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402359; 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=i8i5GAj461c9isPTodgbAHr7mjetvqPUxd6Ug4o/nr8=; b=ov6PCfD4CgnTFs2+Y5yEcl+lK2UI/fSN/cqA+aXlFP2PHhY1XSC7Mj9AhuaNoX5jvZRzZj Wc3wxB89YZLRo0mD8vg2yPF0zw7uwjgrL2jBTBlvZiyj9xJYTKR9KJXnvc3SvZjgTZFeOm h8t+jjeAHmrWn/qV7TbqL5bW93vv+XnTEBOA5Dd11Bpdzwz1kEjH25TAjPGKngSWv39flF rytYVLYz6/rnTcVNj1aIUMjbqG4QQIpEUvXJp/BgQmnJE+gfOmXVMnFnubj58QtLwsckKV 5I+BKGrn9brf3ZfohVU+jUW1PweAqU96T7/e8/Y8JROq2gSi7fC7SMcpWFRGsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754402359; a=rsa-sha256; cv=none; b=yu9q+DRYuqaS5lSYbGpMGk/gZp5JbnFQbFcErQtivHNWNrkKuzPziW6y1AEY72rZdA5VC/ HavpTdoyNKd1ZVwmy7bHmVZ9j5dmOZxyyyE0Xdi30lWpW5Z4LafldDgCNKnkRppsRH/iyv 0jqoX4cneAv7mbyVQE/+/4Y1NPbbONf5wBTQ4v/LwXRQeS+Bb0D8DZmP5n7xXII1cZXPje 0Cwoieax90DHB4Pg12Wq1eamznB1EKWIHywM6IBtHhFeMES+i44QbpVprKvGyIO2jKet5h S4yOfLDRUhzLX0JJTm8k1mSH4o6ha5ALeJY2n5vC36URnjK/Lk41+eo4ymqWDA== 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 4bxFQv0dQnzdcy; Tue, 05 Aug 2025 13:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575DxI66052902; Tue, 5 Aug 2025 13:59:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575DxImc052899; Tue, 5 Aug 2025 13:59:18 GMT (envelope-from git) Date: Tue, 5 Aug 2025 13:59:18 GMT Message-Id: <202508051359.575DxImc052899@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: 0a7db9f4f673 - stable/14 - if_ovpn: Sprinkle const over some helper functions 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 0a7db9f4f673a5c256e8d968935e4db5b9e6ff57 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a7db9f4f673a5c256e8d968935e4db5b9e6ff57 commit 0a7db9f4f673a5c256e8d968935e4db5b9e6ff57 Author: Mark Johnston AuthorDate: 2025-07-25 13:13:13 +0000 Commit: Mark Johnston CommitDate: 2025-08-05 13:59:11 +0000 if_ovpn: Sprinkle const over some helper functions No functional change intended. Reviewed by: kp MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51494 (cherry picked from commit 2ff1587e3803e76a9726e1734181a5170079ddbe) --- sys/net/if_ovpn.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 0db4c8a8ab86..1de48c8f639e 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -204,7 +204,8 @@ static int ovpn_encap(struct ovpn_softc *, uint32_t, struct mbuf *); static int ovpn_get_af(struct mbuf *); static void ovpn_free_kkey_dir(struct ovpn_kkey_dir *); static bool ovpn_check_replay(struct ovpn_kkey_dir *, uint32_t); -static int ovpn_peer_compare(struct ovpn_kpeer *, struct ovpn_kpeer *); +static int ovpn_peer_compare(const struct ovpn_kpeer *, + const struct ovpn_kpeer *); static RB_PROTOTYPE(ovpn_kpeers, ovpn_kpeer, tree, ovpn_peer_compare); static RB_GENERATE(ovpn_kpeers, ovpn_kpeer, tree, ovpn_peer_compare); @@ -277,7 +278,7 @@ SYSCTL_INT(_net_link_openvpn, OID_AUTO, netisr_queue, "Use netisr_queue() rather than netisr_dispatch()."); static int -ovpn_peer_compare(struct ovpn_kpeer *a, struct ovpn_kpeer *b) +ovpn_peer_compare(const struct ovpn_kpeer *a, const struct ovpn_kpeer *b) { return (a->peerid - b->peerid); } @@ -303,15 +304,15 @@ ovpn_find_only_peer(struct ovpn_softc *sc) } static uint16_t -ovpn_get_port(struct sockaddr_storage *s) +ovpn_get_port(const struct sockaddr_storage *s) { switch (s->ss_family) { case AF_INET: { - struct sockaddr_in *in = (struct sockaddr_in *)s; + const struct sockaddr_in *in = (const struct sockaddr_in *)s; return (in->sin_port); } case AF_INET6: { - struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)s; + const struct sockaddr_in6 *in6 = (const struct sockaddr_in6 *)s; return (in6->sin6_port); } default: From nobody Tue Aug 5 13:59:20 2025 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 4bxFQw4WZSz63GD9; Tue, 05 Aug 2025 13:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxFQw1lyYz49S2; Tue, 05 Aug 2025 13:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402360; 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=OFPrMxv9fdLtgkXwomZXyHcM2K55zWRI1iFf8vT+PHE=; b=jk9KZAX9/VArBC2N14hyW/ZAzwWzrGiSBUDJU7SzqWCsyrX7UfZmDRHAFHLf47F5ivtBKm iQHr1PVGBf7CiZ24g/D/Wl0mzu57HSzecRq1QEeTIn5StfOi4LZmZMTfwm4YcF815Q9kLP mRn8z4QfHhj2xE9763qgOKDHs8safvKb9f0uE7MpqTmvC8vFiTFcKyToNdN5RVRGn2WvQ0 QPURi4GrgWlBnucyUTPr7mjCBYjvr3wO8HhOS+XT99gLOQc+5CGpW9+1NK1yYUe70wu02v 7mMF2EEDyAi9eXVIR8mO08EMhfUSEoOUJ3BPygBZgsE8n1RM2dqEbCQMtydy3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402360; 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=OFPrMxv9fdLtgkXwomZXyHcM2K55zWRI1iFf8vT+PHE=; b=cVR4a3iLBwjxqsHwDDTxjc8rrZxPJNYogTvV+yUE2h3k8pGdUynFwERWYFVvZxEWnE+W/j 9EYTkCcVx6YS28sJkTlSbnYVbUZ1MpaWlNgPM3mXZKmONZzUwXe6r2ilw9y0v8YlTdtlvv YV+FrtNEm2EM1mX1eAmk9G7L/mYVx+IfM5+S1TWDKgHeEy/XoJ+lLQWvIUOuUeqTv9mYHH LzqMwlzWY3d1rulkwIvwuv6FQumKIM5XkE8VCTBemffqzupB5dfNK8GnUzT37EwbratJh4 KIDM+A6zfBbCXwmAaIbag9IlUTZQ8VXrjcO7J74SgIMriAZGVCJ/UsBAQDExbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754402360; a=rsa-sha256; cv=none; b=vviCp5NJcEGZspCzFFO9x/GpHetw3ynm6Kc2umfMTrJuG0qVAiVOTG5ePObRD/E5d2EJP0 75yrL4aqRkr1RAXNJ5/V2nfXUn97hZhbb+waj5Gp5OkbEY11Y47c4ikDl5rwVvgjxZk8qW Q+QuxhPrI7OXu9xvFD4HDDhpklpksUCVVAaddGSJYg/7o87+0pX9/IU5XkxIvMUUbw78uo /QcFptLjNbX0A7wx+PlVxKloiQ7GDU7sjfROFBHj++1pgvvwzWQYIV7mtvpmPMGwLxXKgU 9DsD+fHNh1Ki+X/+Ob6/khxkVrFTG/g2Aq1QXrRttowYOsJxgmJ7ex70dkj2YA== 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 4bxFQw1GcCzdvB; Tue, 05 Aug 2025 13:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575DxKmc052935; Tue, 5 Aug 2025 13:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575DxK6s052932; Tue, 5 Aug 2025 13:59:20 GMT (envelope-from git) Date: Tue, 5 Aug 2025 13:59:20 GMT Message-Id: <202508051359.575DxK6s052932@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: 9fd5e22f426e - stable/14 - if_ovpn: Destroy the datapath lock when destroying a clone 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 9fd5e22f426e77991971a907d442fbeb573441ab Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9fd5e22f426e77991971a907d442fbeb573441ab commit 9fd5e22f426e77991971a907d442fbeb573441ab Author: Mark Johnston AuthorDate: 2025-07-25 13:13:31 +0000 Commit: Mark Johnston CommitDate: 2025-08-05 13:59:12 +0000 if_ovpn: Destroy the datapath lock when destroying a clone Reviewed by: kp MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51495 (cherry picked from commit 9bc6980bdf57432ee8519a3707423f410c5ec639) --- sys/net/if_ovpn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 1de48c8f639e..52a5f08d738a 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -2517,6 +2517,7 @@ ovpn_clone_destroy_cb(struct epoch_context *ctx) COUNTER_ARRAY_FREE(sc->counters, OVPN_COUNTER_SIZE); + rm_destroy(&sc->lock); if_free(sc->ifp); free(sc, M_OVPN); } From nobody Tue Aug 5 13:59:21 2025 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 4bxFQy735hz63G3t; Tue, 05 Aug 2025 13:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxFQx4lbQz49Xm; Tue, 05 Aug 2025 13:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402361; 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=RtK7BSUIBHCdQ9IbaNklaVbT8ca2QAf+KFho9QSG+3U=; b=CJNI/PGTRRUCpKZKWoRUe6kKM3wowj48cLQWG9AYAcb2hvrFDTuGGrU1PsxtJlwib2h0g9 3aiarQrJ0Bcr1ZUYaxkDFinlwPtcWzYe+O51Uq68717aN1NfDiedyj64ilE3Kh6Kv++34z CcIBm/gdP//xALJ9j7hVQhyJwL/QlFe3zfew0e/tiEK5HEABBhVcMMShtBoKSXiGq9DPwx lr1rQ2C5sqjTA9YyVPq7q7O2Hp5E2dtdzTi4/CkaSK6NjSST4hweYzDGmUz1dGISoTYWh/ VdNnscgBV22TwB7mmmPBHsJts0FRvxshjtRdRDUAojUHDBYhBCYlGJx1IeP62A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402361; 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=RtK7BSUIBHCdQ9IbaNklaVbT8ca2QAf+KFho9QSG+3U=; b=Gs2w4cJClFOIH51rYKYGlgmwEf0nGJY5k86MUqfTaRzB01tbN/j8AlWPQ4IEGC9T4208Wi 1tiNbckPB2pCs7B0R1eR7+Mky3FsjElf0EQJIfyn5m6lhTM+wlxVK8KUieSDQosrNwhMH/ ch1/f4rJGsTsNK12ateWjkR5royFx6uRoS1buPIe+GqRGXBztX6sMsfZtJCVhvKsR0k5pd 2yTV32NRaqtcmVmUNR8lZX9cmgpdd6KuWCLBinhwclOGKPFW80C4yjVhl0qcraR3qEiThq OtuHtd907vPU5EJ8do8RjImcqWtt5lM2nJMcTNEe5TGP+cy/nC0M/72pM9W1+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754402361; a=rsa-sha256; cv=none; b=Jxpinrb18XVbXvRuj8JEqfQKrkbl10PMnOENET0E4e0xXXWXvlHjH58YSVA7Z1nkpQf67K UmZn7gshrOUJ0Imsim2vbf2Hb+KSByqNTWrxxl1B2gnFYJ21VBK7tHlVdmS8lRv041hoRv jzAtHrCRuWaQZka8xjsVRiMl5UZ5XJw7/v5jl7kDGPYkuJdEeACBa1w60+9O6cCJk6LRFu mponsPy4cQtxQmvL9E5rd2Nbc2PuBvHIAmfYP5cyrKUzGanxBv2tKlwOugx+F3kRyWqDVW sTty4qw0uRzEWSzUEgMt0c2k/DGm4HFEca19V/bmGhdGCM9FlMNH1FVF7By11w== 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 4bxFQx23klzdfv; Tue, 05 Aug 2025 13:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575DxLMT052968; Tue, 5 Aug 2025 13:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575DxLaa052965; Tue, 5 Aug 2025 13:59:21 GMT (envelope-from git) Date: Tue, 5 Aug 2025 13:59:21 GMT Message-Id: <202508051359.575DxLaa052965@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: 6bd8a7393f28 - stable/14 - if_ovpn: Assert that udp_set_kernel_tunneling() succeeds 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 6bd8a7393f28074dea80d452584b992c6302026a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6bd8a7393f28074dea80d452584b992c6302026a commit 6bd8a7393f28074dea80d452584b992c6302026a Author: Mark Johnston AuthorDate: 2025-07-25 13:13:52 +0000 Commit: Mark Johnston CommitDate: 2025-08-05 13:59:12 +0000 if_ovpn: Assert that udp_set_kernel_tunneling() succeeds We do this elsewhere, so copy the pattern here. Reviewed by: kp MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51496 (cherry picked from commit a7dfc570f2747668b2fdd8fde6e1954fcedb2378) --- sys/net/if_ovpn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 52a5f08d738a..10b864f62787 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -639,6 +639,7 @@ ovpn_new_peer(struct ifnet *ifp, const nvlist_t *nvl) * a new one. */ ret = udp_set_kernel_tunneling(sc->so, NULL, NULL, NULL); + MPASS(ret == 0); sorele(sc->so); sc->so = NULL; } From nobody Tue Aug 5 13:59:22 2025 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 4bxFQz5rx0z63GGy; Tue, 05 Aug 2025 13:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxFQy3R7zz49q9; Tue, 05 Aug 2025 13:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402362; 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=pYwhaTcxi03hVTZIcpFrGdRJun3sfWeOpsaTKYnAsh8=; b=aNHe+lyZwFVs9KZNUJGhgZBIgUWI3YjKT+QplJ7cIe64UZ4tnV/A1d25ZfbfmtY95cmchH s+5XHChIp2ECFNUxSVEOW9r2tLN2c8cWEXVW4vz2OxDybTDcziR57awbWA7oz5lE/L+PwN 8ByQPEmyixctqQm4qj6I2DCQEEm7ttf1QSRADsgA+bf/tS9UkTMFma7mwXDnXf/zTv2pl4 lst0k4MkBZPWb6MmvMVcp5gxrytLCs0UJ61sdvLBuaRX0w3ip19EMgQkcjSt0HjxWWQlvP YsJtm8StAcdkjci/icoLlVaS+Xv/c6NnSRry1jE9dW3yKG5p7D0J47dXIAGezA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402362; 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=pYwhaTcxi03hVTZIcpFrGdRJun3sfWeOpsaTKYnAsh8=; b=pfk/l39L6B0nOBXLYiiuJAutIshC8jyZaR90vX6pNltmvB3n9TerEhn29eR1A1c0bW/dHW OX55OJEtyMg9K4F/gLPIHrXz9gKLkmrpIct42b9nDXhyYpy0mUXjZA+6/w+uOpiBzQVaJD R0l4DMlwg+/TDs1S0FI66GaUBKsP/sBTmsRSbhHsVNRyAWYRFBWXXdVbhVnc9cdKlOnSkn xMbAUuWyTS+jiQhkc6Y9U2nxppxwnyNWHf+SJIj5eAb/sB+B1AuGnt/Ukm33rhMmquB0hS 02zR61/2OBk2CSbZp9icDVO0YmQG/AJG38JjbwqzKO45xJLISXrYrEFseeGKBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754402362; a=rsa-sha256; cv=none; b=OD+QdAj5kOeaNKVaS5dobYR5nIsR7KYa5FrXUX89Y3grp2QmAbtfe7C3aTLLo+CDuBeayj t4a3mh0I3RmAkY+kvB/GmsgFRHrMtxvF011VXVsO12iCAbSyYoDqXbzDNry2KuFL8IssXL trKV3nJFPntyFPo8Q2Hnrbv/Uhpblm9c4Xf89pjWjitmgcDCAnIHAkvLw5N/T4bSpvEQH5 ZeNqoPn69EimV0mFjxUp7c2Dta7BngQtYOcDSOIeECdVjx0lNDFTsU7Cgh15B5BjqvhTNa GLFanki/xUk0L4AhdxHy2/K1Eyb17Esyd+uNcFlwYozOFzkI4hwe1z6xIejvCA== 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 4bxFQy30xyzdd0; Tue, 05 Aug 2025 13:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575DxMrn053001; Tue, 5 Aug 2025 13:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575DxMCT052998; Tue, 5 Aug 2025 13:59:22 GMT (envelope-from git) Date: Tue, 5 Aug 2025 13:59:22 GMT Message-Id: <202508051359.575DxMCT052998@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: 818c85bee2c0 - stable/14 - if_ovpn: Support multihomed server configurations 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 818c85bee2c0f2f9c876df7301859903abd49520 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=818c85bee2c0f2f9c876df7301859903abd49520 commit 818c85bee2c0f2f9c876df7301859903abd49520 Author: Mark Johnston AuthorDate: 2025-07-25 13:15:02 +0000 Commit: Mark Johnston CommitDate: 2025-08-05 13:59:12 +0000 if_ovpn: Support multihomed server configurations In UDP server mode, openvpn implements the "multihome" option, which makes it avoid binding to an address. Instead, the server socket is bound to INADDR_ANY. Today, when configuring a new peer and setting the source address, sockaddr() returns the wildcard address, so the source address is implicitly determined by the output interface. This doesn't work as one would want if the WAN interface has multiple addresses and clients connect to non-primary addresses. Make multihome mode work properly: use the local address supplied by openvpn in preference to that of the socket. We still fetch the port number out of the socket. PR: 273664 Reviewed by: kp MFC after: 1 month Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51498 (cherry picked from commit 05b5d56c540335ed17acf843810901338bf862d5) --- sys/net/if_ovpn.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 10b864f62787..e8b2cb0df1a6 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -320,6 +320,25 @@ ovpn_get_port(const struct sockaddr_storage *s) } } +static void +ovpn_set_port(struct sockaddr_storage *s, unsigned short port) +{ + switch (s->ss_family) { + case AF_INET: { + struct sockaddr_in *in = (struct sockaddr_in *)s; + in->sin_port = port; + break; + } + case AF_INET6: { + struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)s; + in6->sin6_port = port; + break; + } + default: + panic("Unsupported address family %d", s->ss_family); + } +} + static int ovpn_nvlist_to_sockaddr(const nvlist_t *nvl, struct sockaddr_storage *sa) { @@ -333,13 +352,14 @@ ovpn_nvlist_to_sockaddr(const nvlist_t *nvl, struct sockaddr_storage *sa) return (EINVAL); af = nvlist_get_number(nvl, "af"); - switch (af) { #ifdef INET case AF_INET: { struct sockaddr_in *in = (struct sockaddr_in *)sa; size_t len; const void *addr = nvlist_get_binary(nvl, "address", &len); + + memset(in, 0, sizeof(*in)); in->sin_family = af; if (len != sizeof(in->sin_addr)) return (EINVAL); @@ -354,6 +374,8 @@ ovpn_nvlist_to_sockaddr(const nvlist_t *nvl, struct sockaddr_storage *sa) struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)sa; size_t len; const void *addr = nvlist_get_binary(nvl, "address", &len); + + memset(in6, 0, sizeof(*in6)); in6->sin6_family = af; if (len != sizeof(in6->sin6_addr)) return (EINVAL); @@ -506,7 +528,7 @@ ovpn_new_peer(struct ifnet *ifp, const nvlist_t *nvl) #ifdef INET6 struct epoch_tracker et; #endif - struct sockaddr_storage remote; + struct sockaddr_storage local, remote; struct ovpn_kpeer *peer = NULL; struct file *fp = NULL; struct sockaddr *name = NULL; @@ -578,19 +600,37 @@ ovpn_new_peer(struct ifnet *ifp, const nvlist_t *nvl) ret = so->so_proto->pr_sockaddr(so, &name); if (ret) goto error; + memset(&local, 0, sizeof(local)); + memcpy(&local, name, name->sa_len); + free(name, M_SONAME); + name = NULL; + if (nvlist_exists_nvlist(nvl, "local")) { + struct sockaddr_storage local1; - if (ovpn_get_port((struct sockaddr_storage *)name) == 0) { + ret = ovpn_nvlist_to_sockaddr(nvlist_get_nvlist(nvl, "local"), + &local1); + if (ret != 0) + goto error; + + /* + * openvpn doesn't provide a port here when in multihome mode, + * just steal the one the socket is bound to. + */ + if (ovpn_get_port(&local1) == 0) + ovpn_set_port(&local1, ovpn_get_port(&local)); + memcpy(&local, &local1, sizeof(local1)); + } + if (ovpn_get_port(&local) == 0) { ret = EINVAL; goto error; } - if (name->sa_family != remote.ss_family) { + if (local.ss_family != remote.ss_family) { ret = EINVAL; goto error; } - memcpy(&peer->local, name, name->sa_len); + memcpy(&peer->local, &local, sizeof(local)); memcpy(&peer->remote, &remote, sizeof(remote)); - free(name, M_SONAME); name = NULL; #ifdef INET6 From nobody Tue Aug 5 13:59:23 2025 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 4bxFR14K38z63GDF; Tue, 05 Aug 2025 13:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxFQz4PbBz49w0; Tue, 05 Aug 2025 13:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402363; 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=L2EnG6XAaNgGZpwOFYKSeENouqbFgtlimMC+kbybPz4=; b=We4LfxXwfCzGa7Lp0ngk4a8oN3qIvSw9efb4sic8zjlo8UnsktkqukmjbrT+dHwRO5v7PZ VjhMDe0JGSsG2WK3Auq+Yg0sGnnhNCNw72qp9qLngsBT8XgmwY7P5Ln4F0i8iYIaCqeFNU ImJZ7iMv2RMAUrEb9iSRawUR3z2VQHSrH0rQ41sZ9q1dS52YGkTyWwdOEIZ3y0rq0II/VB Yx/qXL28fxw7Ax6w4hgsps20quLszObEGC5tuLWFPMp2jkiDl0TXGUMG77vJzt1wiHoqfx pdpWWvYNXfm1oC1AoJn4IeDcVdKgDn+XUrxeXgSZyuhOX2nOHv6wA3Bh3xVCNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754402363; 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=L2EnG6XAaNgGZpwOFYKSeENouqbFgtlimMC+kbybPz4=; b=E9lEpcG4BCEFuXEjazLr49WnHYq4zcDoeMyTJEXz2U6lIQvbcGR9S/6X+UXHJ6EM/g6tlk qgXOODNlIDtqOaaVx6oXEPQyLVaA5Vc7uMaQSy8hgQOlCKgko6mI07n+mB0ZaJe5GxJU5A wqfETgqQMg3UxaunbkfyvGIjMDgWCtvpzfFmzoxsNxZ3igOesXu2yqh2npY70JJ3n4ci5w WEtRVOjO32sWSL/iGEnKEFuYKlDqT8gfnGf7r1eJwDtU2V5hp/7XiT2laBKDluFOVUbZoV gTOgXOQUVeRQPPFPOt2kJnriOug50A9ksFzFHjVGhpWxvvghtQdiitEm61/tWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754402363; a=rsa-sha256; cv=none; b=pg101SddUQ9uvHrggJa6XPLIq6tQh27/vEted2/v85En/8n6SYJzThut1KKCrpxcaHir7h aLoxc0UK6fa0MhIWeyIrw5NtEmHD74t9Utapo2A+BoSDMRNij0llpPa9GaRaKgP0IquU3s 2aRWRYYBCWw4FW6iITNxvJJ6ZBMy+IG1zzh2H/xJohE+wiA67xHUNyhB7tvQXpqwOUvPdg 3UkDQO8ECcJ6hGTZnb2T2Fj/wtkvt1N+AGFiKVspEXzJUfvS1q0+tWPyL2mhFI+I5mh7B4 LjMS/fywK4PQ5lap9PydgoG1iwQY162zP/Rm+Mdv5ZtK3qqGrddXs2335BZ0tg== 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 4bxFQz40Mjzdd1; Tue, 05 Aug 2025 13:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 575DxNLj053034; Tue, 5 Aug 2025 13:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 575DxNOV053031; Tue, 5 Aug 2025 13:59:23 GMT (envelope-from git) Date: Tue, 5 Aug 2025 13:59:23 GMT Message-Id: <202508051359.575DxNOV053031@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: d05b81a8edd4 - stable/14 - if_ovpn tests: Exercise the multihome option 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: d05b81a8edd461db0d40920f7c35a69da2dd7a65 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d05b81a8edd461db0d40920f7c35a69da2dd7a65 commit d05b81a8edd461db0d40920f7c35a69da2dd7a65 Author: Mark Johnston AuthorDate: 2025-07-25 13:15:39 +0000 Commit: Mark Johnston CommitDate: 2025-08-05 13:59:12 +0000 if_ovpn tests: Exercise the multihome option These test cases are variants of the 4in4 and 6in6 tests wherein the server interface has an alias assigned and the client is configured to connect to the alias rather than the primary address. Reviewed by: kp MFC after: 1 month Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51499 (cherry picked from commit 0bfcfb3cb1cbfa383cbd24eff39d39f143eb63ba) --- tests/sys/net/if_ovpn/if_ovpn.sh | 172 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index b0967c992b5d..c7e2f928e340 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -1110,6 +1110,176 @@ gcm_128_cleanup() ovpn_cleanup } +destroy_unused_cleanup() +{ + ovpn_cleanup +} + +atf_test_case "multihome4" "cleanup" +multihome4_head() +{ + atf_set descr 'Test multihome IPv4 with OpenVPN' + atf_set require.user root + atf_set require.progs openvpn +} + +multihome4_body() +{ + pft_init + ovpn_init + + l=$(vnet_mkepair) + + vnet_mkjail a ${l}a + atf_check jexec a ifconfig ${l}a inet 192.0.2.1/24 + atf_check jexec a ifconfig ${l}a alias 192.0.2.2/24 + vnet_mkjail b ${l}b + atf_check jexec b ifconfig ${l}b inet 192.0.2.3/24 + + # Sanity check + atf_check -s exit:0 -o ignore jexec b ping -c 1 192.0.2.1 + atf_check -s exit:0 -o ignore jexec b ping -c 1 192.0.2.2 + + ovpn_start a " + dev ovpn0 + dev-type tun + proto udp4 + + cipher AES-256-GCM + auth SHA256 + + multihome + server 198.51.100.0 255.255.255.0 + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/server.crt + key $(atf_get_srcdir)/server.key + dh $(atf_get_srcdir)/dh.pem + + mode server + script-security 2 + auth-user-pass-verify /usr/bin/true via-env + topology subnet + + keepalive 100 600 + " + ovpn_start b " + dev tun0 + dev-type tun + + client + + remote 192.0.2.2 + auth-user-pass $(atf_get_srcdir)/user.pass + + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/client.crt + key $(atf_get_srcdir)/client.key + dh $(atf_get_srcdir)/dh.pem + + keepalive 100 600 + " + + # Block packets from the primary address, openvpn should only use the + # configured remote address. + jexec b pfctl -e + pft_set_rules b \ + "block in quick from 192.0.2.1 to any" \ + "pass all" + + # Give the tunnel time to come up + sleep 10 + + atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1 +} + +multihome4_cleanup() +{ + ovpn_cleanup + pft_cleanup +} + +multihome6_head() +{ + atf_set descr 'Test multihome IPv6 with OpenVPN' + atf_set require.user root + atf_set require.progs openvpn +} + +multihome6_body() +{ + ovpn_init + + l=$(vnet_mkepair) + + vnet_mkjail a ${l}a + atf_check jexec a ifconfig ${l}a inet6 2001:db8::1/64 no_dad + atf_check jexec a ifconfig ${l}a inet6 alias 2001:db8::2/64 no_dad + vnet_mkjail b ${l}b + atf_check jexec b ifconfig ${l}b inet6 2001:db8::3/64 no_dad + + # Sanity check + atf_check -s exit:0 -o ignore jexec b ping6 -c 1 2001:db8::1 + atf_check -s exit:0 -o ignore jexec b ping6 -c 1 2001:db8::2 + + ovpn_start a " + dev ovpn0 + dev-type tun + proto udp6 + + cipher AES-256-GCM + auth SHA256 + + multihome + server-ipv6 2001:db8:1::/64 + + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/server.crt + key $(atf_get_srcdir)/server.key + dh $(atf_get_srcdir)/dh.pem + + mode server + script-security 2 + auth-user-pass-verify /usr/bin/true via-env + topology subnet + + keepalive 100 600 + " + ovpn_start b " + dev tun0 + dev-type tun + + client + + remote 2001:db8::2 + auth-user-pass $(atf_get_srcdir)/user.pass + + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/client.crt + key $(atf_get_srcdir)/client.key + dh $(atf_get_srcdir)/dh.pem + + keepalive 100 600 + " + + # Block packets from the primary address, openvpn should only use the + # configured remote address. + jexec b pfctl -e + pft_set_rules b \ + "block in quick from 2001:db8::1 to any" \ + "pass all" + + # Give the tunnel time to come up + sleep 10 + + atf_check -s exit:0 -o ignore jexec b ping6 -c 3 2001:db8:1::1 + atf_check -s exit:0 -o ignore jexec b ping6 -c 3 -z 16 2001:db8:1::1 +} + +multihome6_cleanup() +{ + ovpn_cleanup +} + atf_init_test_cases() { atf_add_test_case "4in4" @@ -1125,4 +1295,6 @@ atf_init_test_cases() atf_add_test_case "ra" atf_add_test_case "chacha" atf_add_test_case "gcm_128" + atf_add_test_case "multihome4" + atf_add_test_case "multihome6" } From nobody Wed Aug 6 00:28:27 2025 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 4bxWNr16zlz63w1V; Wed, 06 Aug 2025 00:28: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxWNr0Ly3z3Lfk; Wed, 06 Aug 2025 00:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440108; 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=NjtbWqB/WDDT1X577aGAd/YhJNZx8nRBSS91BSxgtmU=; b=ypl3z6LtPCXBqY5vp//X4K3YA1Br1WGe5VMoF821QL3jG37niU54ah5Q0JJeIMCZ20jmj5 4wzvEifpd1SUqBYQri8tYUbqKQgNjg8QndbRrjwaKdTGXvcpEfvipj4FnAJ49lbNcXRZDp XoyaeWpfFUc7QLavjP7P6Sb+VJobNQBURO4kcjw1lBtm0W6ZLdtPK6YdFxoI2fYuZRHArh Ap0oMrZr1U8QnZwy65iHx87Hlf/7gRLxFS+3+KHiM6oGPJhAVXtTCaFHelhC2L3860gJ+x 37R0yPytkGdyd0ed6wyIqXlJAI+U+ttEEPDMHBKGsffsx/oCnchvJiT56KfTdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440108; 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=NjtbWqB/WDDT1X577aGAd/YhJNZx8nRBSS91BSxgtmU=; b=CCMPt2xq5YOA+4gp0VwkJpE8LH7pI7UC49Vfi6P6bdCir9yVNuUXL4Q5d8N0Yr9d/KBQz0 kdJBMOtYp8GXeWkqd7j426KmT6aw9pgqzt86j5paPiKw2waxqQkihyz5XZS8AMiTvDkmve zhVJq6rt9nGmpGk69DIxM+g5FpgqR3d+QBcxdMPqJWBtxhVExZz4yjHu49CBaZhc+woTHb FAMWy8e9IQHwEQbGeTIqkxnojsdGFIP/+MJILTKxsU2GQBK08QpA5c7R2r5s41gHzY7+KV Y/GjlIU3FrmT9292OJ5rgS9UuCTFukwCcON+kwVLXjMA1220G/5pn5+83qTKLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754440108; a=rsa-sha256; cv=none; b=foWDoQdek/rhLjHAuTuSzh9FLgtGlGBGUO1Mc8he9wboQlpj0F42jwo7I/ODs25lslMm9e i6IRjcQO74s5Rs/SwOYhKpRB2Df4b3hyHLSq3ug1Fic5nl5VIw/upJ2jSs+GS8V8ZwIWhc 8Gr0bt5PLutuDO0hoqFNNkauT2QXc8CkQGJsInTl4YVanih9p16kKATy468CT6YWEfbFmw DVq5vizqPIzZn6D/GUadIRPDgTht8cE88yOtu615t57Xh3w9IESdEl1x9EchQKJvNA5R45 eCE28MkgwsRXHmiyFOb/44FOXUhoDsAq7xN2ArxFMHNH/rVoHrQNQvXFhGJyWg== 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 4bxWNq71K6zy7g; Wed, 06 Aug 2025 00:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5760SRFN040640; Wed, 6 Aug 2025 00:28:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5760SRBE040637; Wed, 6 Aug 2025 00:28:27 GMT (envelope-from git) Date: Wed, 6 Aug 2025 00:28:27 GMT Message-Id: <202508060028.5760SRBE040637@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: 1f8b830f46ba - stable/14 - ufs_vnops.c: use unsigned type for newparent inode number in ufs_rename() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 1f8b830f46bac0bc41273916d2f624ea75ed32f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1f8b830f46bac0bc41273916d2f624ea75ed32f7 commit 1f8b830f46bac0bc41273916d2f624ea75ed32f7 Author: Konstantin Belousov AuthorDate: 2025-07-27 13:47:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-06 00:26:32 +0000 ufs_vnops.c: use unsigned type for newparent inode number in ufs_rename() (cherry picked from commit c069ca085bd185eda4a90dc4bc2b76cceb74579d) --- sys/ufs/ufs/ufs_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 1a50089781ee..7375e931d26b 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1270,7 +1270,8 @@ ufs_rename( struct inode *fip, *tip, *tdp, *fdp; struct direct newdir; off_t endoff; - int doingdirectory, newparent; + int doingdirectory; + u_int newparent; int error = 0; struct mount *mp; ino_t ino; From nobody Wed Aug 6 00:28:29 2025 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 4bxWNs2gxRz63wJ0; Wed, 06 Aug 2025 00:28: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxWNs1Dl6z3M2c; Wed, 06 Aug 2025 00:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440109; 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=EvYKLMjWcP+PaZzGgxvLaJsmjqDXNGbf27wz17h2cdo=; b=Jid7nAXkXctFATVr+zhVA0ZdAdCoGQeA76w8kwd+E6KI2Lh9ByCahvQzh37Fd9DxWRwwcG mMh2Y8k37P5eiSDXlVtJaT5g76DGWz6Uncq6ZrU9ztEmbxWqczAz7kFx3vDQhNAhT8hTYj FZ5RYwxQrtUHIPGn3YPZyPd9meV3VMBVHXJvT6djVbMsxs+fZvi2zVcX/J254260tngjnA 3sHC5YZ7dkr461uAN23IEIYYmPGDfKgmatogwtsq0BhSxEsGMSmsmOmmNsQYbwndhI65xa 9mTWo0AFJ88D10yCfLEVqsRLr4UYjXyo5pf+BCZFxOuQFYhCnadn8gdZvkIrrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440109; 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=EvYKLMjWcP+PaZzGgxvLaJsmjqDXNGbf27wz17h2cdo=; b=C6e4paUIOEtdIW3Yha7jrtmfaklwXUSNWPdI6F0b5KhYUCUp34CGDMfSwVDcKy9lvKIwl9 9PXkFNgE5lBjwuimA3wfl9dDqNIPeMm3kfgdtuL7d6OZOWSnAYE2u5+zEMICVwrzHfTHOv IEZM1oaqNuQTSs/ZIwzwwiN+MbRm7v+rZ3lsJSNgU694RJ/g2R1OA0oAmJ5EzlXFg2NKfE WcDnd55N6BiXWUuA0RbzD0Uq9adLJSDyPETdY+j7wZ6fsbjSlZJs0qfAXyEW65qhLDV+rb z55iefF5XxC5TxZSv8a2rF0moMfw+WcEbLcsAVSZO9BD3z9W64MuHt/NpPl8lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754440109; a=rsa-sha256; cv=none; b=p6ZXF7sziMQqQRtp8hQcvFFEYtpF+zpqNDzncrCPeMm+kkqTqmO6bHOnQokSqIrZpd6N35 F7+1VRPr8ji5BWEFVi6F4emei0Co67+TEh3jkoryyRQDP2I6bXuR4x1FtHcPVf95D6m6T2 mSwZb8U7cKxxeMiquT8WCGr2X/sRxH3va8P3M8b+ze3xx8msr/ZEq6YKHTlyqjJU6mWGih X7D/UvmoweFFoTkGmAowfskEGD1wWa0AXoQcG4rcJy/tvZJlziZO97JpeUZ3rixcTkGEB9 RVtBMMnuEgYcM80wV6yPEiT5vAJSuhbSaJ6LDshU1GZpBVrxoPDbmRSTQuoM0g== 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 4bxWNs0qnVzxTQ; Wed, 06 Aug 2025 00:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5760STsu040678; Wed, 6 Aug 2025 00:28:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5760STKE040675; Wed, 6 Aug 2025 00:28:29 GMT (envelope-from git) Date: Wed, 6 Aug 2025 00:28:29 GMT Message-Id: <202508060028.5760STKE040675@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: c330e9622403 - stable/14 - ufs_vnops.c: newparent is not bool 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: c330e962240311aefde305b4644abf9fc627f511 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c330e962240311aefde305b4644abf9fc627f511 commit c330e962240311aefde305b4644abf9fc627f511 Author: Konstantin Belousov AuthorDate: 2025-07-27 13:50:57 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-06 00:26:32 +0000 ufs_vnops.c: newparent is not bool (cherry picked from commit 610319c766e941de96e52f2d28fea9f8cfc51aeb) --- sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 7375e931d26b..924e70a1a5f5 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1482,7 +1482,7 @@ relock: * the user must have write permission in the source so * as to be able to change "..". */ - if (doingdirectory && newparent) { + if (doingdirectory && newparent != 0) { error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); if (error) goto unlockout; @@ -1549,7 +1549,7 @@ relock: if (tip == NULL) { if (ITODEV(tdp) != ITODEV(fip)) panic("ufs_rename: EXDEV"); - if (doingdirectory && newparent) { + if (doingdirectory && newparent != 0) { /* * Account for ".." in new directory. * When source and destination have the same @@ -1644,7 +1644,7 @@ relock: goto bad; } if (doingdirectory) { - if (!newparent) { + if (newparent == 0) { tdp->i_effnlink--; if (DOINGSOFTDEP(tdvp)) softdep_change_linkcnt(tdp); @@ -1654,11 +1654,10 @@ relock: softdep_change_linkcnt(tip); } error = ufs_dirrewrite(tdp, tip, fip->i_number, - IFTODT(fip->i_mode), - (doingdirectory && newparent) ? newparent : doingdirectory); + IFTODT(fip->i_mode), doingdirectory); if (error) { if (doingdirectory) { - if (!newparent) { + if (newparent == 0) { tdp->i_effnlink++; if (DOINGSOFTDEP(tdvp)) softdep_change_linkcnt(tdp); @@ -1681,7 +1680,7 @@ relock: * disk, so when running with that code we avoid doing * them now. */ - if (!newparent) { + if (newparent == 0) { tdp->i_nlink--; DIP_SET_NLINK(tdp, tdp->i_nlink); UFS_INODE_SET_FLAG(tdp, IN_CHANGE); @@ -1710,7 +1709,7 @@ relock: * parent directory must be decremented * and ".." set to point to the new parent. */ - if (doingdirectory && newparent) { + if (doingdirectory && newparent != 0) { /* * Set the directory depth based on its new parent. */ From nobody Wed Aug 6 00:28:30 2025 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 4bxWNv01RGz63wLB; Wed, 06 Aug 2025 00:28:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxWNt4Byyz3Lfn; Wed, 06 Aug 2025 00:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440110; 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=S5oes2rO6c+I7QRix+HNgM0OrxQ/sB6RRhYAmx64oCI=; b=j82YUydUuw3439zWjXPyPT5cu9BYnH9OkCG0W8NH6IzgTnAUNsC1Jucza6hLaVZ4nf9S3M 3PLGr4YAZiIo45KbNg0Clv0387yo801YiyT38/qghM4w0U2cejkvypBIiCkPk+Tvbv6yVX mEyEUJiepuO6hpZHMN6cnbeFUnEvH38xrw69y7eEXLmesZhsTY/1JzEna0/pXFkSJa+Dh6 +QLuQZwheiRgNRoO4MrOEOKYTWohQ/sw5ESMYzNIQ/UblIeN1CfCcgaRLFNob5bINI7QyW ZeTqQFWTvublPBLzJzYvmFGMhGyhVWctJr3T9YBINeS18Xv5YuvAWcXjl+zBOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440110; 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=S5oes2rO6c+I7QRix+HNgM0OrxQ/sB6RRhYAmx64oCI=; b=tkWrKpiVgY1gYQimcuwdzgTBpv9OyrCjkZT48vaPBq22OSNItsKmbNg78A9bFqmPQWPHMu nahEnBUVxXj0GcQbG80r523h1tu+IVszIaCTsxnklklKxTEnvTMN+qVnV6/cX+e5vxgHGd qFbCeu0jTdfMTy2bgvhGqnuDTOe0AJ+JF3j1GSO7p8bSAoBJbo0QTxfK7rTMy3MEyIvm5Y atDMDg5YRY3ZKPO/aJ1zHfOCI68CXf/koWRHJgBD8+UywWm/sVzSPy0sDGgwTovmR3O5S1 q29Iqb4g4J5B7iPR0UHMXfc+SW+M5ygBh8s26bV+chrBseyumtWNFD0Ypz72VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754440110; a=rsa-sha256; cv=none; b=qgBBDXSh3/STlD+hsqMmlng3I3oLp5gvIu5WF3smucg7vGwT5QlInJNjQXCWT3YxY/w3A/ Gunq2kWBNcfQFbnPy2tcScpWezdQCvq07W4GZn8cgaejFEtdSHxJV9AnZSMC4H9ai+ymNL f6reEWHly+ERXBlpwWOXDMwm/NAAqVE+1kGow9dwdNfJ7qrfMxkWYqsjcUEUsnakF8N4TA aZj8tGb/j1wBHOea9Qr4zZQgIDa1AnFcgvO2F3FA8XeDuNFrkNia61iu9c7yECsB2cYzvp VM7jA87chKlYLJKfLAgGVFc79dz8kYXuijc//1snLXCk6gd/ITsFd1MOm1A8Sw== 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 4bxWNt1mdrzxqM; Wed, 06 Aug 2025 00:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5760SU8n040711; Wed, 6 Aug 2025 00:28:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5760SUw0040709; Wed, 6 Aug 2025 00:28:30 GMT (envelope-from git) Date: Wed, 6 Aug 2025 00:28:30 GMT Message-Id: <202508060028.5760SUw0040709@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: f8073b224a14 - stable/14 - ufs: restore conditional 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: f8073b224a14d1e2ae61408667818e401cced1b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f8073b224a14d1e2ae61408667818e401cced1b0 commit f8073b224a14d1e2ae61408667818e401cced1b0 Author: Konstantin Belousov AuthorDate: 2025-07-29 12:45:25 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-06 00:26:32 +0000 ufs: restore conditional (cherry picked from commit 98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8) --- sys/ufs/ufs/ufs_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 924e70a1a5f5..6940510e315e 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1654,7 +1654,8 @@ relock: softdep_change_linkcnt(tip); } error = ufs_dirrewrite(tdp, tip, fip->i_number, - IFTODT(fip->i_mode), doingdirectory); + IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? + newparent != 0: doingdirectory); if (error) { if (doingdirectory) { if (newparent == 0) { From nobody Wed Aug 6 00:28:31 2025 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 4bxWNv75dFz63w1Y; Wed, 06 Aug 2025 00:28:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxWNv4gqFz3LjM; Wed, 06 Aug 2025 00:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440111; 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=J26MIL3FJP0OJKoG9O/0bGkY8H456yOGiYNZW3LvxhQ=; b=oCLJr/Q3voS/i9a+tDZeed5mQ0HS/PKYgePsPM3DW+7uAX9NIs2kwww2QFHOXmODv2gr7I oZiC4lUJUxn5E/04avL6kbIS7oPfB9j6/9xTWV3YGYbDT5J9pAfa9AigoWFPIvScWqVpfW xJmTDCToRQQUb8RJkFTLZV+kLSfFxl28WFTZo5N82edThYbdomIy5wqvUowFPL32pKDyaw lBcUOXhCRJ6fUX3VofdY3xYFrQO1hlybfwBYKtqQDso7y5xkCBKD30UU4c9YXyHQk6vb8x OIt0jdSTGrFkS1h00KSP282ooqlMmoLmu89LbQOOOAP+NZEPjgJ+PK69d0w/Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440111; 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=J26MIL3FJP0OJKoG9O/0bGkY8H456yOGiYNZW3LvxhQ=; b=xu+4TZsyEOixwcYkH+13Uis0qFPveJZ4EhrBTKv4yfsxCXHArMYAmwusfAeuYr6S0RjaKs v8DKtf9fQ0X6wzxPjYSWSP14Cq2KTXuCs79f4LhumrXykRRSz0lF6MshNJypZtRAlvWIE/ zzbOzdrjQtboEknBcyuon3OHqGEnRjxPOzOTwsFf8N2yPO9ftGd/Z1wxnQln11WIMcZVAB rzOM3T4JBpMPVlmbg3Jt4bdTZQ45NGKrP+7Do4ZwFO2HTD38RbOvBRwT966ZSoPRdlIrOX JxxfIca6eyR45Y2E37d1qpChbEaojBpvoKS8m1Va/KzQO0zD+cTnJ+lscM33lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754440111; a=rsa-sha256; cv=none; b=Gm0Vih6twdre8v1zAlSFi8kqqTvKz2oaj8YCLct6lrce94MyXhNh0tnXqBKam5yovjz+uF qAw1O8hBAwRFVDno8JpRUknkMN3v/oglfMuK5QzRNuAzmhZOD2c84iSHY9xxqRzsYnYi1C 3asFHRSLUHwdu/DCdCHRsGOXTVZ4zAZQgCktL4RJeC1k5Ze8CFVeR9QAzT2SW+WIgRIdmD YHUDSNno4j6FHzNOasE08dAvbBYQb+MzU3r4z2mmItqa/b0CNBfKHRJFXU6NQU5XsYTt0h 7i4MaQw6F6PxFsTv9KtZ+bpgZAo1ldHvCAneesgutKRwSpwfc52lt0MahEjxJg== 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 4bxWNv2j4nzxqN; Wed, 06 Aug 2025 00:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5760SVxu040744; Wed, 6 Aug 2025 00:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5760SVQ8040741; Wed, 6 Aug 2025 00:28:31 GMT (envelope-from git) Date: Wed, 6 Aug 2025 00:28:31 GMT Message-Id: <202508060028.5760SVQ8040741@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: 94069737c028 - stable/14 - ufs: Pass the new parent inode number to ufs_dirrewrite() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 94069737c0282ecd3a6d8ba3df12e919e8bef7a8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=94069737c0282ecd3a6d8ba3df12e919e8bef7a8 commit 94069737c0282ecd3a6d8ba3df12e919e8bef7a8 Author: Mark Johnston AuthorDate: 2025-07-29 13:56:48 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-06 00:26:32 +0000 ufs: Pass the new parent inode number to ufs_dirrewrite() (cherry picked from commit 2bc355c0182a889acc97a09e1272f7d7593949af) --- sys/ufs/ufs/ufs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 6940510e315e..3621d072f608 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1655,7 +1655,7 @@ relock: } error = ufs_dirrewrite(tdp, tip, fip->i_number, IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? - newparent != 0: doingdirectory); + newparent : doingdirectory); if (error) { if (doingdirectory) { if (newparent == 0) { From nobody Wed Aug 6 00:28:32 2025 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 4bxWNx4b94z63wT4; Wed, 06 Aug 2025 00:28:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxWNw4qB9z3M5d; Wed, 06 Aug 2025 00:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440112; 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=K8rnZheoDIqCfOfPObRVPZyFVBSvnMmjlwZveG+t/vI=; b=BtzwYs/CZzqHTfPj84wEIIgabK490dcOTuwm92vNCTFPQIdH1QYcPuLXHLrSPMtBIIF/jN SPp58uJrTauFKnOCo5AMBD/F3KJVkoYdfuVHWrG12JigdQh1ciPkqBqJUF54566EtHOqrx Q4HFcVwJPLhZWcKialUGqeDU0q28/nDwSGwR3VEakjqBC5GuXzfenfw/762WTeG8KM3FHW FTBQCpEbPMgPfo+UbUG+1cnRU9MjrqU05xg2SqeLh1COAHcuUl2c3eh0+MVNbL4zTgl2r1 saURVpZnbUSs7yoaGnwQ8Anb7AUqJGr6nwesuUw9mKFlS+JWRHvH4Yxusl+DSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754440112; 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=K8rnZheoDIqCfOfPObRVPZyFVBSvnMmjlwZveG+t/vI=; b=hV7/bMgW2FSLrQSA8XAMdhN9/UxxnSTTHh8crz0A4/Hp7NFWcVzIQ3iRgzXyfkQxOEU8Vj jaFf0Fciymu+a1CeKkTWE0aXOuF63JZulMxIbTzmnNnbwSm9KqkBap/sOT7jSy9igf74FU YyqrPuSvAY6AUKej1Q1TMqgkxbKfAFpGCcZMLXSOhYeM/vy6Xc2NjLiN8XmwR3jZ+pfaaF mtVfPq6S0djwhoTlMITgP2Ngh/S/FeHXkEMcSB3LAJGVbt9G1f07hLS0L3dO2G6CW7cFHX 7Zi4UN2hRTPawM6UnadKLFF8zavrHo+8YdCITjX5moy3jNi4OxVQeCjC/Lf9LA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754440112; a=rsa-sha256; cv=none; b=CbdUtihBhSONnJpKrtsJQIKplW588VgfWQY6YvkjNHWZIvBkBb8xE6M9+w+rvTDrIPEgU2 OVdlJ4RhdHdHYOvnz4DVrl2ECdPUfcgO7msyF3Y40LApXFfrWUz1x7idQmuI8rAB3pQcCk 7KO6QoP0nc3y9er1LWZCwmIQ96cRFWFCryyoUcQNUau1MvGc/Cb/PuLb8m/NecW11PiUtw pbTTxwDMRwQufrgwCo+IVhvH42pGwWWuaSgCi2wjQ35zpCtsP/41uL0W1sgDtzTShjHhgJ rSswQ1m+lqAWzZqILxOpJTPg19uUrXkDzwz9iOu3dDxofHfQkhaOlv24Jwqf6A== 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 4bxWNw3pKxzy56; Wed, 06 Aug 2025 00:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5760SWNd040778; Wed, 6 Aug 2025 00:28:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5760SWSG040775; Wed, 6 Aug 2025 00:28:32 GMT (envelope-from git) Date: Wed, 6 Aug 2025 00:28:32 GMT Message-Id: <202508060028.5760SWSG040775@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: 231985152cf7 - stable/14 - ufs: change isrmdir type to bool or u_int as appropriate 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 231985152cf71d57bd19a518138cbd6da13f4ac4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=231985152cf71d57bd19a518138cbd6da13f4ac4 commit 231985152cf71d57bd19a518138cbd6da13f4ac4 Author: Konstantin Belousov AuthorDate: 2025-07-29 13:35:17 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-06 00:26:33 +0000 ufs: change isrmdir type to bool or u_int as appropriate (cherry picked from commit 6f4de208eddec8556da1beba6e732f8abbbd8d8e) --- sys/ufs/ffs/ffs_softdep.c | 20 ++++++++++---------- sys/ufs/ufs/ufs_extern.h | 8 ++++---- sys/ufs/ufs/ufs_lookup.c | 7 ++++--- sys/ufs/ufs/ufs_vnops.c | 8 ++++---- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index edf064549d85..54a0466da88c 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -276,7 +276,7 @@ void softdep_setup_remove(struct buf *bp, struct inode *dp, struct inode *ip, - int isrmdir) + bool isrmdir) { panic("softdep_setup_remove called"); @@ -287,7 +287,7 @@ softdep_setup_directory_change(struct buf *bp, struct inode *dp, struct inode *ip, ino_t newinum, - int isrmdir) + u_int newparent) { panic("softdep_setup_directory_change called"); @@ -767,7 +767,7 @@ static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *); static void handle_workitem_freefile(struct freefile *); static int handle_workitem_remove(struct dirrem *, int); static struct dirrem *newdirrem(struct buf *, struct inode *, - struct inode *, int, struct dirrem **); + struct inode *, bool, struct dirrem **); static struct indirdep *indirdep_lookup(struct mount *, struct inode *, struct buf *); static void cancel_indirdep(struct indirdep *, struct buf *, @@ -9173,7 +9173,7 @@ softdep_setup_remove( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir) /* indicates if doing RMDIR */ + bool isrmdir) /* indicates if doing RMDIR */ { struct dirrem *dirrem, *prevdirrem; struct inodedep *inodedep; @@ -9365,7 +9365,7 @@ newdirrem( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir, /* indicates if doing RMDIR */ + bool isrmdir, /* indicates if doing RMDIR */ struct dirrem **prevdirremp) /* previously referenced inode, if any */ { int offset; @@ -9494,7 +9494,7 @@ newdirrem( dirrem->dm_state |= COMPLETE; cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref); #ifdef INVARIANTS - if (isrmdir == 0) { + if (!isrmdir) { struct worklist *wk; LIST_FOREACH(wk, &dirrem->dm_jwork, wk_list) @@ -9529,7 +9529,7 @@ softdep_setup_directory_change( struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ ino_t newinum, /* new inode number for changed entry */ - int isrmdir) /* indicates if doing RMDIR */ + u_int newparent) /* indicates if doing RMDIR */ { int offset; struct diradd *dap = NULL; @@ -9562,10 +9562,10 @@ softdep_setup_directory_change( /* * Allocate a new dirrem and ACQUIRE_LOCK. */ - dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem); + dirrem = newdirrem(bp, dp, ip, newparent != 0, &prevdirrem); pagedep = dirrem->dm_pagedep; /* - * The possible values for isrmdir: + * The possible values for newparent: * 0 - non-directory file rename * 1 - directory rename within same directory * inum - directory rename to new directory of given inode number @@ -9576,7 +9576,7 @@ softdep_setup_directory_change( * the DIRCHG flag to tell handle_workitem_remove to skip the * followup dirrem. */ - if (isrmdir > 1) + if (newparent > 1) dirrem->dm_state |= DIRCHG; /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index 1403c6832cb0..ba6a4de71735 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -68,8 +68,8 @@ void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); int ufs_direnter(struct vnode *, struct vnode *, struct direct *, struct componentname *, struct buf *); -int ufs_dirremove(struct vnode *, struct inode *, int, int); -int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); +int ufs_dirremove(struct vnode *, struct inode *, int, bool); +int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, u_int); int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, ino_t *); int ufs_getlbns(struct vnode *, ufs2_daddr_t, struct indir *, int *); @@ -95,9 +95,9 @@ int softdep_setup_directory_add(struct buf *, struct inode *, off_t, ino_t, struct buf *, int); void softdep_change_directoryentry_offset(struct buf *, struct inode *, caddr_t, caddr_t, caddr_t, int); -void softdep_setup_remove(struct buf *,struct inode *, struct inode *, int); +void softdep_setup_remove(struct buf *,struct inode *, struct inode *, bool); void softdep_setup_directory_change(struct buf *, struct inode *, - struct inode *, ino_t, int); + struct inode *, ino_t, u_int); void softdep_change_linkcnt(struct inode *); int softdep_slowdown(struct vnode *); void softdep_setup_create(struct inode *, struct inode *); diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 0beeeed32251..423c4c2e4e28 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1103,7 +1103,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, * to the size of the previous entry. */ int -ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) +ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, bool isrmdir) { struct inode *dp; struct direct *ep, *rep; @@ -1226,7 +1226,7 @@ out: */ int ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, - int isrmdir) + u_int newparent) { struct buf *bp; struct direct *ep; @@ -1269,7 +1269,8 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, if (!OFSFMT(vdp)) ep->d_type = newtype; if (DOINGSOFTDEP(vdp)) { - softdep_setup_directory_change(bp, dp, oip, newinum, isrmdir); + softdep_setup_directory_change(bp, dp, oip, newinum, + newparent); bdwrite(bp); } else { if (DOINGASYNC(vdp)) { diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 3621d072f608..bc62ad59ff00 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1053,7 +1053,7 @@ ufs_remove( #ifdef UFS_GJOURNAL ufs_gjournal_orphan(vp); #endif - error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, 0); + error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, false); if (ip->i_nlink <= 0) vp->v_vflag |= VV_NOSYNC; if (IS_SNAPSHOT(ip)) { @@ -1211,7 +1211,7 @@ ufs_whiteout( #endif cnp->cn_flags &= ~DOWHITEOUT; - error = ufs_dirremove(dvp, NULL, cnp->cn_flags, 0); + error = ufs_dirremove(dvp, NULL, cnp->cn_flags, false); break; default: panic("ufs_whiteout: unknown op"); @@ -1740,7 +1740,7 @@ relock: "rename: missing .. entry"); cache_purge(fdvp); } - error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); + error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, false); /* * The kern_renameat() looks up the fvp using the DELETE flag, which * causes the removal of the name cache entry for fvp. @@ -2319,7 +2319,7 @@ ufs_rmdir( ip->i_effnlink--; if (DOINGSOFTDEP(vp)) softdep_setup_rmdir(dp, ip); - error = ufs_dirremove(dvp, ip, cnp->cn_flags, 1); + error = ufs_dirremove(dvp, ip, cnp->cn_flags, true); if (error) { dp->i_effnlink++; ip->i_effnlink++; From nobody Wed Aug 6 05:55:06 2025 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 4bxfdk347Pz64DTv; Wed, 06 Aug 2025 05:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfdk2JBrz3rXR; Wed, 06 Aug 2025 05:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459706; 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=EY02oAqUJNCvOM7a7dy1bzVSMo1ednkAmkCe/nDI5Zc=; b=OCFhUoo+9f3sCUPRO34fZBhkMlokQq0rncYOcfd1PeIxc4gpJrVThyq8OT+CYjXHcytouZ yoKW8khS/rnjHYqRh8EOOg5BZ/f7Npr9fa36W9JRYkFZ267BYbtYKMHdtwgo+M/U3Nnp5V lJLpa+uIa4UIZVpUJPZS2jQPK9Y80WCUE2Eve2MACBBZMR9Jz7XXNZI+BVUUCOA10I4juX BIYBxtA6M+SOQHC1RHfS98PUWWxOFwu6FRejlGZmyQVlhNMR9gfzcX3hGmu4r7DqSqX2zZ rr9JVMMEH6vvfnVDOWfVB+Z0SO3AO6NZ0xxnbR44QEGiiLvLoFJRuDGiRb0zjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459706; 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=EY02oAqUJNCvOM7a7dy1bzVSMo1ednkAmkCe/nDI5Zc=; b=b7zcZTmsRCo1FYsgfEx1Z7OMeqdENK9g1D3BuD9lWFDYDJXQf0kawOpGRh7zf31bdxiYow vYCSSf7LY8OqDBPRhud4sqbv4/+Fo987gJZKdH0xIF9CRTRi8CJ3MrptEaFEp2+6aczlBA I+5a+iMGtu+O17mvMvjP4Ak6ElWFo8jndXvq8JwVfg19Rn7ZItX0K3WnqX2CKOQaJnouA+ 9/MclHej9c+p302zx+O6V0qrAf8FsjsjO0bd5z43cV1XfVLJ1keZmq67D0k3BZFoYYpSM4 Iyp9jIMnOeNjzw8TIBezrzzydDBeUMof2D1VseiHMvPrXMyxN2zXAU6gSihWyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754459706; a=rsa-sha256; cv=none; b=yu0qJkRpUq2m/Mx1YT5iGFijY473GpLnoD0q0vl3uqQM5a7Sy2xGM5tMZIMtpFfSId4aYO oVu/Ar9hd1DMyyi6llR8vBK2afPi+HDPx8K1T6kKZ4OgP0eFs9ZVcgx5jRxuk02DHZtvZX BuY6V/kY2kCYZN9haxB+En92yQrwkFNnplJOf3V8cIBtpGAdMvnKC+BYDXcNerYcy7I/n1 a4ixad1wRQPJXwoXuyF2cfYTCnD0zRLMa+g8H1k35J3r8jXnnd0Z6NCZXI3Zk9vLjxIiuu 64LUZlBrc9uc3ZA8xASR64wCgffaoDiL4OESCa1PXoxwE2ROFehdKJLjTx+zdQ== 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 4bxfdk1sL1z172q; Wed, 06 Aug 2025 05:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5765t6al057956; Wed, 6 Aug 2025 05:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5765t6mL057953; Wed, 6 Aug 2025 05:55:06 GMT (envelope-from git) Date: Wed, 6 Aug 2025 05:55:06 GMT Message-Id: <202508060555.5765t6mL057953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 640979856fc8 - stable/14 - rk_i2c: emulate repeated start 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 640979856fc8d9c2abf1dd78d68f016d265abc5c Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=640979856fc8d9c2abf1dd78d68f016d265abc5c commit 640979856fc8d9c2abf1dd78d68f016d265abc5c Author: Andriy Gapon AuthorDate: 2024-06-27 07:40:22 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 05:54:22 +0000 rk_i2c: emulate repeated start rk_i2c_send_stop is modified so that it sends a stop condition, like it always did, if there is no IIC_M_NOSTOP flag. But if the flag is set then the function completely resets the control register and sets the driver state to transfer completed. Something like this was previously done for a write with IIC_M_NOSTOP. Now it is done for a read with IIC_M_NOSTOP as well. Linux code says that the hardware does not support the repeated start condition and the documentation, indeed, does not mention it. But according to the Linux driver clearing the control register and then sending a start condition acts as if it were a repeated start. While here, add braces around a single-line 'if' branch to balance it with a multi-line 'else' branch. Tested with max44009(4). MFC after: 2 weeks (cherry picked from commit 0deaf4be346f7f343bd2cf771bbf5d172d1c0d2a) --- sys/arm64/rockchip/rk_i2c.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c index 608b9782d787..ea32f52876be 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -282,13 +282,26 @@ rk_i2c_send_stop(struct rk_i2c_softc *sc) { uint32_t reg; - RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_STOPIEN); + if (!(sc->msg->flags & IIC_M_NOSTOP)) { + RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_STOPIEN); - sc->state = STATE_STOP; + sc->state = STATE_STOP; - reg = RK_I2C_READ(sc, RK_I2C_CON); - reg |= RK_I2C_CON_STOP; - RK_I2C_WRITE(sc, RK_I2C_CON, reg); + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg |= RK_I2C_CON_STOP; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); + } else { + /* + * Do not actually set stop bit, set up conditions to + * emulate repeated start by clearing all state. + */ + sc->state = STATE_IDLE; + sc->transfer_done = 1; + + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg &= ~RK_I2C_CON_CTRL_MASK; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); + } } static void @@ -351,9 +364,9 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc) case STATE_READ: rk_i2c_drain_rx(sc); - if (sc->cnt == sc->msg->len) + if (sc->cnt == sc->msg->len) { rk_i2c_send_stop(sc); - else { + } else { sc->mode = RK_I2C_CON_MODE_RX; reg = RK_I2C_READ(sc, RK_I2C_CON) & \ ~RK_I2C_CON_CTRL_MASK; @@ -370,7 +383,6 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc) RK_I2C_WRITE(sc, RK_I2C_CON, reg); RK_I2C_WRITE(sc, RK_I2C_MRXCNT, transfer_len); } - break; case STATE_WRITE: if (sc->cnt < sc->msg->len) { @@ -379,12 +391,10 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc) RK_I2C_IEN_NAKRCVIEN); transfer_len = rk_i2c_fill_tx(sc); RK_I2C_WRITE(sc, RK_I2C_MTXCNT, transfer_len); - break; - } else if (!(sc->msg->flags & IIC_M_NOSTOP)) { + } else { rk_i2c_send_stop(sc); - break; } - /* passthru */ + break; case STATE_STOP: /* Disable stop bit */ reg = RK_I2C_READ(sc, RK_I2C_CON); From nobody Wed Aug 6 05:55:07 2025 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 4bxfdl58Nsz64DPf; Wed, 06 Aug 2025 05:55:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfdl3Dhsz3rmG; Wed, 06 Aug 2025 05:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459707; 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=w/+1qa+dyxEj4ibCsPn6176pDdtw0WaRR0zHIqdjUkA=; b=fA5xk6VrxtJt4Px3ZDqA6xlSTXoN37ApvRSfEXj2lZ/oAWb4reJEwmcdiymC4BYdaS09ge 2yevkvN9Vta69ZJoARrNmY2H0OjYlbUqyBrsA1n7Nv8z3WQPdZMx5dpk46iur7qiF6hvhG iz1V+/egSIH8jnC9Uo8ZKneDOwwV2AdMjiqWXEDgyfZHQzbg2PFxPR2FIoQYeTCt8l0AGA Q2j4iJrL5zXuACN9HfiPE4m8qUf5fCB6ZBBiNKsZvs8If/Ls2kHE3of/t2chZqhrdjvJJp SGigBCfx7hopGo/3kRLfBiD/+onWaHea+mZgUgjPkTtLZWCUk3cLj/icaUxpcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459707; 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=w/+1qa+dyxEj4ibCsPn6176pDdtw0WaRR0zHIqdjUkA=; b=AVLqMerBGCIZ14FK1nrJr+gm3swWg2avDoU6gKXh4JgHZYGDczOeGs6Udcmow69R/Cp9QT TNYvj1SVa9mirmswSb1C4zNUKleJd2syUdwyb2jlrhfLfBhE0wctvMKzz4UaSD8QBuYM03 ICmDFonA1SSVUDwA6ZeElI+DPJb6tooWO5q7rz5KRai04NoaBOf0q6LKYaqzz/5pGmJine bv+EHSUHzJtXEBQlBRTaVAzPdAHUusu7u5+mye/kb0CGLCxO8UAsGnPt5Ji25U9vcBQ+e/ lG5s7mZxUgmQD/QhY2xaR5QK/i6JQWpvNZDqioZS8WViEZcissXCDoRqgnlSjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754459707; a=rsa-sha256; cv=none; b=ViEeV3mhjTHWfq/Bqh3F19+7LxZWBge4F2gCMv4M7Cg9wRbPlCMQKTSVDj4Nw6CLdSJlx4 Y3fmVniWJFrBDxaD75iJoGwy0liqJ31ZhQ1/i+sU+D6gBJ37jUQalZMlPl13vTUmtFsvSH oYbSWoOwN0zD86ouLstE4FcHHmicApt4/EJpCtV87DfSYUNKeGybEU4TnFuYpl2+v5NRBL m+tNKqKBhPWyEr4JBaT5seUTycb+S3STLwy3SCIRNTPpu3Uyf/iqqrH99A0TdJhB8vPVKr tUOkObwe3deQ6LKtHDpvBHH9qG3yod5Vaa1+vrphMT0piJg6zJkmskfe8LGoiQ== 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 4bxfdl2nNxz172r; Wed, 06 Aug 2025 05:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5765t7lV057989; Wed, 6 Aug 2025 05:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5765t7Fa057986; Wed, 6 Aug 2025 05:55:07 GMT (envelope-from git) Date: Wed, 6 Aug 2025 05:55:07 GMT Message-Id: <202508060555.5765t7Fa057986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 775224f7e412 - stable/14 - rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 775224f7e4123378b06c28f1adcb4d30a0717a92 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=775224f7e4123378b06c28f1adcb4d30a0717a92 commit 775224f7e4123378b06c28f1adcb4d30a0717a92 Author: Andriy Gapon AuthorDate: 2024-06-27 07:48:30 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 05:54:59 +0000 rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP Tested with max44009(4). MFC after: 2 weeks (cherry picked from commit a743e280ea0541163afa7d1c320504925a02f80b) --- sys/arm64/rockchip/rk_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c index ea32f52876be..6da1d6169ecf 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -526,7 +526,7 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) if (nmsgs - i >= 2 && msgs[i].len < 4 && msgs[i].flags == (IIC_M_WR | IIC_M_NOSTOP) && - msgs[i + 1].flags == IIC_M_RD && + (msgs[i + 1].flags & IIC_M_RD) == IIC_M_RD && (msgs[i].slave & ~LSB) == (msgs[i + 1].slave & ~LSB)) { sc->mode = RK_I2C_CON_MODE_RRX; From nobody Wed Aug 6 05:55:45 2025 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 4bxffT4FRnz64DmJ; Wed, 06 Aug 2025 05:55:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxffT2l7vz3sHv; Wed, 06 Aug 2025 05:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459745; 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=SLP+RqoECVkzOiMBiap8asqirzjlRlXcABWq7P7TaNE=; b=Q1AuJypPVZEW2POXuo7txKTt/UmYeq8n3F/qSinXwDm3rAbKR9/F6/3ai+x1LTf0cZLYLn hbr//EHGXQztPG5LZTFHDJOPMXAAdykWtyxGU++ZdsBnj8ERrHHnL9BE+hmoYVSKFGyryG VAyGuasllWXPTnBubAtRPDA9JiGRpZf/ZRLMei+c1CiK/0yULjNav6a/xENkqU7d41i5z4 qJphzLQGHsag/+hT/8RzQpVN6V3dfL8Fl6RCGiz21Afu4+Ud/xOy3Xx+xGWbE/Df7PYGS/ RMg6FEKNH+gWJiMwsSWHNnboL2yTCc0qVaAZKm6em7LWHJkJZBaGAtuyPHGkZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459745; 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=SLP+RqoECVkzOiMBiap8asqirzjlRlXcABWq7P7TaNE=; b=CY8KpsYP3u5WZqsNuUuA4xlvmkaV9YsLcwSHOJ6N4t8UAVfAz0Jt7kdRfH5xS/DlQyFseh TqVcoNem/zbY5i25EBct27tO4g/qq+UCyVr0U/9VVhAtztvVjwGlVw2wY0/1f7Ot9b+qVC BRZW8IbmSFCteGsT2rBCI64eO84xMn/s7QKdHNb9/QT26c/Nhr/WGBbDlKxfAx9S5F810N Amj3L5WCF+4eOCPNMBYQMLmqutzNgPQDs825AjzhKwgykg0QTNYfbGir6A4ulPGpISHXJB EPCJJydJTB8FELQQEdYM8Al34qNfJnpzl4eXkNqnpR1N8COtA/7EJkUpdITToQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754459745; a=rsa-sha256; cv=none; b=nlpps/0OeAnlOi8UGhTH8nrtgqeCcFYg4NQAwU1z40i9mI25yNAltajLte1VtLEnxcL1S7 /LfxkWloe/tDeMIaiJcaqOJYxhEGlnc0LhQXPJHRIL0xakcAWr/t+aAB6SLH05Nk4rserO qWJax22/uWAZJ54A2QBQc3KzB07DwGAhhOz0aLmiQOt/Anyj/gF+WMUvayGjBiER+FYSsd 6JK4I8cYT/+5PZVZtcsoXtGd0J0/bHBI4Ocp/D8X7oS097OiYYV5N5TluNua6funB84ZCz I8kP10CKTo/69/XZJ5kbFSswwE9VcmoJSM8hRPqw3nXJ/SZeAUy46djNmt/4mQ== 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 4bxffT2Kh5z17Jl; Wed, 06 Aug 2025 05:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5765tjS8058276; Wed, 6 Aug 2025 05:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5765tjfN058273; Wed, 6 Aug 2025 05:55:45 GMT (envelope-from git) Date: Wed, 6 Aug 2025 05:55:45 GMT Message-Id: <202508060555.5765tjfN058273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: e71f019b82f4 - stable/13 - rk_i2c: emulate repeated start 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e71f019b82f4d4e623fa75aca647cf7103d89b54 Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=e71f019b82f4d4e623fa75aca647cf7103d89b54 commit e71f019b82f4d4e623fa75aca647cf7103d89b54 Author: Andriy Gapon AuthorDate: 2024-06-27 07:40:22 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 05:55:24 +0000 rk_i2c: emulate repeated start rk_i2c_send_stop is modified so that it sends a stop condition, like it always did, if there is no IIC_M_NOSTOP flag. But if the flag is set then the function completely resets the control register and sets the driver state to transfer completed. Something like this was previously done for a write with IIC_M_NOSTOP. Now it is done for a read with IIC_M_NOSTOP as well. Linux code says that the hardware does not support the repeated start condition and the documentation, indeed, does not mention it. But according to the Linux driver clearing the control register and then sending a start condition acts as if it were a repeated start. While here, add braces around a single-line 'if' branch to balance it with a multi-line 'else' branch. Tested with max44009(4). (cherry picked from commit 0deaf4be346f7f343bd2cf771bbf5d172d1c0d2a) --- sys/arm64/rockchip/rk_i2c.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c index cfaf3c7f871a..d2f1c2fc4a5b 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -282,13 +282,26 @@ rk_i2c_send_stop(struct rk_i2c_softc *sc) { uint32_t reg; - RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_STOPIEN); + if (!(sc->msg->flags & IIC_M_NOSTOP)) { + RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_STOPIEN); - sc->state = STATE_STOP; + sc->state = STATE_STOP; - reg = RK_I2C_READ(sc, RK_I2C_CON); - reg |= RK_I2C_CON_STOP; - RK_I2C_WRITE(sc, RK_I2C_CON, reg); + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg |= RK_I2C_CON_STOP; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); + } else { + /* + * Do not actually set stop bit, set up conditions to + * emulate repeated start by clearing all state. + */ + sc->state = STATE_IDLE; + sc->transfer_done = 1; + + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg &= ~RK_I2C_CON_CTRL_MASK; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); + } } static void @@ -351,9 +364,9 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc) case STATE_READ: rk_i2c_drain_rx(sc); - if (sc->cnt == sc->msg->len) + if (sc->cnt == sc->msg->len) { rk_i2c_send_stop(sc); - else { + } else { sc->mode = RK_I2C_CON_MODE_RX; reg = RK_I2C_READ(sc, RK_I2C_CON) & \ ~RK_I2C_CON_CTRL_MASK; @@ -370,7 +383,6 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc) RK_I2C_WRITE(sc, RK_I2C_CON, reg); RK_I2C_WRITE(sc, RK_I2C_MRXCNT, transfer_len); } - break; case STATE_WRITE: if (sc->cnt < sc->msg->len) { @@ -379,12 +391,10 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc) RK_I2C_IEN_NAKRCVIEN); transfer_len = rk_i2c_fill_tx(sc); RK_I2C_WRITE(sc, RK_I2C_MTXCNT, transfer_len); - break; - } else if (!(sc->msg->flags & IIC_M_NOSTOP)) { + } else { rk_i2c_send_stop(sc); - break; } - /* passthru */ + break; case STATE_STOP: /* Disable stop bit */ reg = RK_I2C_READ(sc, RK_I2C_CON); From nobody Wed Aug 6 05:55:46 2025 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 4bxffV68XFz64DPr; Wed, 06 Aug 2025 05:55:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxffV4Dj7z3sNk; Wed, 06 Aug 2025 05:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459746; 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=/23Og3gJeEi6lrCPtz/HOsUIUnGZphxz6vtGBg9qwyo=; b=sEg/E6MC31tDgnKlvjpqJbbVjfFbZ8ldpouMmqSP9eV1kWBlERxEvGes4HTF301peW2maJ id2GZk3SEtiiXFOAwlyn6X68m7jur3dZ7wiMPQ8SVCNBqxSxEd+No6o0aNfGtdnkTvIlZ/ LScQB5ahvETczETfLMDjCKbWUMUkvdnva8s2rhxCeg7qxfvSNEComMdMfOBYN/sg1a/sCc c+92B/f4zXU1YroO54TsmgGnlr9NXcVUVIhEtlV8y+CeQeqbZCIpKFUM6t0NYCyjxrJN97 Pg8xKFYkb6xujHsKmyliOJ7bA+4F4+dOxGl5XdEQcVmMAILIhxkTW8yIRBOtrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754459746; 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=/23Og3gJeEi6lrCPtz/HOsUIUnGZphxz6vtGBg9qwyo=; b=cKHTAhmJUwDFMYWO2YBZPGE96ao1xYO+St4Bwm/T0nGfX/C+v1rz97vEFPY3H33QHKxO+M wM/t9YppFi12UtD2nPKvAqKpK0SR+SpuPvz32h4A6swsUb7Ey9c1PP8Th7Bs13Laf4urGj oarmmQKTr8xleNkq8BszUtImK2svHspv0XLXAp/d5H9zRgYXR4IGrh7m93pckIq/qoOufv SQ5EX4JEAve9DwTP3jbuB/St/EHEkDvn/+EApyC147Uf/bBDZLDHbCS6tNbz9RmtbvWfi7 wPWEK340bMCZ/MDVvJG71ESB2GpsA04G6nUY31Xq3zwnP6nwTlgxzbbFjCyTPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754459746; a=rsa-sha256; cv=none; b=Kmon7fibBcBiwCFWBczVMGm12Gs5TpWfDRvLCmmCotZXC3OTxpg0bYLk4An221yGMGGXKv EGxTK/q9XvrL4YxvDEHUKG2d7EkeNFKxAu9pAwM10nIlJ2TCawzZ9o6sFG2h1O0ibHBy3B ogHxD46djFYc1637WQE0DLFyPON7F+0xltF/aWUYEsuXjJFnpmg9IXH29nJuRUe34MaMuw GHpfKlHoo77alDLUROaRm+rfRHTH8EoVUzyDSrzwJ1E5dkihgGg/v+8EUvBjFMC1jCs2yM S2fpIsQRvGxr2Qiclj/5dX+7F92MUDAnx0BOf3NY/Hq4fmdWME7UcgNqVHDBeg== 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 4bxffV3FwYz16lJ; Wed, 06 Aug 2025 05:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5765tk3N058310; Wed, 6 Aug 2025 05:55:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5765tkkM058307; Wed, 6 Aug 2025 05:55:46 GMT (envelope-from git) Date: Wed, 6 Aug 2025 05:55:46 GMT Message-Id: <202508060555.5765tkkM058307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: f8f0cae5e06b - stable/13 - rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8f0cae5e06bc3598cc97a618aad62e8c5671bfd Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=f8f0cae5e06bc3598cc97a618aad62e8c5671bfd commit f8f0cae5e06bc3598cc97a618aad62e8c5671bfd Author: Andriy Gapon AuthorDate: 2024-06-27 07:48:30 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 05:55:34 +0000 rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP Tested with max44009(4). (cherry picked from commit a743e280ea0541163afa7d1c320504925a02f80b) --- sys/arm64/rockchip/rk_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c index d2f1c2fc4a5b..a4cd07ae9bd4 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -526,7 +526,7 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) if (nmsgs - i >= 2 && msgs[i].len < 4 && msgs[i].flags == (IIC_M_WR | IIC_M_NOSTOP) && - msgs[i + 1].flags == IIC_M_RD && + (msgs[i + 1].flags & IIC_M_RD) == IIC_M_RD && (msgs[i].slave & ~LSB) == (msgs[i + 1].slave & ~LSB)) { sc->mode = RK_I2C_CON_MODE_RRX; From nobody Wed Aug 6 06:02:23 2025 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 4bxfp74Kh1z64Dkl; Wed, 06 Aug 2025 06:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfp73lfKz3t73; Wed, 06 Aug 2025 06:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460143; 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=/SMzlpA66f9bH9VpLqNO5QCxnXc+iM1xXZlhD5ROIpk=; b=k0SaWsJjM0Ze/ok3gbcpoinXVbqogJyaq4r3nn4d/ybV+zck5Y4hBI+ya1iPXTwxh/WJZU V+urn095Steo0fYwLqZwjJ0pue/8ZNzE65CjNqJqoWZqk3SYxVEkJiXYszilG5rDqPQyRd 9sYOS22sX8DSem4Pgsm+RyyqmJ+TlURSvc2ntuuHKYK2wsD/jnPxjWYOKhMbhXhyFP1gSt WBo0It5LdfJY/4fxhGmGAW2plNkI8rfC3a+df/Hz6Rec0XJRUircnnSx4/QWr9q96CmI6p fYVuf8xXsEviB8RKmgsHAMsvKfV8UaTZB3sPkddBDg9mSDq42ZrESnDU5E57wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460143; 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=/SMzlpA66f9bH9VpLqNO5QCxnXc+iM1xXZlhD5ROIpk=; b=xaotEfAYPfVkeN0OwArAQMqWRWjV7j1HWntzTtHAk6+qFimbcwwRWPFPdj8FuiH32YFGuo nFHw2ZQFOluLeHrMWmPiiq9TX9z7uT705/Quhip6NIlGijoOXdXEedSCREaujqG4MSoB5o MFBCIJxqRhpOxuGFcEU5liSxyZrDCcprIPzPxQZw2QwGvYTMNLv0fm4N5pabmJlzDSDHl1 0lCS1H3fsSPs8N128OaU2C61jfHx5W1r6JvT0AXT4zYO5T3LfzMdTLzTXzZ7Dcm6eWpVdM Zzbv7P6bJumCI14axNDY8Nkg1PwBbq9u6gzOsmNimiyQyCLwO41ks1jL/Kq9bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460143; a=rsa-sha256; cv=none; b=K/vmJcIMFop3AUx4Vyc2WKH846DRA9StCxAeunBu0rwd2DFGZvusU9uX3vrVR7eV/3Pfwl ggAu9hI6jLwLmIyjLYw2mBovzYJNC+fTTDVc2pAGEIcUK0PUOqZbIf1ZZbmjRtTWSE4KVC wjNYSjVTDt6vcyl/AfcBv0KoSiR9fmx1ipnXNw+ltFpsq1KkBMyYI+mEK9w5en/dB9r3Zf GGDcauVKMohWcnDL7RJSZS/EErfjZW2CyWSk+/O/0wm3C4u4KJwJouWngimnSPeLmjQHIp zFQgUYIp69wInB/QHuSMP6EH09ypOJ6iyk1JX6/iBQoCwnlCAB5p++XfqQw/ug== 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 4bxfp73BNMz17TN; Wed, 06 Aug 2025 06:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57662NoP076602; Wed, 6 Aug 2025 06:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57662NC5076599; Wed, 6 Aug 2025 06:02:23 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:02:23 GMT Message-Id: <202508060602.57662NC5076599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: ab8d88442fbb - stable/14 - rk3328_codec: add trivial set_sysclk method implementation 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ab8d88442fbbea9d6d57bb0359943514187c34cd Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ab8d88442fbbea9d6d57bb0359943514187c34cd commit ab8d88442fbbea9d6d57bb0359943514187c34cd Author: Andriy Gapon AuthorDate: 2025-06-23 21:07:48 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 05:56:23 +0000 rk3328_codec: add trivial set_sysclk method implementation The method does not change any settings, just returns success. This is to silence "pcm0: failed to set sysclk for codec node" message printed in audio_soc code. Previously, that message was printed only during boot which was tolerable. Recently something changed either in the sound infrastructure or in sound applications that I use and the message started to be printed regularly. (cherry picked from commit 99f436aec00ece1f56132a1fee972fc797bb1b42) --- sys/arm64/rockchip/rk3328_codec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/arm64/rockchip/rk3328_codec.c b/sys/arm64/rockchip/rk3328_codec.c index b797ac3d26b4..62818bbf7905 100644 --- a/sys/arm64/rockchip/rk3328_codec.c +++ b/sys/arm64/rockchip/rk3328_codec.c @@ -569,6 +569,12 @@ rkcodec_dai_setup_mixer(device_t dev, device_t pcmdev) return (0); } +static int +rkcodec_dai_set_sysclk(device_t dev, unsigned int rate, int dai_dir) +{ + return (0); +} + static device_method_t rkcodec_methods[] = { /* Device interface */ DEVMETHOD(device_probe, rkcodec_probe), @@ -578,6 +584,7 @@ static device_method_t rkcodec_methods[] = { DEVMETHOD(audio_dai_init, rkcodec_dai_init), DEVMETHOD(audio_dai_setup_mixer, rkcodec_dai_setup_mixer), DEVMETHOD(audio_dai_trigger, rkcodec_dai_trigger), + DEVMETHOD(audio_dai_set_sysclk, rkcodec_dai_set_sysclk), DEVMETHOD_END }; From nobody Wed Aug 6 06:02:24 2025 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 4bxfp86R9Sz64DnH; Wed, 06 Aug 2025 06:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfp84SNzz3t8p; Wed, 06 Aug 2025 06:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460144; 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=6L4RCFy5Erscy0J3NBlHiVrVM5EEQofEce8DukVLz1M=; b=O9SkJcbnbOGoCMvNNwR9J5qiEdsyGc5BcXdgee0u5besMjKO9Dj6+9YOmv2oVRaM7WyTJZ SW6bAAwsmv2dRFGFcz1CyeHJXfcJdoXAC6J/iGzUXcJy3kB+ERSXNEdHXMsu/20TkmTsnA ug3H/yuAH20hWafoU35Gi1hSGWlezvBc5hruIpA6AHlT+1fXwbO78rfYvUYsOVU3mUlq5w d3V4naPgKYKgnr6IzT/aJ8J/oF8psBPdIBlEkvvIII8r0RXOxx7p8OozBxzMrwvv+cXa0c OXTMlRLIiuHh/MRwx1loJbXwb11j3NzHxZhbHN/d/CYKGmwRUU0jmhzsuvjLSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460144; 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=6L4RCFy5Erscy0J3NBlHiVrVM5EEQofEce8DukVLz1M=; b=kYubtAf9uHtT7WONYoSxpiHHU4pw9oUAIVTXd3EG6LQAuGYV8cLVba1dFgmYo2Hm/4672r 3Wx1MUCFEnNrVF/RE418gdizPnjmJYR4fuI08Nf1eX9gXPSyM7qRkJb6ZDAutFtPID/jGm ZsEO1ajjZTW8p5KoSWn5fYyyVkl+YI3q3WpC8399jkWZYknS9Grl6wlV98Zfml0oIflpQL jefVoMkr3gySyiEKjexxSVhjC9bTQ8uduJ3511rqaVr6g81OC6GGtXDpGFJAjP3zW5EmPf Sv66mXzhaMgzZTQxYy1lO7yZJfLunwGnMPThl3m33nvFS3NjYb0JX4rGtf1rWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460144; a=rsa-sha256; cv=none; b=d8e8ZwMs44wsnqShpYAlJcYwTikRa7319Iw8u19xUmmP0RjxWy4QfVTFzqfmr3E4JHbm+x 7I8ezzYxkZ2x5OOJJFGCnMJhGpiNNzeD0njFwJwnRpRipaGCuCT5jKzcz5p2n4z/m32rg7 LU3SmNNpWmenuQ5/77NalyU7PXNQigzp1rT/h6TvgHYetBiuohOpHXZnq/CpaJbh8jQRLp hjdOk8NFNEYZ0xu3IbKYHFSbAU3cxlhbbg8VBvZxxGpLBs1zKUhTxXv0aJpvhCC3sdAUyy sE7x58Ft1dNwxj62XkwEgFdKPGEVaXZ0prRIl3y4iBmOXeG66pEDa8yau9+Gag== 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 4bxfp83sXDz17TP; Wed, 06 Aug 2025 06:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57662Ohq076636; Wed, 6 Aug 2025 06:02:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57662O27076633; Wed, 6 Aug 2025 06:02:24 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:02:24 GMT Message-Id: <202508060602.57662O27076633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: b91babab9596 - stable/14 - mmc_xpt: use strlcpy instead of strncpy 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b91babab95965209bae8388c1004d8c42fdc0547 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=b91babab95965209bae8388c1004d8c42fdc0547 commit b91babab95965209bae8388c1004d8c42fdc0547 Author: Andriy Gapon AuthorDate: 2025-06-23 21:31:04 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 05:56:44 +0000 mmc_xpt: use strlcpy instead of strncpy A better practice in general. (cherry picked from commit ad8d33679999c0e7f6fd2b77d2e414102bd365ec) --- sys/cam/mmc/mmc_xpt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index 41b3f5146530..7280890348c1 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -1214,9 +1214,9 @@ mmc_path_inq(struct ccb_pathinq *cpi, const char *hba, cpi->max_lun = 0; cpi->initiator_id = 1; cpi->maxio = maxio; - strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, hba, HBA_IDLEN); - strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strlcpy(cpi->hba_vid, hba, HBA_IDLEN); + strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = cam_sim_bus(sim); cpi->protocol = PROTO_MMCSD; From nobody Wed Aug 6 06:02:26 2025 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 4bxfpC1kBqz64Dw7; Wed, 06 Aug 2025 06:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfpB6zdXz3t7J; Wed, 06 Aug 2025 06:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460147; 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=xNgeDlmWL78w3Ldqdy6okB17rM3ZFquOSeHeiQbP9QY=; b=j9leDQurpkgeu3mjm4KJZMTSw1fk2mY0VIU2q1uCGShN02LGOMn+d6GU316bpOHEQFhiI6 XRw9TWdCPQTFRTePvNhqNc6goAau9Ss8o+oC8HbEIH5R6EQEfXsJrnIKUkZJy4WZFO48/8 fL4V87LOA0O5Juk1J9kgpQVITDvqRPNTh6Htiap/RjhBXKmEi0WxbbUDSf8XYYRzLSOfZx K8RbHawIJvs638KaOBz+2y3PPcCOLGCckYtdevuYpEz9H8tEbaP+fTZEy5rfW1V2Bx4eMb wgQllZ1bc8iN1yocQnVhHC3944MW50+38XEr4H4kbdPBIuFuoNG+YP+3LxPiUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460147; 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=xNgeDlmWL78w3Ldqdy6okB17rM3ZFquOSeHeiQbP9QY=; b=sBycvdFDXkmYtwO8r8OMnNHvsoMZBtarIJYp99W+Rs3PvW5Kd6KBK3b9sla9pUB7MtJbIn O8ZUCEngVBtJNiX2030uyT9gwDzgp31a3Lr5LmS0/k8aRa9cmSgJz+gTZ4VA+ci3G4251v kJSvz+P7K0qQq98FcXOLSJOP4EQWUbwVPR5qTe46aUpvTPyOWEWn2W5PVJ5ut8009Nxx2T 4UVtEb3n7juK12uTqmjjH1RZ6w5MJNgXl5djfkrZlyugWdZ5mPOczzhniUBOQ6y6nzjNXo VPgC2cuS6Yd4rCHwyk828M+T7xv7pAg4jHmfazW43fj1fMNkshPOZLxl73Uivw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460147; a=rsa-sha256; cv=none; b=lCbTT9jeQ9AFhdn8nnJtZkkxVIEJ70/sKC0ibuuOGutHyg3SMyraOc8M2lmSIdt4xZ2MyE b536hHOd/WsN901UrNrl5s+iCaLa1fFe74jPByl9zQFLlLXScA/5O7A5ZYjo1cCeZOFS0I OaYBDSFVvklMVkQX3/jw003iatahzh256fOZ13VCydaMR+3oZdvGoA64a1ha9h50ixpLF3 AyQ+wDY3Z61shNxTvZgw+wQZX6VL9zFQbfBMdKG9FlhYCPtHWlKjt9qJ6d480QeLCSh3jk paAbssM7SfhTkFBvNCs6NYre+z2DNRpDJKhjVgAEoGM5nFG1O9bZ6yB9Xpbpyg== 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 4bxfpB63Xbz17nL; Wed, 06 Aug 2025 06:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57662QDw076705; Wed, 6 Aug 2025 06:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57662Qm9076702; Wed, 6 Aug 2025 06:02:26 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:02:26 GMT Message-Id: <202508060602.57662Qm9076702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: d4d7b768bb8e - stable/14 - mmc_da: garbage-collect sdda_get_max_data 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d4d7b768bb8e6d1915f9bbb5ba1d2fc705ce1ec2 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=d4d7b768bb8e6d1915f9bbb5ba1d2fc705ce1ec2 commit d4d7b768bb8e6d1915f9bbb5ba1d2fc705ce1ec2 Author: Andriy Gapon AuthorDate: 2025-07-04 07:53:11 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 06:00:39 +0000 mmc_da: garbage-collect sdda_get_max_data The function is unused since 5aedb8b1d4a6. For information, in MMC CAM both XPT_GET_TRAN_SETTINGS and XPT_PATH_INQ obtain data using MMC_SIM_GET_TRAN_SETTINGS. So, "overlapping" information like ccb_trans_settings_mmc::host_max_data and ccb_pathinq::maxio is derived from the same source. That's why sdda_get_max_data was redundant. Reported by: bz (cherry picked from commit ad0c3859a9184036484c0cd63d7260a4a3d1ad2d) --- sys/cam/mmc/mmc_da.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 594426d288cf..d6f8b514e183 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1199,27 +1199,6 @@ sdda_get_host_caps(struct cam_periph *periph, union ccb *ccb) return (cts->host_caps); } -static uint32_t -sdda_get_max_data(struct cam_periph *periph, union ccb *ccb) -{ - struct ccb_trans_settings_mmc *cts; - - cts = &ccb->cts.proto_specific.mmc; - memset(cts, 0, sizeof(struct ccb_trans_settings_mmc)); - - ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - ccb->ccb_h.flags = CAM_DIR_NONE; - ccb->ccb_h.retry_count = 0; - ccb->ccb_h.timeout = 100; - ccb->ccb_h.cbfcnp = NULL; - xpt_action(ccb); - - if (ccb->ccb_h.status != CAM_REQ_CMP) - panic("Cannot get host max data"); - KASSERT(cts->host_max_data != 0, ("host_max_data == 0?!")); - return (cts->host_max_data); -} - static void sdda_start_init(void *context, union ccb *start_ccb) { From nobody Wed Aug 6 06:02:25 2025 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 4bxfpB3nNQz64Dw6; Wed, 06 Aug 2025 06:02:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfp95hkSz3tNR; Wed, 06 Aug 2025 06:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460145; 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=u4B09yxO8ndTGkTEanMyVZ7s5AyBxBvK6cK2s2YkAr8=; b=lwxWwpW9TEISW+HoqG5HtvKisGSwPizF2xrpCjRdJBfnJNhPuI9ruGFGiJDDRJBwNloLci yGYVN1bY0s7J4BMmSZplb6UvmXTPfhX+7+Cm2Aj4DJE4iEw9c6WHNANm3YZrJMGHX/jqqr 9rPYG6bbCA8r/vdXEIqEx4UDt3t3XTHjT3B2uFd5+mcyenHFL8Et6n7AlG5xK/Ssj7k8j8 +WSEt2UG2Wd/NvcHx4QvmxDqz0q+8qKRL33/8iwIHi+KWupRW9L3CW0JwK27wY6syQXGSy iLRrDxrnvLW12n+ULk5psoYQC0hu1AX31TzNcTQy4EpGrTfO09+mlrko1ncX9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460145; 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=u4B09yxO8ndTGkTEanMyVZ7s5AyBxBvK6cK2s2YkAr8=; b=YiYuEH4fc9HvxK5h1JioH0UkARyEKxaE33VhHsN6FxLg/y/CANC5S0TSuMwzuVYDA+mUM+ Wmxaq7Ev/fdQkrBhOS0cpKXMOI4qhbuGUfFgEdTxWLotwj1BBZA2SsAqvbKzhtB/19AWY3 pcjOjA/eL/UKIQKiC7lwQe/ebRkcUeUXKjv85strsCHl/r0gFkofsgEvf1UY3jlTNN9G2A PDIHwjBJ+ti/pVtNV4flk1hkaHLWzC2qmxtBzh3S3Q+Qr4AenbR1hLZHjhsfcYYydGko0G TvI2VH2bndgaCbtYJiHASAvDwlekzvj5Uj3j87uPGvFC14+l72OxPiWW5bt71Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460145; a=rsa-sha256; cv=none; b=fGQYuTl9v74DU6vQay6IByx+0SuRRwOyBGkBpNc/BFtbjomE0xQRELCUGIVVNVSewXJ0XS KlB1lzYiNL+zFjxwNmVoP12gNObq3kHFoiNYG91F+/L8rZgFTMSZTBDr+oLzGQQqSX3Sb6 XsivT8UdizO7IlfXAXXne8FQhRkVY9/OYRwOD936MVa2eYxOJSwEx9bbxXOo18IL5vean/ 7rQPZ8qoeKKr95FfYgedaMpm1EWtwfep5wzuEUuVmrgpPJr26v+cZxmXrNG0jmhs0Qxy/l 7mZRBa+Onh56DBzFHGK1wMUtLc2By3hxgUSb1A/iFNoc+Hh2fhlosepT1jqPXQ== 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 4bxfp955Slz17nH; Wed, 06 Aug 2025 06:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57662P1I076672; Wed, 6 Aug 2025 06:02:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57662P0v076669; Wed, 6 Aug 2025 06:02:25 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:02:25 GMT Message-Id: <202508060602.57662P0v076669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 9d5d9e723c4a - stable/14 - mmc_da: fix garbage in disk->d_attachment 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d5d9e723c4a73a3d816a5d2b0a1b7956d1cb87e Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=9d5d9e723c4a73a3d816a5d2b0a1b7956d1cb87e commit 9d5d9e723c4a73a3d816a5d2b0a1b7956d1cb87e Author: Andriy Gapon AuthorDate: 2025-06-23 21:43:35 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 06:00:39 +0000 mmc_da: fix garbage in disk->d_attachment The garbage resulted from reading the value from a ccb which was originally populated by XPT_PATH_INQ operation but then overwritten by XPT_GET_TRAN_SETTINGS operation. The problem could probably be fixed by re-ordering the XPT_GET_TRAN_SETTINGS operation, but it seems like the operation was redundant. Besides, the ccb is declared not as union ccb but as struct ccb_pathinq, so using it for XPT_GET_TRAN_SETTINGS was questionable. I opted for replacing a call to sdda_get_max_data (which uses XPT_GET_TRAN_SETTINGS internally) with using maxio provided by the XPT_PATH_INQ operation. This also required fixing mmc_cam_sim_default_action as controllers return maximum I/O size in sectors, but maxio value should be in bytes. (cherry picked from commit 5aedb8b1d4a6c099eaa0a65f8fcbdcc4aba8f75b) --- sys/cam/mmc/mmc_da.c | 4 +--- sys/cam/mmc/mmc_sim.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index de6e89a4da38..594426d288cf 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1573,9 +1573,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, part->disk->d_gone = sddadiskgonecb; part->disk->d_name = part->name; part->disk->d_drv1 = part; - part->disk->d_maxsize = - MIN(maxphys, sdda_get_max_data(periph, - (union ccb *)&cpi) * mmc_get_sector_size(periph)); + part->disk->d_maxsize = MIN(maxphys, cpi.maxio); part->disk->d_unit = cnt; part->disk->d_flags = 0; strlcpy(part->disk->d_descr, sc->card_id_string, diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c index 3033e327d0d5..7170ffe397c7 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -110,7 +110,7 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_INVALID; } else { mmc_path_inq(&ccb->cpi, "Deglitch Networks", - sim, mmc.host_max_data); + sim, mmc.host_max_data * MMC_SECTOR_SIZE); } break; case XPT_GET_TRAN_SETTINGS: From nobody Wed Aug 6 06:02:27 2025 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 4bxfpD2rccz64DnK; Wed, 06 Aug 2025 06:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfpC6kGHz3tVK; Wed, 06 Aug 2025 06:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460148; 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=vnHlmzdhMuKFdu3lKAow+EPEg4ljDRF07KaUr/zWa2o=; b=VTE1NIgXIDmE17dQ2uAy8dZEdSqoNg2g8KqAjFVkfDWlq7xJrSsJaRDM5CGSAtRvhh7JrE Bbqz/J22PEC4vzVsE3Cx/6rUkhVuwbWmtck4jvIapl5RLTgOTGHBWS+ibul1VUeI19fTJG UJa9HVyAwFFZNBl5uZcPa2YsWHmqDI22/zcLmdjKngQInfQwcQl8JTG4q6oGnQ42TMV9gB Ot+jUybPuFdBDENP44lDxUPQZALlzzr3bUI9niHRzeRLGOmP3hbYI+sLzUo1rbiSXAGaSy 4Ivh7rNxwDtZapeU4x6nQ9mVQJn78msg9SZYDHASGBrbKsEGIwKNpbYqG8aFGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460148; 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=vnHlmzdhMuKFdu3lKAow+EPEg4ljDRF07KaUr/zWa2o=; b=b0yHOi11QdNIwvSpjf1yznu3STnCioZF7F4s3uykGyy1sz3S2LnJPO5mpLTnrXIBrINvNX g0alygsbRNDWtV8uZ0QELGbjcH8HMH7FlRuW6/C7u0pqEWxtqrHx1t49qjx4HiVfPuu5Ov SBBPGPlXPs6KegzCSHLs09VvoOalLZXxfUllKL1HmjTKX8rp+nrz4C1vK/Fr5C8R8SYRmQ 133YqBNyzcnGaeDOnb91k1S5IMI/krvgLsFci1NusBHsmlke64xMOHEZLP7ds9cS+g3olF uSWMqYsG3AjDPNVor+rN+lA0Pl5/aD1HZH1ZJbzy6dGcFR/sk5t6ilBgyKkW/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460148; a=rsa-sha256; cv=none; b=euyJ2DxV+4Qo0KYTjn9lcVxePOh2SsgXu2lyWw41bvr0iuaZc8hNmMf/kkJK6NzHCPe6MO jGG6mp49aH/RADIRV/8yDUUdruE1dWxj0XWT97y0w6D25IDylEZc0hjo0QxQcWR28AjlEQ aoMyp3CktLjCUxIXY+Sk2WNsy+FKTblNjACr8YsZDxt/LslwhgodJgslFFkZpM1I6bofn4 FEh55cVWX1KAbiYBIdODvSOdXhcTMaJPCzjVJDHPGxGHcQ7cQ4PGE5nrfCjLdg+Ryv5yMd 669MdyI0oFEELTH7pjjNjvGlTD/IzaIkBpnvIjVP9GDWxqtvH/U8SE8N0dN12g== 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 4bxfpC6Khdz17KJ; Wed, 06 Aug 2025 06:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57662RJG076738; Wed, 6 Aug 2025 06:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57662Rn4076735; Wed, 6 Aug 2025 06:02:27 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:02:27 GMT Message-Id: <202508060602.57662Rn4076735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 48bd13dbf900 - stable/14 - cam_fill_mmcio: initialize cmd.error sub-field 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 48bd13dbf90022b0266d419d465160ffb01b8040 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=48bd13dbf90022b0266d419d465160ffb01b8040 commit 48bd13dbf90022b0266d419d465160ffb01b8040 Author: Andriy Gapon AuthorDate: 2025-06-23 21:30:23 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 06:00:39 +0000 cam_fill_mmcio: initialize cmd.error sub-field For me, this fixes a problem with using eMMC storage in MMCCAM configuration with dwmmc driver (on Rock64). The problem appeared after commit 07da3bb5d56c85 "mmc: support for SPI bus type". The problem was caused by the said commit changing the layout of struct mmc_ios which is embedded into struct ccb_trans_settings_mmc with the latter being embedded into struct ccb_trans_settings, a member of union ccb. The layout mattered for two reasons: 1. dwmmc sets cmd.error only in case of an error; 2. mmc_da's sdda_start_init uses the same ccb for different transaction types without explicitly clearing the object between transactions. As a result, cmd.error could start out with a non-zero value and dwmmc would keep that value which would then be interpreted as a failure. Such a failure happened in mmc_set_timing resulting in incorrect timing settings and subsequent complete failure to communicate with the eMMC module. Reviewed by: pkelsey (cherry picked from commit 10db2ad8614adc544292856c693503ca8e9c9fd9) --- sys/cam/cam_ccb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 47fb3d09664d..a86e83cfd063 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -1488,6 +1488,7 @@ cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, mmcio->cmd.opcode = mmc_opcode; mmcio->cmd.arg = mmc_arg; mmcio->cmd.flags = mmc_flags; + mmcio->cmd.error = 0; mmcio->stop.opcode = 0; mmcio->stop.arg = 0; mmcio->stop.flags = 0; From nobody Wed Aug 6 06:04:53 2025 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 4bxfs15PCMz64F83; Wed, 06 Aug 2025 06:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfs14MTXz3vXb; Wed, 06 Aug 2025 06:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460293; 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=hhaztQkDtAdTmNujEH2AecDBDospVMF4YwOfYbUcpfk=; b=xm74YMTDsN5xUMWdH2DRgERDCglJF4Yyp3l0/OoRt1ksfuRyps8xe7JtOKdiaW9YZJcLtp 0wo6U0yWxeWZfFyCDmnpNwshN4Tl7Zt6i59EPFkw07UHZKC7yJWPiIZ5VS+IYs/VcwR99N FKrebK9fFVOFGrorc9d+Rt6ThlaoVUPIihL18EhN3+zNzEBf1hhkmWahoYL1jB0QLZmP6O 0utjIiImId6MSkm7KGNTxDSD7OD+mnQOYKAY0jFDH2tUf/aAV2ND3Ajy+Anip6t9dCcCe8 FLSyI1nolHQtHX+VhqiWQIm0q+ecTRgPsgCW2lKRyWYBHzl9uiIP9NX2a7V6PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460293; 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=hhaztQkDtAdTmNujEH2AecDBDospVMF4YwOfYbUcpfk=; b=jBt/iIdF2wxkl9x+AMl6wn11JSpqIhUtiDslfuo2qopvkA3VAE+Ye7ZqpoZL1faeHU3Rxp yPmdjHd4zDnLlh7j7YGDsO2xpaUAz65+FdhkBtRJ9qP4lO4aemnWsOFRU52OlkhCgdhWjp osehZaMbIgDI3MQrxi5jF8m/JXVGv2ANitIteg2eyUZLF3CzR8qSah/BcwDc8aVmE4SQL6 GwT166Exe+2xA4u7D5vK/VhIKFwriTNCRTM1qe+rtr/PKEwwArYU5r18xFTxpVy2QXG1fG kqfPkvwPNA0za5XgasRgu0MWo/mTeuUYNLdU2CPGg5ojcr4l0pwUe0okU2KLYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460293; a=rsa-sha256; cv=none; b=mmQLUMAkJq/ryH5lAYadxeg2DrKjtJckaVFNXlHZFv+JOCISLk4NKuRLaGamdkvHOnPKmz DhFBvHckRPEKgoUem3pJHW1y8g7SP1selx+0Avumr0/FX/nE3CJsdEoyDSWhnrzZC02Zs3 FDsU8fqOp5pffisU5WSJe/czQAlP8jYvQmemYtGJU5o8l5/A23N/LgFBCTvMiEZQpPxbOf cdWzaIVLT4UyD/jS9osD6pGaecoomPH5bajQM5+6MQzfbMaEVWl3ZgozvyD8efTm5mLtA2 MYsWjCLmOWPNUsLerRumzQoj1WUqhYxWv/zYqQO8jmLEFYC1KaaZpbvm9gehhw== 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 4bxfs13hTrz17qm; Wed, 06 Aug 2025 06:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57664rNJ077626; Wed, 6 Aug 2025 06:04:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57664rLn077623; Wed, 6 Aug 2025 06:04:53 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:04:53 GMT Message-Id: <202508060604.57664rLn077623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: be941fa4830f - stable/13 - mmc_xpt: use strlcpy instead of strncpy 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: be941fa4830fc7f9da6a34af70ac52780048037b Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=be941fa4830fc7f9da6a34af70ac52780048037b commit be941fa4830fc7f9da6a34af70ac52780048037b Author: Andriy Gapon AuthorDate: 2025-06-23 21:31:04 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 06:04:23 +0000 mmc_xpt: use strlcpy instead of strncpy A better practice in general. (cherry picked from commit ad8d33679999c0e7f6fd2b77d2e414102bd365ec) --- sys/cam/mmc/mmc_xpt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index c957a1ef5e41..a92628f2befa 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -1223,9 +1223,9 @@ mmc_path_inq(struct ccb_pathinq *cpi, const char *hba, cpi->max_lun = 0; cpi->initiator_id = 1; cpi->maxio = maxio; - strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, hba, HBA_IDLEN); - strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strlcpy(cpi->hba_vid, hba, HBA_IDLEN); + strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = cam_sim_bus(sim); cpi->protocol = PROTO_MMCSD; From nobody Wed Aug 6 06:04:54 2025 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 4bxfs24q0fz64Dns; Wed, 06 Aug 2025 06:04:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfs238kmz3vPZ; Wed, 06 Aug 2025 06:04:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460294; 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=g72JawPpQrbNJV+XsYeiQUKJGrJXbXndaMtEB9TjNmE=; b=Lw9wdqSB3nz+3tFaJBs+WQNLJgElmoURTI7e0pe+LnQeiAkwtiB1A/oFkRKOjVg3/SpWQb nXuF351Tj8mLR+Gj8CH/zdX9G1ljVxssLsPYU0U2SLWkk3jq1hJnn/+ZtoetgAjZXQ6cFZ J5avnoe1CjAfGMKamoNBkeG5soAvWegOXjpEoL5+COznNc/QXzYM3n+hUhbQaQ4/wKHeVW XFF/oVRhly/6YE3Ozn13nkMD5ITQ55WV11oWXjb2Tsk69hbfSXNsoJcaEMW1ZA93YgqBty 5isf+puywNfXIh3wG/q9rvowakHhyJbRuumnzSLTiWViGD4xhtW5X0tig9L/XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460294; 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=g72JawPpQrbNJV+XsYeiQUKJGrJXbXndaMtEB9TjNmE=; b=bvg82f+fCkhxVLYGma7b/tRABJxmUOf8gBjemFWI3Aki7vmczi411Q/thgtCGLhqhSwddP x9iruWf2N7yPqzXxsMvri661nc1JrDVhrhDn14eCML9GiRNY4ZfdC8QjAZSDk/+FfF2b6g hKrTW6q+DIDZl375oZ19WZt0sWPGOJrH55G1EzTrlhsfSwpsyKozwv4bikACtbkEOpMpCc eHxoRYlhjeFyPqgjavGm4aI4h3Z3MHULUuVC4h67E30ARv/AOrqBpytRF2oJUlcU1cBvJq TYTmbFmiZnmk8JBgK5BXXAcHERNkavVZ71AW58mZGj+ORaDetKKdlp9XXk57Lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460294; a=rsa-sha256; cv=none; b=e70U+EZ/VUI2ZYDlCbivjG0t+1r211Bm/EdH8zxBc+UagvW4Vvc87l3c8A6hv7Ag3Y5FWH rlRaBs9xaBr4lZCrqhrBO7O2K+F3dQyGSAQvqko2PcWVDJ4BHQd/0eyiQjgwapsa1C6fDF p6jJ5fYlPwuM0ZuWnL/HAXrOXJSIDUfsDOoq9cEYoUz1jMnFq43kzRnm+eh0yhQZj246sy 6XEqyUY/7hpZjUQuaElfQOEq6babgD6XIQ9KvR/mf2IjeV9Y2naL60MqRV8WPIt/g3RYi1 mLW+XduX0mCf51jBSBhMEma8TaSqNkpwKKrHO8r8VAy5RARSubkLupLLoHtwHg== 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 4bxfs22WMfz17cP; Wed, 06 Aug 2025 06:04:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57664s4C077660; Wed, 6 Aug 2025 06:04:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57664sFA077657; Wed, 6 Aug 2025 06:04:54 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:04:54 GMT Message-Id: <202508060604.57664sFA077657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 7293d8210412 - stable/13 - mmc_da: fix garbage in disk->d_attachment 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7293d821041206d0c520e798d3faa2a0639dea29 Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=7293d821041206d0c520e798d3faa2a0639dea29 commit 7293d821041206d0c520e798d3faa2a0639dea29 Author: Andriy Gapon AuthorDate: 2025-06-23 21:43:35 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 06:04:27 +0000 mmc_da: fix garbage in disk->d_attachment The garbage resulted from reading the value from a ccb which was originally populated by XPT_PATH_INQ operation but then overwritten by XPT_GET_TRAN_SETTINGS operation. The problem could probably be fixed by re-ordering the XPT_GET_TRAN_SETTINGS operation, but it seems like the operation was redundant. Besides, the ccb is declared not as union ccb but as struct ccb_pathinq, so using it for XPT_GET_TRAN_SETTINGS was questionable. I opted for replacing a call to sdda_get_max_data (which uses XPT_GET_TRAN_SETTINGS internally) with using maxio provided by the XPT_PATH_INQ operation. This also required fixing mmc_cam_sim_default_action as controllers return maximum I/O size in sectors, but maxio value should be in bytes. (cherry picked from commit 5aedb8b1d4a6c099eaa0a65f8fcbdcc4aba8f75b) --- sys/cam/mmc/mmc_da.c | 4 +--- sys/cam/mmc/mmc_sim.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 81cbccb62693..6ea05863d646 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1573,9 +1573,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, part->disk->d_gone = sddadiskgonecb; part->disk->d_name = part->name; part->disk->d_drv1 = part; - part->disk->d_maxsize = - MIN(maxphys, sdda_get_max_data(periph, - (union ccb *)&cpi) * mmc_get_sector_size(periph)); + part->disk->d_maxsize = MIN(maxphys, cpi.maxio); part->disk->d_unit = cnt; part->disk->d_flags = 0; strlcpy(part->disk->d_descr, sc->card_id_string, diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c index 434cd6c65e64..809e682fc061 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -110,7 +110,7 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_INVALID; } else { mmc_path_inq(&ccb->cpi, "Deglitch Networks", - sim, mmc.host_max_data); + sim, mmc.host_max_data * MMC_SECTOR_SIZE); } break; case XPT_GET_TRAN_SETTINGS: From nobody Wed Aug 6 06:04:55 2025 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 4bxfs361D8z64F9X; Wed, 06 Aug 2025 06:04:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfs340HZz3vTr; Wed, 06 Aug 2025 06:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460295; 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=p0tpkq+jq6d/Bka+y303I+UG+s64JGNmxG800yTxX6M=; b=NeXk4JXj6kYtcIIDxSjQu0pnJvhNYao3FuzjmmzZ5Buxc71yrUPEL/IcE8O8ixQac2GMZO Y+7icL4dZsM7tDVs1nrJjdCLzPiN1L5wczGNTiGv0eTr/OzkCTdNjZ0sex1p4bCB2g6PVJ hptCqPwpNYTUJkF8Z2RIF7mdPLs4KTNGyYUxfEZLlsT25PSR9O+CVE/3CS+pjmRBhdMEuq l2ICiRH7WVZQnAv7AFjmpfpdZBCfxHYQo0U7v6dhUEH7X2EX1VjQgHytGS9bBtB2Abj7f0 AnXL/Lwyjejxdpq7hG/QQlgAhVHmc84b2gK95uKzvNUc7bgD5l6GLuxc1kV52Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460295; 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=p0tpkq+jq6d/Bka+y303I+UG+s64JGNmxG800yTxX6M=; b=taSLzqYhIoyoMHdRRK1l5lFq2RvRgR+kOtei7VYR8xv46RHVnmPUoytyY/oJn2gugMykSH IS1xRVWYNGfan9HdoLGqiGqInPhEi4tjfZEhtGl/DmHczPQPLP61xvZ9JPbIHKzjk+UJEp 6I2tCq0L13SzT2EgwgUqI/xhWyaqElUaora06cAgD0QQOhH3RljMyQHOu+xOuOB3uijt4c XVIfe4nSkMq89Ml/EbTpxwPqi9otutqB+EOMLPjIZ8W+3QzltXx8GWOMrDnobq7G+ji2Jo 4xdGdjknt/vrphQ294lWLHKf+7RS8/qcBzYyWYkcaMZvEE2EA+CInZhPozyC5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460295; a=rsa-sha256; cv=none; b=AUtbb121C5QHWNC0cHCc7JtMXjESETRCjzBNqH6LVLCQkIH+Lw0oq9B1NP2Q7b5BHVCURY nMciEwXsx+UTaUqLahaUsI9f/O51J5ocO7mgo7FU/cCS0Og4VbSw6PpoYituSYcJFwdtcA KQJE9qsvOe+jPngeYeTlBfdF+W06/f9r4JUD8APxDw6nA7oorT6YDulwAzFy4tSGJsla/i UnoNEYZhL1FibYkKmC+DEcQkwr+co6XmrRiDiF0G1XlBY16iCifTmeqzHQC5twApah4dJI g0M6q7s8v/0I/Bn6TVXeXvqFDVn1/efWivo/iuJrUonV7RfOQdLPN9mtqiHrUA== 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 4bxfs33N9wz17nN; Wed, 06 Aug 2025 06:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57664toO077695; Wed, 6 Aug 2025 06:04:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57664tBg077690; Wed, 6 Aug 2025 06:04:55 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:04:55 GMT Message-Id: <202508060604.57664tBg077690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 706291eddb45 - stable/13 - mmc_da: garbage-collect sdda_get_max_data 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 706291eddb45a9afd8e690dc8d7e2c8d6bad6084 Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=706291eddb45a9afd8e690dc8d7e2c8d6bad6084 commit 706291eddb45a9afd8e690dc8d7e2c8d6bad6084 Author: Andriy Gapon AuthorDate: 2025-07-04 07:53:11 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 06:04:32 +0000 mmc_da: garbage-collect sdda_get_max_data The function is unused since 5aedb8b1d4a6. For information, in MMC CAM both XPT_GET_TRAN_SETTINGS and XPT_PATH_INQ obtain data using MMC_SIM_GET_TRAN_SETTINGS. So, "overlapping" information like ccb_trans_settings_mmc::host_max_data and ccb_pathinq::maxio is derived from the same source. That's why sdda_get_max_data was redundant. Reported by: bz (cherry picked from commit ad0c3859a9184036484c0cd63d7260a4a3d1ad2d) --- sys/cam/mmc/mmc_da.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 6ea05863d646..8f9646f7b98f 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1199,27 +1199,6 @@ sdda_get_host_caps(struct cam_periph *periph, union ccb *ccb) return (cts->host_caps); } -static uint32_t -sdda_get_max_data(struct cam_periph *periph, union ccb *ccb) -{ - struct ccb_trans_settings_mmc *cts; - - cts = &ccb->cts.proto_specific.mmc; - memset(cts, 0, sizeof(struct ccb_trans_settings_mmc)); - - ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - ccb->ccb_h.flags = CAM_DIR_NONE; - ccb->ccb_h.retry_count = 0; - ccb->ccb_h.timeout = 100; - ccb->ccb_h.cbfcnp = NULL; - xpt_action(ccb); - - if (ccb->ccb_h.status != CAM_REQ_CMP) - panic("Cannot get host max data"); - KASSERT(cts->host_max_data != 0, ("host_max_data == 0?!")); - return (cts->host_max_data); -} - static void sdda_start_init(void *context, union ccb *start_ccb) { From nobody Wed Aug 6 06:04:56 2025 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 4bxfs53NxXz64F9Y; Wed, 06 Aug 2025 06:04:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxfs44qjyz3vk6; Wed, 06 Aug 2025 06:04:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460296; 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=U8IhG0iNLNrkfsaCs1VlhGErD+yunbBtex8zgJcVjs8=; b=R6S9NC+iUUNi/XIiY0V7Y/E8XFtstq3QBjc7RukRQIN3qRk4Bnrhe89wcWMgw6HXPH0DZH rKWkfm47ap4mAeDviWVsdULp/Q/ifhcsJt927qe4Q+b/Xy2+p0XAVeLHiz/CtbBq4iX4Fg NIz7Vg2V4T/uqcjpn3GP0WA6rLyJTg8vFDgfJdchCriuvKELKUmwmWna5+GnydCELUK1ho ZtszAk3yK5nMVoABBgMCiGJpmd1kGjSTwUptGGTvNal3dy+ZjMtp101e4lEP4CiPm3QoDq 9rzIH6sTvnaBX/SjjVQ69aptJkgJBOq+l3d6qxq/27sbB19tFUJR94MKq9Z8SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754460296; 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=U8IhG0iNLNrkfsaCs1VlhGErD+yunbBtex8zgJcVjs8=; b=genZuBBW5MrmWf1fUAhaS/Iz7x79MCFOWyKIvarK8k/VQNWRGonBomtGM7axGyTQDEdQqV f+hEcfmOQtrT/5uZSoo+/zC2/+O8TxqO2NYPrBsayOtnuR0RoRF58+K6G9DgAMLqHM0aLK yVejafP1TkQAnZgGKIb+NckWSjborNyL8LMRHfIaJpeacE2bKdmIZ6etAWZgI55mN2tSK7 FgDGHa3SkDsLQjebCMd0xkb/e59XlFZnV/1DQGx1Xnlc4CSB4YWiO457A60VKcCbJjAXPg ZRXPPULgyMbS94OhBeE3R50Zjgfs6rYYLJurOhTirZItF4oi/opOM4/oBS/eqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754460296; a=rsa-sha256; cv=none; b=vNzCLyFlp8l+Uuvt7vRFYWAmZByqWsZRj2WY3rwn83ayBtK2Fi/qoyFmJdkb/9cNtunc+X u0vTd1/N2wtNqNpIfUcKmtUstUcKV5eTH5z3Qr+uG4TNEua6175uxzRrWcTaileIXFI42N 0HeuAMFcKeOZr2+qJRgzlIcKKFOngyTeOVVuKSEr8GbSxYTIPYapY/aX4cEocKAK8xjxqL RI8BqKFlrCvL9FcTcRpdNVvqJXF3DEXYD5K7lnRFN4JEJDyiQgINHOPsF6/rSFmHuM6UED yuJ6uDMm5/9rGjqHXQ0n2/RUx7DOOoFo81xJK7foXiPM0ru4FX5bwQoHTZzc0Q== 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 4bxfs4474Lz17KK; Wed, 06 Aug 2025 06:04:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57664ueN077730; Wed, 6 Aug 2025 06:04:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57664uXI077727; Wed, 6 Aug 2025 06:04:56 GMT (envelope-from git) Date: Wed, 6 Aug 2025 06:04:56 GMT Message-Id: <202508060604.57664uXI077727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: aadc10e7ce1a - stable/13 - cam_fill_mmcio: initialize cmd.error sub-field 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aadc10e7ce1a8bb47cd628a2111b71fac3684915 Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=aadc10e7ce1a8bb47cd628a2111b71fac3684915 commit aadc10e7ce1a8bb47cd628a2111b71fac3684915 Author: Andriy Gapon AuthorDate: 2025-06-23 21:30:23 +0000 Commit: Andriy Gapon CommitDate: 2025-08-06 06:04:36 +0000 cam_fill_mmcio: initialize cmd.error sub-field For me, this fixes a problem with using eMMC storage in MMCCAM configuration with dwmmc driver (on Rock64). The problem appeared after commit 07da3bb5d56c85 "mmc: support for SPI bus type". The problem was caused by the said commit changing the layout of struct mmc_ios which is embedded into struct ccb_trans_settings_mmc with the latter being embedded into struct ccb_trans_settings, a member of union ccb. The layout mattered for two reasons: 1. dwmmc sets cmd.error only in case of an error; 2. mmc_da's sdda_start_init uses the same ccb for different transaction types without explicitly clearing the object between transactions. As a result, cmd.error could start out with a non-zero value and dwmmc would keep that value which would then be interpreted as a failure. Such a failure happened in mmc_set_timing resulting in incorrect timing settings and subsequent complete failure to communicate with the eMMC module. Reviewed by: pkelsey (cherry picked from commit 10db2ad8614adc544292856c693503ca8e9c9fd9) --- sys/cam/cam_ccb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index cccebbfeb199..9a3cc5fcbbb1 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -1480,6 +1480,7 @@ cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, mmcio->cmd.opcode = mmc_opcode; mmcio->cmd.arg = mmc_arg; mmcio->cmd.flags = mmc_flags; + mmcio->cmd.error = 0; mmcio->stop.opcode = 0; mmcio->stop.arg = 0; mmcio->stop.flags = 0; From nobody Wed Aug 6 15:32:24 2025 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 4bxvRs076lz63s8K; Wed, 06 Aug 2025 15:32: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxvRr6YPqz47Nv; Wed, 06 Aug 2025 15:32:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754494344; 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=g+1zEnnmjyXPOth9OqhNFY8GzgL2BYchUHcsDuwnMQ8=; b=h+wObDFnGI2EiANtF0fN8Sq3y2r4J/wYutOIoFvhOrgQ4eFoaV33lI4g4xO+oAO6OpI1lm ms6Wb00j+ceDCL6IUadLwNAHvysPtMHjDtACOTwYtSMONysPxCqCapBIks1SgBMx/Yqjrp 9ShruONvq7VQcDkwENnB4PusAcDysAdbPIxNFRs20CU3GmE6s0IGq2M/v9o39i7Ly8gQy3 SOwTfYBsrN4riqXC1ihwV8tsUrsKLYy5Na4s7+S2tiLi/wmLxTN6ghqOUgXjRNyDKLVtAj lN5YatRUsg8eSQz+DjnOLqajMvNh9KNawVthRjUwBOCyJCabCXUjWgWoLqIoXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754494344; 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=g+1zEnnmjyXPOth9OqhNFY8GzgL2BYchUHcsDuwnMQ8=; b=oekfsr8nt1z4XAax2fkJ4FW9qcgB3JWjxgcN4xzitd/ORLif4n9nAkaRMN2EWuHB8fhf4K s3Nubh+q99zymbvRSWcvFbsA8Ye6W0iuWichf+ayiPlEGW+HcPtdMGLY+1uUapASO1WEXW 2PHDq+W8sW1upRBnYwEmxJyaUwENeKZ/v2aG96Gv4mH3MK7DWJh5XAd6oARAurKibOk5a1 +fYKQqD6jnFAS2BPeDbH+ycamJUF6uE84VfkUQ3VEb8XonY5IPYqorUrXWGl8EvSCov8ne 8h0l8aX7TCvRidgQfC3WBfELItI04Cb3GCjElq6n9K5N66eQmehTqgfNqKhw5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754494344; a=rsa-sha256; cv=none; b=UvwO2B2HhK34O2HkEaBEg5//no2i7P6t2uwFWtRBrORZVTEehuHLo+tNvLkH5RrzQvTNsH 0b0exX4jNF730YtL1UW3y2SNn13v1eXL4ZP97DP1UbyXlSvdjIBNfm4dEyBSakH2UGHwL9 2vr9sk7U1388gptNusbwZFhM52gG1XwCZp5ddwOq1alAPel/UScB5Q1dOsyBxX9r/uzqus RBDPCvFonztq5mF4njniUcVrjpBHICIfCfCu4RCKByknw1s1s9FosDkVKqDWvf/9CQaCjk WYwrfxM3bbjJkh6nb0fpXl4sBu1+OpmkksqE8mLLwvUkkYmdH3p90l0SkdvRgg== 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 4bxvRr68WZzBHX; Wed, 06 Aug 2025 15:32:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 576FWOBx047923; Wed, 6 Aug 2025 15:32:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 576FWOJT047920; Wed, 6 Aug 2025 15:32:24 GMT (envelope-from git) Date: Wed, 6 Aug 2025 15:32:24 GMT Message-Id: <202508061532.576FWOJT047920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 627831eba3de - stable/14 - netlink: Fully clear parser state between messages 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 627831eba3deb2644edc2b92c4ce8365321b8930 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=627831eba3deb2644edc2b92c4ce8365321b8930 commit 627831eba3deb2644edc2b92c4ce8365321b8930 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-31 10:06:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-06 13:52:12 +0000 netlink: Fully clear parser state between messages Failing to reset the cookie between messages can lead to an attempt to interpret a zeroed buffer as a struct nlattr, causing a length calculation to underflow, resulting in a memcpy() call where the length exceeds the actual size of the buffer. MFC after: 1 week PR: 283797 Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D51634 (cherry picked from commit a8d90e32133b77a49c2551f22e59f72d65293b64) --- sys/netlink/netlink_io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c index 0ca71fb6219b..c6827c76c623 100644 --- a/sys/netlink/netlink_io.c +++ b/sys/netlink/netlink_io.c @@ -520,6 +520,7 @@ static void npt_clear(struct nl_pstate *npt) { lb_clear(&npt->lb); + npt->cookie = NULL; npt->error = 0; npt->err_msg = NULL; npt->err_off = 0; From nobody Wed Aug 6 15:32:27 2025 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 4bxvRv5W1lz63rv4; Wed, 06 Aug 2025 15:32: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxvRv474hz47d7; Wed, 06 Aug 2025 15:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754494347; 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=CoTYhSrykCK75bC/s/CvHz0dIfnMbvfzNVwau9wq9r0=; b=kwy0AzRym+3HoiCSopFKeKW22ILtXzEerAN9/Z1zofjHUZNN52NCC7vKt9NMVbr/O6LbhP 8+DXfaH/iR46US9fS47dLxOXO/9aPMCxgHjxusdBL3EZEefb9FRILqqlYgkjZUHgcPyZl6 1K99W1BDfN6w9V2Ronthtoy5k12Hov/PvDA+z0P86dy5O89RwbmSwl4ZQyVXKRr40Df1d8 BQjia1Axqul9zYgexv4j6g2aD+Cz9n2shoRsMug/2+QWScdPoOdrAtSozd28KKZscM70Hh Rf/Dq6CHUqp+wBsa3DWX0E1jmlFE32K1tGFlzIjgcrw8IZj5FCTo5pmpPdJC3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754494347; 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=CoTYhSrykCK75bC/s/CvHz0dIfnMbvfzNVwau9wq9r0=; b=gkRNYyS4GrvihOwpbFhMJKQhKLVPGF9VhCBRns3V1rP/dqVzhdzXAP1wht9rzGflnbcHdN PCWK/rbpqVfXfla6Sa1sJZM52fYNNrMLBRW0HXPqeDCe0lcaMRNwAvw/e/2QnFyKUqE6cA cEL7s1D7fLSiv2sUoYIsYpNSlyJuSgVL8UfzVjURSYayKTBoBDXYk1vrk1qTYNHgBTjNsi uSsd4tT5MkiFQbBVLxPDLXopFM1udPW9hIxgGCKi85Cl4cEQBN1fOxL3daPZSKDIzIBFG+ IctgbjEba/LUDRVvXru+Fk0xHoEElmGPQOSvucicD6dVZK09xpPvYcUx9QQtjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754494347; a=rsa-sha256; cv=none; b=QrW/gRRi6J2X6oH5JJt3uvORzrgfT8lHugJLLsbsrvh0E9lRlViaCUvqNNfSaALLoNEkMU yfYm1skocSs0dCQVBNSZsqQAnqpW9By3RTXCmk5Jui1rR8VfzfAZpmVd2oY3Un40EAiF4e +B/fz/I/kBXwuLV0GWu8gFxNplx3oWjtl/229lED2hB0p7l5Sc6UJ7400yHLqa3YhvGhE4 KxOwJDjh5gB23IaG2dzPIFWUrEJUdytXGW/Oc4oB4pcJ6wZbHoYkBE9RmeAj/fvafj4QRH jsQmkEUO/NQH4qHa4hWcwDrrPFiMFhOtxXjGnWkvGOGQYqiuCzBiSCr7Tro5Jg== 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 4bxvRv11VXzBF5; Wed, 06 Aug 2025 15:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 576FWR7I048995; Wed, 6 Aug 2025 15:32:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 576FWRQG048992; Wed, 6 Aug 2025 15:32:27 GMT (envelope-from git) Date: Wed, 6 Aug 2025 15:32:27 GMT Message-Id: <202508061532.576FWRQG048992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f318186deb3e - stable/13 - netlink: Fully clear parser state between messages 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f318186deb3ef3b90104e8372563e80c9358183e Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f318186deb3ef3b90104e8372563e80c9358183e commit f318186deb3ef3b90104e8372563e80c9358183e Author: Dag-Erling Smørgrav AuthorDate: 2025-07-31 10:06:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-06 13:52:14 +0000 netlink: Fully clear parser state between messages Failing to reset the cookie between messages can lead to an attempt to interpret a zeroed buffer as a struct nlattr, causing a length calculation to underflow, resulting in a memcpy() call where the length exceeds the actual size of the buffer. MFC after: 1 week PR: 283797 Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D51634 (cherry picked from commit a8d90e32133b77a49c2551f22e59f72d65293b64) --- sys/netlink/netlink_io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c index d33a3ace9e36..baa7e3350caf 100644 --- a/sys/netlink/netlink_io.c +++ b/sys/netlink/netlink_io.c @@ -454,6 +454,7 @@ static void npt_clear(struct nl_pstate *npt) { lb_clear(&npt->lb); + npt->cookie = NULL; npt->error = 0; npt->err_msg = NULL; npt->err_off = 0; From nobody Fri Aug 8 00:39:02 2025 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 4bylX66Jynz63kfS; Fri, 08 Aug 2025 00:39:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylX629LYz3WlS; Fri, 08 Aug 2025 00:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613542; 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=xgBdjPWRXa6z/aVSS6Tg8Ap6Rg8hkBv5lCGPuIyRYB0=; b=ZVT4XyvP2jTj/ow9e/6pvVqE9ID0pR021XKU6iVHpmPmFEQlPpBzgpkFiHu7iuXOnWj8Ws BEtR709uR0zT4NM3m4lALWbZyzweV7t0dOK/sM3nUl3hh37z46G6bLVNUSWmGhp+BYrlFs isMh0prsoWzjGrsVYUiicDLx/4IeMg26p57xY3JEC/A0QN4vKMNQbBvq+QITv07HbdH3GE h2Ov6CmuONpMKkkPWtxpSJOO4R2wl+sWVvSbrlaELXsDehB99aKDu9m+ojAVrM+IdYWbSF 5PIMx5ojr/kweqCg2sgHHMJWCEN2vL/U1ARIX/eaOGePUzBxMvJur0NaEpMGnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613542; 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=xgBdjPWRXa6z/aVSS6Tg8Ap6Rg8hkBv5lCGPuIyRYB0=; b=uxOa+T9sP4yWyJHlMbcX57So0DOucwICNO4PdSa5kG5RjjE9wikZT9pmjPu30gR6XVmtKh hYjwZyRjENiel/HXNHWT3FuOwVGHGfe8O8O0rnF6DQT2UV0AsdRvqLM55JDn2gKMzlhbgY Pi1z0uaJEs+P54QDg5H0ZbQNeAYqWNHKMycWfFDNJ8DCRWzyeM8igTE8PbFC8tsJBZWszY Hepd5CUQRYY4IMNoifd1bieOHVivbsz16vcaIWoVxDWLOAGB5xjrFND/MiVMt0b0oIAoSy QE2UJZyi9u4mGunbeHJ9X8Lf3zcOsrjvwO1jAN38v/wXOot0jFl81BDpCybjfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613542; a=rsa-sha256; cv=none; b=nXOyM1cC3iiZ3I+Ay4JAzIK3U+QNXs83Vx7PwWpCzi8rIUeizCpl3RTKRZZMczbOW/gNe4 wylAr8vWyaFcmX4vFmZzkdlB8n1iUL2ZLlbFvAYTly1n5d5wGbOpjZLcg9QSR4ySxqWyvI RFgoob1QjybbwKGyCU6C3eyRtH/CTKRN1i2i3u+VblhJ0AfnrmOVc5VFe/PhsCgjAUK1dw rrZEKoT6MSa0E7Z+qIOAHrIbO5TxuMVlnB+CWsGL60z8W7X1yGne7Fs8VgAkAPYNGi+YRt zzMyVajA8iWXoVvxyGdUk5bErX66JWSvr2T9pNovvyLwlHOUTPtCOMcdBELImQ== 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 4bylX61NV6z1Rxw; Fri, 08 Aug 2025 00:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780d29o073624; Fri, 8 Aug 2025 00:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780d2JD073621; Fri, 8 Aug 2025 00:39:02 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:02 GMT Message-Id: <202508080039.5780d2JD073621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: ce4fe4c4bfcd - releng/14.3 - Add a new sysctl in order to diffrentiate UEFI architectures 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: ce4fe4c4bfcd5908b5f4121623f6640e15261bc8 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=ce4fe4c4bfcd5908b5f4121623f6640e15261bc8 commit ce4fe4c4bfcd5908b5f4121623f6640e15261bc8 Author: Ahmad Khalifa AuthorDate: 2024-06-03 01:40:43 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-07 23:10:00 +0000 Add a new sysctl in order to diffrentiate UEFI architectures With the new 32-bit UEFI loader, it's convenient to have a sysctl to figure out how we booted. Can be accessed at machdep.efi_arch Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 (cherry picked from commit b538d4911004ca541507166b8ec9689d2e87d1aa) (cherry picked from commit 0e8890a425bc778d323566c881e26bad7c54baf2) Approved by: so Security: FreeBSD-EN-25:12.efi --- stand/efi/loader/bootinfo.c | 8 +++++++- sys/amd64/amd64/machdep.c | 21 +++++++++++++++++++++ sys/x86/include/metadata.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 5afb4c78353e..2961b8b97fb7 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -447,9 +447,15 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) module = *modulep; file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module); #endif -#if defined(EFI) && !defined(__i386__) +#ifdef EFI +#ifndef __i386__ file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST); #endif +#if defined(__amd64__) || defined(__i386__) + file_addmetadata(kfp, MODINFOMD_EFI_ARCH, sizeof(MACHINE_ARCH), + MACHINE_ARCH); +#endif +#endif #ifdef LOADER_GELI_SUPPORT geli_export_key_metadata(kfp); #endif diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index ea0f164b2e56..9644e167d54d 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1691,6 +1691,27 @@ SYSCTL_PROC(_machdep, OID_AUTO, efi_map, efi_map_sysctl_handler, "S,efi_map_header", "Raw EFI Memory Map"); +static int +efi_arch_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + char *arch; + caddr_t kmdp; + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + + arch = (char *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_ARCH); + if (arch == NULL) + return (0); + + return (SYSCTL_OUT_STR(req, arch)); +} +SYSCTL_PROC(_machdep, OID_AUTO, efi_arch, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + efi_arch_sysctl_handler, "A", "EFI Firmware Architecture"); + void spinlock_enter(void) { diff --git a/sys/x86/include/metadata.h b/sys/x86/include/metadata.h index dbc6d3275e53..b3eb4b16c1ba 100644 --- a/sys/x86/include/metadata.h +++ b/sys/x86/include/metadata.h @@ -34,6 +34,7 @@ #define MODINFOMD_EFI_FB 0x1005 #define MODINFOMD_MODULEP 0x1006 #define MODINFOMD_VBE_FB 0x1007 +#define MODINFOMD_EFI_ARCH 0x1008 struct efi_map_header { uint64_t memory_size; From nobody Fri Aug 8 00:39:03 2025 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 4bylX743twz63kfT; Fri, 08 Aug 2025 00:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylX730QPz3WWC; Fri, 08 Aug 2025 00:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613543; 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=sKobaSA0EdSEm6f48+nCOSZ2PtMEiSa4FQJzqZJbZWU=; b=k/eMMTIIdYAeHoquEdRkCrU1XgNXKNX9AKsxVpnZ7x/N06QE1lUpCROf6ddQJO2LOantiV YV69dCgNmVW5ft1DlGTvCljUBAKYEDuuFqe3K+8wHdBzqm+AkfXrPYctm+RbC2t+1fFV4b DtXrsA45RdhXyV0q+K1nQfbkOqddMY9W3giDtRoV7+JvDyMuQib84igJGTOIUKFU9wNiUN 2z7WKkt9Nansr1A2l/4KE/DM1Jo7ukm/b5Wadilb8ZnpAym7nXo/DbK5KQ76NSgvb90L+M fYFePeXbSA7YTMvwiM96z8mm3cz7vaMCWyQ2iJWqTBVrSxBhgu8XjqAEyv0Cdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613543; 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=sKobaSA0EdSEm6f48+nCOSZ2PtMEiSa4FQJzqZJbZWU=; b=o59ToFmRN3mZHkh5c1wSD09zdFNhYg793zjhis+x9LE0ZBv1QPw3Iow+GHMvyXWbXHmsCb LpqYfpfMqtVP8f6hVQdFoLsqGyhmiwhu+4J5t9P3bDbUnMetUI1jXlmbjiiFEUD9YDYGSS vdMzUpuuIMGpjGWoNBHQI8M4VibNGF0pyVvZzcXwe+Q4RCwhyHNzrtNfKZ2xExqss7rNJn isDCPCVXxBkrXNUNKYgVziRRmuJnOOF9IL++dhIP6haTEIjU9ahZgjMAJzdf8KDO0KOQNj cIX8a1Xr1UI3JA/pQNFUsGbqbyrei+qTPmon/KX2WgyQ+ZTPBTDx2BvBRTSSLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613543; a=rsa-sha256; cv=none; b=r1wFDmDfOhlsDOeLelacdx9P+Te3dupKbf8nSDDgS/MtmPqcL5gBoflWEQyUqG/0aQH4/C Jej5jY2Cfkh4OiEVMkBn1vqon+ULjv8wgIe1ZUx0+IhHIQG98z6CI9BIE44p8FCAd3oktF 4adPo/RGX5cNFlRZK3Bn3EWx30zSERcsqgzyrzzlQyxRT/ptdi5Pr2hfim/TPzbOmm4s4o q3+RVQhhoHa0HfGD1gnmmL3WUCDnZkXKJUBJhteG+56Fkkj4nLwAo70M/8o0yiQEoUIphc 1/OOiEztZZ18cCD9oPKfaP4gQ7FO6BRgJAIx8JUz6lF+UD6cb8TPzrkJjOejTg== 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 4bylX72bYNz1Rxx; Fri, 08 Aug 2025 00:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780d3FM073658; Fri, 8 Aug 2025 00:39:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780d3Uj073655; Fri, 8 Aug 2025 00:39:03 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:03 GMT Message-Id: <202508080039.5780d3Uj073655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: a3bd81ddfe29 - releng/14.3 - net80211: fix TKIP trailer trimming w/ no rx parameters given 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: a3bd81ddfe2912afb824e322fddc576cde72e376 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=a3bd81ddfe2912afb824e322fddc576cde72e376 commit a3bd81ddfe2912afb824e322fddc576cde72e376 Author: Adrian Chadd AuthorDate: 2025-06-02 00:11:40 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-07 23:21:08 +0000 net80211: fix TKIP trailer trimming w/ no rx parameters given Previous work made trimming the TKIP trailer an optional thing based on what the driver indicated it did with the received frame. However, for drivers that aren't populating an RX frame with an rx status - notably iwn(4) - exposed this bug. If the driver doesn't expose any RX status then just restore the previous behaviour. This matches what was done in the CCMP code in ccmp_decap(). Locally tested: * iwn(4), STA mode, CCMP + TKIP groupwise network Differential Revision: https://reviews.freebsd.org/D50638 Fixes: 731ff40069d28 Reviewed by: bz Approved by: so Security: FreeBSD-EN-25:13.wlan_tkip (cherry picked from commit 36fcd52c2bd5a8a4b3d584564852f417fb83e762) (cherry picked from commit 950343a170f06a0651b725058e0669b8d03b9d24) --- sys/net80211/ieee80211_crypto_tkip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index ca474b504fff..0506e2df6545 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -370,7 +370,7 @@ finish: /* * Strip the ICV if hardware has not done so already. */ - if (rxs != NULL && (rxs->c_pktflags & IEEE80211_RX_F_ICV_STRIP) == 0) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_ICV_STRIP) == 0) m_adj(m, -tkip.ic_trailer); return 1; From nobody Fri Aug 8 00:39:04 2025 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 4bylX85QqGz63ksH; Fri, 08 Aug 2025 00:39:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylX83dC5z3WWF; Fri, 08 Aug 2025 00:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613544; 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=cBPwj0y+X0Q2OxqCH+HR7jPeg3ifP28M/lAg5F7mfCk=; b=uE0Lf5ilUHP3aQI1xC8JOJq/us8H1Bet8tK7HCYAlfywy4Ct5m1jCXqCLHcVZamEOx377t v5DsLIMKnKqM6U4qkDL186HzQ+CCEmEVGZLcsbAnK9oV9L5hG53oheriZiy+ivxGic7QtJ HB7Qwmnocu3+edossWtj9ZKXXDUaHnVPxwnAtQ42KS3ZGjpXfPcTwXPoZUzQ2EIHoAjx7w 4tSeGwnrqc+cU1nYfDLXFSIKCfqVD3hZvUBG1lL5KOLFnLsHyPZO7R5pYdTMR7pgf9PaZ+ l15wtG6UxkpS/EB8Ykr6sscy2VQYU0J0UA/wsZRTdrrIiR0Ud1oWFpBOCdSLVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613544; 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=cBPwj0y+X0Q2OxqCH+HR7jPeg3ifP28M/lAg5F7mfCk=; b=pDLpzbDEo5ld4fumwX/6G6aUJYyL5RJCrbIoXn9Ge0gLFbwTfBAFCGLhls5+noX5QraW3W QW7096+2dnobq2VC1X324oNwxO4xLu3Hi5C1h5gzGOtDlTPs2bUhCnRECvBtuVm8PRddK3 LAXLm0EGWe0A96gsgoZHx8pyucqeGQ1tDHz4AKGXslktKULVroaCc9MrdgG2yEFDewGvni 1thGy0j+YfszTeNWTeqPMBju9OzYW16DkuGm/5k030oZ5nKTrS75ocw6ut5tso0uO08R22 AStNZMoTKiSVW86Cn37LhOpxxKIL6cpVUwt80YtCxd42gIIXf3c0ChLXmGMh/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613544; a=rsa-sha256; cv=none; b=uv6htYFm0J+5BHCl8iB5zSb11Jjd5Inotcmdf0fs/xmS/AJc2KPzjK4Un0UiCaL2b1nJoL uzlNyhcpcJHSTjGgvu31rD+f49HxUzCXDgiBO/huAGUno+jQ0pdhnoW8G2uqBy5qIdlEz5 1gqSFyVKYXAokHxX7nQQxEbfhQBdVeT3aq2odcgFAkVNxo0taUlWOdrYyfa9u8bOEbYRk2 lC35Go08zxQz8TsMCFRVLsCiF0ktciANWMQHuWmBHopBd0SGK2ud2hNGxrtS+eGs7qPvx4 bzhHvZl4AB7crtL0UOTNUVchtCsZMIX6JyBQ+tYmPdR7DfdDNQvsNfn/qolAcQ== 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 4bylX83Ctfz1SN1; Fri, 08 Aug 2025 00:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780d4Xh073693; Fri, 8 Aug 2025 00:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780d4pZ073690; Fri, 8 Aug 2025 00:39:04 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:04 GMT Message-Id: <202508080039.5780d4pZ073690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 97f34921d77b - releng/14.3 - route: fix `route -n monitor` when its output is redirected 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 97f34921d77b62721da53dbde19851cd38efe5c5 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=97f34921d77b62721da53dbde19851cd38efe5c5 commit 97f34921d77b62721da53dbde19851cd38efe5c5 Author: Oleg Streejak AuthorDate: 2025-07-17 17:06:50 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-07 23:22:27 +0000 route: fix `route -n monitor` when its output is redirected This is a small oversight in the transition to netlink; the non-netlink implementation would explicitly flush its stdout as necessary to avoid apparent long stalls in output when we end up fully-buffered. Adjust the netlink implementation to do the same. This was noticed while trying to triage failures in the wg-quick script. Commit message by kevans, patch by author. PR: 278265 Fixes: 091fec1188929 ("route: switch transport protocol [...]") Approved by: so Security: FreeBSD-EN-25:14.route (cherry picked from commit 97b61b22edba74c62adba1d022fb73541aa5ff93) (cherry picked from commit dd695839efd80fe81143cd6c7a552c30df8448f6) --- sbin/route/route_netlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c index 28766b062e18..2870d256aadd 100644 --- a/sbin/route/route_netlink.c +++ b/sbin/route/route_netlink.c @@ -733,6 +733,7 @@ print_nlmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct snl_msg_info *cinf print_nlmsg_generic(h, hdr, cinfo); } + fflush(stdout); snl_clear_lb(&h->ss_cmd); } From nobody Fri Aug 8 00:39:05 2025 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 4bylXB6kjlz63jgf; Fri, 08 Aug 2025 00:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylXB1SGCz3WcY; Fri, 08 Aug 2025 00:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613546; 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=/R/SZDOFuB8Rdq14pP0OBi0AP/icRcd4RFN7ETuvVyI=; b=dQfPeAWk7DnT1JVrPmRClfld4cNtBHlqegO0PxMkB7AnbgBm1Al7KdbeXdxcGTCJmM2Qzk di/wjI2mEjiBH4YDY9jPwnZ6UPud2/FLnjfmtEyEkLLmJUl4wfBqbaLUZPQX/g3r/+klWu RqUmpWJJVqgV4UI+L04DyDVGtxoraXCoCFKCjcT6Q+YcQ+y1KPqTf3KH0A0H1Q+bZvmwXn Rg+ucaUVvFd+tSFhB/oMTsYmf8p+7HkCRrOn4UoxzEi0sf9yJytycr29JITI8E+1xgJvf+ 2fPgBmuoWg98YymzAJNve7jIv3g7h6mrfUCdW/liyyGLk8hEO9AUn3+pjwbp+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613546; 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=/R/SZDOFuB8Rdq14pP0OBi0AP/icRcd4RFN7ETuvVyI=; b=AfzNRXyy4yFqtO84LDTFHfJ5WZpzMJpoR9kZhrDON9IXQ/dqFXm2IWTooF9tgmOE4hMkQa ITZZdMQ4MTQvlJRuu2AcKMc8f+QW78qsotr82QJTCoSdeITtzbG4gfV/B1rGpmM+G4qVk1 qsZ6O0Dujr3U8YhvsbR0Yt617JkLND2rPK99XNcCC5K1dePKGjAIXM2QEgx5hoOTvOZama qxbx55nLUi+xKqtGl7K5xYM4uBSb+bDxbQt2XKkgM/drCVhHddHIQUaAOUQR+b3CcZmGjo r2x7nozA1jsP8BbbznDU7VelZko75+b9crjhwg5iNoEVdfgfJQgrLVkoKBdZLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613546; a=rsa-sha256; cv=none; b=TaAItys4eeHaPeuJ/LVyyt+DOVYEqBokIQrgWNHt6f6KtVqN+iHvo6D2xaw09LDtjC9jzW Z7ZUBiO93IF71ujIIP//erB/5Fi9cFFBxVnqRx0gUpodviMVlvQpwGE/8BaIDlFyA5RcN0 zaXTS95gcHFqeOo6rWFQ7ckIYtd7vKIpn0OEdIhVhukoJDZsnZIcIjMCitglkc8ZSvDpA7 MvcwTOS5xCQuKGEpx54ql9gEJI8q8fBoWMmEIL9Zq5ekrJj0iOy3TGbqooieQXn9QWifkl ZLjoqKXH4/Wu9H/43fm3VMwMrGTEsnuFTft9AnYbPpGScaH8yreiN09MwGADgQ== 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 4bylXB08s7z1Rck; Fri, 08 Aug 2025 00:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780d55r073729; Fri, 8 Aug 2025 00:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780d5tM073723; Fri, 8 Aug 2025 00:39:05 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:05 GMT Message-Id: <202508080039.5780d5tM073723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: fb780a82dfbd - releng/14.3 - libarchive: merge from vendor branch 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: fb780a82dfbde953dae414f42b99157cade2517a Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=fb780a82dfbde953dae414f42b99157cade2517a commit fb780a82dfbde953dae414f42b99157cade2517a Author: Martin Matuska AuthorDate: 2025-06-01 20:16:26 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-07 23:57:20 +0000 libarchive: merge from vendor branch libarchive 3.8.1 New features: #2088 7-zip reader: improve self-extracting archive detection #2137 zip writer: added XZ, LZMA, ZSTD and BZIP2 support #2403 zip writer: added LZMA + RISCV BCJ filter #2601 bsdtar: support --mtime and --clamp-mtime #2602 libarchive: mbedtls 3.x compatibility Security fixes: #2422 tar reader: Handle truncation in the middle of a GNU long linkname (CVE-2024-57970) #2532 tar reader: fix unchecked return value in list_item_verbose() (CVE-2025-25724) #2532 unzip: fix null pointer dereference (CVE-2025-1632) #2568 warc: prevent signed integer overflow (CVE-2025-5916) #2584 rar: do not skip past EOF while reading (CVE-2025-5918) #2588 tar: fix overflow in build_ustar_entry (CVE-2025-5917) #2598 rar: fix double free with over 4 billion nodes (CVE-2025-5914) #2599 rar: fix heap-buffer-overflow (CVE-2025-5915) Important bugfixes: #2399 7-zip reader: add SPARC filter support for non-LZMA compressors #2405 tar reader: ignore ustar size when pax size is present #2435 tar writer: fix bug when -s/a/b/ used more than once with b flag #2459 7-zip reader: add POWERPC filter support for non-LZMA compressors #2519 libarchive: handle ARCHIVE_FILTER_LZOP in archive_read_append_filter #2539 libarchive: add missing seeker function to archive_read_open_FILE() #2544 gzip: allow setting the original filename for gzip compressed files #2564 libarchive: improve lseek handling #2582 rar: support large headers on 32 bit systems #2587 bsdtar: don't hardlink negative inode files together #2596 rar: support large headers on 32 bit systems #2606 libarchive: support @-prefixed Unix epoch timestamps as date strings #2634 tar: Support negative time values with pax #2637 tar: Keep block alignment after pax error #2642 libarchive: fix FILE_skip regression #2643 tar: Handle extra bytes after sparse entries #2649 compress: Prevent call stack overflow #2651 iso9660: always check archive_string_ensure return value CVE: CVE-2024-57970, CVE-2025-1632, CVE-2025-25724, CVE-2025-5914, CVE-2025-5915, CVE-2025-5916, CVE-2025-5917, CVE-2025-5918 PR: 286944 (exp-run, main, libarchive 3.8.0) Approved by: so Security: FreeBSD-SA-25:07.libarchive (cherry picked from commit 2e113ef82465598b8c26e0ca415fbe90677fbd47) (cherry picked from commit 6dad4525a2910496ecf3c41de659aac906f6c1f4) --- contrib/libarchive/COPYING | 2 +- contrib/libarchive/NEWS | 8 + contrib/libarchive/README.md | 9 +- .../github_actions/install-macos-dependencies.sh | 19 + contrib/libarchive/cpio/cpio.c | 2 +- contrib/libarchive/cpio/test/test_format_newc.c | 12 +- contrib/libarchive/cpio/test/test_option_a.c | 2 +- contrib/libarchive/cpio/test/test_option_c.c | 8 +- contrib/libarchive/libarchive/archive.h | 57 +- contrib/libarchive/libarchive/archive_acl.c | 14 +- .../libarchive/libarchive/archive_acl_private.h | 2 +- contrib/libarchive/libarchive/archive_cmdline.c | 2 +- .../libarchive/archive_cryptor_private.h | 8 + contrib/libarchive/libarchive/archive_digest.c | 344 +- .../libarchive/libarchive/archive_digest_private.h | 35 +- .../libarchive/archive_disk_acl_freebsd.c | 4 +- contrib/libarchive/libarchive/archive_entry.c | 54 +- contrib/libarchive/libarchive/archive_entry.h | 84 +- .../libarchive/archive_entry_link_resolver.c | 8 + .../libarchive/libarchive/archive_entry_locale.h | 2 +- .../libarchive/libarchive/archive_entry_private.h | 13 +- .../libarchive/libarchive/archive_hmac_private.h | 2 +- contrib/libarchive/libarchive/archive_match.c | 102 +- contrib/libarchive/libarchive/archive_options.c | 4 +- .../libarchive/archive_options_private.h | 4 +- contrib/libarchive/libarchive/archive_pack_dev.h | 2 +- .../{archive_getdate.c => archive_parse_date.c} | 65 +- contrib/libarchive/libarchive/archive_platform.h | 5 + .../libarchive/libarchive/archive_platform_acl.h | 2 +- .../libarchive/libarchive/archive_platform_xattr.h | 2 +- contrib/libarchive/libarchive/archive_ppmd7.c | 11 +- contrib/libarchive/libarchive/archive_ppmd8.c | 15 +- .../libarchive/libarchive/archive_ppmd_private.h | 18 +- .../libarchive/libarchive/archive_random_private.h | 2 +- contrib/libarchive/libarchive/archive_rb.h | 2 +- contrib/libarchive/libarchive/archive_read.c | 6 - .../libarchive/archive_read_append_filter.c | 4 + .../libarchive/archive_read_disk_entry_from_file.c | 2 +- .../libarchive/archive_read_disk_posix.c | 9 +- .../libarchive/archive_read_disk_private.h | 7 +- .../libarchive/libarchive/archive_read_format.3 | 15 + .../libarchive/libarchive/archive_read_open_fd.c | 42 +- .../libarchive/libarchive/archive_read_open_file.c | 121 +- .../libarchive/archive_read_open_filename.c | 61 +- .../archive_read_support_filter_by_code.c | 14 - .../archive_read_support_filter_compress.c | 3 +- .../libarchive/archive_read_support_filter_lz4.c | 1 - .../libarchive/archive_read_support_format_7zip.c | 445 +- .../archive_read_support_format_by_code.c | 15 - .../libarchive/archive_read_support_format_cab.c | 7 +- .../libarchive/archive_read_support_format_cpio.c | 22 +- .../archive_read_support_format_iso9660.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 73 +- .../libarchive/archive_read_support_format_rar.c | 184 +- .../libarchive/archive_read_support_format_rar5.c | 101 +- .../libarchive/archive_read_support_format_tar.c | 409 +- .../libarchive/archive_read_support_format_warc.c | 7 +- .../libarchive/archive_read_support_format_xar.c | 355 +- .../libarchive/archive_read_support_format_zip.c | 33 +- contrib/libarchive/libarchive/archive_string.c | 141 +- .../libarchive/archive_string_composition.h | 3 +- .../libarchive/libarchive/archive_string_sprintf.c | 11 +- contrib/libarchive/libarchive/archive_time.c | 163 + .../{archive_getdate.h => archive_time_private.h} | 26 +- contrib/libarchive/libarchive/archive_util.c | 76 +- .../libarchive/archive_version_details.c | 405 +- contrib/libarchive/libarchive/archive_write.c | 2 +- .../archive_write_add_filter_b64encode.c | 2 +- .../libarchive/archive_write_add_filter_gzip.c | 19 +- .../libarchive/archive_write_add_filter_uuencode.c | 2 +- .../libarchive/archive_write_disk_posix.c | 15 +- .../libarchive/archive_write_open_filename.c | 8 +- .../libarchive/archive_write_set_format_7zip.c | 298 +- .../libarchive/archive_write_set_format_gnutar.c | 16 +- .../libarchive/archive_write_set_format_iso9660.c | 25 +- .../libarchive/archive_write_set_format_mtree.c | 123 +- .../libarchive/archive_write_set_format_pax.c | 6 +- .../libarchive/archive_write_set_format_xar.c | 692 +- .../libarchive/archive_write_set_format_zip.c | 986 +- .../libarchive/archive_write_set_options.3 | 43 +- contrib/libarchive/libarchive/libarchive-formats.5 | 20 +- .../libarchive/libarchive/test/read_open_memory.c | 2 +- .../libarchive/test/test_7zip_filename_encoding.c | 200 +- contrib/libarchive/libarchive/test/test_acl_pax.c | 8 +- .../libarchive/test/test_acl_platform_nfs4.c | 10 +- .../libarchive/test/test_acl_platform_posix1e.c | 3 +- .../libarchive/libarchive/test/test_acl_posix1e.c | 8 +- contrib/libarchive/libarchive/test/test_acl_text.c | 2 +- .../libarchive/test/test_archive_match_time.c | 71 +- ...archive_getdate.c => test_archive_parse_date.c} | 21 +- .../test/test_archive_string_conversion.c | 4 +- .../libarchive/test/test_compat_gtar_large.c | 224 + .../libarchive/test/test_compat_solaris_tar_acl.c | 4 +- .../libarchive/test/test_compat_star_acl.c | 6 +- contrib/libarchive/libarchive/test/test_entry.c | 2 +- .../libarchive/libarchive/test/test_open_file.c | 9 +- .../test/test_read_disk_directory_traversals.c | 2 +- .../libarchive/test/test_read_format_7zip.c | 315 +- .../test_read_format_7zip_deflate_powerpc.7z.uu | 55 + .../test_read_format_7zip_extract_second.7z.uu | 22 +- .../test/test_read_format_7zip_lzma2_powerpc.7z.uu | 48 + .../test/test_read_format_7zip_lzma2_riscv.7z.uu | 49 + .../test/test_read_format_7zip_lzma2_sparc.7z.uu | 51 + .../test/test_read_format_7zip_sfx_elf.elf.uu | 9442 ++++++++++++++++++++ .../test_read_format_7zip_sfx_modified_pe.exe.uu | 109 + .../test/test_read_format_7zip_sfx_pe.exe.uu | 4751 ++++++++++ .../test/test_read_format_7zip_zstd_sparc.7z.uu | 59 + .../test/test_read_format_gtar_redundant_L.c | 40 + .../test_read_format_gtar_redundant_L.tar.Z.uu | 16 + .../libarchive/test/test_read_format_gtar_sparse.c | 8 +- .../test/test_read_format_gtar_sparse_length.c | 53 + .../test_read_format_gtar_sparse_length.tar.Z.uu | 12 + ...est_read_format_gtar_sparse_skip_entry.tar.Z.uu | 18 +- .../libarchive/test/test_read_format_rar.c | 74 +- .../libarchive/test/test_read_format_rar5.c | 29 +- .../test/test_read_format_rar5_unicode.rar.uu | 18 +- .../test/test_read_format_rar_encryption.c | 4 +- .../test/test_read_format_rar_endarc_huge.rar.uu | 4 + .../test/test_read_format_rar_newsub_huge.rar.uu | 5 + .../test/test_read_format_rar_overflow.c | 48 + .../test/test_read_format_rar_overflow.rar.uu | 11 + .../test/test_read_format_rar_symlink_huge.rar.uu | 5 + .../test_read_format_tar_empty_with_gnulabel.c | 2 +- .../test/test_read_format_tar_mac_metadata.c | 85 + .../test_read_format_tar_mac_metadata_1.tar.uu | 231 + .../test/test_read_format_tar_pax_g_large.c | 53 + .../test/test_read_format_tar_pax_g_large.tar.uu | 49 + .../test/test_read_format_tar_pax_negative_time.c | 68 + .../test_read_format_tar_pax_negative_time.tar.uu | 60 + .../libarchive/test/test_read_format_warc.c | 24 + .../test/test_read_format_warc_incomplete.warc.uu | 10 + .../libarchive/test/test_read_format_zip.c | 5 +- .../test/test_read_pax_empty_val_no_nl.c | 65 + .../test/test_read_pax_empty_val_no_nl.tar.uu | 60 + .../libarchive/test/test_read_position.c | 2 +- .../libarchive/libarchive/test/test_sparse_basic.c | 8 +- .../libarchive/libarchive/test/test_tar_large.c | 2 +- .../libarchive/test/test_write_disk_perms.c | 8 +- .../test/test_write_disk_secure_noabsolutepaths.c | 4 +- .../libarchive/test/test_write_filter_gzip.c | 5 +- .../libarchive/test/test_write_format_7zip.c | 6 + .../libarchive/test/test_write_format_7zip_large.c | 6 + .../libarchive/test/test_write_format_gnutar.c | 29 +- .../test/test_write_format_mtree_preset_digests.c | 2107 +++++ .../libarchive/test/test_write_format_tar_sparse.c | 4 +- .../libarchive/test/test_write_format_xar.c | 39 + .../test/test_write_format_zip64_stream.c | 192 +- .../test/test_write_format_zip_compression_bzip2.c | 362 + .../test_write_format_zip_compression_lzmaxz.c | 425 + .../test/test_write_format_zip_compression_store.c | 277 +- .../test/test_write_format_zip_compression_zstd.c | 366 + .../test/test_write_format_zip_entry_size_unset.c | 150 +- .../libarchive/test/test_write_format_zip_file.c | 164 +- .../test/test_write_format_zip_file_zip64.c | 192 +- .../libarchive/test/test_write_format_zip_large.c | 35 +- .../libarchive/test/test_write_format_zip_stream.c | 156 +- contrib/libarchive/libarchive_fe/passphrase.c | 10 +- contrib/libarchive/tar/bsdtar.1 | 74 +- contrib/libarchive/tar/bsdtar.c | 35 +- contrib/libarchive/tar/bsdtar.h | 12 +- contrib/libarchive/tar/cmdline.c | 2 + contrib/libarchive/tar/subst.c | 1 + contrib/libarchive/tar/test/test_list_item.c | 63 + contrib/libarchive/tar/test/test_list_item.tar.uu | 169 + contrib/libarchive/tar/test/test_option_C_mtree.c | 4 +- .../{test_option_P.c => test_option_P_upper.c} | 0 .../libarchive/tar/test/test_option_ignore_zeros.c | 4 +- contrib/libarchive/tar/test/test_option_mtime.c | 82 + contrib/libarchive/tar/test/test_option_s.c | 14 +- contrib/libarchive/tar/test/test_stdio.c | 48 +- contrib/libarchive/tar/util.c | 57 +- contrib/libarchive/tar/write.c | 4 + contrib/libarchive/test_utils/test_common.h | 2 +- contrib/libarchive/test_utils/test_main.c | 192 +- contrib/libarchive/test_utils/test_utils.c | 48 + contrib/libarchive/test_utils/test_utils.h | 11 +- contrib/libarchive/unzip/bsdunzip.c | 21 +- contrib/libarchive/unzip/la_getline.h | 16 + lib/libarchive/Makefile | 3 +- lib/libarchive/tests/Makefile | 35 +- usr.bin/tar/tests/Makefile | 5 +- 181 files changed, 25587 insertions(+), 2345 deletions(-) diff --git a/contrib/libarchive/COPYING b/contrib/libarchive/COPYING index 1b9723574a7b..9d0bcf81ff61 100644 --- a/contrib/libarchive/COPYING +++ b/contrib/libarchive/COPYING @@ -20,7 +20,7 @@ the actual statements in the files are controlling. libarchive/mtree.5 * The following source files are in the public domain: - libarchive/archive_getdate.c + libarchive/archive_parse_date.c * The following source files are triple-licensed with the ability to choose from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 6af50e4e4033..caca7d5cbdb9 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,11 @@ +Jun 01, 2026: libarchive 3.8.1 released + +May 20, 2025: libarchive 3.8.0 released + +Mar 30, 2025: libarchive 3.7.9 released + +Mar 20, 2025: libarchive 3.7.8 released + Oct 13, 2024: libarchive 3.7.7 released Sep 23, 2024: libarchive 3.7.6 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 933de6986425..0d63357292ec 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -85,13 +85,14 @@ Currently, the library automatically detects and reads the following formats: * PWB binary cpio * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) - * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) + * ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives (including archives that use zstandard compression) * Microsoft CAB format * LHA and LZH archives * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * WARC archives * XAR archives The library also detects and handles any of the following before evaluating the archive: @@ -120,15 +121,18 @@ The library can create archives in any of the following formats: * PWB binary cpio * shar archives * ZIP archives (with uncompressed or "deflate" compressed entries) + * ZIPX archives (with bzip2, zstd, lzma or xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * ISO9660 format - * 7-Zip archives + * 7-Zip archives (including archives that use zstandard compression) + * WARC archives * XAR archives When creating archives, the result can be filtered with any of the following: * uuencode + * base64 * gzip compression * bzip2 compression * compress/LZW compression @@ -241,4 +245,3 @@ questions we are asked about libarchive: appropriate. It has many advantages over other tar formats (including the legacy GNU tar format) and is widely supported by current tar implementations. - diff --git a/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh new file mode 100755 index 000000000000..2aa4823fc3d0 --- /dev/null +++ b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -eux + +# Uncommenting these adds a full minute to the CI time +#brew update > /dev/null +#brew upgrade > /dev/null + +# This does an upgrade if the package is already installed +brew install \ + autoconf \ + automake \ + libtool \ + pkg-config \ + cmake \ + xz \ + lz4 \ + zstd \ + libxml2 \ + openssl diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c index 6bc6eb22e967..2bf1bfa2985a 100644 --- a/contrib/libarchive/cpio/cpio.c +++ b/contrib/libarchive/cpio/cpio.c @@ -1206,7 +1206,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else strcpy(date, "invalid mtime"); - fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", + fprintf(out, "%s%3u %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), archive_entry_nlink(entry), uname, gname, size, date, diff --git a/contrib/libarchive/cpio/test/test_format_newc.c b/contrib/libarchive/cpio/test/test_format_newc.c index 884b6c9c4da7..33aa16d07a81 100644 --- a/contrib/libarchive/cpio/test/test_format_newc.c +++ b/contrib/libarchive/cpio/test/test_format_newc.c @@ -189,10 +189,10 @@ DEFINE_TEST(test_format_newc) gid = from_hex(e + 30, 8); /* gid */ assertEqualMem(e + 38, "00000003", 8); /* nlink */ t = from_hex(e + 46, 8); /* mtime */ - failure("t=%#08jx now=%#08jx=%jd", (intmax_t)t, (intmax_t)now, + failure("t=%#08jx now=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now, (intmax_t)now); assert(t <= now); /* File wasn't created in future. */ - failure("t=%#08jx now - 2=%#08jx=%jd", (intmax_t)t, (intmax_t)now - 2, + failure("t=%#08jx now - 2=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now - 2, (intmax_t)now - 2); assert(t >= now - 2); /* File was created w/in last 2 secs. */ failure("newc format stores body only with last appearance of a link\n" @@ -219,7 +219,7 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) /* Mode: Group members bits and others bits do not work. */ assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); #else @@ -230,7 +230,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000001", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created" - " at t2=%#08jx", (intmax_t)t, (intmax_t)t2); + " at t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000005", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -266,7 +266,7 @@ DEFINE_TEST(test_format_newc) #endif t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000000", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -300,7 +300,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000003", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualInt(10, from_hex(e + 54, 8)); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); diff --git a/contrib/libarchive/cpio/test/test_option_a.c b/contrib/libarchive/cpio/test/test_option_a.c index e6b87948c65a..28e5b73765d7 100644 --- a/contrib/libarchive/cpio/test/test_option_a.c +++ b/contrib/libarchive/cpio/test/test_option_a.c @@ -52,7 +52,7 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) times.actime = 86400; times.modtime = 86400; #else diff --git a/contrib/libarchive/cpio/test/test_option_c.c b/contrib/libarchive/cpio/test/test_option_c.c index e8748449514b..2414a4658bb1 100644 --- a/contrib/libarchive/cpio/test/test_option_c.c +++ b/contrib/libarchive/cpio/test/test_option_c.c @@ -18,7 +18,7 @@ is_octal(const char *p, size_t l) return (1); } -static long long int +static unsigned long long int from_octal(const char *p, size_t l) { long long int r = 0; @@ -117,7 +117,7 @@ DEFINE_TEST(test_option_c) gid = (int)from_octal(e + 30, 6); assertEqualMem(e + 36, "000001", 6); /* nlink */ failure("file entries should not have rdev set (dev field was 0%o)", - dev); + (unsigned int)dev); assertEqualMem(e + 42, "000000", 6); /* rdev */ t = from_octal(e + 48, 11); /* mtime */ assert(t <= now); /* File wasn't created in future. */ @@ -133,7 +133,7 @@ DEFINE_TEST(test_option_c) assert(is_octal(e, 76)); /* Entire header is octal digits. */ assertEqualMem(e + 0, "070707", 6); /* Magic */ assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */ - assert(ino != from_octal(e + 12, 6)); /* ino */ + assert(ino != (int)from_octal(e + 12, 6)); /* ino */ #if !defined(_WIN32) || defined(__CYGWIN__) /* On Windows, symbolic link and group members bits and * others bits do not work. */ @@ -163,7 +163,7 @@ DEFINE_TEST(test_option_c) assertEqualInt(dev, from_octal(e + 6, 6)); /* Ino must be different from first entry. */ assert(is_octal(e + 12, 6)); /* ino */ - assert(ino != from_octal(e + 12, 6)); + assert(ino != (int)from_octal(e + 12, 6)); #if defined(_WIN32) && !defined(__CYGWIN__) /* Group members bits and others bits do not work. */ assertEqualMem(e + 18, "040777", 6); /* Mode */ diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 5b65475f61e2..002190a24663 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -34,12 +34,15 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007007 +#define ARCHIVE_VERSION_NUMBER 3008001 #include #include /* for wchar_t */ #include /* For FILE * */ +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* time_t is slated to be removed from public includes in 4.0 */ #include /* For time_t */ +#endif /* * Note: archive.h is for use outside of libarchive; the configuration @@ -63,12 +66,15 @@ #define __LA_INT64_T_DEFINED # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) typedef __int64 la_int64_t; +typedef unsigned __int64 la_uint64_t; # else # include /* ssize_t */ # if defined(_SCO_DS) || defined(__osf__) typedef long long la_int64_t; +typedef unsigned long long la_uint64_t; # else typedef int64_t la_int64_t; +typedef uint64_t la_uint64_t; # endif # endif #endif @@ -94,6 +100,22 @@ typedef ssize_t la_ssize_t; # endif #endif +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for time_t */ +#define __LA_TIME_T time_t +#else +/* Use 64-bits integer types for time_t */ +#define __LA_TIME_T la_int64_t +#endif + +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for dev_t */ +#define __LA_DEV_T dev_t +#else +/* Use 64-bits integer types for dev_t */ +#define __LA_DEV_T la_int64_t +#endif + /* Large file support for Android */ #if defined(__LIBARCHIVE_BUILD) && defined(__ANDROID__) #include "android_lf.h" @@ -132,7 +154,7 @@ typedef ssize_t la_ssize_t; #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */ #endif -#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) # define __LA_DEPRECATED __attribute__((deprecated)) #else # define __LA_DEPRECATED @@ -155,7 +177,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.7" +#define ARCHIVE_VERSION_ONLY_STRING "3.8.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -178,6 +200,23 @@ __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); __LA_DECL const char * archive_libzstd_version(void); +__LA_DECL const char * archive_liblzo2_version(void); +__LA_DECL const char * archive_libexpat_version(void); +__LA_DECL const char * archive_libbsdxml_version(void); +__LA_DECL const char * archive_libxml2_version(void); +__LA_DECL const char * archive_mbedtls_version(void); +__LA_DECL const char * archive_nettle_version(void); +__LA_DECL const char * archive_openssl_version(void); +__LA_DECL const char * archive_libmd_version(void); +__LA_DECL const char * archive_commoncrypto_version(void); +__LA_DECL const char * archive_cng_version(void); +__LA_DECL const char * archive_wincrypt_version(void); +__LA_DECL const char * archive_librichacl_version(void); +__LA_DECL const char * archive_libacl_version(void); +__LA_DECL const char * archive_libattr_version(void); +__LA_DECL const char * archive_libiconv_version(void); +__LA_DECL const char * archive_libpcre_version(void); +__LA_DECL const char * archive_libpcre2_version(void); /* Declare our basic types. */ struct archive; @@ -449,6 +488,8 @@ __LA_DECL int archive_read_support_format_by_code(struct archive *, int); __LA_DECL int archive_read_support_format_cab(struct archive *); __LA_DECL int archive_read_support_format_cpio(struct archive *); __LA_DECL int archive_read_support_format_empty(struct archive *); +/* archive_read_support_format_gnutar() is an alias for historical reasons + * of archive_read_support_format_tar(). */ __LA_DECL int archive_read_support_format_gnutar(struct archive *); __LA_DECL int archive_read_support_format_iso9660(struct archive *); __LA_DECL int archive_read_support_format_lha(struct archive *); @@ -828,6 +869,10 @@ __LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const ch __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext); __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); __LA_DECL int archive_write_zip_set_compression_store(struct archive *); +__LA_DECL int archive_write_zip_set_compression_lzma(struct archive *); +__LA_DECL int archive_write_zip_set_compression_xz(struct archive *); +__LA_DECL int archive_write_zip_set_compression_bzip2(struct archive *); +__LA_DECL int archive_write_zip_set_compression_zstd(struct archive *); /* Deprecated; use archive_write_open2 instead */ __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, @@ -1083,6 +1128,10 @@ __LA_DECL int archive_compression(struct archive *) __LA_DEPRECATED; #endif +/* Parses a date string relative to the current time. + * NOTE: This is not intended for general date parsing, and the resulting timestamp should only be used for libarchive. */ +__LA_DECL time_t archive_parse_date(time_t now, const char *datestr); + __LA_DECL int archive_errno(struct archive *); __LA_DECL const char *archive_error_string(struct archive *); __LA_DECL const char *archive_format_name(struct archive *); @@ -1201,8 +1250,10 @@ __LA_DECL int archive_match_include_gname_w(struct archive *, const wchar_t *); /* Utility functions */ +#if ARCHIVE_VERSION_NUMBER < 4000000 /* Convenience function to sort a NULL terminated list of strings */ __LA_DECL int archive_utility_string_sort(char **); +#endif #ifdef __cplusplus } diff --git a/contrib/libarchive/libarchive/archive_acl.c b/contrib/libarchive/libarchive/archive_acl.c index bbb085afe7af..9e71f5ee5610 100644 --- a/contrib/libarchive/libarchive/archive_acl.c +++ b/contrib/libarchive/libarchive/archive_acl.c @@ -1185,8 +1185,13 @@ archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, /* Set remaining fields to blank. */ for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; + + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } - if (field[0].start != NULL && *(field[0].start) == L'#') { + if (*(field[0].start) == L'#') { /* Comment, skip entry */ continue; } @@ -1676,7 +1681,12 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text, for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; - if (field[0].start != NULL && *(field[0].start) == '#') { + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } + + if (*(field[0].start) == '#') { /* Comment, skip entry */ continue; } diff --git a/contrib/libarchive/libarchive/archive_acl_private.h b/contrib/libarchive/libarchive/archive_acl_private.h index 2c9b5053430e..54e4439692ed 100644 --- a/contrib/libarchive/libarchive/archive_acl_private.h +++ b/contrib/libarchive/libarchive/archive_acl_private.h @@ -80,4 +80,4 @@ int archive_acl_from_text_l(struct archive_acl *, const char * /* text */, int archive_acl_from_text_nl(struct archive_acl *, const char * /* text */, size_t /* size of text */, int /* type */, struct archive_string_conv *); -#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ +#endif /* !ARCHIVE_ACL_PRIVATE_H_INCLUDED */ diff --git a/contrib/libarchive/libarchive/archive_cmdline.c b/contrib/libarchive/libarchive/archive_cmdline.c index 2e5428cae516..23bb05d6424a 100644 --- a/contrib/libarchive/libarchive/archive_cmdline.c +++ b/contrib/libarchive/libarchive/archive_cmdline.c @@ -71,7 +71,7 @@ get_argument(struct archive_string *as, const char *p) archive_string_empty(as); /* Skip beginning space characters. */ - while (*s != '\0' && *s == ' ') + while (*s == ' ') s++; /* Copy non-space characters. */ while (*s != '\0' && *s != ' ') { diff --git a/contrib/libarchive/libarchive/archive_cryptor_private.h b/contrib/libarchive/libarchive/archive_cryptor_private.h index c13f29260a07..4b3c6c161433 100644 --- a/contrib/libarchive/libarchive/archive_cryptor_private.h +++ b/contrib/libarchive/libarchive/archive_cryptor_private.h @@ -64,6 +64,7 @@ typedef struct { #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA #include +#define ARCHIVE_CRYPTOR_USE_CNG 1 /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS @@ -86,6 +87,7 @@ typedef struct { #include #include #include +#define ARCHIVE_CRYPTOR_USE_MBED 1 #define AES_MAX_KEY_SIZE 32 #define AES_BLOCK_SIZE 16 @@ -105,6 +107,7 @@ typedef struct { #endif #include #include +#define ARCHIVE_CRYPTOR_USE_NETTLE 1 typedef struct { #if NETTLE_VERSION_MAJOR < 3 @@ -125,6 +128,7 @@ typedef struct { #elif defined(HAVE_LIBCRYPTO) #include "archive_openssl_evp_private.h" +#define ARCHIVE_CRYPTOR_USE_OPENSSL 1 #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 @@ -140,6 +144,10 @@ typedef struct { #else +#if defined(_WIN32) && !defined(__CYGWIN__) && !(defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA) +#define ARCHIVE_CRYPTOR_USE_WINCRYPT 1 +#endif + #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 typedef int archive_crypto_ctx; diff --git a/contrib/libarchive/libarchive/archive_digest.c b/contrib/libarchive/libarchive/archive_digest.c index 3776831b21c9..45fc36af1145 100644 --- a/contrib/libarchive/libarchive/archive_digest.c +++ b/contrib/libarchive/libarchive/archive_digest.c @@ -196,6 +196,13 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) +// These functions are available in macOS 10.4 and later, but deprecated from 10.15 onwards. +// We need to continue supporting this feature regardless, so suppress the warnings. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + static int __archive_md5init(archive_md5_ctx *ctx) { @@ -218,13 +225,46 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +#elif defined(ARCHIVE_CRYPTO_MD5_WIN) + +static int +__archive_md5init(archive_md5_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); +#endif +} + +static int +__archive_md5update(archive_md5_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_md5final(archive_md5_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 16, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int __archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_starts(ctx) == 0) +#else if (mbedtls_md5_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -234,7 +274,11 @@ static int __archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_update(ctx, indata, insize) == 0) +#else if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -243,7 +287,11 @@ __archive_md5update(archive_md5_ctx *ctx, const void *indata, static int __archive_md5final(archive_md5_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_finish(ctx, md) == 0) { +#else if (mbedtls_md5_finish_ret(ctx, md) == 0) { +#endif mbedtls_md5_free(ctx); return (ARCHIVE_OK); } else { @@ -311,31 +359,6 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_MD5_WIN) - -static int -__archive_md5init(archive_md5_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); -#endif -} - -static int -__archive_md5update(archive_md5_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_md5final(archive_md5_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 16, ctx)); -} - #else static int @@ -420,7 +443,11 @@ static int __archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_starts(ctx) == 0) +#else if (mbedtls_ripemd160_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -430,7 +457,11 @@ static int __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_update(ctx, indata, insize) == 0) +#else if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -439,7 +470,11 @@ __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, static int __archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_finish(ctx, md) == 0) { +#else if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { +#endif mbedtls_ripemd160_free(ctx); return (ARCHIVE_OK); } else { @@ -605,13 +640,42 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) + +static int +__archive_sha1init(archive_sha1_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); +#endif +} + +static int +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_sha1final(archive_sha1_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 20, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int __archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_starts(ctx) == 0) +#else if (mbedtls_sha1_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -621,7 +685,11 @@ static int __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_update(ctx, indata, insize) == 0) +#else if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -630,7 +698,11 @@ __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, static int __archive_sha1final(archive_sha1_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_finish(ctx, md) == 0) { +#else if (mbedtls_sha1_finish_ret(ctx, md) == 0) { +#endif mbedtls_sha1_free(ctx); return (ARCHIVE_OK); } else { @@ -698,31 +770,6 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) - -static int -__archive_sha1init(archive_sha1_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); -#endif -} - -static int -__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_sha1final(archive_sha1_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 20, ctx)); -} - #else static int @@ -873,13 +920,42 @@ __archive_sha256final(archive_sha256_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA256_WIN) + +static int +__archive_sha256init(archive_sha256_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA256_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_256)); +#endif +} + +static int +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, + size_t insize) *** 35194 LINES SKIPPED *** From nobody Fri Aug 8 00:39:07 2025 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 4bylXD2Q7yz63jgg; Fri, 08 Aug 2025 00:39:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylXC1kjyz3WR3; Fri, 08 Aug 2025 00:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613547; 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=/hnTimLtMVFD2uMI58yAnKspr17LiaZ7ogYdyCBi4eE=; b=nuCkD6VEhZFz6YDci0/asSIfcLICa1srcYMimXJsg+S6z4FecJFSfXR234GLyCjLVcxMvz w3Q5pZXYCeMFc2L8nIM83tSDr40wd70+R9hg7dzysAti67nJh6bE0k2LMJIxMmN3G7jWDj 3zhZW4jmE8JaqJ8nWlAV1yNFdV510O+76fSrMe7MqavLqJeySCFXY5YE8M+kiFOp/FIxaI JJ8oIt/mkMU21M543gQWnl5rBqH3SvmGra5ZujDrZ+F0FxjRo8LY1/KR5BF5V+AVIyHpjX w9HOcBgmhhlfy/rkho0VpbfK+H6tpKI1mbRKiBeshJprlnwUZeqKZ1cDl9+wwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613547; 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=/hnTimLtMVFD2uMI58yAnKspr17LiaZ7ogYdyCBi4eE=; b=Ox3ScKFuilIK9udtUEdks7ZHd2SLeIJSni9Cv4zgvy5ePyMXjk6+Q3988R4yVV/A5n/BH4 WcQ84jdoE8+bPq0siiE8K2O81tIsW5m6rzvwKQ8zoNW8TWeqqmsw3FU9BIKBbPoGT4w2dF ygy8F0a2EDEOJ9aQ0hlMHjeeyTX8KiJRDc1Mjpa6a3FNgTEK8ql6gq4d7iVBQA5pC5TFbC YnQrgunbeCDwRk4u7qjUF/a6zH+yEgdxNUc6aaBOIXNxD8kbcPO56o1IMcbxAvEAxMbi7l FtBFZt9ulPS1wlMYo/aIujZJp+TPmLvpJS8i8gOHrpdedVXvW3DWG12Knnzh3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613547; a=rsa-sha256; cv=none; b=kyho+qZZfjE3D64mcBXWNSfjxHCnkmN9C7bHw096p6Akt8kcAVoGhY99bid1DniV4RguZc okChLED5ZUASvxGD5aT3dE/K29j9hvFiHNqvANulJsFdk/mhthSPs8NGeSaBRyqG0cqLQ8 qUq2JdaBSYYx1ZHurW9blJz8L6yxCQbHo8Ltx7i056/HVjdeMN4eEhBQWTL6d9vPsLBSh1 k4R6E3pvTpcN0308xfS1EfKPy+NF7dvie62MDxeqbTgnX/djt9coFdgWOMMTxB/zgrn7Zb C84SnUTWRtwjf1H8Pw78tMxzr//FKHsUqhSyqv/GagOxGD1JTaM1GhUuI6w8ag== 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 4bylXC1LNYz1S6x; Fri, 08 Aug 2025 00:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780d774073762; Fri, 8 Aug 2025 00:39:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780d74i073759; Fri, 8 Aug 2025 00:39:07 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:07 GMT Message-Id: <202508080039.5780d74i073759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 5982521fe3dd - releng/14.3 - Add UPDATING entries and bump version. 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 5982521fe3dd3f1627bbe29ee8c3b190a24e3963 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=5982521fe3dd3f1627bbe29ee8c3b190a24e3963 commit 5982521fe3dd3f1627bbe29ee8c3b190a24e3963 Author: Gordon Tetlow AuthorDate: 2025-08-08 00:15:39 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-08 00:15:39 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 16 ++++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 5a2bcdd07615..13a84a404535 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,22 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250808: + 14.3-RELEASE-p2 EN-25:12.efi + EN-25:13.wlan_tkip + EN-25:14.route + SA-25:07.libarchive + + Fix bsdinstall(8) not copying the correct loader on systems with IA32 UEFI + firmware. [EN-25:12.efi] + + Fix net80211 TKIP crypto support failing for some drivers. [EN-25:13.wlan_tkip] + + Fix route(8) monitor buffering too much when redirected to a file. [EN-25:14.route] + + Update libarchive to 3.8.1 to fix integer overflow leading to double + free. [SA-25:07.libarchive] + 20250702: 14.3-RELEASE-p1 EN-25:10.zfs diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b27ca22487d2..a8ec74cc1226 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.3" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Aug 8 00:39:19 2025 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 4bylXS0JQfz63khN; Fri, 08 Aug 2025 00:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylXR4tRyz3XBg; Fri, 08 Aug 2025 00:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613559; 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=vh2ny7RLE8rUJbHls/S9GqPqIhoX0xBrJcELks9Xl9E=; b=JR4LZ8CuxRGeIwfEa12nUmEW8fP7tn2eUPOldXf5X7B3jTjpKXUtkLPeHeoCzGm2kJLcoh J7WGgsR2fNzaOy7jOfZ6zX9KnLE/+MvtM46wWr3PyHImmSBlKA/jdDK8fzzlppHseyyP5X CLbrQO4slr22XUdQLp6h+71YX+OOltUIBSL+XfPkXsF5HHmBjel95H8/eMfBb5a1d0bJTu 3uPR2zlRsgtkdtRoJdfT/YfX0bksZVlFWqA7EW3lhL+2Be+JnOTP3zWuYOQ2a6qdWtVt6l iNelZ4l/8zFpIDiNwNn4yFDg7CSFKot6rk/4zEFySRpn5uEJndAV/Ebbo1fObw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613559; 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=vh2ny7RLE8rUJbHls/S9GqPqIhoX0xBrJcELks9Xl9E=; b=aj1AO8+jRmPU4lhJnMa7Y2l6Y4KPMppvlW0OGMH70JkvHvZz3WPIde4GLsWL/ve7zUyVnv daPPwzRzNTr8EfZrg8R7eBKRWYMeoBlNhvDM4axpbLtBEL9ipt+2nQW5i1R/bxLeLkUqD/ YmPDWFTyfcg1UhYYbkJwdZ3+G/Dy+1Wn9y9TJR/c7CwB+iUZUjKMUR6m+4UjXGHZ6vy5ea vjQhsYz7K1U1ZRvXe1ZUPy+5SQZ4iMcXVN4g2j1OnqHKP6lTGVrAfQmCsPiTXsXEvvZ260 a0ifsAXgNGNdPMQtdisSWGzrES6o5vCpaS+KgtI0xxJYKZqOtJ3V9/yXHUqdRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613559; a=rsa-sha256; cv=none; b=v9s5mV337qrNGtA0PVfReaZPIDX7atfQLrmnEJNLiIoEzjSa7JqvgmSjw/S3ZcDTb6cIwP IZnRyPHXjlgWqVTDmLHYCjW/g2fiBwEmlTsw7VVSmxhgLhIilmPoHj/f1MYw5pRgoi05ah G+AyUiCmtxaa3ce2BbJlzVFZUg+f6d+ivqjJHVV8G/BZ4wQD/l6iFs4Kv4l9EzzxqCETWb qZe4/ThfYzygEEE7yIxzDJmLxb46b5O+eDrEhgux8A6vweLwIH7oJWPPontHzg+lnetHhz D7eJ3G/168X0SCck/tZG6b3501uf8swNocP/Mz3fC9Q1BP7kRyNZuDD42uNTXw== 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 4bylXR4JPpz1SLM; Fri, 08 Aug 2025 00:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780dJcT073997; Fri, 8 Aug 2025 00:39:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780dJfV073991; Fri, 8 Aug 2025 00:39:19 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:19 GMT Message-Id: <202508080039.5780dJfV073991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: c0979bd2734f - releng/14.2 - libarchive: merge from vendor branch 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: c0979bd2734f792c33bd45932f2eefe792dc74c2 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c0979bd2734f792c33bd45932f2eefe792dc74c2 commit c0979bd2734f792c33bd45932f2eefe792dc74c2 Author: Martin Matuska AuthorDate: 2025-06-01 20:16:26 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-07 23:53:04 +0000 libarchive: merge from vendor branch libarchive 3.8.1 New features: #2088 7-zip reader: improve self-extracting archive detection #2137 zip writer: added XZ, LZMA, ZSTD and BZIP2 support #2403 zip writer: added LZMA + RISCV BCJ filter #2601 bsdtar: support --mtime and --clamp-mtime #2602 libarchive: mbedtls 3.x compatibility Security fixes: #2422 tar reader: Handle truncation in the middle of a GNU long linkname (CVE-2024-57970) #2532 tar reader: fix unchecked return value in list_item_verbose() (CVE-2025-25724) #2532 unzip: fix null pointer dereference (CVE-2025-1632) #2568 warc: prevent signed integer overflow (CVE-2025-5916) #2584 rar: do not skip past EOF while reading (CVE-2025-5918) #2588 tar: fix overflow in build_ustar_entry (CVE-2025-5917) #2598 rar: fix double free with over 4 billion nodes (CVE-2025-5914) #2599 rar: fix heap-buffer-overflow (CVE-2025-5915) Important bugfixes: #2399 7-zip reader: add SPARC filter support for non-LZMA compressors #2405 tar reader: ignore ustar size when pax size is present #2435 tar writer: fix bug when -s/a/b/ used more than once with b flag #2459 7-zip reader: add POWERPC filter support for non-LZMA compressors #2519 libarchive: handle ARCHIVE_FILTER_LZOP in archive_read_append_filter #2539 libarchive: add missing seeker function to archive_read_open_FILE() #2544 gzip: allow setting the original filename for gzip compressed files #2564 libarchive: improve lseek handling #2582 rar: support large headers on 32 bit systems #2587 bsdtar: don't hardlink negative inode files together #2596 rar: support large headers on 32 bit systems #2606 libarchive: support @-prefixed Unix epoch timestamps as date strings #2634 tar: Support negative time values with pax #2637 tar: Keep block alignment after pax error #2642 libarchive: fix FILE_skip regression #2643 tar: Handle extra bytes after sparse entries #2649 compress: Prevent call stack overflow #2651 iso9660: always check archive_string_ensure return value CVE: CVE-2024-57970, CVE-2025-1632, CVE-2025-25724, CVE-2025-5914, CVE-2025-5915, CVE-2025-5916, CVE-2025-5917, CVE-2025-5918 PR: 286944 (exp-run, main, libarchive 3.8.0) Approved by: so Security: FreeBSD-SA-25:07.libarchive (cherry picked from commit 2e113ef82465598b8c26e0ca415fbe90677fbd47) (cherry picked from commit 6dad4525a2910496ecf3c41de659aac906f6c1f4) --- contrib/libarchive/COPYING | 2 +- contrib/libarchive/NEWS | 8 + contrib/libarchive/README.md | 9 +- .../github_actions/install-macos-dependencies.sh | 19 + contrib/libarchive/cpio/cpio.c | 2 +- contrib/libarchive/cpio/test/test_format_newc.c | 12 +- contrib/libarchive/cpio/test/test_option_a.c | 2 +- contrib/libarchive/cpio/test/test_option_c.c | 8 +- contrib/libarchive/libarchive/archive.h | 57 +- contrib/libarchive/libarchive/archive_acl.c | 14 +- .../libarchive/libarchive/archive_acl_private.h | 2 +- contrib/libarchive/libarchive/archive_cmdline.c | 2 +- .../libarchive/archive_cryptor_private.h | 8 + contrib/libarchive/libarchive/archive_digest.c | 344 +- .../libarchive/libarchive/archive_digest_private.h | 35 +- .../libarchive/archive_disk_acl_freebsd.c | 4 +- contrib/libarchive/libarchive/archive_entry.c | 54 +- contrib/libarchive/libarchive/archive_entry.h | 84 +- .../libarchive/archive_entry_link_resolver.c | 8 + .../libarchive/libarchive/archive_entry_locale.h | 2 +- .../libarchive/libarchive/archive_entry_private.h | 13 +- .../libarchive/libarchive/archive_hmac_private.h | 2 +- contrib/libarchive/libarchive/archive_match.c | 102 +- contrib/libarchive/libarchive/archive_options.c | 4 +- .../libarchive/archive_options_private.h | 4 +- contrib/libarchive/libarchive/archive_pack_dev.h | 2 +- .../{archive_getdate.c => archive_parse_date.c} | 65 +- contrib/libarchive/libarchive/archive_platform.h | 5 + .../libarchive/libarchive/archive_platform_acl.h | 2 +- .../libarchive/libarchive/archive_platform_xattr.h | 2 +- contrib/libarchive/libarchive/archive_ppmd7.c | 11 +- contrib/libarchive/libarchive/archive_ppmd8.c | 15 +- .../libarchive/libarchive/archive_ppmd_private.h | 18 +- .../libarchive/libarchive/archive_random_private.h | 2 +- contrib/libarchive/libarchive/archive_rb.h | 2 +- contrib/libarchive/libarchive/archive_read.c | 6 - .../libarchive/archive_read_append_filter.c | 4 + .../libarchive/archive_read_disk_entry_from_file.c | 2 +- .../libarchive/archive_read_disk_posix.c | 9 +- .../libarchive/archive_read_disk_private.h | 7 +- .../libarchive/libarchive/archive_read_format.3 | 15 + .../libarchive/libarchive/archive_read_open_fd.c | 42 +- .../libarchive/libarchive/archive_read_open_file.c | 121 +- .../libarchive/archive_read_open_filename.c | 61 +- .../archive_read_support_filter_by_code.c | 14 - .../archive_read_support_filter_compress.c | 3 +- .../libarchive/archive_read_support_filter_lz4.c | 1 - .../libarchive/archive_read_support_format_7zip.c | 445 +- .../archive_read_support_format_by_code.c | 15 - .../libarchive/archive_read_support_format_cab.c | 7 +- .../libarchive/archive_read_support_format_cpio.c | 22 +- .../archive_read_support_format_iso9660.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 73 +- .../libarchive/archive_read_support_format_rar.c | 184 +- .../libarchive/archive_read_support_format_rar5.c | 101 +- .../libarchive/archive_read_support_format_tar.c | 409 +- .../libarchive/archive_read_support_format_warc.c | 7 +- .../libarchive/archive_read_support_format_xar.c | 355 +- .../libarchive/archive_read_support_format_zip.c | 33 +- contrib/libarchive/libarchive/archive_string.c | 141 +- .../libarchive/archive_string_composition.h | 3 +- .../libarchive/libarchive/archive_string_sprintf.c | 11 +- contrib/libarchive/libarchive/archive_time.c | 163 + .../{archive_getdate.h => archive_time_private.h} | 26 +- contrib/libarchive/libarchive/archive_util.c | 76 +- .../libarchive/archive_version_details.c | 405 +- contrib/libarchive/libarchive/archive_write.c | 2 +- .../archive_write_add_filter_b64encode.c | 2 +- .../libarchive/archive_write_add_filter_gzip.c | 19 +- .../libarchive/archive_write_add_filter_uuencode.c | 2 +- .../libarchive/archive_write_disk_posix.c | 15 +- .../libarchive/archive_write_open_filename.c | 8 +- .../libarchive/archive_write_set_format_7zip.c | 298 +- .../libarchive/archive_write_set_format_gnutar.c | 16 +- .../libarchive/archive_write_set_format_iso9660.c | 25 +- .../libarchive/archive_write_set_format_mtree.c | 123 +- .../libarchive/archive_write_set_format_pax.c | 6 +- .../libarchive/archive_write_set_format_xar.c | 692 +- .../libarchive/archive_write_set_format_zip.c | 986 +- .../libarchive/archive_write_set_options.3 | 43 +- contrib/libarchive/libarchive/libarchive-formats.5 | 20 +- .../libarchive/libarchive/test/read_open_memory.c | 2 +- .../libarchive/test/test_7zip_filename_encoding.c | 200 +- contrib/libarchive/libarchive/test/test_acl_pax.c | 8 +- .../libarchive/test/test_acl_platform_nfs4.c | 10 +- .../libarchive/test/test_acl_platform_posix1e.c | 3 +- .../libarchive/libarchive/test/test_acl_posix1e.c | 8 +- contrib/libarchive/libarchive/test/test_acl_text.c | 2 +- .../libarchive/test/test_archive_match_time.c | 71 +- ...archive_getdate.c => test_archive_parse_date.c} | 21 +- .../test/test_archive_string_conversion.c | 4 +- .../libarchive/test/test_compat_gtar_large.c | 224 + .../libarchive/test/test_compat_solaris_tar_acl.c | 4 +- .../libarchive/test/test_compat_star_acl.c | 6 +- contrib/libarchive/libarchive/test/test_entry.c | 2 +- .../libarchive/libarchive/test/test_open_file.c | 9 +- .../test/test_read_disk_directory_traversals.c | 2 +- .../libarchive/test/test_read_format_7zip.c | 315 +- .../test_read_format_7zip_deflate_powerpc.7z.uu | 55 + .../test_read_format_7zip_extract_second.7z.uu | 22 +- .../test/test_read_format_7zip_lzma2_powerpc.7z.uu | 48 + .../test/test_read_format_7zip_lzma2_riscv.7z.uu | 49 + .../test/test_read_format_7zip_lzma2_sparc.7z.uu | 51 + .../test/test_read_format_7zip_sfx_elf.elf.uu | 9442 ++++++++++++++++++++ .../test_read_format_7zip_sfx_modified_pe.exe.uu | 109 + .../test/test_read_format_7zip_sfx_pe.exe.uu | 4751 ++++++++++ .../test/test_read_format_7zip_zstd_sparc.7z.uu | 59 + .../test/test_read_format_gtar_redundant_L.c | 40 + .../test_read_format_gtar_redundant_L.tar.Z.uu | 16 + .../libarchive/test/test_read_format_gtar_sparse.c | 8 +- .../test/test_read_format_gtar_sparse_length.c | 53 + .../test_read_format_gtar_sparse_length.tar.Z.uu | 12 + ...est_read_format_gtar_sparse_skip_entry.tar.Z.uu | 18 +- .../libarchive/test/test_read_format_rar.c | 74 +- .../libarchive/test/test_read_format_rar5.c | 29 +- .../test/test_read_format_rar5_unicode.rar.uu | 18 +- .../test/test_read_format_rar_encryption.c | 4 +- .../test/test_read_format_rar_endarc_huge.rar.uu | 4 + .../test/test_read_format_rar_newsub_huge.rar.uu | 5 + .../test/test_read_format_rar_overflow.c | 48 + .../test/test_read_format_rar_overflow.rar.uu | 11 + .../test/test_read_format_rar_symlink_huge.rar.uu | 5 + .../test_read_format_tar_empty_with_gnulabel.c | 2 +- .../test/test_read_format_tar_mac_metadata.c | 85 + .../test_read_format_tar_mac_metadata_1.tar.uu | 231 + .../test/test_read_format_tar_pax_g_large.c | 53 + .../test/test_read_format_tar_pax_g_large.tar.uu | 49 + .../test/test_read_format_tar_pax_negative_time.c | 68 + .../test_read_format_tar_pax_negative_time.tar.uu | 60 + .../libarchive/test/test_read_format_warc.c | 24 + .../test/test_read_format_warc_incomplete.warc.uu | 10 + .../libarchive/test/test_read_format_zip.c | 5 +- .../test/test_read_pax_empty_val_no_nl.c | 65 + .../test/test_read_pax_empty_val_no_nl.tar.uu | 60 + .../libarchive/test/test_read_position.c | 2 +- .../libarchive/libarchive/test/test_sparse_basic.c | 8 +- .../libarchive/libarchive/test/test_tar_large.c | 2 +- .../libarchive/test/test_write_disk_perms.c | 8 +- .../test/test_write_disk_secure_noabsolutepaths.c | 4 +- .../libarchive/test/test_write_filter_gzip.c | 5 +- .../libarchive/test/test_write_format_7zip.c | 6 + .../libarchive/test/test_write_format_7zip_large.c | 6 + .../libarchive/test/test_write_format_gnutar.c | 29 +- .../test/test_write_format_mtree_preset_digests.c | 2107 +++++ .../libarchive/test/test_write_format_tar_sparse.c | 4 +- .../libarchive/test/test_write_format_xar.c | 39 + .../test/test_write_format_zip64_stream.c | 192 +- .../test/test_write_format_zip_compression_bzip2.c | 362 + .../test_write_format_zip_compression_lzmaxz.c | 425 + .../test/test_write_format_zip_compression_store.c | 277 +- .../test/test_write_format_zip_compression_zstd.c | 366 + .../test/test_write_format_zip_entry_size_unset.c | 150 +- .../libarchive/test/test_write_format_zip_file.c | 164 +- .../test/test_write_format_zip_file_zip64.c | 192 +- .../libarchive/test/test_write_format_zip_large.c | 35 +- .../libarchive/test/test_write_format_zip_stream.c | 156 +- contrib/libarchive/libarchive_fe/passphrase.c | 10 +- contrib/libarchive/tar/bsdtar.1 | 74 +- contrib/libarchive/tar/bsdtar.c | 35 +- contrib/libarchive/tar/bsdtar.h | 12 +- contrib/libarchive/tar/cmdline.c | 2 + contrib/libarchive/tar/subst.c | 1 + contrib/libarchive/tar/test/test_list_item.c | 63 + contrib/libarchive/tar/test/test_list_item.tar.uu | 169 + contrib/libarchive/tar/test/test_option_C_mtree.c | 4 +- .../{test_option_P.c => test_option_P_upper.c} | 0 .../libarchive/tar/test/test_option_ignore_zeros.c | 4 +- contrib/libarchive/tar/test/test_option_mtime.c | 82 + contrib/libarchive/tar/test/test_option_s.c | 14 +- contrib/libarchive/tar/test/test_stdio.c | 48 +- contrib/libarchive/tar/util.c | 57 +- contrib/libarchive/tar/write.c | 4 + contrib/libarchive/test_utils/test_common.h | 2 +- contrib/libarchive/test_utils/test_main.c | 192 +- contrib/libarchive/test_utils/test_utils.c | 48 + contrib/libarchive/test_utils/test_utils.h | 11 +- contrib/libarchive/unzip/bsdunzip.c | 21 +- contrib/libarchive/unzip/la_getline.h | 16 + lib/libarchive/Makefile | 3 +- lib/libarchive/tests/Makefile | 35 +- usr.bin/tar/tests/Makefile | 5 +- 181 files changed, 25587 insertions(+), 2345 deletions(-) diff --git a/contrib/libarchive/COPYING b/contrib/libarchive/COPYING index 1b9723574a7b..9d0bcf81ff61 100644 --- a/contrib/libarchive/COPYING +++ b/contrib/libarchive/COPYING @@ -20,7 +20,7 @@ the actual statements in the files are controlling. libarchive/mtree.5 * The following source files are in the public domain: - libarchive/archive_getdate.c + libarchive/archive_parse_date.c * The following source files are triple-licensed with the ability to choose from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 6af50e4e4033..caca7d5cbdb9 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,11 @@ +Jun 01, 2026: libarchive 3.8.1 released + +May 20, 2025: libarchive 3.8.0 released + +Mar 30, 2025: libarchive 3.7.9 released + +Mar 20, 2025: libarchive 3.7.8 released + Oct 13, 2024: libarchive 3.7.7 released Sep 23, 2024: libarchive 3.7.6 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 933de6986425..0d63357292ec 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -85,13 +85,14 @@ Currently, the library automatically detects and reads the following formats: * PWB binary cpio * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) - * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) + * ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives (including archives that use zstandard compression) * Microsoft CAB format * LHA and LZH archives * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * WARC archives * XAR archives The library also detects and handles any of the following before evaluating the archive: @@ -120,15 +121,18 @@ The library can create archives in any of the following formats: * PWB binary cpio * shar archives * ZIP archives (with uncompressed or "deflate" compressed entries) + * ZIPX archives (with bzip2, zstd, lzma or xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * ISO9660 format - * 7-Zip archives + * 7-Zip archives (including archives that use zstandard compression) + * WARC archives * XAR archives When creating archives, the result can be filtered with any of the following: * uuencode + * base64 * gzip compression * bzip2 compression * compress/LZW compression @@ -241,4 +245,3 @@ questions we are asked about libarchive: appropriate. It has many advantages over other tar formats (including the legacy GNU tar format) and is widely supported by current tar implementations. - diff --git a/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh new file mode 100755 index 000000000000..2aa4823fc3d0 --- /dev/null +++ b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -eux + +# Uncommenting these adds a full minute to the CI time +#brew update > /dev/null +#brew upgrade > /dev/null + +# This does an upgrade if the package is already installed +brew install \ + autoconf \ + automake \ + libtool \ + pkg-config \ + cmake \ + xz \ + lz4 \ + zstd \ + libxml2 \ + openssl diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c index 6bc6eb22e967..2bf1bfa2985a 100644 --- a/contrib/libarchive/cpio/cpio.c +++ b/contrib/libarchive/cpio/cpio.c @@ -1206,7 +1206,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else strcpy(date, "invalid mtime"); - fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", + fprintf(out, "%s%3u %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), archive_entry_nlink(entry), uname, gname, size, date, diff --git a/contrib/libarchive/cpio/test/test_format_newc.c b/contrib/libarchive/cpio/test/test_format_newc.c index 884b6c9c4da7..33aa16d07a81 100644 --- a/contrib/libarchive/cpio/test/test_format_newc.c +++ b/contrib/libarchive/cpio/test/test_format_newc.c @@ -189,10 +189,10 @@ DEFINE_TEST(test_format_newc) gid = from_hex(e + 30, 8); /* gid */ assertEqualMem(e + 38, "00000003", 8); /* nlink */ t = from_hex(e + 46, 8); /* mtime */ - failure("t=%#08jx now=%#08jx=%jd", (intmax_t)t, (intmax_t)now, + failure("t=%#08jx now=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now, (intmax_t)now); assert(t <= now); /* File wasn't created in future. */ - failure("t=%#08jx now - 2=%#08jx=%jd", (intmax_t)t, (intmax_t)now - 2, + failure("t=%#08jx now - 2=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now - 2, (intmax_t)now - 2); assert(t >= now - 2); /* File was created w/in last 2 secs. */ failure("newc format stores body only with last appearance of a link\n" @@ -219,7 +219,7 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) /* Mode: Group members bits and others bits do not work. */ assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); #else @@ -230,7 +230,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000001", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created" - " at t2=%#08jx", (intmax_t)t, (intmax_t)t2); + " at t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000005", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -266,7 +266,7 @@ DEFINE_TEST(test_format_newc) #endif t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000000", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -300,7 +300,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000003", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualInt(10, from_hex(e + 54, 8)); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); diff --git a/contrib/libarchive/cpio/test/test_option_a.c b/contrib/libarchive/cpio/test/test_option_a.c index e6b87948c65a..28e5b73765d7 100644 --- a/contrib/libarchive/cpio/test/test_option_a.c +++ b/contrib/libarchive/cpio/test/test_option_a.c @@ -52,7 +52,7 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) times.actime = 86400; times.modtime = 86400; #else diff --git a/contrib/libarchive/cpio/test/test_option_c.c b/contrib/libarchive/cpio/test/test_option_c.c index e8748449514b..2414a4658bb1 100644 --- a/contrib/libarchive/cpio/test/test_option_c.c +++ b/contrib/libarchive/cpio/test/test_option_c.c @@ -18,7 +18,7 @@ is_octal(const char *p, size_t l) return (1); } -static long long int +static unsigned long long int from_octal(const char *p, size_t l) { long long int r = 0; @@ -117,7 +117,7 @@ DEFINE_TEST(test_option_c) gid = (int)from_octal(e + 30, 6); assertEqualMem(e + 36, "000001", 6); /* nlink */ failure("file entries should not have rdev set (dev field was 0%o)", - dev); + (unsigned int)dev); assertEqualMem(e + 42, "000000", 6); /* rdev */ t = from_octal(e + 48, 11); /* mtime */ assert(t <= now); /* File wasn't created in future. */ @@ -133,7 +133,7 @@ DEFINE_TEST(test_option_c) assert(is_octal(e, 76)); /* Entire header is octal digits. */ assertEqualMem(e + 0, "070707", 6); /* Magic */ assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */ - assert(ino != from_octal(e + 12, 6)); /* ino */ + assert(ino != (int)from_octal(e + 12, 6)); /* ino */ #if !defined(_WIN32) || defined(__CYGWIN__) /* On Windows, symbolic link and group members bits and * others bits do not work. */ @@ -163,7 +163,7 @@ DEFINE_TEST(test_option_c) assertEqualInt(dev, from_octal(e + 6, 6)); /* Ino must be different from first entry. */ assert(is_octal(e + 12, 6)); /* ino */ - assert(ino != from_octal(e + 12, 6)); + assert(ino != (int)from_octal(e + 12, 6)); #if defined(_WIN32) && !defined(__CYGWIN__) /* Group members bits and others bits do not work. */ assertEqualMem(e + 18, "040777", 6); /* Mode */ diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 5b65475f61e2..002190a24663 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -34,12 +34,15 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007007 +#define ARCHIVE_VERSION_NUMBER 3008001 #include #include /* for wchar_t */ #include /* For FILE * */ +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* time_t is slated to be removed from public includes in 4.0 */ #include /* For time_t */ +#endif /* * Note: archive.h is for use outside of libarchive; the configuration @@ -63,12 +66,15 @@ #define __LA_INT64_T_DEFINED # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) typedef __int64 la_int64_t; +typedef unsigned __int64 la_uint64_t; # else # include /* ssize_t */ # if defined(_SCO_DS) || defined(__osf__) typedef long long la_int64_t; +typedef unsigned long long la_uint64_t; # else typedef int64_t la_int64_t; +typedef uint64_t la_uint64_t; # endif # endif #endif @@ -94,6 +100,22 @@ typedef ssize_t la_ssize_t; # endif #endif +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for time_t */ +#define __LA_TIME_T time_t +#else +/* Use 64-bits integer types for time_t */ +#define __LA_TIME_T la_int64_t +#endif + +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for dev_t */ +#define __LA_DEV_T dev_t +#else +/* Use 64-bits integer types for dev_t */ +#define __LA_DEV_T la_int64_t +#endif + /* Large file support for Android */ #if defined(__LIBARCHIVE_BUILD) && defined(__ANDROID__) #include "android_lf.h" @@ -132,7 +154,7 @@ typedef ssize_t la_ssize_t; #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */ #endif -#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) # define __LA_DEPRECATED __attribute__((deprecated)) #else # define __LA_DEPRECATED @@ -155,7 +177,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.7" +#define ARCHIVE_VERSION_ONLY_STRING "3.8.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -178,6 +200,23 @@ __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); __LA_DECL const char * archive_libzstd_version(void); +__LA_DECL const char * archive_liblzo2_version(void); +__LA_DECL const char * archive_libexpat_version(void); +__LA_DECL const char * archive_libbsdxml_version(void); +__LA_DECL const char * archive_libxml2_version(void); +__LA_DECL const char * archive_mbedtls_version(void); +__LA_DECL const char * archive_nettle_version(void); +__LA_DECL const char * archive_openssl_version(void); +__LA_DECL const char * archive_libmd_version(void); +__LA_DECL const char * archive_commoncrypto_version(void); +__LA_DECL const char * archive_cng_version(void); +__LA_DECL const char * archive_wincrypt_version(void); +__LA_DECL const char * archive_librichacl_version(void); +__LA_DECL const char * archive_libacl_version(void); +__LA_DECL const char * archive_libattr_version(void); +__LA_DECL const char * archive_libiconv_version(void); +__LA_DECL const char * archive_libpcre_version(void); +__LA_DECL const char * archive_libpcre2_version(void); /* Declare our basic types. */ struct archive; @@ -449,6 +488,8 @@ __LA_DECL int archive_read_support_format_by_code(struct archive *, int); __LA_DECL int archive_read_support_format_cab(struct archive *); __LA_DECL int archive_read_support_format_cpio(struct archive *); __LA_DECL int archive_read_support_format_empty(struct archive *); +/* archive_read_support_format_gnutar() is an alias for historical reasons + * of archive_read_support_format_tar(). */ __LA_DECL int archive_read_support_format_gnutar(struct archive *); __LA_DECL int archive_read_support_format_iso9660(struct archive *); __LA_DECL int archive_read_support_format_lha(struct archive *); @@ -828,6 +869,10 @@ __LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const ch __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext); __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); __LA_DECL int archive_write_zip_set_compression_store(struct archive *); +__LA_DECL int archive_write_zip_set_compression_lzma(struct archive *); +__LA_DECL int archive_write_zip_set_compression_xz(struct archive *); +__LA_DECL int archive_write_zip_set_compression_bzip2(struct archive *); +__LA_DECL int archive_write_zip_set_compression_zstd(struct archive *); /* Deprecated; use archive_write_open2 instead */ __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, @@ -1083,6 +1128,10 @@ __LA_DECL int archive_compression(struct archive *) __LA_DEPRECATED; #endif +/* Parses a date string relative to the current time. + * NOTE: This is not intended for general date parsing, and the resulting timestamp should only be used for libarchive. */ +__LA_DECL time_t archive_parse_date(time_t now, const char *datestr); + __LA_DECL int archive_errno(struct archive *); __LA_DECL const char *archive_error_string(struct archive *); __LA_DECL const char *archive_format_name(struct archive *); @@ -1201,8 +1250,10 @@ __LA_DECL int archive_match_include_gname_w(struct archive *, const wchar_t *); /* Utility functions */ +#if ARCHIVE_VERSION_NUMBER < 4000000 /* Convenience function to sort a NULL terminated list of strings */ __LA_DECL int archive_utility_string_sort(char **); +#endif #ifdef __cplusplus } diff --git a/contrib/libarchive/libarchive/archive_acl.c b/contrib/libarchive/libarchive/archive_acl.c index bbb085afe7af..9e71f5ee5610 100644 --- a/contrib/libarchive/libarchive/archive_acl.c +++ b/contrib/libarchive/libarchive/archive_acl.c @@ -1185,8 +1185,13 @@ archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, /* Set remaining fields to blank. */ for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; + + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } - if (field[0].start != NULL && *(field[0].start) == L'#') { + if (*(field[0].start) == L'#') { /* Comment, skip entry */ continue; } @@ -1676,7 +1681,12 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text, for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; - if (field[0].start != NULL && *(field[0].start) == '#') { + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } + + if (*(field[0].start) == '#') { /* Comment, skip entry */ continue; } diff --git a/contrib/libarchive/libarchive/archive_acl_private.h b/contrib/libarchive/libarchive/archive_acl_private.h index 2c9b5053430e..54e4439692ed 100644 --- a/contrib/libarchive/libarchive/archive_acl_private.h +++ b/contrib/libarchive/libarchive/archive_acl_private.h @@ -80,4 +80,4 @@ int archive_acl_from_text_l(struct archive_acl *, const char * /* text */, int archive_acl_from_text_nl(struct archive_acl *, const char * /* text */, size_t /* size of text */, int /* type */, struct archive_string_conv *); -#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ +#endif /* !ARCHIVE_ACL_PRIVATE_H_INCLUDED */ diff --git a/contrib/libarchive/libarchive/archive_cmdline.c b/contrib/libarchive/libarchive/archive_cmdline.c index 2e5428cae516..23bb05d6424a 100644 --- a/contrib/libarchive/libarchive/archive_cmdline.c +++ b/contrib/libarchive/libarchive/archive_cmdline.c @@ -71,7 +71,7 @@ get_argument(struct archive_string *as, const char *p) archive_string_empty(as); /* Skip beginning space characters. */ - while (*s != '\0' && *s == ' ') + while (*s == ' ') s++; /* Copy non-space characters. */ while (*s != '\0' && *s != ' ') { diff --git a/contrib/libarchive/libarchive/archive_cryptor_private.h b/contrib/libarchive/libarchive/archive_cryptor_private.h index c13f29260a07..4b3c6c161433 100644 --- a/contrib/libarchive/libarchive/archive_cryptor_private.h +++ b/contrib/libarchive/libarchive/archive_cryptor_private.h @@ -64,6 +64,7 @@ typedef struct { #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA #include +#define ARCHIVE_CRYPTOR_USE_CNG 1 /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS @@ -86,6 +87,7 @@ typedef struct { #include #include #include +#define ARCHIVE_CRYPTOR_USE_MBED 1 #define AES_MAX_KEY_SIZE 32 #define AES_BLOCK_SIZE 16 @@ -105,6 +107,7 @@ typedef struct { #endif #include #include +#define ARCHIVE_CRYPTOR_USE_NETTLE 1 typedef struct { #if NETTLE_VERSION_MAJOR < 3 @@ -125,6 +128,7 @@ typedef struct { #elif defined(HAVE_LIBCRYPTO) #include "archive_openssl_evp_private.h" +#define ARCHIVE_CRYPTOR_USE_OPENSSL 1 #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 @@ -140,6 +144,10 @@ typedef struct { #else +#if defined(_WIN32) && !defined(__CYGWIN__) && !(defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA) +#define ARCHIVE_CRYPTOR_USE_WINCRYPT 1 +#endif + #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 typedef int archive_crypto_ctx; diff --git a/contrib/libarchive/libarchive/archive_digest.c b/contrib/libarchive/libarchive/archive_digest.c index 3776831b21c9..45fc36af1145 100644 --- a/contrib/libarchive/libarchive/archive_digest.c +++ b/contrib/libarchive/libarchive/archive_digest.c @@ -196,6 +196,13 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) +// These functions are available in macOS 10.4 and later, but deprecated from 10.15 onwards. +// We need to continue supporting this feature regardless, so suppress the warnings. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + static int __archive_md5init(archive_md5_ctx *ctx) { @@ -218,13 +225,46 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +#elif defined(ARCHIVE_CRYPTO_MD5_WIN) + +static int +__archive_md5init(archive_md5_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); +#endif +} + +static int +__archive_md5update(archive_md5_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_md5final(archive_md5_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 16, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int __archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_starts(ctx) == 0) +#else if (mbedtls_md5_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -234,7 +274,11 @@ static int __archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_update(ctx, indata, insize) == 0) +#else if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -243,7 +287,11 @@ __archive_md5update(archive_md5_ctx *ctx, const void *indata, static int __archive_md5final(archive_md5_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_finish(ctx, md) == 0) { +#else if (mbedtls_md5_finish_ret(ctx, md) == 0) { +#endif mbedtls_md5_free(ctx); return (ARCHIVE_OK); } else { @@ -311,31 +359,6 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_MD5_WIN) - -static int -__archive_md5init(archive_md5_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); -#endif -} - -static int -__archive_md5update(archive_md5_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_md5final(archive_md5_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 16, ctx)); -} - #else static int @@ -420,7 +443,11 @@ static int __archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_starts(ctx) == 0) +#else if (mbedtls_ripemd160_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -430,7 +457,11 @@ static int __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_update(ctx, indata, insize) == 0) +#else if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -439,7 +470,11 @@ __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, static int __archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_finish(ctx, md) == 0) { +#else if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { +#endif mbedtls_ripemd160_free(ctx); return (ARCHIVE_OK); } else { @@ -605,13 +640,42 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) + +static int +__archive_sha1init(archive_sha1_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); +#endif +} + +static int +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_sha1final(archive_sha1_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 20, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int __archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_starts(ctx) == 0) +#else if (mbedtls_sha1_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -621,7 +685,11 @@ static int __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_update(ctx, indata, insize) == 0) +#else if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -630,7 +698,11 @@ __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, static int __archive_sha1final(archive_sha1_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_finish(ctx, md) == 0) { +#else if (mbedtls_sha1_finish_ret(ctx, md) == 0) { +#endif mbedtls_sha1_free(ctx); return (ARCHIVE_OK); } else { @@ -698,31 +770,6 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) - -static int -__archive_sha1init(archive_sha1_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); -#endif -} - -static int -__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_sha1final(archive_sha1_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 20, ctx)); -} - #else static int @@ -873,13 +920,42 @@ __archive_sha256final(archive_sha256_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA256_WIN) + +static int +__archive_sha256init(archive_sha256_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA256_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_256)); +#endif +} + +static int +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, + size_t insize) *** 35194 LINES SKIPPED *** From nobody Fri Aug 8 00:39:20 2025 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 4bylXT0LSGz63khP; Fri, 08 Aug 2025 00:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylXS6G08z3XKn; Fri, 08 Aug 2025 00:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613560; 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=s/374/qclC/ZJhhOrk/sBwigmMbftxprDcigPhZE+4A=; b=equiI+PM5Ma72WsX9nHb7rnC0NLVVkcxZFr7I55U5RneBIJ2GotUJ1VjpeIFJwAJZ0TKGN TaZyD7IVfAk/EHWltDVTMg+fe7QqQkCP6taVLHyaJ2M8XveS9BWr8e67pWjH7hwxFKc0zj s9mBSiTb0mUPWcN90tt7DKV1/4zLRm8B2WK+C8AeNnbHnHGbdlDvVIBQ00XiS3QIZAKUfm QAPbfAgoNB+r21hKEtRtZODCXD0CdXKsGJJpSPIkbnWIKjNlfQeiUvdDir3f6fS1rrONnl WDehI+EZ3pmkbl3IRN63DtyYq7iWy6wIrgISyFLilt/hz4PmwkA6srSrgaoNCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613560; 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=s/374/qclC/ZJhhOrk/sBwigmMbftxprDcigPhZE+4A=; b=x5o0wgsBDXRM5riNgmX8PbiJlGQh9j/9zvb19ooCwX0zKAx30b3ICCKmeaqN8c8T8bJZs3 WYm3TZGikaODCJ9a7ZepP4YIvvpc9w0o8QQvfgQeCsMhB9iSZjHZhhTee7yXeTMqkhZlCR JQAhhHbF/Z6zBAF3nc+gSSxuryftHPiRgpq/wa3yNC7VMTvKmu1iiSSH4HvyGhmlIRFTFm MLRt0DGimNaxiKB+DFaDWKFxOPgWJHgLttkDEhIqW+Nd3tkoCzSdCP9OKQ5s7qJRC4iRuV E96S4ZwGa8UXTVy2XHwtEofuBt6JbvIfn7u5T4XyApXyr9pLjGeA4Zg6YIgNnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613560; a=rsa-sha256; cv=none; b=xegY9QrIlGXSgFcEut5hrgsr2SJ0dgIo7clpWuvj83XzxJ+N0YyipIy0txhVLenD7lfm9c wjaDVWB71LINyOMTur9P10x+MMjbWmiBI8Yr2af6iaqGP5cK6VGOuuuf/Yiq1tt/VuXJpI iN2k3zlVXNMErp86TzmFVfuWIT0Aau5CuOj+cbEskQgo4Txje6dfIEF53Z3fzcbaQ3Eh3d ZcU75ESsill6X4l0puwlHtRAx90w02jdb6BXRxfnRPSt9FuLYMGIatn7UP3Z2C6bJUy1vs DrmYN1Dey6KojS7insGIvbBScRZ3aa1hy2dcpoMqCn6SNEo1kcyuA/SWMID3Ww== 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 4bylXS5DHHz1SLN; Fri, 08 Aug 2025 00:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780dKPV074030; Fri, 8 Aug 2025 00:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780dKtY074027; Fri, 8 Aug 2025 00:39:20 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:20 GMT Message-Id: <202508080039.5780dKtY074027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 0781dd1545f6 - releng/14.2 - Add UPDATING entries and bump version. 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 0781dd1545f6ed8a12cad7c3b98cf7c36c5af36f Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=0781dd1545f6ed8a12cad7c3b98cf7c36c5af36f commit 0781dd1545f6ed8a12cad7c3b98cf7c36c5af36f Author: Gordon Tetlow AuthorDate: 2025-08-08 00:18:32 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-08 00:18:32 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 10 ++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index f48519c38c75..36f7e4a7b151 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,16 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250808: + 14.2-RELEASE-p5 EN-25:14.route + SA-25:07.libarchive + + Fix route(8) monitor buffering too much when redirected to a + file. [EN-25:14.route] + + Update libarchive to 3.8.1 to fix integer overflow leading to double + free. [SA-25:07.libarchive] + 20250702: 14.2-RELEASE-p4 EN-25:09.libc EN-25:10.zfs diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 5feaa7fab80b..773335879171 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.2" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Aug 8 00:39:29 2025 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 4bylXf2FPFz63jgt; Fri, 08 Aug 2025 00:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylXf0PpHz3Xcp; Fri, 08 Aug 2025 00:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613570; 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=ZgggshzOdqb2x9qRfE5w03rgAK6QIxg0Bi6na6Kj7Eo=; b=xC8WciWi/S1waOAMpQiUg6dzc9z9vSUNn9PxGgWhelLrc0GdN8sZ0yKvCwPCc7V7kHfrsd G+tuISH8jIQmd57F8/h8U2XOguhfDsj6VxeqlCMbsyTrsxqHIO/ehDMyjK5lxDCK6+gamm oYojvrp3PBj1TVkLkpU+9K1qbKpq+jf6oQYM5t7AxwT3UpQsBKGsE02KqJEBlYOT90dYSj SbbNwV4nWElfCStkNimZVplc9p8HBj88oK5TvKI3srAAWuO8rdD9aLRbMRuZUGU3uOo6EX aORBcVVIWeGrpindms+A5bRt7GKcOPN4wK0BnMGhuflTV9JGIc+LO3RxeAAlrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613570; 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=ZgggshzOdqb2x9qRfE5w03rgAK6QIxg0Bi6na6Kj7Eo=; b=olvd1lTVUt6DdlIwjvYjf+N4zXpG/Qyvu5UG2P8WQ/SNfQYF/TfCH7ME82WKoosmwg6k9a d1SZC9+GAIv4dPUGkV+98VpVj9P4jliuygHZMd8oEK+MQl85POPcpXbfEns/xTjUlFbDru 0okfMb9d70xCJ7oPuzhxIoc9rHCwZxQg6HhCNeHZhdGV1Y0WI0c4vhJE5+Ufp2CQb/4s9M ye36NanKyO1ekW9Q7ogJqcEUmyl9N17WT3CtfqDqTZl2ZqsVSsub3KEWGrWfgcdM5FSNkp +/sJN7uRoyJhuLlI4wW/AMSFJD2a3XXqRPDy37xP+QIVRr4GYI8DaTzi+hbipg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613570; a=rsa-sha256; cv=none; b=OvpH+GbumLED7eal8LN2rMQPgCXSCyAs5RNc3Kpa1Pjrs6FrYi89mktP8TCtfiqDaYVuNt W/oU8zNoKF3RccJC98oLyU4iTQvqrL1Zf+1BTBzJWCruHLgDBfBT1/6GG1FvoJ99wqU5Ef fmbpzqlugmL7QPF0ciBfNEUmM45dEl91u+s5HDWdP2xT9uOqROB467dY6xeOWEAB+iO7sa reu6FJIWDl8vWDxLGe2czNbH7aKEgnjn1mJ9zuWp+J672H5UHu+phOAP5/gc7HDhcONB4H QWtr8Llq9pExjEK6FkX5Kg9Vj5bSsR2qnlD0+s0X3mKQRWbtqUbn39weMcIQ2A== 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 4bylXd70mMz1SN4; Fri, 08 Aug 2025 00:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780dTH8074220; Fri, 8 Aug 2025 00:39:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780dTxm074214; Fri, 8 Aug 2025 00:39:29 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:29 GMT Message-Id: <202508080039.5780dTxm074214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 798b7b161a71 - releng/13.5 - libarchive: merge from vendor branch 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 798b7b161a71282aff73d532ffe381b65dd04251 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=798b7b161a71282aff73d532ffe381b65dd04251 commit 798b7b161a71282aff73d532ffe381b65dd04251 Author: Martin Matuska AuthorDate: 2025-06-01 20:16:26 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-07 23:50:06 +0000 libarchive: merge from vendor branch libarchive 3.8.1 New features: #2088 7-zip reader: improve self-extracting archive detection #2137 zip writer: added XZ, LZMA, ZSTD and BZIP2 support #2403 zip writer: added LZMA + RISCV BCJ filter #2601 bsdtar: support --mtime and --clamp-mtime #2602 libarchive: mbedtls 3.x compatibility Security fixes: #2422 tar reader: Handle truncation in the middle of a GNU long linkname (CVE-2024-57970) #2532 tar reader: fix unchecked return value in list_item_verbose() (CVE-2025-25724) #2532 unzip: fix null pointer dereference (CVE-2025-1632) #2568 warc: prevent signed integer overflow (CVE-2025-5916) #2584 rar: do not skip past EOF while reading (CVE-2025-5918) #2588 tar: fix overflow in build_ustar_entry (CVE-2025-5917) #2598 rar: fix double free with over 4 billion nodes (CVE-2025-5914) #2599 rar: fix heap-buffer-overflow (CVE-2025-5915) Important bugfixes: #2399 7-zip reader: add SPARC filter support for non-LZMA compressors #2405 tar reader: ignore ustar size when pax size is present #2435 tar writer: fix bug when -s/a/b/ used more than once with b flag #2459 7-zip reader: add POWERPC filter support for non-LZMA compressors #2519 libarchive: handle ARCHIVE_FILTER_LZOP in archive_read_append_filter #2539 libarchive: add missing seeker function to archive_read_open_FILE() #2544 gzip: allow setting the original filename for gzip compressed files #2564 libarchive: improve lseek handling #2582 rar: support large headers on 32 bit systems #2587 bsdtar: don't hardlink negative inode files together #2596 rar: support large headers on 32 bit systems #2606 libarchive: support @-prefixed Unix epoch timestamps as date strings #2634 tar: Support negative time values with pax #2637 tar: Keep block alignment after pax error #2642 libarchive: fix FILE_skip regression #2643 tar: Handle extra bytes after sparse entries #2649 compress: Prevent call stack overflow #2651 iso9660: always check archive_string_ensure return value CVE: CVE-2024-57970, CVE-2025-1632, CVE-2025-25724, CVE-2025-5914, CVE-2025-5915, CVE-2025-5916, CVE-2025-5917, CVE-2025-5918 PR: 286944 (exp-run on main, libarchive 3.8.0) Approved by: so Security: FreeBSD-SA-25:07.libarchive (cherry picked from commit 2e113ef82465598b8c26e0ca415fbe90677fbd47) (cherry picked from commit f47afeb2ce1eb04a787a4b8c1a6d7752940268da) --- contrib/libarchive/COPYING | 2 +- contrib/libarchive/NEWS | 8 + contrib/libarchive/README.md | 9 +- .../github_actions/install-macos-dependencies.sh | 19 + contrib/libarchive/cpio/cpio.c | 2 +- contrib/libarchive/cpio/test/test_format_newc.c | 12 +- contrib/libarchive/cpio/test/test_option_a.c | 2 +- contrib/libarchive/cpio/test/test_option_c.c | 8 +- contrib/libarchive/libarchive/archive.h | 57 +- contrib/libarchive/libarchive/archive_acl.c | 14 +- .../libarchive/libarchive/archive_acl_private.h | 2 +- contrib/libarchive/libarchive/archive_cmdline.c | 2 +- .../libarchive/archive_cryptor_private.h | 8 + contrib/libarchive/libarchive/archive_digest.c | 344 +- .../libarchive/libarchive/archive_digest_private.h | 35 +- .../libarchive/archive_disk_acl_freebsd.c | 4 +- contrib/libarchive/libarchive/archive_entry.c | 54 +- contrib/libarchive/libarchive/archive_entry.h | 84 +- .../libarchive/archive_entry_link_resolver.c | 8 + .../libarchive/libarchive/archive_entry_locale.h | 2 +- .../libarchive/libarchive/archive_entry_private.h | 13 +- .../libarchive/libarchive/archive_hmac_private.h | 2 +- contrib/libarchive/libarchive/archive_match.c | 102 +- contrib/libarchive/libarchive/archive_options.c | 4 +- .../libarchive/archive_options_private.h | 4 +- contrib/libarchive/libarchive/archive_pack_dev.h | 2 +- .../{archive_getdate.c => archive_parse_date.c} | 65 +- contrib/libarchive/libarchive/archive_platform.h | 5 + .../libarchive/libarchive/archive_platform_acl.h | 2 +- .../libarchive/libarchive/archive_platform_xattr.h | 2 +- contrib/libarchive/libarchive/archive_ppmd7.c | 11 +- contrib/libarchive/libarchive/archive_ppmd8.c | 15 +- .../libarchive/libarchive/archive_ppmd_private.h | 18 +- .../libarchive/libarchive/archive_random_private.h | 2 +- contrib/libarchive/libarchive/archive_rb.h | 2 +- contrib/libarchive/libarchive/archive_read.c | 6 - .../libarchive/archive_read_append_filter.c | 4 + .../libarchive/archive_read_disk_entry_from_file.c | 2 +- .../libarchive/archive_read_disk_posix.c | 9 +- .../libarchive/archive_read_disk_private.h | 7 +- .../libarchive/libarchive/archive_read_format.3 | 15 + .../libarchive/libarchive/archive_read_open_fd.c | 42 +- .../libarchive/libarchive/archive_read_open_file.c | 121 +- .../libarchive/archive_read_open_filename.c | 61 +- .../archive_read_support_filter_by_code.c | 14 - .../archive_read_support_filter_compress.c | 3 +- .../libarchive/archive_read_support_filter_lz4.c | 1 - .../libarchive/archive_read_support_format_7zip.c | 445 +- .../archive_read_support_format_by_code.c | 15 - .../libarchive/archive_read_support_format_cab.c | 7 +- .../libarchive/archive_read_support_format_cpio.c | 22 +- .../archive_read_support_format_iso9660.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 73 +- .../libarchive/archive_read_support_format_rar.c | 184 +- .../libarchive/archive_read_support_format_rar5.c | 101 +- .../libarchive/archive_read_support_format_tar.c | 409 +- .../libarchive/archive_read_support_format_warc.c | 7 +- .../libarchive/archive_read_support_format_xar.c | 355 +- .../libarchive/archive_read_support_format_zip.c | 33 +- contrib/libarchive/libarchive/archive_string.c | 141 +- .../libarchive/archive_string_composition.h | 3 +- .../libarchive/libarchive/archive_string_sprintf.c | 11 +- contrib/libarchive/libarchive/archive_time.c | 163 + .../{archive_getdate.h => archive_time_private.h} | 26 +- contrib/libarchive/libarchive/archive_util.c | 76 +- .../libarchive/archive_version_details.c | 405 +- contrib/libarchive/libarchive/archive_write.c | 2 +- .../archive_write_add_filter_b64encode.c | 2 +- .../libarchive/archive_write_add_filter_gzip.c | 19 +- .../libarchive/archive_write_add_filter_uuencode.c | 2 +- .../libarchive/archive_write_disk_posix.c | 15 +- .../libarchive/archive_write_open_filename.c | 8 +- .../libarchive/archive_write_set_format_7zip.c | 298 +- .../libarchive/archive_write_set_format_gnutar.c | 16 +- .../libarchive/archive_write_set_format_iso9660.c | 25 +- .../libarchive/archive_write_set_format_mtree.c | 123 +- .../libarchive/archive_write_set_format_pax.c | 6 +- .../libarchive/archive_write_set_format_xar.c | 692 +- .../libarchive/archive_write_set_format_zip.c | 986 +- .../libarchive/archive_write_set_options.3 | 43 +- contrib/libarchive/libarchive/libarchive-formats.5 | 20 +- .../libarchive/libarchive/test/read_open_memory.c | 2 +- .../libarchive/test/test_7zip_filename_encoding.c | 200 +- contrib/libarchive/libarchive/test/test_acl_pax.c | 8 +- .../libarchive/test/test_acl_platform_nfs4.c | 10 +- .../libarchive/test/test_acl_platform_posix1e.c | 3 +- .../libarchive/libarchive/test/test_acl_posix1e.c | 8 +- contrib/libarchive/libarchive/test/test_acl_text.c | 2 +- .../libarchive/test/test_archive_match_time.c | 71 +- ...archive_getdate.c => test_archive_parse_date.c} | 21 +- .../test/test_archive_string_conversion.c | 4 +- .../libarchive/test/test_compat_gtar_large.c | 224 + .../libarchive/test/test_compat_solaris_tar_acl.c | 4 +- .../libarchive/test/test_compat_star_acl.c | 6 +- contrib/libarchive/libarchive/test/test_entry.c | 2 +- .../libarchive/libarchive/test/test_open_file.c | 9 +- .../test/test_read_disk_directory_traversals.c | 2 +- .../libarchive/test/test_read_format_7zip.c | 315 +- .../test_read_format_7zip_deflate_powerpc.7z.uu | 55 + .../test_read_format_7zip_extract_second.7z.uu | 22 +- .../test/test_read_format_7zip_lzma2_powerpc.7z.uu | 48 + .../test/test_read_format_7zip_lzma2_riscv.7z.uu | 49 + .../test/test_read_format_7zip_lzma2_sparc.7z.uu | 51 + .../test/test_read_format_7zip_sfx_elf.elf.uu | 9442 ++++++++++++++++++++ .../test_read_format_7zip_sfx_modified_pe.exe.uu | 109 + .../test/test_read_format_7zip_sfx_pe.exe.uu | 4751 ++++++++++ .../test/test_read_format_7zip_zstd_sparc.7z.uu | 59 + .../test/test_read_format_gtar_redundant_L.c | 40 + .../test_read_format_gtar_redundant_L.tar.Z.uu | 16 + .../libarchive/test/test_read_format_gtar_sparse.c | 8 +- .../test/test_read_format_gtar_sparse_length.c | 53 + .../test_read_format_gtar_sparse_length.tar.Z.uu | 12 + ...est_read_format_gtar_sparse_skip_entry.tar.Z.uu | 18 +- .../libarchive/test/test_read_format_rar.c | 74 +- .../libarchive/test/test_read_format_rar5.c | 29 +- .../test/test_read_format_rar5_unicode.rar.uu | 18 +- .../test/test_read_format_rar_encryption.c | 4 +- .../test/test_read_format_rar_endarc_huge.rar.uu | 4 + .../test/test_read_format_rar_newsub_huge.rar.uu | 5 + .../test/test_read_format_rar_overflow.c | 48 + .../test/test_read_format_rar_overflow.rar.uu | 11 + .../test/test_read_format_rar_symlink_huge.rar.uu | 5 + .../test_read_format_tar_empty_with_gnulabel.c | 2 +- .../test/test_read_format_tar_mac_metadata.c | 85 + .../test_read_format_tar_mac_metadata_1.tar.uu | 231 + .../test/test_read_format_tar_pax_g_large.c | 53 + .../test/test_read_format_tar_pax_g_large.tar.uu | 49 + .../test/test_read_format_tar_pax_negative_time.c | 68 + .../test_read_format_tar_pax_negative_time.tar.uu | 60 + .../libarchive/test/test_read_format_warc.c | 24 + .../test/test_read_format_warc_incomplete.warc.uu | 10 + .../libarchive/test/test_read_format_zip.c | 5 +- .../test/test_read_pax_empty_val_no_nl.c | 65 + .../test/test_read_pax_empty_val_no_nl.tar.uu | 60 + .../libarchive/test/test_read_position.c | 2 +- .../libarchive/libarchive/test/test_sparse_basic.c | 8 +- .../libarchive/libarchive/test/test_tar_large.c | 2 +- .../libarchive/test/test_write_disk_perms.c | 8 +- .../test/test_write_disk_secure_noabsolutepaths.c | 4 +- .../libarchive/test/test_write_filter_gzip.c | 5 +- .../libarchive/test/test_write_format_7zip.c | 6 + .../libarchive/test/test_write_format_7zip_large.c | 6 + .../libarchive/test/test_write_format_gnutar.c | 29 +- .../test/test_write_format_mtree_preset_digests.c | 2107 +++++ .../libarchive/test/test_write_format_tar_sparse.c | 4 +- .../libarchive/test/test_write_format_xar.c | 39 + .../test/test_write_format_zip64_stream.c | 192 +- .../test/test_write_format_zip_compression_bzip2.c | 362 + .../test_write_format_zip_compression_lzmaxz.c | 425 + .../test/test_write_format_zip_compression_store.c | 277 +- .../test/test_write_format_zip_compression_zstd.c | 366 + .../test/test_write_format_zip_entry_size_unset.c | 150 +- .../libarchive/test/test_write_format_zip_file.c | 164 +- .../test/test_write_format_zip_file_zip64.c | 192 +- .../libarchive/test/test_write_format_zip_large.c | 35 +- .../libarchive/test/test_write_format_zip_stream.c | 156 +- contrib/libarchive/libarchive_fe/passphrase.c | 10 +- contrib/libarchive/tar/bsdtar.1 | 74 +- contrib/libarchive/tar/bsdtar.c | 35 +- contrib/libarchive/tar/bsdtar.h | 12 +- contrib/libarchive/tar/cmdline.c | 2 + contrib/libarchive/tar/subst.c | 1 + contrib/libarchive/tar/test/test_list_item.c | 63 + contrib/libarchive/tar/test/test_list_item.tar.uu | 169 + contrib/libarchive/tar/test/test_option_C_mtree.c | 4 +- .../{test_option_P.c => test_option_P_upper.c} | 0 .../libarchive/tar/test/test_option_ignore_zeros.c | 4 +- contrib/libarchive/tar/test/test_option_mtime.c | 82 + contrib/libarchive/tar/test/test_option_s.c | 14 +- contrib/libarchive/tar/test/test_stdio.c | 48 +- contrib/libarchive/tar/util.c | 57 +- contrib/libarchive/tar/write.c | 4 + contrib/libarchive/test_utils/test_common.h | 2 +- contrib/libarchive/test_utils/test_main.c | 192 +- contrib/libarchive/test_utils/test_utils.c | 48 + contrib/libarchive/test_utils/test_utils.h | 11 +- contrib/libarchive/unzip/bsdunzip.c | 21 +- contrib/libarchive/unzip/la_getline.h | 16 + lib/libarchive/Makefile | 3 +- lib/libarchive/tests/Makefile | 35 +- usr.bin/tar/tests/Makefile | 5 +- 181 files changed, 25587 insertions(+), 2345 deletions(-) diff --git a/contrib/libarchive/COPYING b/contrib/libarchive/COPYING index 1b9723574a7b..9d0bcf81ff61 100644 --- a/contrib/libarchive/COPYING +++ b/contrib/libarchive/COPYING @@ -20,7 +20,7 @@ the actual statements in the files are controlling. libarchive/mtree.5 * The following source files are in the public domain: - libarchive/archive_getdate.c + libarchive/archive_parse_date.c * The following source files are triple-licensed with the ability to choose from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 6af50e4e4033..caca7d5cbdb9 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,11 @@ +Jun 01, 2026: libarchive 3.8.1 released + +May 20, 2025: libarchive 3.8.0 released + +Mar 30, 2025: libarchive 3.7.9 released + +Mar 20, 2025: libarchive 3.7.8 released + Oct 13, 2024: libarchive 3.7.7 released Sep 23, 2024: libarchive 3.7.6 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 933de6986425..0d63357292ec 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -85,13 +85,14 @@ Currently, the library automatically detects and reads the following formats: * PWB binary cpio * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) - * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) + * ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives (including archives that use zstandard compression) * Microsoft CAB format * LHA and LZH archives * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * WARC archives * XAR archives The library also detects and handles any of the following before evaluating the archive: @@ -120,15 +121,18 @@ The library can create archives in any of the following formats: * PWB binary cpio * shar archives * ZIP archives (with uncompressed or "deflate" compressed entries) + * ZIPX archives (with bzip2, zstd, lzma or xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * ISO9660 format - * 7-Zip archives + * 7-Zip archives (including archives that use zstandard compression) + * WARC archives * XAR archives When creating archives, the result can be filtered with any of the following: * uuencode + * base64 * gzip compression * bzip2 compression * compress/LZW compression @@ -241,4 +245,3 @@ questions we are asked about libarchive: appropriate. It has many advantages over other tar formats (including the legacy GNU tar format) and is widely supported by current tar implementations. - diff --git a/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh new file mode 100755 index 000000000000..2aa4823fc3d0 --- /dev/null +++ b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -eux + +# Uncommenting these adds a full minute to the CI time +#brew update > /dev/null +#brew upgrade > /dev/null + +# This does an upgrade if the package is already installed +brew install \ + autoconf \ + automake \ + libtool \ + pkg-config \ + cmake \ + xz \ + lz4 \ + zstd \ + libxml2 \ + openssl diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c index 6bc6eb22e967..2bf1bfa2985a 100644 --- a/contrib/libarchive/cpio/cpio.c +++ b/contrib/libarchive/cpio/cpio.c @@ -1206,7 +1206,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else strcpy(date, "invalid mtime"); - fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", + fprintf(out, "%s%3u %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), archive_entry_nlink(entry), uname, gname, size, date, diff --git a/contrib/libarchive/cpio/test/test_format_newc.c b/contrib/libarchive/cpio/test/test_format_newc.c index 884b6c9c4da7..33aa16d07a81 100644 --- a/contrib/libarchive/cpio/test/test_format_newc.c +++ b/contrib/libarchive/cpio/test/test_format_newc.c @@ -189,10 +189,10 @@ DEFINE_TEST(test_format_newc) gid = from_hex(e + 30, 8); /* gid */ assertEqualMem(e + 38, "00000003", 8); /* nlink */ t = from_hex(e + 46, 8); /* mtime */ - failure("t=%#08jx now=%#08jx=%jd", (intmax_t)t, (intmax_t)now, + failure("t=%#08jx now=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now, (intmax_t)now); assert(t <= now); /* File wasn't created in future. */ - failure("t=%#08jx now - 2=%#08jx=%jd", (intmax_t)t, (intmax_t)now - 2, + failure("t=%#08jx now - 2=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now - 2, (intmax_t)now - 2); assert(t >= now - 2); /* File was created w/in last 2 secs. */ failure("newc format stores body only with last appearance of a link\n" @@ -219,7 +219,7 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) /* Mode: Group members bits and others bits do not work. */ assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); #else @@ -230,7 +230,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000001", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created" - " at t2=%#08jx", (intmax_t)t, (intmax_t)t2); + " at t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000005", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -266,7 +266,7 @@ DEFINE_TEST(test_format_newc) #endif t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000000", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -300,7 +300,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000003", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualInt(10, from_hex(e + 54, 8)); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); diff --git a/contrib/libarchive/cpio/test/test_option_a.c b/contrib/libarchive/cpio/test/test_option_a.c index e6b87948c65a..28e5b73765d7 100644 --- a/contrib/libarchive/cpio/test/test_option_a.c +++ b/contrib/libarchive/cpio/test/test_option_a.c @@ -52,7 +52,7 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) times.actime = 86400; times.modtime = 86400; #else diff --git a/contrib/libarchive/cpio/test/test_option_c.c b/contrib/libarchive/cpio/test/test_option_c.c index e8748449514b..2414a4658bb1 100644 --- a/contrib/libarchive/cpio/test/test_option_c.c +++ b/contrib/libarchive/cpio/test/test_option_c.c @@ -18,7 +18,7 @@ is_octal(const char *p, size_t l) return (1); } -static long long int +static unsigned long long int from_octal(const char *p, size_t l) { long long int r = 0; @@ -117,7 +117,7 @@ DEFINE_TEST(test_option_c) gid = (int)from_octal(e + 30, 6); assertEqualMem(e + 36, "000001", 6); /* nlink */ failure("file entries should not have rdev set (dev field was 0%o)", - dev); + (unsigned int)dev); assertEqualMem(e + 42, "000000", 6); /* rdev */ t = from_octal(e + 48, 11); /* mtime */ assert(t <= now); /* File wasn't created in future. */ @@ -133,7 +133,7 @@ DEFINE_TEST(test_option_c) assert(is_octal(e, 76)); /* Entire header is octal digits. */ assertEqualMem(e + 0, "070707", 6); /* Magic */ assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */ - assert(ino != from_octal(e + 12, 6)); /* ino */ + assert(ino != (int)from_octal(e + 12, 6)); /* ino */ #if !defined(_WIN32) || defined(__CYGWIN__) /* On Windows, symbolic link and group members bits and * others bits do not work. */ @@ -163,7 +163,7 @@ DEFINE_TEST(test_option_c) assertEqualInt(dev, from_octal(e + 6, 6)); /* Ino must be different from first entry. */ assert(is_octal(e + 12, 6)); /* ino */ - assert(ino != from_octal(e + 12, 6)); + assert(ino != (int)from_octal(e + 12, 6)); #if defined(_WIN32) && !defined(__CYGWIN__) /* Group members bits and others bits do not work. */ assertEqualMem(e + 18, "040777", 6); /* Mode */ diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 5b65475f61e2..002190a24663 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -34,12 +34,15 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007007 +#define ARCHIVE_VERSION_NUMBER 3008001 #include #include /* for wchar_t */ #include /* For FILE * */ +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* time_t is slated to be removed from public includes in 4.0 */ #include /* For time_t */ +#endif /* * Note: archive.h is for use outside of libarchive; the configuration @@ -63,12 +66,15 @@ #define __LA_INT64_T_DEFINED # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) typedef __int64 la_int64_t; +typedef unsigned __int64 la_uint64_t; # else # include /* ssize_t */ # if defined(_SCO_DS) || defined(__osf__) typedef long long la_int64_t; +typedef unsigned long long la_uint64_t; # else typedef int64_t la_int64_t; +typedef uint64_t la_uint64_t; # endif # endif #endif @@ -94,6 +100,22 @@ typedef ssize_t la_ssize_t; # endif #endif +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for time_t */ +#define __LA_TIME_T time_t +#else +/* Use 64-bits integer types for time_t */ +#define __LA_TIME_T la_int64_t +#endif + +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for dev_t */ +#define __LA_DEV_T dev_t +#else +/* Use 64-bits integer types for dev_t */ +#define __LA_DEV_T la_int64_t +#endif + /* Large file support for Android */ #if defined(__LIBARCHIVE_BUILD) && defined(__ANDROID__) #include "android_lf.h" @@ -132,7 +154,7 @@ typedef ssize_t la_ssize_t; #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */ #endif -#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) # define __LA_DEPRECATED __attribute__((deprecated)) #else # define __LA_DEPRECATED @@ -155,7 +177,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.7" +#define ARCHIVE_VERSION_ONLY_STRING "3.8.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -178,6 +200,23 @@ __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); __LA_DECL const char * archive_libzstd_version(void); +__LA_DECL const char * archive_liblzo2_version(void); +__LA_DECL const char * archive_libexpat_version(void); +__LA_DECL const char * archive_libbsdxml_version(void); +__LA_DECL const char * archive_libxml2_version(void); +__LA_DECL const char * archive_mbedtls_version(void); +__LA_DECL const char * archive_nettle_version(void); +__LA_DECL const char * archive_openssl_version(void); +__LA_DECL const char * archive_libmd_version(void); +__LA_DECL const char * archive_commoncrypto_version(void); +__LA_DECL const char * archive_cng_version(void); +__LA_DECL const char * archive_wincrypt_version(void); +__LA_DECL const char * archive_librichacl_version(void); +__LA_DECL const char * archive_libacl_version(void); +__LA_DECL const char * archive_libattr_version(void); +__LA_DECL const char * archive_libiconv_version(void); +__LA_DECL const char * archive_libpcre_version(void); +__LA_DECL const char * archive_libpcre2_version(void); /* Declare our basic types. */ struct archive; @@ -449,6 +488,8 @@ __LA_DECL int archive_read_support_format_by_code(struct archive *, int); __LA_DECL int archive_read_support_format_cab(struct archive *); __LA_DECL int archive_read_support_format_cpio(struct archive *); __LA_DECL int archive_read_support_format_empty(struct archive *); +/* archive_read_support_format_gnutar() is an alias for historical reasons + * of archive_read_support_format_tar(). */ __LA_DECL int archive_read_support_format_gnutar(struct archive *); __LA_DECL int archive_read_support_format_iso9660(struct archive *); __LA_DECL int archive_read_support_format_lha(struct archive *); @@ -828,6 +869,10 @@ __LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const ch __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext); __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); __LA_DECL int archive_write_zip_set_compression_store(struct archive *); +__LA_DECL int archive_write_zip_set_compression_lzma(struct archive *); +__LA_DECL int archive_write_zip_set_compression_xz(struct archive *); +__LA_DECL int archive_write_zip_set_compression_bzip2(struct archive *); +__LA_DECL int archive_write_zip_set_compression_zstd(struct archive *); /* Deprecated; use archive_write_open2 instead */ __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, @@ -1083,6 +1128,10 @@ __LA_DECL int archive_compression(struct archive *) __LA_DEPRECATED; #endif +/* Parses a date string relative to the current time. + * NOTE: This is not intended for general date parsing, and the resulting timestamp should only be used for libarchive. */ +__LA_DECL time_t archive_parse_date(time_t now, const char *datestr); + __LA_DECL int archive_errno(struct archive *); __LA_DECL const char *archive_error_string(struct archive *); __LA_DECL const char *archive_format_name(struct archive *); @@ -1201,8 +1250,10 @@ __LA_DECL int archive_match_include_gname_w(struct archive *, const wchar_t *); /* Utility functions */ +#if ARCHIVE_VERSION_NUMBER < 4000000 /* Convenience function to sort a NULL terminated list of strings */ __LA_DECL int archive_utility_string_sort(char **); +#endif #ifdef __cplusplus } diff --git a/contrib/libarchive/libarchive/archive_acl.c b/contrib/libarchive/libarchive/archive_acl.c index bbb085afe7af..9e71f5ee5610 100644 --- a/contrib/libarchive/libarchive/archive_acl.c +++ b/contrib/libarchive/libarchive/archive_acl.c @@ -1185,8 +1185,13 @@ archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, /* Set remaining fields to blank. */ for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; + + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } - if (field[0].start != NULL && *(field[0].start) == L'#') { + if (*(field[0].start) == L'#') { /* Comment, skip entry */ continue; } @@ -1676,7 +1681,12 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text, for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; - if (field[0].start != NULL && *(field[0].start) == '#') { + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } + + if (*(field[0].start) == '#') { /* Comment, skip entry */ continue; } diff --git a/contrib/libarchive/libarchive/archive_acl_private.h b/contrib/libarchive/libarchive/archive_acl_private.h index 2c9b5053430e..54e4439692ed 100644 --- a/contrib/libarchive/libarchive/archive_acl_private.h +++ b/contrib/libarchive/libarchive/archive_acl_private.h @@ -80,4 +80,4 @@ int archive_acl_from_text_l(struct archive_acl *, const char * /* text */, int archive_acl_from_text_nl(struct archive_acl *, const char * /* text */, size_t /* size of text */, int /* type */, struct archive_string_conv *); -#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ +#endif /* !ARCHIVE_ACL_PRIVATE_H_INCLUDED */ diff --git a/contrib/libarchive/libarchive/archive_cmdline.c b/contrib/libarchive/libarchive/archive_cmdline.c index 2e5428cae516..23bb05d6424a 100644 --- a/contrib/libarchive/libarchive/archive_cmdline.c +++ b/contrib/libarchive/libarchive/archive_cmdline.c @@ -71,7 +71,7 @@ get_argument(struct archive_string *as, const char *p) archive_string_empty(as); /* Skip beginning space characters. */ - while (*s != '\0' && *s == ' ') + while (*s == ' ') s++; /* Copy non-space characters. */ while (*s != '\0' && *s != ' ') { diff --git a/contrib/libarchive/libarchive/archive_cryptor_private.h b/contrib/libarchive/libarchive/archive_cryptor_private.h index c13f29260a07..4b3c6c161433 100644 --- a/contrib/libarchive/libarchive/archive_cryptor_private.h +++ b/contrib/libarchive/libarchive/archive_cryptor_private.h @@ -64,6 +64,7 @@ typedef struct { #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA #include +#define ARCHIVE_CRYPTOR_USE_CNG 1 /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS @@ -86,6 +87,7 @@ typedef struct { #include #include #include +#define ARCHIVE_CRYPTOR_USE_MBED 1 #define AES_MAX_KEY_SIZE 32 #define AES_BLOCK_SIZE 16 @@ -105,6 +107,7 @@ typedef struct { #endif #include #include +#define ARCHIVE_CRYPTOR_USE_NETTLE 1 typedef struct { #if NETTLE_VERSION_MAJOR < 3 @@ -125,6 +128,7 @@ typedef struct { #elif defined(HAVE_LIBCRYPTO) #include "archive_openssl_evp_private.h" +#define ARCHIVE_CRYPTOR_USE_OPENSSL 1 #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 @@ -140,6 +144,10 @@ typedef struct { #else +#if defined(_WIN32) && !defined(__CYGWIN__) && !(defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA) +#define ARCHIVE_CRYPTOR_USE_WINCRYPT 1 +#endif + #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 typedef int archive_crypto_ctx; diff --git a/contrib/libarchive/libarchive/archive_digest.c b/contrib/libarchive/libarchive/archive_digest.c index 3776831b21c9..45fc36af1145 100644 --- a/contrib/libarchive/libarchive/archive_digest.c +++ b/contrib/libarchive/libarchive/archive_digest.c @@ -196,6 +196,13 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) +// These functions are available in macOS 10.4 and later, but deprecated from 10.15 onwards. +// We need to continue supporting this feature regardless, so suppress the warnings. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + static int __archive_md5init(archive_md5_ctx *ctx) { @@ -218,13 +225,46 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +#elif defined(ARCHIVE_CRYPTO_MD5_WIN) + +static int +__archive_md5init(archive_md5_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); +#endif +} + +static int +__archive_md5update(archive_md5_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_md5final(archive_md5_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 16, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int __archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_starts(ctx) == 0) +#else if (mbedtls_md5_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -234,7 +274,11 @@ static int __archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_update(ctx, indata, insize) == 0) +#else if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -243,7 +287,11 @@ __archive_md5update(archive_md5_ctx *ctx, const void *indata, static int __archive_md5final(archive_md5_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_finish(ctx, md) == 0) { +#else if (mbedtls_md5_finish_ret(ctx, md) == 0) { +#endif mbedtls_md5_free(ctx); return (ARCHIVE_OK); } else { @@ -311,31 +359,6 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_MD5_WIN) - -static int -__archive_md5init(archive_md5_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); -#endif -} - -static int -__archive_md5update(archive_md5_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_md5final(archive_md5_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 16, ctx)); -} - #else static int @@ -420,7 +443,11 @@ static int __archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_starts(ctx) == 0) +#else if (mbedtls_ripemd160_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -430,7 +457,11 @@ static int __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_update(ctx, indata, insize) == 0) +#else if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -439,7 +470,11 @@ __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, static int __archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_finish(ctx, md) == 0) { +#else if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { +#endif mbedtls_ripemd160_free(ctx); return (ARCHIVE_OK); } else { @@ -605,13 +640,42 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) + +static int +__archive_sha1init(archive_sha1_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); +#endif +} + +static int +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_sha1final(archive_sha1_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 20, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int __archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_starts(ctx) == 0) +#else if (mbedtls_sha1_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -621,7 +685,11 @@ static int __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_update(ctx, indata, insize) == 0) +#else if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -630,7 +698,11 @@ __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, static int __archive_sha1final(archive_sha1_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_finish(ctx, md) == 0) { +#else if (mbedtls_sha1_finish_ret(ctx, md) == 0) { +#endif mbedtls_sha1_free(ctx); return (ARCHIVE_OK); } else { @@ -698,31 +770,6 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) - -static int -__archive_sha1init(archive_sha1_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); -#endif -} - -static int -__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_sha1final(archive_sha1_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 20, ctx)); -} - #else static int @@ -873,13 +920,42 @@ __archive_sha256final(archive_sha256_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA256_WIN) + +static int +__archive_sha256init(archive_sha256_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA256_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_256)); +#endif +} + +static int +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, *** 35195 LINES SKIPPED *** From nobody Fri Aug 8 00:39:31 2025 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 4bylXg3pjRz63kkZ; Fri, 08 Aug 2025 00:39:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylXg1dBbz3XPB; Fri, 08 Aug 2025 00:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613571; 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=pv/xIZ12TUh+4cYNgyspbKZKEq2ZlCUylMcXe1WqIYM=; b=w59IyDf63WfBCd685t1cyJ+sTV+Mf1py/Gl+IfwTn6AGEEg9uCCn9GQKNalAtYx1VGPxMx ZMJlgR8Dtbj1maEPHELaKwhM1NC2QIKrcIZkstFk/Fm8pN9JFVX4VpXQruPI/be7t5CJK3 lZSytjPv4i6fD26jqkNCUGTJRdVNvlw0HmBgmx6Ngh/KFcrc3T+l1tK5tXicRmAMMARzMr laxLAD/7zaZiR4wNRU4lHV4wLnGEP1YVqVQeV7OqeXs3fQTLaPdjdfgFoeoE+COLErFw3h XtsHh6k/XnrgMjdtdyaY6cnU2WGzcjcXqzbIWck512tlWDGWPNsjokttc0e4Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754613571; 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=pv/xIZ12TUh+4cYNgyspbKZKEq2ZlCUylMcXe1WqIYM=; b=UxGLn5xQE6jmV+DYwVN/ipz88bPpIu1wT7QKA3ZtHg41Gf/Oc6TX8MDwCTjRyK9B/vluFg ACHQUMmX2tronqtlvyMN+GOBqJtPxf85wPdBWpegFD0CiOwAvICGxeiAsGodD11uc5mVPI J/ZSEctJMhj3FXJcz9Ve9rauZ6U1y3Hx4kb5sgzkJhagxrbYQOqvC2J3zp9PkzC8o3u+tx +K6b+u+M5undKUY4NA2ShMHR9XpCxTwJpgpaMmXG3d2E65moRjTsBPMfq3MPYX0y40AJr2 S7Z2qVnjf2N4H25RYCcPHcKrfMJGBySAbEN7g1w8aBP5ob5w3gEEpPSnlcKPEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754613571; a=rsa-sha256; cv=none; b=RtppDzkUt7FimnSDrmwY9+EBt9ofj0bzShi7Q+/xU9EYu4tgsBNBoRcNATOmiGlQBtoX0K R71YZ8U2IQCK0XJ1uYbBg1b0X4Q1qWEMXFCOJ6JOSq3Fwp/AKbZ0qOyiBKuioyHTVTus+n m0+fFLlh4HjC66pLI3JNO+7nw7phguwnoZz+IQLzJ4pRrtTWZphsdVIKdz0ZUx3MfuRCGC voTCC81hCUTX4phLc8+r3HhRBqne5NW8Jvrv4Z9SEiDN6dOH/eZON/FS6Qn3E9+eXueyvp zQCuaaDmH3Rvw+WA/BZruJO7dGChtOt3TLK0ijCd+lAZt7CNUlXMst7MMkjf6w== 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 4bylXg0X4jz1Rcl; Fri, 08 Aug 2025 00:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780dVll074253; Fri, 8 Aug 2025 00:39:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780dVbv074250; Fri, 8 Aug 2025 00:39:31 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:39:31 GMT Message-Id: <202508080039.5780dVbv074250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 23bc592b8fe4 - releng/13.5 - Add UPDATING entries and bump version. 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 23bc592b8fe46bbfa37f41ecc66fd30033df1463 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=23bc592b8fe46bbfa37f41ecc66fd30033df1463 commit 23bc592b8fe46bbfa37f41ecc66fd30033df1463 Author: Gordon Tetlow AuthorDate: 2025-08-08 00:23:24 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-08 00:23:24 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 6 ++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index b3f3eb5ef41d..98ab66444454 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250808: + 13.5-RELEASE-p3 SA-25:07.libarchive + + Update libarchive to 3.8.1 to fix integer overflow leading to double + free. [SA-25:07.libarchive] + 20250702: 13.5-RELEASE-p2 EN-25:09.libc EN-25:10.zfs diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 5259f59649ff..a58cc976112a 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Aug 8 00:56:40 2025 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 4bylwS2KKSz63lwN; Fri, 08 Aug 2025 00:56:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylwS1m6lz3fsy; Fri, 08 Aug 2025 00:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754614600; 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=0XpfJVStc11DRh3shjA+iw9RIdP9B0PmJGC6dhvfQB4=; b=OGgbzIYsk2+fDvjxcobLvw2V2q4HYbMNMGlYwK+HAOLnu3bmCsVQP9pqXm7M5CTcwXtyYL Ik5lwsl+Ypssyr1LLQO4KzqIyifk1udt6zyZ/9sQ6vyfrNMR+AK6cydScFK+6U5VLnAmXv eIyloAGH40rgmJHOIP/fAONeZXrri8Vv6pnqqkwLEBptnJbmdpSBPcOIB+xNQR7yHUmmwp 8AQgVfolBTxDEgtkMuUGLwHjKeDwi5k2gGSNWE7HQsOi+8uHpeJ93SOmlzS4tp2o3o8spf E90rWT04l/GGgwOLg1WHvDHprUkpvOnAhYbZzSnGdZcvt7f10/cgJwKOQirwGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754614600; 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=0XpfJVStc11DRh3shjA+iw9RIdP9B0PmJGC6dhvfQB4=; b=HA4XUu37DzR9OBSOGppiXEEV16RmuxechpROLV5l5OPtWMrWSGJJm+brPb2bw2xA34/ZMv NTzBgNlZIt4r20zZx7znKRCSlMX/bHgd1d2H3KeF30V64FEghb3wkb3iz6iHlBNpzJ352r bfiy1aQyzew2D6cWGms0idogC7dgoHvmdGkq2v/zJfpWmvruTlwYdtPS61b9pUER+9Q9Qm quT8sYbN0RvQyGKQlqrLSQXstziJ6n2d91snJi8VlvNy8In17ycv+/1RvYl32FwBtGIh3+ PBUwTMrPeP/Jdsf5SDdnYB23wuWBfH7tSLOSals9qeegExsvr9uHpqLLcCYnow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754614600; a=rsa-sha256; cv=none; b=OvuWr6A69qNx7CrwwQhJtlHuGT7oSl8qmyhMJLnDlWi8AE5C0T/GSL9TWtOfN1LFUITN51 7cF3q77mL9l5eUpdjUAzeCbgzaHAWHMzSjUWMK8ND+ifDi3nlZOr0RMVjCmUO90DLs4rt1 0kCESHL/uMGRr7dP3M/+rOeYGwe86S31rWocQfcxaNMdjeH/zbyFQfBK7RpQ9vt0ZPXBnQ WWZc46Knin4kvAvrIVJ9ZTC+ZUiOGzdGSS+6hIUwELi7M24efkSUVRZdxjxnReHjaugvFl BB7aQfIxmupbciMvwcm/JlkU/4OEbh+xK7yfXy6BiQLKxIFvMTWGn6WipkWVdw== 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 4bylwS1KTbz5s; Fri, 08 Aug 2025 00:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780ueqC010520; Fri, 8 Aug 2025 00:56:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780uegK010519; Fri, 8 Aug 2025 00:56:40 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:56:40 GMT Message-Id: <202508080056.5780uegK010519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: ef0a37ccf9b2 - Create tag release/14.3.0-p2 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.3.0-p2 X-Git-Reftype: annotated tag X-Git-Commit: ef0a37ccf9b20e72c01df60b1c0cfc28be18e217 Auto-Submitted: auto-generated The annotated tag release/14.3.0-p2 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.3.0-p2 tag release/14.3.0-p2 Tagger: Philip Paeps TaggerDate: 2025-08-08 00:56:12 +0000 Tag FreeBSD 14.3-RELEASE-p2 commit 5982521fe3dd3f1627bbe29ee8c3b190a24e3963 Author: Gordon Tetlow AuthorDate: 2025-08-08 00:15:39 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-08 00:15:39 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Aug 8 00:57:30 2025 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 4bylxQ4PqTz63llK; Fri, 08 Aug 2025 00:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylxQ3jfHz3fyF; Fri, 08 Aug 2025 00:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754614650; 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=36jcXmTLs7SPxFfRYNemvKFnC1YzE855c7QsMG+56NU=; b=U1nxRJ0AUY8+r6yEt18Eqo8GOXaP/U8zhhBPz/2iSFlUDFVDtjsh5GYDAsEbaUfuvIy3/f BAfcCdWLFoZzSyk5y3uCRxwwaYP2yKenFCw3JBLNqnzGUCe7Em+Rlj8bOhR4IOzb1t8xAT 4xX+ZVkahVO+5sLNzPDJ0+x2ScKulrsqSZfUGZWTAgccbttFFwD5y98zZxiHOLlFV/pXvS 95dQ6I+9cGXVaY+8LUKFRJLj+76hPqM3IR44sPy7eemhcjus+EHN4RwNbQ83t+SPs+lNuR K1vyGaVuX5U4MHAfjALICyl+Df8C/WGCO3qZsHm05oLsXxdYlE6z37D7j9yFjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754614650; 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=36jcXmTLs7SPxFfRYNemvKFnC1YzE855c7QsMG+56NU=; b=vZVaWmKHBpZnR5OBQsv0gYYfVdpKAVpONYz4yNVxwq0LJu9ez1mg1YH3bd8ReRD82ViEIi D24rP1xD9SEgm82kIaeUwejnaOoyXgqMowvwu5W2e3Z+aFE8Q8XeDku3M0qgSAX5koaGkX QG72hYDeXoVG6UkzHmUkqaXxNlXPQDym9CjOwjJCojrOXfH1h4LC007y54kZJrkKLketxt zAiMT7M8BZJ3Tf5N24UZ5YRyRgNrgH4JVCfJdIP6XuQ7kwMRNaoprVvMI0NAYda0D/iQ4A sKHzy3z2wmOqcbFABfZOPJAkt9Keq/LsWKZ5RtA8+QHBChM0C6uCw+HKDF1f3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754614650; a=rsa-sha256; cv=none; b=Fky0+AlZ6DSgiHSFtJeha74DXHIm1/svt9NtzwwfbK6N4Kyorwo5yJndFqPL1dpdDSDuAq cY0obyB4rSiuR6K8Z9ukLO1WIuzBdZn+nUsWIX7u68AVYgIvoS+eCW4zqA1Ef7cv/LHv/5 w2fOTFj1vP9fTMB5txAGecyi6Q1s/lZhw5ZxueBwZggbaOv3EJLZS5qG9/B2uAr7ks/yAN zpFjfE7HKCO4B2gl0b83e2sHeup13E9SNkhemSV/nPbKkyx1vKDUGVFALzrh/aF+B7ye31 GywAqOVhIwPcbzvUNSHi1/2TVPq1dYgI5r0VA/+u5AujBmto/tA2qf8ua/nBsA== 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 4bylxQ3GrZzLZ; Fri, 08 Aug 2025 00:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780vUMW010778; Fri, 8 Aug 2025 00:57:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780vUB8010777; Fri, 8 Aug 2025 00:57:30 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:57:30 GMT Message-Id: <202508080057.5780vUB8010777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: b3de27c62c37 - Create tag release/14.2.0-p5 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.2.0-p5 X-Git-Reftype: annotated tag X-Git-Commit: b3de27c62c377257b3f0ad72bdbb29406169d2e3 Auto-Submitted: auto-generated The annotated tag release/14.2.0-p5 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.2.0-p5 tag release/14.2.0-p5 Tagger: Philip Paeps TaggerDate: 2025-08-08 00:57:08 +0000 Tag FreeBSD 14.2-RELEASE-p5 commit 0781dd1545f6ed8a12cad7c3b98cf7c36c5af36f Author: Gordon Tetlow AuthorDate: 2025-08-08 00:18:32 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-08 00:18:32 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Aug 8 00:58:15 2025 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 4bylyH23pmz63lsK; Fri, 08 Aug 2025 00:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bylyH1YKKz3gHl; Fri, 08 Aug 2025 00:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754614695; 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=foC0Aa5vIYCMGMvJbCOClFYhV5o3ymORovE+Ioin0iE=; b=izbx4/3h008xR4NvvjyaOmA2X97uCTSDLnv8r3VdlrPPbrTf50O9FWvT7FW9LLw1LMzNHM di3uGf0Lm6WVqNrfC6j3T9Ah3e6m0KzHaLOnuaXsA+Xvn599CV/hKlx9nchc/K6CtDDXRt Vf8nV+zAkUDJzX1PUs9MYFk3jMPoFGtgm153tso6pVPuv5rBfKQUutQsKegTX02hBHZmrn d91F8JFNZmmOa52gAXA+HdZnV85/f6fmPs39j7D0wqtHVvFb99xQYweHNq3ETyghHm1+A7 tcMBRpLNWKBiJkgv3u84j6++8EICdiq0yFMeGFUt8CipYJV/V83BohkkwIB08Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754614695; 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=foC0Aa5vIYCMGMvJbCOClFYhV5o3ymORovE+Ioin0iE=; b=h+WDFFbN9zdM3+CbVGuWBr/pTl+BOsYzL4GsBY2aXqQZCrv0IAIGH2A6Ba9omBnk5bfcuy FrhhKWFj8uQtqiRRn/NUM/GTi+6cse35gW9UJytn1jjZ8ijOvjD+JiICR2J85gd5z8thOm en3cwoD+Z4ufCHCOkxNj+W+RQL0uAgYeYDYD8pTO6Ckpj2dEWrtTY4bSy2PZ9t0cPFNIEM +x2KH917W/KAokulGvWAQwMMeS/5JIUD+sDUocKZ9G5w6mTP3iIBeksH+K8Pms6Po6dwPc ccwURwSHDXzwFIEW2FWaGynlSNmt9k7GfqPW16A/MHdqrdDYt/uZKKjJzh69Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754614695; a=rsa-sha256; cv=none; b=l07eoDz1l5/cE96Rh88dbWOzEsqL9wQduxVfKGn8WsS2dCo143uigHOZCKIe/OQvBUK1zV gVJPNlUK1aOOSngYB1D+NH2bv95Ni42nqcFAqnbHEFSzxhj0a0fehHPTmr4PK33I2ExTV3 au3BoLfEbLuIjzRVoVBcNs2cbMys0dkgv3yFwCoJ0jmJfLPMV+YkanvTbr/la+P8tt6wmt JbKHfT8NPr9i8ECKvKFdPk1VlRDzp/tGrugLIoMiVRXOJvUgLGp3d2lEJAvsEOS0+z+GDa /MpNXR2wW6Sh33AXzuVagcx67FdXm1ikul31U92UHBrBBHcTaWftn7pT+rHNtA== 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 4bylyH181tz5t; Fri, 08 Aug 2025 00:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5780wF9I011047; Fri, 8 Aug 2025 00:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5780wFbQ011046; Fri, 8 Aug 2025 00:58:15 GMT (envelope-from git) Date: Fri, 8 Aug 2025 00:58:15 GMT Message-Id: <202508080058.5780wFbQ011046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: a7e482a2a613 - Create tag release/13.5.0-p3 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/13.5.0-p3 X-Git-Reftype: annotated tag X-Git-Commit: a7e482a2a61360b5643b54cd310587a3e54216e5 Auto-Submitted: auto-generated The annotated tag release/13.5.0-p3 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/13.5.0-p3 tag release/13.5.0-p3 Tagger: Philip Paeps TaggerDate: 2025-08-08 00:57:56 +0000 Tag FreeBSD 13.5-RELEASE-p3 commit 23bc592b8fe46bbfa37f41ecc66fd30033df1463 Author: Gordon Tetlow AuthorDate: 2025-08-08 00:23:24 +0000 Commit: Gordon Tetlow CommitDate: 2025-08-08 00:23:24 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Aug 8 04:18:41 2025 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 4byrPZ3vm5z647PP; Fri, 08 Aug 2025 04:18: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4byrPZ1lBXz3PMd; Fri, 08 Aug 2025 04:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754626722; 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=gCb8Kon8EsEpTvNO05u1R7XS+nV5a5fjlpyvftqrCqQ=; b=aH8XzoT9ozKxOnVzx5J5BKCS8wTfvSDu78l02VHPvo4aqcXrQHUEBKhAIbijqCnI+EFs20 OhvSGXVxHDfFNbWINMDNUaTho7BHB15O2J22J0p1RSO6fx+tXuMWyLIziZ3zUQjjcMzUIW yAhS5MQHkmR1tK5TB74SyhdyXa45j4Dj1y8VfUCRzN6mbar1Cevoo6vOvj/+dot6tLBkb9 WqIee0OinxXHgdonWSC4AuaGXo3hN+IUp7snlgbGl3TFsVeq0EUKHlGUq8y9c2G/l4V+7u XG0Wi6eREnmVYlLhvwA8/k8MgMZcqLwJmtrZfhAGYks9Jwpkqd4c6kGtMjg3Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754626722; 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=gCb8Kon8EsEpTvNO05u1R7XS+nV5a5fjlpyvftqrCqQ=; b=o9nMDh+jB7JhzNgCaIXBjgH7QVqK+W2GMq7S7FBTQdAYXF+ERO/D04vI5nMquwE5BH/HxK NqN27HPJiNraAftvg8RXbGEL7UA2NqGMMurxnKHxx/yH3/7TtyIjTuNaWFnZEBujfapHlR gO/Ozku+LUyfvn9uqJxqARzDqiZY7trfMtfHhsHM6w1O6uwn8pONwzYaV3YYDSCV0clgtd Qplmm6WkeOwgC4g+c+Npu0+M+AUJPqeOvKDsuYQdOJE3URqY2s7R5XWeR+hHmFvBlNgooA R5uOFY+JCJ0Qfu3EsgqaPQowIRtGTam8K37AroKfnpXKKd/YjoJXhKjcAT0dYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754626722; a=rsa-sha256; cv=none; b=yLHbeyHKKaL/mMyReMqZUJ3878OOiOxG6kRbKUAuv18N8yX0+Kx1iutDswXjHlBzD94fme WmbuUZr4LTEXEfrh0qAdYMZpHU5/qW4rJ6UoLUZ/PGY9H6VutAupbrIg1D3wcghB9u56T1 I2vKTqa4rK2+JE8xsyeKBk0dZmOqrEXDBjaIrHaYOJ9lxSUpGFMK4sjF+DYOyrunXXDi3B RZNazF+N2xPC3ScZDvScHFRpuIzPmNh6n8JEoWBC5dy+YVaIi2XhaBYWjYzKtWsoRI80an Snk/EHsvVVF0xhnZ8Qg0h7Niccd76bjxWkKFOKztqKDNmLEn4l/R9FgHK6n/Cw== 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 4byrPZ13pPz5N6; Fri, 08 Aug 2025 04:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5784Iftq086542; Fri, 8 Aug 2025 04:18:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5784IfcK086539; Fri, 8 Aug 2025 04:18:41 GMT (envelope-from git) Date: Fri, 8 Aug 2025 04:18:41 GMT Message-Id: <202508080418.5784IfcK086539@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: 592f2e599f24 - stable/14 - devfs readdir: handle short buffer same as UFS 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 592f2e599f242826a68a08186f2e65e29c2eb887 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=592f2e599f242826a68a08186f2e65e29c2eb887 commit 592f2e599f242826a68a08186f2e65e29c2eb887 Author: Konstantin Belousov AuthorDate: 2025-08-01 08:22:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-08 04:16:47 +0000 devfs readdir: handle short buffer same as UFS (cherry picked from commit 011efaa5cd246a67bbe6e37364baa18178a9f7bd) --- sys/fs/devfs/devfs_vnops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 4b6845602218..2a4576320286 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1452,6 +1452,7 @@ devfs_readdir(struct vop_readdir_args *ap) struct devfs_mount *dmp; off_t off; int *tmp_ncookies = NULL; + ssize_t startresid; if (ap->a_vp->v_type != VDIR) return (ENOTDIR); @@ -1484,6 +1485,7 @@ devfs_readdir(struct vop_readdir_args *ap) error = 0; de = ap->a_vp->v_data; off = 0; + startresid = uio->uio_resid; TAILQ_FOREACH(dd, &de->de_dlist, de_list) { KASSERT(dd->de_cdp != (void *)0xdeadc0de, ("%s %d\n", __func__, __LINE__)); if (dd->de_flags & (DE_COVERED | DE_WHITEOUT)) @@ -1496,8 +1498,13 @@ devfs_readdir(struct vop_readdir_args *ap) de = dd; dp = dd->de_dirent; MPASS(dp->d_reclen == GENERIC_DIRSIZ(dp)); - if (dp->d_reclen > uio->uio_resid) + if (dp->d_reclen > uio->uio_resid) { + /* Nothing was copied out, return EINVAL. */ + if (uio->uio_resid == startresid) + error = EINVAL; + /* Otherwise stop. */ break; + } dp->d_fileno = de->de_inode; /* NOTE: d_off is the offset for the *next* entry. */ dp->d_off = off + dp->d_reclen; From nobody Fri Aug 8 22:09:14 2025 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 4bzJ8q3vWjz64DLY; Fri, 08 Aug 2025 22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzJ8q1Sytz3rj8; Fri, 08 Aug 2025 22: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=1754690955; 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=noFpLBvbi6BhLZSC+yOMT0fG5vgylvkyp2m69R1ME3A=; b=sZp1gLOFBgEG+b3HsMmKMDofmbS906eKlryHytC4NjEaB0c4RdAx5rwY2Rpv2rTM10+oCd Fouu4omKLgB1BMSKZfuaNuGxtwKSJKnNTOhgl6xGVLKADCf9v89Obv1xtRt1rJYPIEcpDT UY91oI37qIROVRsR+DH9hwnQ+8qUlSsrn+afyhhzmaJsVGCP17K0EwHRUq98C2nfbJFD8A 6TROdO+paPdEkhdyby94Zf23AVP9yYFaEMagYjWtSiksmXxT0P+F2m3usCOaNLdb71B36H a91NKToG7yGu1ErFAgdji9UJXevUAFClH0HT8t+Alha7jrRCe/uhCXac4b8EXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690955; 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=noFpLBvbi6BhLZSC+yOMT0fG5vgylvkyp2m69R1ME3A=; b=sFcl4TVTNDHKDo6+8EoIQnHvhkzbyIYCDKe6A1XwzB5TLEwZX/Wu323IsrGIRKxrAw4eaN GRfFghYRAhFm2amXFzMj6FhVn+u/3kjjWkMvOu+iWJboj0zuLLcznoPz9XWUMiauN2ImIQ /GFsESwIQ6gRqhYoWI9tHsprbafnEQCpJMac1j4b7smQ7O8szzPZrwjw13t4D8liXuP8wq iMuL/lF7PuM4hV1opF0ggd0EU4nSAYbFGKcN6DJyfmZvk1DrtZE8dkGyzfmUgdNdyHKgQC WBx8WX98LGByD0Mhxac4+q27r9BM36CqElEKRPRD/oU3+ICPw0Rmhyd0JV+Mmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754690955; a=rsa-sha256; cv=none; b=LIkD/UX6c9rBmx6RAOqSaPYVkpQyR+sZ0wM9ASMHhfW9Bl14zvluRrGduWsQii3Zq0TMaM wdwNTxJO6OSI7uFX1U1QwsIgY0juzXUF921I2OuyvDnUD0Jcs6J8s6xb/Tisk62b2rQepZ k3AoY8ZnXagzF6D29HU5pCh9r3ZgW2zHHVtAwvCo10GP24iu5HwrWjoFjNTQUgj92ETy1I 96oYit/X0fmYv2dC3fD0j69/SjFGqjs39k32gaxCC08aNaTGXsJo6GLq4oCA8GffyjZYNU Pp7qKLx97KUED/VCOt8WQHIm8cLprBxi7hpdzR9334b0qx6AI/ECZ6XGNLQvyA== 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 4bzJ8q0bzgzv2Z; Fri, 08 Aug 2025 22:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 578M9EnN088912; Fri, 8 Aug 2025 22:09:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 578M9E66088909; Fri, 8 Aug 2025 22:09:14 GMT (envelope-from git) Date: Fri, 8 Aug 2025 22:09:14 GMT Message-Id: <202508082209.578M9E66088909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f2805cf36d39 - stable/14 - bsnmpd: Fix an error message 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2805cf36d3928d34afc54b54397ec04c502032f Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f2805cf36d3928d34afc54b54397ec04c502032f commit f2805cf36d3928d34afc54b54397ec04c502032f Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-08 19:47:00 +0000 bsnmpd: Fix an error message MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51678 (cherry picked from commit bf304a40cde836435a55e938865fc12ce81cf0fe) --- usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c index 8b7e4608d673..f7484e90189b 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c @@ -372,7 +372,7 @@ swins_get_packages(void) } if (errno != 0) { - syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:" + syslog(LOG_ERR, "hrSWInstalledTable: readdir(\"%s\") failed:" " %m", pkg_dir); ret = -1; } else { From nobody Fri Aug 8 22:09:16 2025 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 4bzJ8r4CKZz64DLZ; Fri, 08 Aug 2025 22:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzJ8r1nM4z3rtd; Fri, 08 Aug 2025 22:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690956; 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=yAnHsqh5G1c5/5oNsBFdIgxsq4zheMMqJRC0lM5N1pI=; b=enADEYDquQohwSnpwgyWHXdZm4jdnle+C71Qv/BJzivsEGSEwhR5Wj/Q/I1CpKAqXH3jbf xJZt/OTiN5ZzK0JQxgBvt7yqnsviUnSRjlHDGi0/UfzpDgDygUB1PvaPlYnzqnxrJ5hXlt ScPcPHd0rNnDinoeL5xKJOXSeqNnGn4JZmM9+0Bb4Pj4rWVwLAGnH7hFhwczO0ihbzx/Mz aS2mcXAvAUhc7w16YJLuGwBJfWDLE1L8FvI+X9D3IkeDokViEIogPu0Mj9hr4IGvER4WzF FWdd5jrRQZzmmh1a+Ki42+i6X0cachWj1ckS5aLYiHNHG7gy8Hn6VVQDNBvIQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690956; 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=yAnHsqh5G1c5/5oNsBFdIgxsq4zheMMqJRC0lM5N1pI=; b=cuWXlaJKdrdP0GVg+d7ZoWxIgwXJ5gDGlF+6ISD4SIxmUnx/KzkBc0QYHFcVF01Zowzyr8 6JKfzfkLdx6RHVeRX2sev2LLZUgqptKlJz68yfpLLkF5CbnSrwEcbU+e9E/UwsiKhF7dBK zVR5ZbBAPEH7uaUagIVWnX/+WLI+ypb2LURlNyUTS+YS+ZJOpKwQgotDTlYo3fvHKA/peQ 3btP8BCW7dUaJEX22UeNz4W129EvU3z62pje+BXez28Cq84zpARwxyCH3w0jRp1XBnl99N g7GEkCxz4tGTgfqvgUKKPyMtHWCEkvuizUuJk2ENwYBS18U+5IwUV94yfbFkXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754690956; a=rsa-sha256; cv=none; b=lLcyj1wXhz/QSLkNprn9/j9K4qdw4DByaj2mgnu0zy0vByR4vqmSE8zLXqQKiCKsp0IYHu JozkbnmgONIGQ4NUgukhGcgOEj8tJ0rSVJteCTFo1AzJhKRDh+EVtN2eZOqx8i8rV3Ezep HcEVukFrwVMr2FkzDj71OkkP+EaadMYXj1tBYSEj/L86OZYZN5reY8tqeZarwHczS7pnpl uqTV+7Y2WVDRX+zwircY77VqkrFYOawd5dc+48DBjrfP3IYtpx54SlK7wVssCGXNi3BLkb d103qJ39NU6WM9RSUz/LUPbSQUJeMPJIGvFFki8f0ToAhbU0bxKxZcht6vvlHg== 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 4bzJ8r0zqRzv2b; Fri, 08 Aug 2025 22:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 578M9GS0088947; Fri, 8 Aug 2025 22:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 578M9Gc6088944; Fri, 8 Aug 2025 22:09:16 GMT (envelope-from git) Date: Fri, 8 Aug 2025 22:09:16 GMT Message-Id: <202508082209.578M9Gc6088944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 9ddbef8a3a82 - stable/14 - libarchive: Stop using readdir_r() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9ddbef8a3a827dfa5a0c332838e1fc8e384c4d92 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9ddbef8a3a827dfa5a0c332838e1fc8e384c4d92 commit 9ddbef8a3a827dfa5a0c332838e1fc8e384c4d92 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-08 19:47:01 +0000 libarchive: Stop using readdir_r() It cannot be used safely, though libarchive goes to ridiculous lengths to attempt to do so. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51679 (cherry picked from commit 01e42ce81f751ccbeeddc4bc2716e6bd634cf5f8) --- lib/libarchive/config_freebsd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index a3a0216169bf..1601adddd0de 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -165,7 +165,6 @@ #define HAVE_POSIX_SPAWNP 1 #define HAVE_PTHREAD_H 1 #define HAVE_PWD_H 1 -#define HAVE_READDIR_R 1 #define HAVE_READLINK 1 #define HAVE_READLINKAT 1 #ifndef __linux__ From nobody Fri Aug 8 22:09:17 2025 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 4bzJ8s5bZTz64DLb; Fri, 08 Aug 2025 22:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzJ8s2bjvz3rj9; Fri, 08 Aug 2025 22:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690957; 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=T+bwdTC39bbMI/qoTDxO0ckFrzWzNHKTOG0LWwCuwT8=; b=Ofp8swtr4czXBvcFWnzZSOgN990XdiGUbqggv06ZimHUCMeqbKNtaEZ2EyyN8uITRJjAqJ wBzfWa/HPtTD+wacTvOh6D3enG/pHtp7mNCjFGITXUbyCoo6OYPTblIKqrmcgDeiQe9jA7 lL9MF9aU/xTSl66fz0n3mIcD09YMpJnPPGs++LivOgr0gXRW4cVrQcrv3IZHXdU+/CtNmz QfBeEwnD4Pbtrg3vxeQNjfWAguLCOY+fcViDYMQl4AeBjz74EEh2rF42KHeTSWmH1KExWp LrQ1cYsq9fc4SodfPSByupBSzj77dyKdcXxUgbbeP4swz1EjMF8x4cEtorJIgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690957; 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=T+bwdTC39bbMI/qoTDxO0ckFrzWzNHKTOG0LWwCuwT8=; b=Xb5t2cQn3CZg2qSMwxBLIDtF+pW0TE9lDyi34yscb9ybZwtttyvg+yRWuUQeVDP8NVyiR+ d0bWzU8jFaOaA9Sy22j3Egsz/tt/DWfSi++L8Zk3cJU4if73/SipyjJlSQT3VcV5SqP67Z zsDli2X2MnnktUl5TRRNzQhXY4WCRXs/k9D/Z8NTFut1yJPoF+WuBxhaKknEUyoy72L4X6 S/W3eDahWFRy3ygaFMT/M5Bell97RtA7Z0AAWAGLAfisO74j+K0M/DzpyCr3lsJp2G1IMX w0C226EWhBtWDEKTqw7Rgf1ZHFPhwekRTyQwu+H6uhrNCnd+pp4cR0jwQp9L7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754690957; a=rsa-sha256; cv=none; b=utueNpzO6OcnFK+VOmxgnqbXMrcw+fDFJXpmO+2yi4dWaConTosOZQZ4q6lTh1z8LrasVq QJfw9I5XYFnBNfl6VsH8Iy6eY3gqZfNt0ERJRzOmmBvyWBiAzMdStvFMw1ffjIj80NSTiQ he6XmnKlnEt69AwgKNczHuozTbj698xHx/BoxlDg4b6n62hwnG/1V0EuMNUlwp/00WUHUO lp/lquaCQAa1VuO22niLFclRCfYqngVtzcWNwxdPb398fwasjp/R05VXTSOfVZaZFV+uL3 xCFlWtUZHWfcWx7x1WNTxCiCLdybKS7QZAwd0MvGBcaKvimIGVlwb/lSUBoK2A== 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 4bzJ8s1nr0zv0k; Fri, 08 Aug 2025 22:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 578M9HYw088982; Fri, 8 Aug 2025 22:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 578M9Hck088979; Fri, 8 Aug 2025 22:09:17 GMT (envelope-from git) Date: Fri, 8 Aug 2025 22:09:17 GMT Message-Id: <202508082209.578M9Hck088979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 927c3d709317 - stable/14 - kyua: Stop using readdir_r() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 927c3d7093177a9c1f38cf11f59d17a5b41720e8 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=927c3d7093177a9c1f38cf11f59d17a5b41720e8 commit 927c3d7093177a9c1f38cf11f59d17a5b41720e8 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:26 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-08 19:47:01 +0000 kyua: Stop using readdir_r() It cannot be used safely, and Kyua doesn't even pretend to try. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: igoro Differential Revision: https://reviews.freebsd.org/D51680 (cherry picked from commit 65bae451c23b8d61b2433259d8e707250660eeff) --- contrib/kyua/utils/fs/directory.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/contrib/kyua/utils/fs/directory.cpp b/contrib/kyua/utils/fs/directory.cpp index ff7ad5e34357..9103c2377c34 100644 --- a/contrib/kyua/utils/fs/directory.cpp +++ b/contrib/kyua/utils/fs/directory.cpp @@ -127,16 +127,9 @@ struct utils::fs::detail::directory_iterator::impl : utils::noncopyable { /// not. A null pointer means an invalid iterator. ::DIR* _dirp; - /// Raw representation of the system directory entry. - /// - /// We need to keep this at the class level so that we can use the - /// readdir_r(3) function. - ::dirent _dirent; - /// Custom representation of the directory entry. /// - /// This is separate from _dirent because this is the type we return to the - /// user. We must keep this as a pointer so that we can support the common + /// We must keep this as a pointer so that we can support the common /// operators (* and ->) over iterators. std::auto_ptr< directory_entry > _entry; @@ -192,22 +185,23 @@ struct utils::fs::detail::directory_iterator::impl : utils::noncopyable { /// It is possible to use this function on a new directory_entry object to /// initialize the first entry. /// - /// \throw system_error If the call to readdir_r fails. + /// \throw system_error If the call to readdir fails. void next(void) { ::dirent* result; - if (::readdir_r(_dirp, &_dirent, &result) == -1) { + errno = 0; + if ((result = ::readdir(_dirp)) == NULL && errno != 0) { const int original_errno = errno; - throw fs::system_error(F("readdir_r(%s) failed") % _path, + throw fs::system_error(F("readdir(%s) failed") % _path, original_errno); } if (result == NULL) { _entry.reset(NULL); close(); } else { - _entry.reset(new directory_entry(_dirent.d_name)); + _entry.reset(new directory_entry(result->d_name)); } } }; From nobody Fri Aug 8 22:09:22 2025 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 4bzJ8z22Z0z64DCw; Fri, 08 Aug 2025 22:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzJ8z1D5bz3s5N; Fri, 08 Aug 2025 22:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690963; 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=ViQn3/w1LzGoDSJ6B5ciFvHzTWhtoVJoHkJ5BqqzvoM=; b=aMRRdycmXPMEZ7qOLbkpz56BQxH12UdzlHxq1Am4yDPb8x9sqSOL0Gx0FIip/Fen9JSxE4 6j3Vcx/BDBCzbigF37WybRLh+pOrdxktPJJL7UUZzpaJZ9yLps5uQX710z2gEMWXAgUAcm RJoHDs1y/ISp3P/GVWxRbY5ufeRX4HEk3pFOeN52cCAO7qzv/xe7BvY0RLZc71zpOdXCn1 dcO2zz2lK3AUYIum0CJMQPciWrdhek9ktLp9zpWU7wAkFjiqFYeJO4W/1Nk24fLmDkLvGe AIHPKlKcSRx/RpaoWGAm2EZY074CVB2mBVBvtO5CI1uuDJVAx7gjquMZWOr9PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690963; 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=ViQn3/w1LzGoDSJ6B5ciFvHzTWhtoVJoHkJ5BqqzvoM=; b=TX9pEiJLJOaS8gmN38j0Hs2kCm2abh5C9QGN99SdSwRzfTm4K/l8Fuaz+bVfe0oDCdgqZN RUNW2j67WpiDLMzqcJndf+TFrXwLy9xgq28eYldprNEtN3Hf+aa/m4LVBOhDe9ClIntW8+ 7eWik2oAEaXOCTOI/iejvgBxGtkPsmwS16yrzQkn+/Jsvd1Ag5qv2AWtkNTEGM/cVhPB+Q bgxHGvUY1kBaWyrrpWPlOA3Vh5BziOXzxe7F2P18UNrsyq/Y/r/TZ3AkBPC/kGaTAiFvKt bJIavyiDqP3oMdlGpk6japJED9aYvebVgUtZWSapw5fxzW+SwSIk9sPETPBw4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754690963; a=rsa-sha256; cv=none; b=Y+etXEYPSwLPtKhAKTYF/w5aS4tT0AVKHECJtQw7iNXMJaB27YFmsi71a/i/rstvyH9P40 K0Ev2LlV6vgaAZZo3oCO0lbqs12UwCYhitPnwp7ztV1B1vCpv+QXQXdQUG3Y4X50iPpcAf ne9P5VC/0xXBy1+I3O2Em0LFUTbHmvHBReVdAkb8Y18xv0epu61X6ptU7jZdM2PyXUc6WU EbwZBtmCNMvgp2ZkzVNwORP5uoC9mg606ODcpH8IUQC8ShR3NRLYu/xCEo3HJd+fGwvKh1 9arzZBNL9Nx9Zkq36zGHSZ5vT2eH46GZeCrkzdwfjZFobX4FGv/1l0tjQrzddQ== 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 4bzJ8z0c6Fzt9r; Fri, 08 Aug 2025 22:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 578M9MBm089146; Fri, 8 Aug 2025 22:09:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 578M9MDa089143; Fri, 8 Aug 2025 22:09:22 GMT (envelope-from git) Date: Fri, 8 Aug 2025 22:09:22 GMT Message-Id: <202508082209.578M9MDa089143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 6d2bc21c6731 - stable/13 - bsnmpd: Fix an error message 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d2bc21c67310479747d7d05eac9cd13821b50c7 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6d2bc21c67310479747d7d05eac9cd13821b50c7 commit 6d2bc21c67310479747d7d05eac9cd13821b50c7 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-08 19:46:32 +0000 bsnmpd: Fix an error message MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51678 (cherry picked from commit bf304a40cde836435a55e938865fc12ce81cf0fe) --- usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c index 8b7e4608d673..f7484e90189b 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c @@ -372,7 +372,7 @@ swins_get_packages(void) } if (errno != 0) { - syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:" + syslog(LOG_ERR, "hrSWInstalledTable: readdir(\"%s\") failed:" " %m", pkg_dir); ret = -1; } else { From nobody Fri Aug 8 22:09:24 2025 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 4bzJ905lzCz64DNY; Fri, 08 Aug 2025 22:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzJ901l1dz3s7N; Fri, 08 Aug 2025 22:09:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690964; 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=mHSBI3Duer0GjYuYBsnaL/sKvMuRFuEyGA35Izh+zVg=; b=jljj2Iio7pYZqytnmX8Xrt+3hajvpMu7y/OB9KP7IdwZ8tDPqDyUVgRxYpnILdnexBBuoe UtoBthbaF4o9+6mTgCp7Go6liAtCgHJWVCN3/gKUC7fADceLNXvuJ/lZ5tvSfEW2azJNKH mKfNjt+A354fqLKdu78EXnkn3TCfeQWLhMWaxvNd6TLE7L6WySdLtZS0LbqXfyB8CrBWyO gqhyXRI816MTOVi3dYpXf2CYdAhO2HOr6k9KKItWiFlPtBVLPwyqaVu31YKvHeYp2jGiSO w3/rlYyyMEvX/+dK82Pc0iR0ByuRUcu+YGmAZQ+w+lI7m9BXqJESmBDwKYWUBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690964; 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=mHSBI3Duer0GjYuYBsnaL/sKvMuRFuEyGA35Izh+zVg=; b=WdEGqQJoLIE6FkJETLTp1xCnzxvA0Wf5DUuU4nFMCJKWNdu9lMHOl2jX5ai4DU620RMVOu hzMawcJZI7rplfkGk3ejhLn+hZPRHdQe6O0W7RH16fLf1xGxyZIxpVMgSW3PgR0RobFw/t rJT6nYydaKk7hXk7uYBPpySK6bLxqIfA0IrW99EjZCehIGJGXRaZr0PZZqJC65xc1XAIjc +AZzuU0K8kaQKpEvXZxpcFO+ITldjzzO+sB7GlvNantE6pY7ODbP0Hgj7A9ArnvM0A1u9N 601GwvOsy7NVYTyKXoECcRMGDy6jDRkZpsJz1KJ2e3B95JmPcwQ0XMI4gp5bpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754690964; a=rsa-sha256; cv=none; b=F4oHNxUw3k/jAEfm+42HQ3KLdfdURRv9uZ1dUIe5c2IgcEjH2SRF6tsJ6+jd2q6K95OyCQ 8odIy5qMvfi41adcvRu3AiDay2fpXWI1X/Zc5LZp7j9slPpwriCJ6Dpm/W/NeyctWBrqcT OziYR0y5kwK/k8CvDWcaa8Pobcvc8p+SR/Xt7qiUeDNaIulA5xsqTbexoiW91WTq0U4H5j 5KE8k3Tlfek9zMNkHVWUpvvwKWlQ3gemF81zdF1mZ+WpfsurjxoKLCrz+uJ/yEHZoiEPpe uA7OhnaxSqwLzez65ZWo7Lit05viAsZPJvoduYBwsq+/X7B/X5rUjyJQr6RIRA== 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 4bzJ901HDHzv54; Fri, 08 Aug 2025 22:09:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 578M9O39089182; Fri, 8 Aug 2025 22:09:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 578M9OTM089179; Fri, 8 Aug 2025 22:09:24 GMT (envelope-from git) Date: Fri, 8 Aug 2025 22:09:24 GMT Message-Id: <202508082209.578M9OTM089179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 83e2f9e1c0cf - stable/13 - libarchive: Stop using readdir_r() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 83e2f9e1c0cf31ee8750051d8f6ef661ddafba66 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=83e2f9e1c0cf31ee8750051d8f6ef661ddafba66 commit 83e2f9e1c0cf31ee8750051d8f6ef661ddafba66 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-08 19:46:32 +0000 libarchive: Stop using readdir_r() It cannot be used safely, though libarchive goes to ridiculous lengths to attempt to do so. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51679 (cherry picked from commit 01e42ce81f751ccbeeddc4bc2716e6bd634cf5f8) --- lib/libarchive/config_freebsd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index 49b212c2204c..746207360872 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -163,7 +163,6 @@ #define HAVE_POSIX_SPAWNP 1 #define HAVE_PTHREAD_H 1 #define HAVE_PWD_H 1 -#define HAVE_READDIR_R 1 #define HAVE_READLINK 1 #define HAVE_READLINKAT 1 #define HAVE_READPASSPHRASE 1 From nobody Fri Aug 8 22:09:25 2025 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 4bzJ915SwRz64DFw; Fri, 08 Aug 2025 22:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzJ913Mssz3sGQ; Fri, 08 Aug 2025 22:09:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690965; 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=lGiivm17axyJIsBGVYppCvJWmY5CO9aHtXIY88s7uJ4=; b=Dv0OFLSCtiX7d4kf/qrvxFjZ2HhPwG9HwUM6WI4F7Lt3LjmDfGPER3TCNUUOSg8S4Q+WUG zdq2xaAnGkJmhv/gjRPOcFCXstK5uXzqcAtY3tMbi1emK/kHOppsAc8RoTjwsg7TvIFH60 AZh6tkTvBItm0H49RcsUvgGo4Ko/F8t2mwQsHyu4C50XDFLjaS3T2QWmfHtMpYXYnS3Xk8 uRjvq3qzsl2WYZYmDEJRQOxvtPmfIb9QCEmeJkkozC6T2VbMdUC1E0ELPERyplbNLqPpAR kkPVqCqZx0vWyYgVsnQM9D6YFbm113VGSK/rjU/7kxGroLbKkeradzyUI9qYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754690965; 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=lGiivm17axyJIsBGVYppCvJWmY5CO9aHtXIY88s7uJ4=; b=Ri/ZjhTYspb9Day9OLbK7WnCQ61fgktEwyReXejoFR0pVzxuqniTRjXvtckvICI3yNEpme 253Q0WopbHUvP6prmcJrJuLThmAC6X/Z99bCgXs9FV8Qcd7xjni0LnE8Z4/rtMORqIy6o7 JfVLIsWiOfk/JUJU5o/+Q2/9HmOB0xxEaaRSb1siMjOOEWdifCRZOvStfyP45hHdaM6L+R tyGrA7f8N9rIbuKRnYM93ZoBVvD6u6eZCaSnxmU0p8KK6mYy4x9NnN7G1sWXgGYNS9RuRE Cn5fEAsmpX0Us9BCgRyxlFkpvuSbIBAzivjl8rETP0qFEmMfaq6wNkKS5hcnnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754690965; a=rsa-sha256; cv=none; b=dLbsykBKxxy9doUuyAjvxTOvGhUHlRU7cHCfJP0pr3Z7mfXGMV2HhuQ8x2J5M0peCUWUby gUEtmVu/IQXDmIFIB+kATNVOyHMxiNblPkqORnBx+6ehE9VbBDsyvSWNHk6imDTt6Gp5em yLTvSOrwtsP1MVRgGny+Qdy9RdPDl/pRbw1XkQPcOcJ/5KFD2uAN4uD7W6hrPLq6+MD0Nd NWmgige6E9pvLNuNvevI5of27qAkFHJ3u1FzmiqZMGf2sk9pREwY3btfJ+vjMrRlbLi2KI CHcAQbCaraLLN4dwufvDWeBgq6otvKaTZKSvZF7j3wkctlwvqSzaebbYi/wRUw== 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 4bzJ912WKwztpc; Fri, 08 Aug 2025 22:09:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 578M9P3D089218; Fri, 8 Aug 2025 22:09:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 578M9P7e089215; Fri, 8 Aug 2025 22:09:25 GMT (envelope-from git) Date: Fri, 8 Aug 2025 22:09:25 GMT Message-Id: <202508082209.578M9P7e089215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 805f6029286e - stable/13 - kyua: Stop using readdir_r() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 805f6029286e2045326877e8d06ae1adc2e41862 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=805f6029286e2045326877e8d06ae1adc2e41862 commit 805f6029286e2045326877e8d06ae1adc2e41862 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:26 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-08 19:46:33 +0000 kyua: Stop using readdir_r() It cannot be used safely, and Kyua doesn't even pretend to try. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: igoro Differential Revision: https://reviews.freebsd.org/D51680 (cherry picked from commit 65bae451c23b8d61b2433259d8e707250660eeff) --- contrib/kyua/utils/fs/directory.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/contrib/kyua/utils/fs/directory.cpp b/contrib/kyua/utils/fs/directory.cpp index ff7ad5e34357..9103c2377c34 100644 --- a/contrib/kyua/utils/fs/directory.cpp +++ b/contrib/kyua/utils/fs/directory.cpp @@ -127,16 +127,9 @@ struct utils::fs::detail::directory_iterator::impl : utils::noncopyable { /// not. A null pointer means an invalid iterator. ::DIR* _dirp; - /// Raw representation of the system directory entry. - /// - /// We need to keep this at the class level so that we can use the - /// readdir_r(3) function. - ::dirent _dirent; - /// Custom representation of the directory entry. /// - /// This is separate from _dirent because this is the type we return to the - /// user. We must keep this as a pointer so that we can support the common + /// We must keep this as a pointer so that we can support the common /// operators (* and ->) over iterators. std::auto_ptr< directory_entry > _entry; @@ -192,22 +185,23 @@ struct utils::fs::detail::directory_iterator::impl : utils::noncopyable { /// It is possible to use this function on a new directory_entry object to /// initialize the first entry. /// - /// \throw system_error If the call to readdir_r fails. + /// \throw system_error If the call to readdir fails. void next(void) { ::dirent* result; - if (::readdir_r(_dirp, &_dirent, &result) == -1) { + errno = 0; + if ((result = ::readdir(_dirp)) == NULL && errno != 0) { const int original_errno = errno; - throw fs::system_error(F("readdir_r(%s) failed") % _path, + throw fs::system_error(F("readdir(%s) failed") % _path, original_errno); } if (result == NULL) { _entry.reset(NULL); close(); } else { - _entry.reset(new directory_entry(_dirent.d_name)); + _entry.reset(new directory_entry(result->d_name)); } } }; From nobody Sat Aug 9 11:29:57 2025 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 4bzdwk26Kxz644ZW; Sat, 09 Aug 2025 11:29:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzdwk1R8hz3Z9R; Sat, 09 Aug 2025 11:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754738998; 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=AEQy1JACe1IzT6Hlw/uxh6Y3iyRd2qUg+rnblfTBUoQ=; b=YYSV/Ylz4O0tUIlZ9zLznrGT2xiHZDNY6uWvr7D/5THd7rD0qRMEYbjk+Z3GSPe+pQ+I2U bcNcAxvc0BHxXUIHRHOZ9PqNOok8RnAX1+Gf1ELKr8ZRt1Y9cpgspA60f3dk+1UayL5fu4 6Xv2v3j7fN73chUu2pXkH+WRkxIJUExS5+GzKBU7vBuGIPwuXMvteMXx7PU0vzfLGQXPca +cknBl1L5xL4UbIaIAUEZyfhGxraxarFFFJkE7rYm+a1D7icrRANSoPwcb5mCdRHMXBBPH UC5cbOwHdNDY1B9Zw+shv6EVZlJD0tcEvatwkAJOD9KqdD66Yt7qZoRYYOKvRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754738998; 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=AEQy1JACe1IzT6Hlw/uxh6Y3iyRd2qUg+rnblfTBUoQ=; b=aHAyVm0WxFwA1aPvoIAOBMcEq7XAzml70fVbVP/kB+3tSSTy61FxoCgd7KAuGDhFx1lqh7 +dlz66Q9VBdgirvrEmmECuRmmyot5JCd5oRJgrWVh3dvst/WnxzD/yumGRuNjfHGNsaMGW QGO9P2SyYGacmUIzSWqZLdLylg4TvwL7EHslS7GGCXs8cxKtMnpPbJk28U6V9MVc4sqcLH cBO2TZ8ESM6vUX7PWkaQdzbF3cIBxK9crrT31cbk39OyrOKLJ0ih6lgDiaEmOcuJuBSVKE 1Mtq/RIypf88U8HVCrX0s2MMsTMd0vSenb/xDsXJX5RGUP3j+TQHveomqnPRcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754738998; a=rsa-sha256; cv=none; b=F41pv0oDZJTQmlsmBELBkYs54y2NsVYhuCdffRN+61oKSbYp/Iu87izrXOg54O3I285Lrh I0Oi52YAhHV6aGZS8VBomdQ3wgTJ9qVljksQU5+++9/UF3vANxu7XBlOkw7Jbv8TxODLUy 1/wJemotYLT1QnkrpnxsWkxu3CMxlKc0i493iqKNeJNlMF//hqANVk9LVFz6MphTgsYbQG OTc7uAZakj45RKwnyldYRq5WZDWFend1c32OBnytGj2imicHnyt1Vpb7UbtKSmlMr/KV/x s4dfVgIs97LxJpkMO9VlfSw8l/zv72lpYUUNi3E/f+Ik/9KF5ILJWSi2uKIIWA== 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 4bzdwk0gGjz45X; Sat, 09 Aug 2025 11:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 579BTvZo089160; Sat, 9 Aug 2025 11:29:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 579BTvEr089157; Sat, 9 Aug 2025 11:29:57 GMT (envelope-from git) Date: Sat, 9 Aug 2025 11:29:57 GMT Message-Id: <202508091129.579BTvEr089157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 25a559444bd4 - stable/14 - sys/geom: use proper style for sizeof operator 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 25a559444bd4a830063ac8ea353e00ad42ecf0ab Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=25a559444bd4a830063ac8ea353e00ad42ecf0ab commit 25a559444bd4a830063ac8ea353e00ad42ecf0ab Author: Andriy Gapon AuthorDate: 2025-07-26 15:13:20 +0000 Commit: Andriy Gapon CommitDate: 2025-08-09 11:29:00 +0000 sys/geom: use proper style for sizeof operator No functional change is intended. Missing parentheses around sizeof operands have been added with a coccinnele patch: @disable paren@ expression E; @@ ( sizeof(E) | sizeof +( E +) ) Spaces between sizeof and a parenthesis have been removed with sed. Discussed with: imp (cherry picked from commit 150834f8fa57c1ee42e4dd5a42e7faf08ec5b2e5) --- sys/geom/geom.h | 2 +- sys/geom/geom_ccd.c | 10 +++++----- sys/geom/geom_event.c | 2 +- sys/geom/geom_io.c | 2 +- sys/geom/geom_slice.c | 6 +++--- sys/geom/geom_subr.c | 18 +++++++++--------- sys/geom/multipath/g_multipath.c | 10 +++++----- sys/geom/virstor/g_virstor.c | 28 ++++++++++++++-------------- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/sys/geom/geom.h b/sys/geom/geom.h index 0eb6775701fd..c8a79987090b 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -282,7 +282,7 @@ void g_detach(struct g_consumer *cp); void g_error_provider(struct g_provider *pp, int error); struct g_provider *g_provider_by_name(char const *arg); int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len); -#define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v)) +#define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof(*(v))) int g_handleattr(struct bio *bp, const char *attribute, const void *val, int len); int g_handleattr_int(struct bio *bp, const char *attribute, int val); diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index 0c9fbaca00ea..a502f0fc5734 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -733,17 +733,17 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp) int i, error; g_topology_assert(); - unit = gctl_get_paraml(req, "unit", sizeof (*unit)); + unit = gctl_get_paraml(req, "unit", sizeof(*unit)); if (unit == NULL) { gctl_error(req, "unit parameter not given"); return; } - ileave = gctl_get_paraml(req, "ileave", sizeof (*ileave)); + ileave = gctl_get_paraml(req, "ileave", sizeof(*ileave)); if (ileave == NULL) { gctl_error(req, "ileave parameter not given"); return; } - nprovider = gctl_get_paraml(req, "nprovider", sizeof (*nprovider)); + nprovider = gctl_get_paraml(req, "nprovider", sizeof(*nprovider)); if (nprovider == NULL) { gctl_error(req, "nprovider parameter not given"); return; @@ -772,7 +772,7 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp) } gp = g_new_geomf(mp, "ccd%d", *unit); - sc = g_malloc(sizeof *sc, M_WAITOK | M_ZERO); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); gp->softc = sc; sc->sc_ndisks = *nprovider; @@ -875,7 +875,7 @@ g_ccd_list(struct gctl_req *req, struct g_class *mp) struct g_geom *gp; int i, unit, *up; - up = gctl_get_paraml(req, "unit", sizeof (*up)); + up = gctl_get_paraml(req, "unit", sizeof(*up)); if (up == NULL) { gctl_error(req, "unit parameter not given"); return; diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index a4b42694eb6c..0973b87b36bc 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -147,7 +147,7 @@ g_attr_changed(struct g_provider *pp, const char *attr, int flag) struct g_attrchanged_args *args; int error; - args = g_malloc(sizeof *args, flag); + args = g_malloc(sizeof(*args), flag); if (args == NULL) return (ENOMEM); args->pp = pp; diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index da8f917686ff..08ce93a4451a 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -276,7 +276,7 @@ g_io_init(void) g_bioq_init(&g_bio_run_down); g_bioq_init(&g_bio_run_up); - biozone = uma_zcreate("g_bio", sizeof (struct bio), + biozone = uma_zcreate("g_bio", sizeof(struct bio), NULL, NULL, NULL, NULL, 0, 0); diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index e66a84da310a..cf6bc63e0c42 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -59,7 +59,7 @@ g_slice_alloc(unsigned nslice, unsigned scsize) { struct g_slicer *gsp; - gsp = g_malloc(sizeof *gsp, M_WAITOK | M_ZERO); + gsp = g_malloc(sizeof(*gsp), M_WAITOK | M_ZERO); if (scsize > 0) gsp->softc = g_malloc(scsize, M_WAITOK | M_ZERO); else @@ -465,9 +465,9 @@ g_slice_conf_hot(struct g_geom *gp, u_int idx, off_t offset, off_t length, int r } gsl = gsp->hotspot; if(idx >= gsp->nhotspot) { - gsl2 = g_malloc((idx + 1) * sizeof *gsl2, M_WAITOK | M_ZERO); + gsl2 = g_malloc((idx + 1) * sizeof(*gsl2), M_WAITOK | M_ZERO); if (gsp->hotspot != NULL) - bcopy(gsp->hotspot, gsl2, gsp->nhotspot * sizeof *gsl2); + bcopy(gsp->hotspot, gsl2, gsp->nhotspot * sizeof(*gsl2)); gsp->hotspot = gsl2; if (gsp->hotspot != NULL) g_free(gsl); diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 3fef8a918530..a063313a4d71 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -268,7 +268,7 @@ g_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: g_trace(G_T_TOPOLOGY, "g_modevent(%s, LOAD)", mp->name); - hh = g_malloc(sizeof *hh, M_WAITOK | M_ZERO); + hh = g_malloc(sizeof(*hh), M_WAITOK | M_ZERO); hh->mp = mp; /* * Once the system is not cold, MOD_LOAD calls will be @@ -352,7 +352,7 @@ g_retaste(struct g_class *mp) if (mp->taste == NULL) return (EINVAL); - hh = g_malloc(sizeof *hh, M_WAITOK | M_ZERO); + hh = g_malloc(sizeof(*hh), M_WAITOK | M_ZERO); hh->mp = mp; if (cold) { @@ -382,7 +382,7 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...) sbuf_vprintf(sb, fmt, ap); va_end(ap); sbuf_finish(sb); - gp = g_malloc(sizeof *gp, M_WAITOK | M_ZERO); + gp = g_malloc(sizeof(*gp), M_WAITOK | M_ZERO); gp->name = g_malloc(sbuf_len(sb) + 1, M_WAITOK | M_ZERO); gp->class = mp; gp->rank = 1; @@ -529,7 +529,7 @@ g_new_consumer(struct g_geom *gp) ("g_new_consumer on geom(%s) (class %s) without orphan", gp->name, gp->class->name)); - cp = g_malloc(sizeof *cp, M_WAITOK | M_ZERO); + cp = g_malloc(sizeof(*cp), M_WAITOK | M_ZERO); cp->geom = gp; cp->stat = devstat_new_entry(cp, -1, 0, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); @@ -618,7 +618,7 @@ g_new_providerf(struct g_geom *gp, const char *fmt, ...) sbuf_vprintf(sb, fmt, ap); va_end(ap); sbuf_finish(sb); - pp = g_malloc(sizeof *pp + sbuf_len(sb) + 1, M_WAITOK | M_ZERO); + pp = g_malloc(sizeof(*pp) + sbuf_len(sb) + 1, M_WAITOK | M_ZERO); pp->name = (char *)(pp + 1); strcpy(pp->name, sbuf_data(sb)); sbuf_delete(sb); @@ -750,7 +750,7 @@ g_resize_provider(struct g_provider *pp, off_t size) if (size == pp->mediasize) return; - hh = g_malloc(sizeof *hh, M_WAITOK | M_ZERO); + hh = g_malloc(sizeof(*hh), M_WAITOK | M_ZERO); hh->pp = pp; hh->size = size; g_post_event(g_resize_provider_event, hh, M_WAITOK, NULL); @@ -1084,21 +1084,21 @@ int g_handleattr_int(struct bio *bp, const char *attribute, int val) { - return (g_handleattr(bp, attribute, &val, sizeof val)); + return (g_handleattr(bp, attribute, &val, sizeof(val))); } int g_handleattr_uint16_t(struct bio *bp, const char *attribute, uint16_t val) { - return (g_handleattr(bp, attribute, &val, sizeof val)); + return (g_handleattr(bp, attribute, &val, sizeof(val))); } int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val) { - return (g_handleattr(bp, attribute, &val, sizeof val)); + return (g_handleattr(bp, attribute, &val, sizeof(val))); } int diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c index c48f9aee65a2..5067c412895a 100644 --- a/sys/geom/multipath/g_multipath.c +++ b/sys/geom/multipath/g_multipath.c @@ -322,7 +322,7 @@ g_multipath_resize(struct g_consumer *cp) if (sc->sc_uuid[0] != 0) { pp = cp->provider; strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); - memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); + memcpy(md.md_uuid, sc->sc_uuid, sizeof(sc->sc_uuid)); strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name)); md.md_version = G_MULTIPATH_VERSION; md.md_size = size; @@ -553,8 +553,8 @@ g_multipath_create(struct g_class *mp, struct g_multipath_metadata *md) gp = g_new_geomf(mp, "%s", md->md_name); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); mtx_init(&sc->sc_mtx, "multipath", NULL, MTX_DEF); - memcpy(sc->sc_uuid, md->md_uuid, sizeof (sc->sc_uuid)); - memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name)); + memcpy(sc->sc_uuid, md->md_uuid, sizeof(sc->sc_uuid)); + memcpy(sc->sc_name, md->md_name, sizeof(sc->sc_name)); sc->sc_active_active = md->md_active_active; sc->sc_size = md->md_size; gp->softc = sc; @@ -907,7 +907,7 @@ g_multipath_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) char buf[16]; u_long rand = random(); - snprintf(buf, sizeof (buf), "%s-%lu", md.md_name, rand); + snprintf(buf, sizeof(buf), "%s-%lu", md.md_name, rand); printf("GEOM_MULTIPATH: geom %s/%s exists already\n", sc->sc_name, sc->sc_uuid); printf("GEOM_MULTIPATH: %s will be (temporarily) %s\n", @@ -1201,7 +1201,7 @@ g_multipath_ctl_configure(struct gctl_req *req, struct g_class *mp) cp = sc->sc_active; pp = cp->provider; strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); - memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); + memcpy(md.md_uuid, sc->sc_uuid, sizeof(sc->sc_uuid)); strlcpy(md.md_name, name, sizeof(md.md_name)); md.md_version = G_MULTIPATH_VERSION; md.md_size = pp->mediasize; diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index 262d4726618c..04657f226ca3 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -203,7 +203,7 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class *cp) int *force, *nargs; int i; - nargs = gctl_get_paraml(req, "nargs", sizeof *nargs); + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { gctl_error(req, "Error fetching argument '%s'", "nargs"); return; @@ -212,7 +212,7 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class *cp) gctl_error(req, "Invalid number of arguments"); return; } - force = gctl_get_paraml(req, "force", sizeof *force); + force = gctl_get_paraml(req, "force", sizeof(*force)); if (force == NULL) { gctl_error(req, "Error fetching argument '%s'", "force"); return; @@ -316,7 +316,7 @@ virstor_ctl_add(struct gctl_req *req, struct g_class *cp) u_int nc; u_int j; - snprintf(aname, sizeof aname, "arg%d", i); + snprintf(aname, sizeof(aname), "arg%d", i); pp = gctl_get_provider(req, aname); if (pp == NULL) { /* This is the most common error so be verbose about it */ @@ -488,12 +488,12 @@ fill_metadata(struct g_virstor_softc *sc, struct g_virstor_metadata *md, { struct g_virstor_component *c; - bzero(md, sizeof *md); + bzero(md, sizeof(*md)); c = &sc->components[nc]; - strncpy(md->md_magic, G_VIRSTOR_MAGIC, sizeof md->md_magic); + strncpy(md->md_magic, G_VIRSTOR_MAGIC, sizeof(md->md_magic)); md->md_version = G_VIRSTOR_VERSION; - strncpy(md->md_name, sc->geom->name, sizeof md->md_name); + strncpy(md->md_name, sc->geom->name, sizeof(md->md_name)); md->md_id = sc->id; md->md_virsize = sc->virsize; md->md_chunk_size = sc->chunk_size; @@ -501,7 +501,7 @@ fill_metadata(struct g_virstor_softc *sc, struct g_virstor_metadata *md, if (hardcode) { strncpy(md->provider, c->gcons->provider->name, - sizeof md->provider); + sizeof(md->provider)); } md->no = nc; md->provsize = c->gcons->provider->mediasize; @@ -960,7 +960,7 @@ virstor_geom_destroy(struct g_virstor_softc *sc, boolean_t force, free(sc->map, M_GVIRSTOR); free(sc->components, M_GVIRSTOR); - bzero(sc, sizeof *sc); + bzero(sc, sizeof(*sc)); free(sc, M_GVIRSTOR); pp = LIST_FIRST(&gp->provider); /* We only offer one provider */ @@ -1214,7 +1214,7 @@ virstor_check_and_run(struct g_virstor_softc *sc) sc->provider->name, sc->chunk_count * (off_t)sc->chunk_size); } - sc->map_size = sc->chunk_count * sizeof *(sc->map); + sc->map_size = sc->chunk_count * sizeof(*(sc->map)); /* The following allocation is in order of 4MB - 8MB */ sc->map = malloc(sc->map_size, M_GVIRSTOR, M_WAITOK); KASSERT(sc->map != NULL, ("%s: Memory allocation error (%zu bytes) for %s", @@ -1268,7 +1268,7 @@ virstor_check_and_run(struct g_virstor_softc *sc) bcopy(mapbuf, &sc->map[n], bs); off += bs; count += bs; - n += bs / sizeof *(sc->map); + n += bs / sizeof(*(sc->map)); g_free(mapbuf); } g_access(sc->components[0].gcons, -1, 0, 0); @@ -1307,8 +1307,8 @@ virstor_check_and_run(struct g_virstor_softc *sc) sc->components[index].chunk_next); } - sc->me_per_sector = sc->sectorsize / sizeof *(sc->map); - if (sc->sectorsize % sizeof *(sc->map) != 0) { + sc->me_per_sector = sc->sectorsize / sizeof(*(sc->map)); + if (sc->sectorsize % sizeof(*(sc->map)) != 0) { LOG_MSG(LVL_ERROR, "%s: Map entries don't fit exactly in a sector (%s)", __func__, sc->geom->name); @@ -1654,7 +1654,7 @@ g_virstor_start(struct bio *b) * XXX: this will prevent the fs from * being umounted! */ struct g_virstor_bio_q *biq; - biq = malloc(sizeof *biq, M_GVIRSTOR, + biq = malloc(sizeof(*biq), M_GVIRSTOR, M_NOWAIT); if (biq == NULL) { bioq_dismantle(&bq); @@ -1704,7 +1704,7 @@ g_virstor_start(struct bio *b) * map array. * sc_offset will end up pointing to the drive * sector. */ - s_offset = chunk_index * sizeof *me; + s_offset = chunk_index * sizeof(*me); s_offset = rounddown(s_offset, sc->sectorsize); /* data_me points to map entry sector From nobody Sat Aug 9 11:32:07 2025 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 4bzdzD24Q8z645J2; Sat, 09 Aug 2025 11:32:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzdzD0Fkmz3ZdP; Sat, 09 Aug 2025 11:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754739128; 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=WVwDUfQcO3hzRhRUQbE54Vpi5cGfXEX0b69KnD59A0I=; b=OLPbK8CJwR1njw3GDchLFFdzL2+lCrvUtLEey6J7xbLVIGAWChMY3CiIMQojTMvHMRN0Hb bFW3E6EcoOFSK8xf7Sy2KBgUmSYRzco6+h9+u6VjTBHK88E9atpb0kr+gvWhvec+cYK47f hT2njx2jDg8aCFPaRMdVgg9aKysqSk6yr6t3rrMQKY3ABHfNL50GGPdeDxT+UwCDi0mBvt NYBaQ6CrgBe0k5jNKJBdaGWxId5KQONerxZZf7hXkvM5Phw1LqkxRQvhWv4MWFnJ9h4KI0 jGGAqT/R5BRZzSy6nWGOvXeZVB+6IC2W3+yEdPmj+Qq11UXUkDBjkL+WlG4miA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754739128; 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=WVwDUfQcO3hzRhRUQbE54Vpi5cGfXEX0b69KnD59A0I=; b=NhkFkksU/EBO4ZEvECowMh53srOzX8/xQOqeZrHenUgQwgq6qTDi2M5sx8E9oFkQpjSnC3 2ePOEir/BHGDrQVcO8wC7OTttUgMfB8PU06KKF982GmkfAZLktY2YufFmhvcasFPeGA+xM GD5cWBw25V3rwf833G/yHJaVB81HOXMJbokVE940dDhLIiYdhtjq9u82AFar85YSrkqRLw uzEVb8da3L4OEndQfe8EnhbSTp+uycbQWNtiIfOqyabqt2vatbClI01SmbdzdzvHQLAsxc EcjSF5O6J52QpmlDUP0u/2P/9TYyGB+TcvU08lz44xiy/GL4ESAkwLbuSfRHZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754739128; a=rsa-sha256; cv=none; b=cG8DdyA4/POFF7mkFNbxHxmYIa5IAAdTdwQX543eGuagerxlUinJQqGAZ/0XOwvjUR1Qq5 2skQmUfzQgWE7LOLZyTWF60ECFP4a9rBqLrdfh4HLsTocAQ/MtxE6iCZuPGwgq2zL4kJjt HDrxD4bBNGWAu7nnOVQ84s+NnXHaXkGiT1vXUgTb6e7ReTsBEPllpn4Iz2KUKMoq+WSjzp LP8T+la9No8k0IibYIUHdC+NTh5Ln1jlSAmwNtA7DTnYINkMqJeIvVZlD8cN6an1PDTdPq wYfvTFEW1aWKiuIgjbkuKddOS7AJfnX75w5YiauMzwn/bbMDTfALFby8JXjieQ== 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 4bzdzC6zNYz3vB; Sat, 09 Aug 2025 11:32:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 579BW7Zj005323; Sat, 9 Aug 2025 11:32:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 579BW79U005320; Sat, 9 Aug 2025 11:32:07 GMT (envelope-from git) Date: Sat, 9 Aug 2025 11:32:07 GMT Message-Id: <202508091132.579BW79U005320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 6b5813daf388 - stable/13 - sys/geom: use proper style for sizeof operator 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b5813daf388d04e66bbf178f84ea19f45dcc182 Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=6b5813daf388d04e66bbf178f84ea19f45dcc182 commit 6b5813daf388d04e66bbf178f84ea19f45dcc182 Author: Andriy Gapon AuthorDate: 2025-07-26 15:13:20 +0000 Commit: Andriy Gapon CommitDate: 2025-08-09 11:31:29 +0000 sys/geom: use proper style for sizeof operator No functional change is intended. Missing parentheses around sizeof operands have been added with a coccinnele patch: @disable paren@ expression E; @@ ( sizeof(E) | sizeof +( E +) ) Spaces between sizeof and a parenthesis have been removed with sed. Discussed with: imp (cherry picked from commit 150834f8fa57c1ee42e4dd5a42e7faf08ec5b2e5) --- sys/geom/geom.h | 2 +- sys/geom/geom_ccd.c | 10 +++++----- sys/geom/geom_event.c | 2 +- sys/geom/geom_io.c | 2 +- sys/geom/geom_slice.c | 6 +++--- sys/geom/geom_subr.c | 18 +++++++++--------- sys/geom/multipath/g_multipath.c | 10 +++++----- sys/geom/virstor/g_virstor.c | 28 ++++++++++++++-------------- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/sys/geom/geom.h b/sys/geom/geom.h index e84549a6b84e..f3cba419bfbd 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -281,7 +281,7 @@ void g_detach(struct g_consumer *cp); void g_error_provider(struct g_provider *pp, int error); struct g_provider *g_provider_by_name(char const *arg); int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len); -#define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v)) +#define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof(*(v))) int g_handleattr(struct bio *bp, const char *attribute, const void *val, int len); int g_handleattr_int(struct bio *bp, const char *attribute, int val); diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index 62bd8d1193eb..b9c981097483 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -733,17 +733,17 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp) int i, error; g_topology_assert(); - unit = gctl_get_paraml(req, "unit", sizeof (*unit)); + unit = gctl_get_paraml(req, "unit", sizeof(*unit)); if (unit == NULL) { gctl_error(req, "unit parameter not given"); return; } - ileave = gctl_get_paraml(req, "ileave", sizeof (*ileave)); + ileave = gctl_get_paraml(req, "ileave", sizeof(*ileave)); if (ileave == NULL) { gctl_error(req, "ileave parameter not given"); return; } - nprovider = gctl_get_paraml(req, "nprovider", sizeof (*nprovider)); + nprovider = gctl_get_paraml(req, "nprovider", sizeof(*nprovider)); if (nprovider == NULL) { gctl_error(req, "nprovider parameter not given"); return; @@ -772,7 +772,7 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp) } gp = g_new_geomf(mp, "ccd%d", *unit); - sc = g_malloc(sizeof *sc, M_WAITOK | M_ZERO); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); gp->softc = sc; sc->sc_ndisks = *nprovider; @@ -875,7 +875,7 @@ g_ccd_list(struct gctl_req *req, struct g_class *mp) struct g_geom *gp; int i, unit, *up; - up = gctl_get_paraml(req, "unit", sizeof (*up)); + up = gctl_get_paraml(req, "unit", sizeof(*up)); if (up == NULL) { gctl_error(req, "unit parameter not given"); return; diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index 9113a3b5825a..daefbeca189b 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -129,7 +129,7 @@ g_attr_changed(struct g_provider *pp, const char *attr, int flag) struct g_attrchanged_args *args; int error; - args = g_malloc(sizeof *args, flag); + args = g_malloc(sizeof(*args), flag); if (args == NULL) return (ENOMEM); args->pp = pp; diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 914b5807e6e0..57d5d765f4d7 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -275,7 +275,7 @@ g_io_init(void) g_bioq_init(&g_bio_run_down); g_bioq_init(&g_bio_run_up); - biozone = uma_zcreate("g_bio", sizeof (struct bio), + biozone = uma_zcreate("g_bio", sizeof(struct bio), NULL, NULL, NULL, NULL, 0, 0); diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index e66a84da310a..cf6bc63e0c42 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -59,7 +59,7 @@ g_slice_alloc(unsigned nslice, unsigned scsize) { struct g_slicer *gsp; - gsp = g_malloc(sizeof *gsp, M_WAITOK | M_ZERO); + gsp = g_malloc(sizeof(*gsp), M_WAITOK | M_ZERO); if (scsize > 0) gsp->softc = g_malloc(scsize, M_WAITOK | M_ZERO); else @@ -465,9 +465,9 @@ g_slice_conf_hot(struct g_geom *gp, u_int idx, off_t offset, off_t length, int r } gsl = gsp->hotspot; if(idx >= gsp->nhotspot) { - gsl2 = g_malloc((idx + 1) * sizeof *gsl2, M_WAITOK | M_ZERO); + gsl2 = g_malloc((idx + 1) * sizeof(*gsl2), M_WAITOK | M_ZERO); if (gsp->hotspot != NULL) - bcopy(gsp->hotspot, gsl2, gsp->nhotspot * sizeof *gsl2); + bcopy(gsp->hotspot, gsl2, gsp->nhotspot * sizeof(*gsl2)); gsp->hotspot = gsl2; if (gsp->hotspot != NULL) g_free(gsl); diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 290c0ea66623..57720bdc092a 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -269,7 +269,7 @@ g_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: g_trace(G_T_TOPOLOGY, "g_modevent(%s, LOAD)", mp->name); - hh = g_malloc(sizeof *hh, M_WAITOK | M_ZERO); + hh = g_malloc(sizeof(*hh), M_WAITOK | M_ZERO); hh->mp = mp; /* * Once the system is not cold, MOD_LOAD calls will be @@ -353,7 +353,7 @@ g_retaste(struct g_class *mp) if (mp->taste == NULL) return (EINVAL); - hh = g_malloc(sizeof *hh, M_WAITOK | M_ZERO); + hh = g_malloc(sizeof(*hh), M_WAITOK | M_ZERO); hh->mp = mp; if (cold) { @@ -383,7 +383,7 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...) sbuf_vprintf(sb, fmt, ap); va_end(ap); sbuf_finish(sb); - gp = g_malloc(sizeof *gp, M_WAITOK | M_ZERO); + gp = g_malloc(sizeof(*gp), M_WAITOK | M_ZERO); gp->name = g_malloc(sbuf_len(sb) + 1, M_WAITOK | M_ZERO); gp->class = mp; gp->rank = 1; @@ -530,7 +530,7 @@ g_new_consumer(struct g_geom *gp) ("g_new_consumer on geom(%s) (class %s) without orphan", gp->name, gp->class->name)); - cp = g_malloc(sizeof *cp, M_WAITOK | M_ZERO); + cp = g_malloc(sizeof(*cp), M_WAITOK | M_ZERO); cp->geom = gp; cp->stat = devstat_new_entry(cp, -1, 0, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); @@ -619,7 +619,7 @@ g_new_providerf(struct g_geom *gp, const char *fmt, ...) sbuf_vprintf(sb, fmt, ap); va_end(ap); sbuf_finish(sb); - pp = g_malloc(sizeof *pp + sbuf_len(sb) + 1, M_WAITOK | M_ZERO); + pp = g_malloc(sizeof(*pp) + sbuf_len(sb) + 1, M_WAITOK | M_ZERO); pp->name = (char *)(pp + 1); strcpy(pp->name, sbuf_data(sb)); sbuf_delete(sb); @@ -751,7 +751,7 @@ g_resize_provider(struct g_provider *pp, off_t size) if (size == pp->mediasize) return; - hh = g_malloc(sizeof *hh, M_WAITOK | M_ZERO); + hh = g_malloc(sizeof(*hh), M_WAITOK | M_ZERO); hh->pp = pp; hh->size = size; g_post_event(g_resize_provider_event, hh, M_WAITOK, NULL); @@ -1085,21 +1085,21 @@ int g_handleattr_int(struct bio *bp, const char *attribute, int val) { - return (g_handleattr(bp, attribute, &val, sizeof val)); + return (g_handleattr(bp, attribute, &val, sizeof(val))); } int g_handleattr_uint16_t(struct bio *bp, const char *attribute, uint16_t val) { - return (g_handleattr(bp, attribute, &val, sizeof val)); + return (g_handleattr(bp, attribute, &val, sizeof(val))); } int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val) { - return (g_handleattr(bp, attribute, &val, sizeof val)); + return (g_handleattr(bp, attribute, &val, sizeof(val))); } int diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c index 9343d1856982..dcead7ca7b8a 100644 --- a/sys/geom/multipath/g_multipath.c +++ b/sys/geom/multipath/g_multipath.c @@ -322,7 +322,7 @@ g_multipath_resize(struct g_consumer *cp) if (sc->sc_uuid[0] != 0) { pp = cp->provider; strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); - memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); + memcpy(md.md_uuid, sc->sc_uuid, sizeof(sc->sc_uuid)); strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name)); md.md_version = G_MULTIPATH_VERSION; md.md_size = size; @@ -553,8 +553,8 @@ g_multipath_create(struct g_class *mp, struct g_multipath_metadata *md) gp = g_new_geomf(mp, "%s", md->md_name); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); mtx_init(&sc->sc_mtx, "multipath", NULL, MTX_DEF); - memcpy(sc->sc_uuid, md->md_uuid, sizeof (sc->sc_uuid)); - memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name)); + memcpy(sc->sc_uuid, md->md_uuid, sizeof(sc->sc_uuid)); + memcpy(sc->sc_name, md->md_name, sizeof(sc->sc_name)); sc->sc_active_active = md->md_active_active; sc->sc_size = md->md_size; gp->softc = sc; @@ -908,7 +908,7 @@ g_multipath_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) char buf[16]; u_long rand = random(); - snprintf(buf, sizeof (buf), "%s-%lu", md.md_name, rand); + snprintf(buf, sizeof(buf), "%s-%lu", md.md_name, rand); printf("GEOM_MULTIPATH: geom %s/%s exists already\n", sc->sc_name, sc->sc_uuid); printf("GEOM_MULTIPATH: %s will be (temporarily) %s\n", @@ -1204,7 +1204,7 @@ g_multipath_ctl_configure(struct gctl_req *req, struct g_class *mp) cp = sc->sc_active; pp = cp->provider; strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); - memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); + memcpy(md.md_uuid, sc->sc_uuid, sizeof(sc->sc_uuid)); strlcpy(md.md_name, name, sizeof(md.md_name)); md.md_version = G_MULTIPATH_VERSION; md.md_size = pp->mediasize; diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index 91389efd64f2..05606f4483a4 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -203,7 +203,7 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class *cp) int *force, *nargs; int i; - nargs = gctl_get_paraml(req, "nargs", sizeof *nargs); + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { gctl_error(req, "Error fetching argument '%s'", "nargs"); return; @@ -212,7 +212,7 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class *cp) gctl_error(req, "Invalid number of arguments"); return; } - force = gctl_get_paraml(req, "force", sizeof *force); + force = gctl_get_paraml(req, "force", sizeof(*force)); if (force == NULL) { gctl_error(req, "Error fetching argument '%s'", "force"); return; @@ -316,7 +316,7 @@ virstor_ctl_add(struct gctl_req *req, struct g_class *cp) u_int nc; u_int j; - snprintf(aname, sizeof aname, "arg%d", i); + snprintf(aname, sizeof(aname), "arg%d", i); pp = gctl_get_provider(req, aname); if (pp == NULL) { /* This is the most common error so be verbose about it */ @@ -488,12 +488,12 @@ fill_metadata(struct g_virstor_softc *sc, struct g_virstor_metadata *md, { struct g_virstor_component *c; - bzero(md, sizeof *md); + bzero(md, sizeof(*md)); c = &sc->components[nc]; - strncpy(md->md_magic, G_VIRSTOR_MAGIC, sizeof md->md_magic); + strncpy(md->md_magic, G_VIRSTOR_MAGIC, sizeof(md->md_magic)); md->md_version = G_VIRSTOR_VERSION; - strncpy(md->md_name, sc->geom->name, sizeof md->md_name); + strncpy(md->md_name, sc->geom->name, sizeof(md->md_name)); md->md_id = sc->id; md->md_virsize = sc->virsize; md->md_chunk_size = sc->chunk_size; @@ -501,7 +501,7 @@ fill_metadata(struct g_virstor_softc *sc, struct g_virstor_metadata *md, if (hardcode) { strncpy(md->provider, c->gcons->provider->name, - sizeof md->provider); + sizeof(md->provider)); } md->no = nc; md->provsize = c->gcons->provider->mediasize; @@ -960,7 +960,7 @@ virstor_geom_destroy(struct g_virstor_softc *sc, boolean_t force, free(sc->map, M_GVIRSTOR); free(sc->components, M_GVIRSTOR); - bzero(sc, sizeof *sc); + bzero(sc, sizeof(*sc)); free(sc, M_GVIRSTOR); pp = LIST_FIRST(&gp->provider); /* We only offer one provider */ @@ -1214,7 +1214,7 @@ virstor_check_and_run(struct g_virstor_softc *sc) sc->provider->name, sc->chunk_count * (off_t)sc->chunk_size); } - sc->map_size = sc->chunk_count * sizeof *(sc->map); + sc->map_size = sc->chunk_count * sizeof(*(sc->map)); /* The following allocation is in order of 4MB - 8MB */ sc->map = malloc(sc->map_size, M_GVIRSTOR, M_WAITOK); KASSERT(sc->map != NULL, ("%s: Memory allocation error (%zu bytes) for %s", @@ -1268,7 +1268,7 @@ virstor_check_and_run(struct g_virstor_softc *sc) bcopy(mapbuf, &sc->map[n], bs); off += bs; count += bs; - n += bs / sizeof *(sc->map); + n += bs / sizeof(*(sc->map)); g_free(mapbuf); } g_access(sc->components[0].gcons, -1, 0, 0); @@ -1307,8 +1307,8 @@ virstor_check_and_run(struct g_virstor_softc *sc) sc->components[index].chunk_next); } - sc->me_per_sector = sc->sectorsize / sizeof *(sc->map); - if (sc->sectorsize % sizeof *(sc->map) != 0) { + sc->me_per_sector = sc->sectorsize / sizeof(*(sc->map)); + if (sc->sectorsize % sizeof(*(sc->map)) != 0) { LOG_MSG(LVL_ERROR, "%s: Map entries don't fit exactly in a sector (%s)", __func__, sc->geom->name); @@ -1656,7 +1656,7 @@ g_virstor_start(struct bio *b) * XXX: this will prevent the fs from * being umounted! */ struct g_virstor_bio_q *biq; - biq = malloc(sizeof *biq, M_GVIRSTOR, + biq = malloc(sizeof(*biq), M_GVIRSTOR, M_NOWAIT); if (biq == NULL) { bioq_dismantle(&bq); @@ -1706,7 +1706,7 @@ g_virstor_start(struct bio *b) * map array. * sc_offset will end up pointing to the drive * sector. */ - s_offset = chunk_index * sizeof *me; + s_offset = chunk_index * sizeof(*me); s_offset = rounddown(s_offset, sc->sectorsize); /* data_me points to map entry sector From nobody Sat Aug 9 20:07:48 2025 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 4bzsQF1dL1z64HXQ; Sat, 09 Aug 2025 20:07:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzsQF0sZzz4MCF; Sat, 09 Aug 2025 20:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754770069; 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=jlFBKgVm/YgDefxTGpUvTGGcNLvlBlvc+UCKZ4hWbRA=; b=rEZSSleeFDO22PJALfWcG5bTSJ9YkTOw6kQWaabCGYXvmOeqC3qihBRKie+qDpmacB/6Nf jIZ4xNZxPDHp3B+/1jopD3cjl8DQqcQl9aUpLMHZOL4aUt5Op4RPaivy5TLG0PssFQkRxq ei+p/pdbVKcTA6XmkDR7zAWfg2K+LbGb/DolM5s7x8hRSM0EXrrkUes/UL6sBMe5Lc9AoR B/cH8pM1jlvOZ1D92whs7VVqFxH/Z+iXWl06Z/7AWuCcEhAHR6ialLW2BfrZr6ZTWS2ZrI Cq6otkroapARvQWCWsdNeQvLFDML5lh0x++lxloo4tQL/UlGR0TKbmjhXAuk+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754770069; 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=jlFBKgVm/YgDefxTGpUvTGGcNLvlBlvc+UCKZ4hWbRA=; b=vl+KS0gf+4wALr470sGuhRE3IjyqIk/7Q1UA1Jpctn+eO44ffsIU/MR8sY0CfiNej4nI4y qmbOuPO7bv0cvrukDMzPZiz4PiyIOtDSxorymCo1v+VLLOWIdvApEZSId3gVqfXrhA4TRM WFhmRflIfWSYw9Xd9ryHbj8W3foaWr2wUlETVS0XF7T7eo2mY9pL3Ht/WrLnppypaSgqsg TwTcEp75P4fuC1QWU5wKZpQ8/uewLwDrXIZAH327WOzRZOXAWB68sFPVmXweekKpDBqGQN OY/fqHUDknrAVR93YaY5uLoNrzTYb43vkW+Ix5siCipDPCyR3fto62KwRD+Dyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754770069; a=rsa-sha256; cv=none; b=AuvxNl42ul4Yv6FB2wo0vRufvVKzme2YMcWh62EN1A7irnYvwVppnkme0uedWyznnRVQV1 rqFY8rZLgRnmybLsAYZIvfB33rQb2MWjlBV3Bs/XRJ94fuxZK23CEznjU+y8dVhM55W7Id XdbJQJgqM13ZTxxH99KMdCddm4MPL8dFzdIXjwReKYjNH25B522P0N3NnMT7wjUtmxJ2EQ ZRiRuc7sI+5/oECE0qROW70XKKlYvIHvmtRpQzfDdJO7CLiw7ENkkwmmpgf5RD2jSfMzgO eJOQ9OEjLZ32tPki7wZWtPGSRMRrNbn25hUmLpTpjBkFdz3ma9doDMWACjYf2A== 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 4bzsQF0TDszbjG; Sat, 09 Aug 2025 20:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 579K7nh8068097; Sat, 9 Aug 2025 20:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 579K7mCL068094; Sat, 9 Aug 2025 20:07:48 GMT (envelope-from git) Date: Sat, 9 Aug 2025 20:07:48 GMT Message-Id: <202508092007.579K7mCL068094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: 702224d7e082 - stable/14 - amd64 pmap: preallocate another page table page in pmap_demote_DMAP() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 702224d7e0824094fa3f33f7fdc5a34be626d774 Auto-Submitted: auto-generated The branch stable/14 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=702224d7e0824094fa3f33f7fdc5a34be626d774 commit 702224d7e0824094fa3f33f7fdc5a34be626d774 Author: Alan Cox AuthorDate: 2025-06-30 07:36:12 +0000 Commit: Alan Cox CommitDate: 2025-08-09 20:04:16 +0000 amd64 pmap: preallocate another page table page in pmap_demote_DMAP() To avoid a possible panic in pmap_demote_DMAP(), preallocate the page table page that may be needed by pmap_demote_pde() before acquiring the kernel pmap lock, so that we can wait until the allocation succeeds. (cherry picked from commit 88c8cba0439599c00d9d3d586a66a035004e6e84) --- sys/amd64/amd64/pmap.c | 113 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 77 insertions(+), 36 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b9681da13d3a..69d4008dda91 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1303,6 +1303,8 @@ static int pmap_change_props_locked(vm_offset_t va, vm_size_t size, static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); +static bool pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, + vm_offset_t va, struct rwlock **lockp, vm_page_t mpte); static bool pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va, vm_page_t m); static int pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, @@ -6007,12 +6009,18 @@ pmap_demote_pde_abort(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp) +{ + return (pmap_demote_pde_mpte(pmap, pde, va, lockp, NULL)); +} + +static bool +pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct rwlock **lockp, vm_page_t mpte) { pd_entry_t newpde, oldpde; pt_entry_t *firstpte, newpte; pt_entry_t PG_A, PG_G, PG_M, PG_PKU_MASK, PG_RW, PG_V; vm_paddr_t mptepa; - vm_page_t mpte; int PG_PTE_CACHE; bool in_kernel; @@ -6025,10 +6033,10 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, PG_PKU_MASK = pmap_pku_mask_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - in_kernel = va >= VM_MAXUSER_ADDRESS; oldpde = *pde; KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V")); +<<<<<<< HEAD /* * Invalidate the 2MB page mapping and return "failure" if the @@ -6042,44 +6050,64 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, } mpte = pmap_remove_pt_page(pmap, va); +======= + KASSERT((oldpde & PG_MANAGED) == 0 || lockp != NULL, + ("pmap_demote_pde: lockp for a managed mapping is NULL")); + in_kernel = va >= VM_MAXUSER_ADDRESS; +>>>>>>> 88c8cba04395 (amd64 pmap: preallocate another page table page in pmap_demote_DMAP()) if (mpte == NULL) { - KASSERT((oldpde & PG_W) == 0, - ("pmap_demote_pde: page table page for a wired mapping" - " is missing")); - - /* - * If the page table page is missing and the mapping - * is for a kernel address, the mapping must belong to - * the direct map. Page table pages are preallocated - * for every other part of the kernel address space, - * so the direct map region is the only part of the - * kernel address space that must be handled here. - */ - KASSERT(!in_kernel || (va >= DMAP_MIN_ADDRESS && - va < DMAP_MAX_ADDRESS), - ("pmap_demote_pde: No saved mpte for va %#lx", va)); - - /* - * If the 2MB page mapping belongs to the direct map - * region of the kernel's address space, then the page - * allocation request specifies the highest possible - * priority (VM_ALLOC_INTERRUPT). Otherwise, the - * priority is normal. - */ - mpte = pmap_alloc_pt_page(pmap, pmap_pde_pindex(va), - (in_kernel ? VM_ALLOC_INTERRUPT : 0) | VM_ALLOC_WIRED); - /* - * If the allocation of the new page table page fails, - * invalidate the 2MB page mapping and return "failure". + * Invalidate the 2MB page mapping and return "failure" if the + * mapping was never accessed. */ - if (mpte == NULL) { + if ((oldpde & PG_A) == 0) { + KASSERT((oldpde & PG_W) == 0, + ("pmap_demote_pde: a wired mapping is missing PG_A")); pmap_demote_pde_abort(pmap, va, pde, oldpde, lockp); return (FALSE); } - if (!in_kernel) - mpte->ref_count = NPTEPG; + mpte = pmap_remove_pt_page(pmap, va); + if (mpte == NULL) { + KASSERT((oldpde & PG_W) == 0, + ("pmap_demote_pde: page table page for a wired mapping is missing")); + + /* + * If the page table page is missing and the mapping + * is for a kernel address, the mapping must belong to + * the direct map. Page table pages are preallocated + * for every other part of the kernel address space, + * so the direct map region is the only part of the + * kernel address space that must be handled here. + */ + KASSERT(!in_kernel || (va >= DMAP_MIN_ADDRESS && + va < DMAP_MAX_ADDRESS), + ("pmap_demote_pde: No saved mpte for va %#lx", va)); + + /* + * If the 2MB page mapping belongs to the direct map + * region of the kernel's address space, then the page + * allocation request specifies the highest possible + * priority (VM_ALLOC_INTERRUPT). Otherwise, the + * priority is normal. + */ + mpte = pmap_alloc_pt_page(pmap, pmap_pde_pindex(va), + (in_kernel ? VM_ALLOC_INTERRUPT : 0) | + VM_ALLOC_WIRED); + + /* + * If the allocation of the new page table page fails, + * invalidate the 2MB page mapping and return "failure". + */ + if (mpte == NULL) { + pmap_demote_pde_abort(pmap, va, pde, oldpde, + lockp); + return (false); + } + + if (!in_kernel) + mpte->ref_count = NPTEPG; + } } mptepa = VM_PAGE_TO_PHYS(mpte); firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa); @@ -9965,8 +9993,8 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) { pdp_entry_t *pdpe; pd_entry_t *pde; - vm_page_t m; vm_offset_t va; + vm_page_t m, mpte; bool changed; if (len == 0) @@ -9986,6 +10014,11 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) * x86_mr_split_dmap() function. */ m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_WAITOK); + if (len < NBPDR) { + mpte = vm_page_alloc_noobj(VM_ALLOC_WIRED | + VM_ALLOC_WAITOK); + } else + mpte = NULL; PMAP_LOCK(kernel_pmap); pdpe = pmap_pdpe(kernel_pmap, va); @@ -10002,9 +10035,13 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) if ((*pde & X86_PG_V) == 0) panic("pmap_demote_DMAP: invalid PDE"); if ((*pde & PG_PS) != 0) { - if (!pmap_demote_pde(kernel_pmap, pde, va)) + mpte->pindex = pmap_pde_pindex(va); + pmap_pt_page_count_adj(kernel_pmap, 1); + if (!pmap_demote_pde_mpte(kernel_pmap, pde, va, + NULL, mpte)) panic("pmap_demote_DMAP: PDE failed"); - changed = TRUE; + changed = true; + mpte = NULL; } } if (changed && invalidate) @@ -10014,6 +10051,10 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) vm_page_unwire_noq(m); vm_page_free(m); } + if (mpte != NULL) { + vm_page_unwire_noq(mpte); + vm_page_free(mpte); + } } } From nobody Sat Aug 9 20:38:20 2025 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 4bzt5S3X8zz64KwP; Sat, 09 Aug 2025 20:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzt5S2Xjhz3KG6; Sat, 09 Aug 2025 20:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754771900; 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=V7WpMDqzggYaU/1UQU1j5Wc70vc/W824Ezfi/BWyOzw=; b=AJ+Aq1UtdVjxEKz07M1uT+018adJZGNoRd46/o4npORl9YGqPkcir0iwTNV+cBg0i6dkn8 WglgB3S0tJD0iGvWqJjN6ufMXNm3Wcj7ew6nFGfmayFlJ1QV4exdGT+DAZaoy+p2Hygl9Y GCgjbTl7Cz+g9wtEeuP2em6Ue2bL+/uIm6Eybw87TVtwWfpBhhfVyRv8ivHwsGxnXzetpv gISfz9wZD9nnue7ZWqX54BrZ73KI0+egO8ikuzLD7Aj2xB4SRYJpVHf5RooBJXniuovH37 Ho//ijX6awAVxuSTPAAe76E1nIKiknwIy9Z5l3WsINpYOuF8TvXUiLEPQj80rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754771900; 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=V7WpMDqzggYaU/1UQU1j5Wc70vc/W824Ezfi/BWyOzw=; b=UakrCGELvzLmPwK3xR+4Iy21e2jd6332e7fnd8rc7cXXLQTdoGJecD+ClVWFCNmq+zkl8o T6cQh537LOLHyfPuNmpHgXBES8Ws56nPMGz2JkbAxLTN+IoE7OOgdjPdMpaLjhTARnQF9N 4037EUUXPKIA1us3XMhsVuGAuZ7526gaJsDRfv2niP5qsTs2sudOG/D/S///JzaidYtYG5 XWd4+PhZs0v9NBdGU8IIJ4FUPrOfFigdV4ZlPhdy379IzWowuwcyOYb9fWDFi/ekGYmL8a U3wfP+5eZgoMoxiHfr9B5DkHdjXPvBt4KPZA0V0bxZoqe19FXe8oXR7iseVHxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754771900; a=rsa-sha256; cv=none; b=sDODqHzM8kkg/HFJFAX/ob+DavoM+8TOCTTW/9T2CuWDbls2Pj5o4VZk19KEANxMgY/gME zURPjhnkVLPUUYIBzxkVLZ64SDyVtSy9vLSXOWfXesDH7haxqWCIApgCD1mLr58aF+/o5F GSeSuuEPGmNxGkO05pylMNgtpucrcA1fbAZWZt2LuM8XB3jt+UgWwnGpkc2QzHzfxq/6zZ SmG7VMJWTKtiHd2vtNgp3USNR7K/LBdmuJ7naWorCcbSiJ2FZt5LpHkDcLxJRhnNX801qt E/GxDtJJ+IFUUKPesVvkgZAXgyGXzwX2BBso1pyrw0zv7WtEix9LPfMBfp7AFg== 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 4bzt5S283wzcqn; Sat, 09 Aug 2025 20:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 579KcKHe025165; Sat, 9 Aug 2025 20:38:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 579KcKNW025162; Sat, 9 Aug 2025 20:38:20 GMT (envelope-from git) Date: Sat, 9 Aug 2025 20:38:20 GMT Message-Id: <202508092038.579KcKNW025162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: 84df9c02785b - stable/14 - amd64 pmap: fix mismerge 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 84df9c02785ba3ca6bbf9d83fa043a640d8d9b97 Auto-Submitted: auto-generated The branch stable/14 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=84df9c02785ba3ca6bbf9d83fa043a640d8d9b97 commit 84df9c02785ba3ca6bbf9d83fa043a640d8d9b97 Author: Alan Cox AuthorDate: 2025-08-09 20:28:15 +0000 Commit: Alan Cox CommitDate: 2025-08-09 20:35:18 +0000 amd64 pmap: fix mismerge Fixes: 702224d7e082 ("preallocate another page table page in pmap_demote_DMAP()") --- sys/amd64/amd64/pmap.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 69d4008dda91..7fc17a55d2a1 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -6036,25 +6036,9 @@ pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, oldpde = *pde; KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V")); -<<<<<<< HEAD - - /* - * Invalidate the 2MB page mapping and return "failure" if the - * mapping was never accessed. - */ - if ((oldpde & PG_A) == 0) { - KASSERT((oldpde & PG_W) == 0, - ("pmap_demote_pde: a wired mapping is missing PG_A")); - pmap_demote_pde_abort(pmap, va, pde, oldpde, lockp); - return (FALSE); - } - - mpte = pmap_remove_pt_page(pmap, va); -======= KASSERT((oldpde & PG_MANAGED) == 0 || lockp != NULL, ("pmap_demote_pde: lockp for a managed mapping is NULL")); in_kernel = va >= VM_MAXUSER_ADDRESS; ->>>>>>> 88c8cba04395 (amd64 pmap: preallocate another page table page in pmap_demote_DMAP()) if (mpte == NULL) { /* * Invalidate the 2MB page mapping and return "failure" if the From nobody Sat Aug 9 21:09:57 2025 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 4bztnx5WrBz64PYM; Sat, 09 Aug 2025 21:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bztnx4wS2z3P2F; Sat, 09 Aug 2025 21:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754773797; 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=T+Qjy6d9vm1bxppKJMNW9D9xbbfwSvomMyvkv0d8Xdw=; b=YgkHKqXMqMUlXjbqZgJAsuW8dhGFab9BwbuXvE//bU7C3gDn9xgIHgk5winHaLM3AoqnYG H0Gas+rNje8MPsbQiCwhF18ZBP4U9d+/nFw7BaVzWkJtM8IwqEtvLDVYjj2FIS4sRQj121 ddI5ufJIWM+sfjjLsPAtZMewCRm3d5Hi4oVfoUZoxNoo4+Sdt18oPnwN/xk+QW9VE2pj0O 6meNMlWtGtLKFU4QGQcL9kYtSaVOjjM16nTXL3UqRPkBnDfaNCsK7QZ8dCKHSqjJVhv/aO aHSExm/C6bKSdYnRWukK9NJnsKkGFjHOBi1d1b2rZ+grU97nKsA5ErPeaAcfug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754773797; 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=T+Qjy6d9vm1bxppKJMNW9D9xbbfwSvomMyvkv0d8Xdw=; b=Otukyycj258RMXrN7kd+JMp6blJdTHTyjFb44E3GkFbEJbGxkx73AaYfpsPwABkVudZsHu GD8tR5lXteF1DHeG3U7EgLaSV8EVIDAiqwoiSf3XmibQaj9zs3H7ThCohQZIaHdw085Bmh ERrvkRWV1dE6ba2pZYn54UvF1La7v6UBcGaDQfzt3nyQJfQBiT+lnbHq27tNp0G6CBRLWV njAZUv+Kk+TDHvtt+K06X2pcggoMETN/e16YE/ohxzIdOtfxtcqy/oNp49SD1Dl53uJPdF A4h7DchDH6Yx2uipTGj9RdExRtRIpv7pFfimfTCUIv09b8ZU3POSR1TmPNJgXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754773797; a=rsa-sha256; cv=none; b=WPIKIcxLoFRtb/KSavEgz+qqU8BP3Biixuph32fLlr7wyC+mDv0aEsXpdOT4Xf+dm4cFxM 3KfRbWC3DNakFM6jt3E1K/u+OdWvNnvBOlGvAnhSnbbDWtP2Sv0ytagUeoUUQdU7EHipBE kxlkL0dgg/Tgkxt75QTgnvyTAEC6wAQBO29X4fYiykztAqG1zwj6qI0nzbVGbaIENRitqa 3+HkM5tqSL4aNew/WNEM7CaimCx+P/f3FaKHsPe2+z+1+EC/TxGBmb06EGef0IR9zp43vq gtVqJxFxJAgM377yfS2ulWXhb8MHMD3G1R3KAEBaCTKTeIOS8soboMOXg7V2pA== 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 4bztnx482jzdBH; Sat, 09 Aug 2025 21:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 579L9vu6082971; Sat, 9 Aug 2025 21:09:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 579L9vxG082968; Sat, 9 Aug 2025 21:09:57 GMT (envelope-from git) Date: Sat, 9 Aug 2025 21:09:57 GMT Message-Id: <202508092109.579L9vxG082968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: 9810fb151938 - stable/14 - amd64 pmap: convert panics to KASSERTs 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9810fb151938b8ceb2e8774b85f1530f41c8241c Auto-Submitted: auto-generated The branch stable/14 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=9810fb151938b8ceb2e8774b85f1530f41c8241c commit 9810fb151938b8ceb2e8774b85f1530f41c8241c Author: Alan Cox AuthorDate: 2025-07-06 17:42:08 +0000 Commit: Alan Cox CommitDate: 2025-08-09 21:01:10 +0000 amd64 pmap: convert panics to KASSERTs With the recent changes to pmap_demote_DMAP(), the calls to pmap_demote_pdpe() and pmap_demote_pde_mpte() should never fail, so we change the associated panics to KASSERTs. (cherry picked from commit 6a7761b4d27c99b3b548f2d948b88bf1430ee636) --- sys/amd64/amd64/pmap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 7fc17a55d2a1..b818fc6979d3 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9979,7 +9979,7 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) pd_entry_t *pde; vm_offset_t va; vm_page_t m, mpte; - bool changed; + bool changed, rv __diagused; if (len == 0) return; @@ -10009,8 +10009,8 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) if ((*pdpe & X86_PG_V) == 0) panic("pmap_demote_DMAP: invalid PDPE"); if ((*pdpe & PG_PS) != 0) { - if (!pmap_demote_pdpe(kernel_pmap, pdpe, va, m)) - panic("pmap_demote_DMAP: PDPE failed"); + rv = pmap_demote_pdpe(kernel_pmap, pdpe, va, m); + KASSERT(rv, ("pmap_demote_DMAP: PDPE failed")); changed = true; m = NULL; } @@ -10021,9 +10021,9 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) if ((*pde & PG_PS) != 0) { mpte->pindex = pmap_pde_pindex(va); pmap_pt_page_count_adj(kernel_pmap, 1); - if (!pmap_demote_pde_mpte(kernel_pmap, pde, va, - NULL, mpte)) - panic("pmap_demote_DMAP: PDE failed"); + rv = pmap_demote_pde_mpte(kernel_pmap, pde, va, + NULL, mpte); + KASSERT(rv, ("pmap_demote_DMAP: PDE failed")); changed = true; mpte = NULL; } From nobody Sun Aug 10 00:42:42 2025 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 4bzzWQ73czz64n0K; Sun, 10 Aug 2025 00:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzzWQ6Pp0z3lWf; Sun, 10 Aug 2025 00:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754786562; 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=Qxt5udMhEavXad0TwJw4sZ8H8o4jn5sopL0t1zELqnw=; b=KyToJcdMwqoXLqIRsHbRhQLAgHBdkazsBv87ifsAA5ymVXrWp652SiswygjWndeD4o76Nv sjWgosBCEGUMvBTUOvxNPDLUb+PYVtzhNEetFFufdh6c04SNBONXg+MVmIVUIvSNIZkcSo 5oEQ/1DRhvDfm5zQom5dH5Z2I4tqIP6cyeLeyHv9ujmO4nEFPpDbtfuWE3HLT/k1F3lDCp qYXNLIb1An43ILO9d4BxPyNcZ/XwH0UAMwqlsmeDHsCm+p6+Rqk3FXE3NCAodmZn6Q71cv aDMACm+S3ImjR6vPesPOhic2RHbuEm+qz0ASKJJQrJyeaQ76VrrX0v34Qa0qaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754786562; 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=Qxt5udMhEavXad0TwJw4sZ8H8o4jn5sopL0t1zELqnw=; b=PtW1dKPPMGttGR18Zbjjpb6Q0NYA9MMwmEAdNtKPVCEj1L7MTqX+sEDhFBE7U2m+oB7c/0 NuRWwPNK3cq8CFMlf2zOX9q36CZI2Ju3UZVQ4NCDtfH2wV+t+XAT7ktTR7V/brZKWgV4Pe nfpRaSsXUXxNn3C8iqKBsECkkmvzZSy90t8E9U8af6EVsCyVs1rvLE+p5RzaHxLmlvA3wK Z+ciqYzloBKaj6xnoJcVDUuz5eYB1EftVoduqkOPtzJlP5vec1RPWcjrb9kwwHvh+HG7eA 9TpF0OJIX0x3XOxN7eLUzn/XshxX6nwgCQ9FXkEpkUCDiD/Mw4m7Aea7tnfwvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754786562; a=rsa-sha256; cv=none; b=f58hPg7+UPxsXRoYBPuwisW/F7jiAZ3pL8H2fabpOxQ+PC9suCQx/eegc5fps6zwSFkcvs OHT1nBZ8qT4TA5DltO3ufrYJgAcqxI5cpBtMEzEjO6Mfu5w291u4Zd60oZv4MAUTy5iZeB Cq8OuqiUeogIS56VlQZo0dvwCzCA5cIqbMC9yC27KNTG1RZkMBoAR/dhbUc6MYbHKP+i6O 91ItHEuDioZgzuIqGQRxX23E8XEnBaIEGmhZJCATQ5V8FaAjEzhcAH96HsoJMBjw+4U3t/ dJluDDuWMxM3p4fFvpjku8wuxiLd2Ko4tkf6cJFTTSvESbDDIHxB5AOawdiszw== 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 4bzzWQ5vbxzkrK; Sun, 10 Aug 2025 00:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A0ggjG091314; Sun, 10 Aug 2025 00:42:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A0ggo1091311; Sun, 10 Aug 2025 00:42:42 GMT (envelope-from git) Date: Sun, 10 Aug 2025 00:42:42 GMT Message-Id: <202508100042.57A0ggo1091311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: b84a0aa00881 - stable/14 - amd64 pmap: simplify recent changes to pmap_enter_pde() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b84a0aa00881ee6ded6e9693db1be6d6dd8b8e52 Auto-Submitted: auto-generated The branch stable/14 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=b84a0aa00881ee6ded6e9693db1be6d6dd8b8e52 commit b84a0aa00881ee6ded6e9693db1be6d6dd8b8e52 Author: Alan Cox AuthorDate: 2025-07-07 20:29:40 +0000 Commit: Alan Cox CommitDate: 2025-08-10 00:03:14 +0000 amd64 pmap: simplify recent changes to pmap_enter_pde() When pmap_enter_pde() removes an existing 2MB page mapping within the kernel address space, do not remap the kernel page table page since it will shortly be unmapped. Simply zero it. Eliminate an unnecessary conditional refcount decrement on what must be a kernel page table page. (We only utilize this refcount on user-space page table pages.) Convert an assertion from a panic to a KASSERT. (cherry picked from commit b87aa791533fd3fc8096faa837264761ed7f4a8c) --- sys/amd64/amd64/pmap.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b818fc6979d3..86773ad1294e 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1338,7 +1338,7 @@ static pdp_entry_t *pmap_pti_pdpe(vm_offset_t va); static pd_entry_t *pmap_pti_pde(vm_offset_t va); static void pmap_pti_wire_pte(void *pte); static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - bool remove_pt, struct spglist *free, struct rwlock **lockp); + bool demote_kpde, struct spglist *free, struct rwlock **lockp); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, pd_entry_t ptepde, struct spglist *free, struct rwlock **lockp); static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); @@ -6162,8 +6162,7 @@ pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * pmap_remove_kernel_pde: Remove a kernel superpage mapping. */ static void -pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, - bool remove_pt) +pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) { pd_entry_t newpde; vm_paddr_t mptepa; @@ -6171,12 +6170,8 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if (remove_pt) - mpte = pmap_remove_pt_page(pmap, va); - else - mpte = vm_radix_lookup(&pmap->pm_root, pmap_pde_pindex(va)); - if (mpte == NULL) - panic("pmap_remove_kernel_pde: Missing pt page."); + mpte = pmap_remove_pt_page(pmap, va); + KASSERT(mpte != NULL, ("pmap_remove_kernel_pde: missing pt page")); mptepa = VM_PAGE_TO_PHYS(mpte); newpde = mptepa | X86_PG_M | X86_PG_A | X86_PG_RW | X86_PG_V; @@ -6206,7 +6201,7 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * pmap_remove_pde: do the things to unmap a superpage in a process */ static int -pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool remove_pt, +pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool demote_kpde, struct spglist *free, struct rwlock **lockp) { struct md_page *pvh; @@ -6246,9 +6241,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool remove_pt, pmap_delayed_invl_page(m); } } - if (pmap == kernel_pmap) { - pmap_remove_kernel_pde(pmap, pdq, sva, remove_pt); - } else { + if (pmap != kernel_pmap) { mpte = pmap_remove_pt_page(pmap, sva); if (mpte != NULL) { KASSERT(vm_page_any_valid(mpte), @@ -6259,6 +6252,14 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool remove_pt, mpte->ref_count = 0; pmap_add_delayed_free_list(mpte, free, FALSE); } + } else if (demote_kpde) { + pmap_remove_kernel_pde(pmap, pdq, sva); + } else { + mpte = vm_radix_lookup(&pmap->pm_root, pmap_pde_pindex(sva)); + if (vm_page_any_valid(mpte)) { + mpte->valid = 0; + pmap_zero_page(mpte); + } } return (pmap_unuse_pt(pmap, sva, *pmap_pdpe(pmap, sva), free)); } @@ -7563,8 +7564,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, * the mapping is not from kernel_pmap, then * a reserved PT page could be freed. */ - (void)pmap_remove_pde(pmap, pde, va, - pmap != kernel_pmap, &free, lockp); + (void)pmap_remove_pde(pmap, pde, va, false, &free, + lockp); if ((oldpde & PG_G) == 0) pmap_invalidate_pde_page(pmap, va, oldpde); } else { @@ -7574,10 +7575,9 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, * before any changes to mappings are * made. Abort on failure. */ - mt = PHYS_TO_VM_PAGE(*pde & PG_FRAME); - if (pmap_insert_pt_page(pmap, mt, false, false)) { - if (pdpg != NULL) - pdpg->ref_count--; + mt = PHYS_TO_VM_PAGE(oldpde & PG_FRAME); + if (pmap_insert_pt_page(pmap, mt, false, + false)) { CTR1(KTR_PMAP, "pmap_enter_pde: cannot ins kern ptp va %#lx", va); From nobody Sun Aug 10 01:36:26 2025 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 4c00jR28nTz64s5n; Sun, 10 Aug 2025 01:36: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c00jQ6HXkz3r9T; Sun, 10 Aug 2025 01:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754789787; 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=p9FQ3dEK6WbaweN6GaOCoazq+rDUJdzi2C7OkPl3Lzo=; b=hV1ptvEoYJBzOtzl5y3s6EkOczWtfipVT2K4eaqm8D1e1mJ1NsnndPo6GYv+Fm5rP0CAf9 ChcxACfMFGwG6Jv+Z8yiLyHU3YNT+BK1TEFoBjWOp1GddBoUYaJkWYx4AHZ/AhXYJDHpOn M8O3MVK+UcXVR2iKz9ZI9Km1Yb9rQCLTjgJNOdFJoQ0vimSeaRywmumr368nkOMcH/A4+g nbCwgamsSJdrfOAAtKJu99fpQcyGr+gmh0+tgtYbdfJHTxM2HZSEuqzztD3IAMnLfZIuAv CvDUfVrwJ1I1E+ySn/RwCnHc67+P4qMML8pGlQ60PRmVmKpxKtr775R+GRl8/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754789787; 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=p9FQ3dEK6WbaweN6GaOCoazq+rDUJdzi2C7OkPl3Lzo=; b=pnQQvwmTP3sLUJ2IqkVFP3tNUsCm738cs4Eofbsn2HWkyP8R9Xh4AW1/eEVGKGHf+UuApc /jCk+iUf2eOllZgRfuOmTWYAEjT6CNHvP86k6TQFJpH722Itvcdceg0M2TzgzO3+liUEiu rmNitfEMx+cfUyaMjtjo/fkcpJNTrXSzf6FX64PixqiAsuHbWqZyeMYVB5jJy1xkX/xMlI QFKn1LdFA4gxSYTYj4YRGSyZ/k0opAfZ/AEE3zPpADRi2yru1RKYhlgRECsyNeMLeBT4a0 MozYP8rrwPXX6w48SJq8oKMybu5TzKG25xwK9AbhEiWEC0nHWYZUGl0HET8hKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754789787; a=rsa-sha256; cv=none; b=LcsPK3o8ROQOeWPhL+p17GTAYmfI1x/E+KWBCq4sG/rSHRO5HeX1VklUPp7C074MR3ewqi B/734gaJZ84awB4N8vpPbgUDEYxN1Yebyvfo/4AJb5LN83TAfy16QfkxZRGSk1n6g4zytp +KzwpgiSdn/n6LeCdKNCwR0nls7S1AS1Kzfn8VkSlC5QQ4JYCXH5OeG/Jw2uanRO86EexB 2SWxhxLJ08JCg39d8dP5rqTBYHgNMU9hv2Qifp6MfJhlnV7UmBcp5LaC7Hsa87ffFE9jBc bDj8lgpOECIn1nWXIDnyvW3wfcU9VqNY4EV7YzGohAzw1cJPHFEcnaLBYLqGWw== 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 4c00jQ5qtKzmkD; Sun, 10 Aug 2025 01:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A1aQ3x086059; Sun, 10 Aug 2025 01:36:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A1aQKS086056; Sun, 10 Aug 2025 01:36:26 GMT (envelope-from git) Date: Sun, 10 Aug 2025 01:36:26 GMT Message-Id: <202508100136.57A1aQKS086056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 35ce5a0f6d3f - stable/14 - amd64/pmap: include opt_kstack_pages.h 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 35ce5a0f6d3fdca121e6e891e060b5af09a1b8fc Auto-Submitted: auto-generated The branch stable/14 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=35ce5a0f6d3fdca121e6e891e060b5af09a1b8fc commit 35ce5a0f6d3fdca121e6e891e060b5af09a1b8fc Author: Ka Ho Ng AuthorDate: 2025-08-03 03:40:57 +0000 Commit: Ka Ho Ng CommitDate: 2025-08-10 01:35:51 +0000 amd64/pmap: include opt_kstack_pages.h This fixes an early KASAN initialization panic in pmap_san_enter_early_alloc_4k, when a non-default value is specified for KSTACK_PAGES in the build config file. Sponsored by: Juniper Networks, Inc. MFC after: 7 days Reviewed by: des, markj Differential Revision: https://reviews.freebsd.org/D51709 (cherry picked from commit ecf65a4ae5cb9f18ebdc5fd9a40332f443e04959) --- sys/amd64/amd64/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 86773ad1294e..ba0ce76c5335 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -106,6 +106,7 @@ */ #include "opt_ddb.h" +#include "opt_kstack_pages.h" #include "opt_pmap.h" #include "opt_vm.h" From nobody Sun Aug 10 05:24:43 2025 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 4c05mq6QbBz63pHW; Sun, 10 Aug 2025 05:24:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05mq5nHGz3Jch; Sun, 10 Aug 2025 05:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803483; 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=XPrIcd30+0g1FHnfp1v5Mj8Qi6k4iUu9JnawO6ZtJ/8=; b=fltJFj0YUCH/WahyS2M42btK+TVaurddAFucvWF+VZKpIvGOJyRxRd89yzOMSQ+S9aQuoJ Dm/7kLFfZYBoN81Hy2QAdkmxNsExIsPWjFzkwJw+dXq1lPCBUNGs1UN04e5yU/YXUR8P4x WFfNb95QxoefZAs631kD8g1CHA3LgxQx3hFA5glWlkwj7JDQsDctGxJCbSi35KJcbKagpY rFfl5GBncrIUDBz1QCqE0yUihRGMHe86ELXDN0uV3aQab33awQlrbxHmMhW8xdLCLeZuDG R65NhXoM8L2K4lwidUdwtuVx1j0kpouwBYAbNn8ET6//FGCTdyNcgcSRjaWx0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803483; 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=XPrIcd30+0g1FHnfp1v5Mj8Qi6k4iUu9JnawO6ZtJ/8=; b=oxgLVp5A0IwJsdiF3B7+QZ2My9XSJgfBiwF0G78sDQoN5G/mB3esrxuRB/63sQa81Bk802 ICpwINkdbA8yRhlAu329ofOx2rdAbT0y2nmf3u5JphUW5net12OSPr7PB86vOYt63ZgUHL 4c9thgJm++qp7H+FCF8t+Uy0MfF8l7kqQhdLeQVQFph2tka8MOm/wTeXiN7p5dROHTRkYs E48HpkzQArlUL6bgPnk4ezgCriwkpt7FdobZ8/Z7ntYM1r7uBCxB9OcxDwlb4wVp5VB7ZV NDW9JuVloJeiAAwNK4bel46+pKk7/SXM4mkbvdr7UQZldHBb9S0MyTlmV/BMZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803483; a=rsa-sha256; cv=none; b=RHAmR/P9Fiw+RSDKzPBIvi0v7gJEXkdEFIZ9+ETwdqRUgwto1B2vjIhNZanGaTZkiQ8lS9 pAg7pgSiSKsaHd48byTupjY/Ualx0BaIhMb3Xc0V5F4ViEs85du/hbnJzv1lf9H1SrN79p x8YwukTmlDzPl+/WA00iyCTXOwn/zmNt85/qdK8amd4y4Pjy5il3BNPx/odVqPFdlpthcL p94sVwdmbM8WIM/mueMPy/bYFF7ROHSZtD8Hz2H7xMQNFcXqC5jHY5Ab8dnlbirnr+OboN uXF3KPpZcOiiL1kmvYT0rLhxMpSIcf4FDHPcWeWjCEGDMFB2S3w7E+GArzsE+Q== 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 4c05mq55FGzt4N; Sun, 10 Aug 2025 05:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5Oh4o020507; Sun, 10 Aug 2025 05:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Oh0W020504; Sun, 10 Aug 2025 05:24:43 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:43 GMT Message-Id: <202508100524.57A5Oh0W020504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: bad971197256 - stable/14 - Revert "ipfilter: Avoid allocating a new ipf token when not needed" 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bad971197256729a12c067f1e1f5f7e73dd6098e Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=bad971197256729a12c067f1e1f5f7e73dd6098e commit bad971197256729a12c067f1e1f5f7e73dd6098e Author: Cy Schubert AuthorDate: 2025-07-07 16:50:27 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:57 +0000 Revert "ipfilter: Avoid allocating a new ipf token when not needed" malloc() outside of a write lock will reduce potential contention. MFC after: 3 days This reverts commit 7f5e3b9fa3d159b7f061b4d01a767cbe5d0527f3. (cherry picked from commit cf9b6857545371ab5becc6a785c62bc844cb2f94) --- sys/netpfil/ipfilter/netinet/fil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 76fde8622498..18ef46e25805 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -7459,6 +7459,10 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) { ipftoken_t *it, *new; + KMALLOC(new, ipftoken_t *); + if (new != NULL) + bzero((char *)new, sizeof(*new)); + WRITE_ENTER(&softc->ipf_tokens); for (it = softc->ipf_token_head; it != NULL; it = it->ipt_next) { if ((ptr == it->ipt_ctx) && (type == it->ipt_type) && @@ -7467,10 +7471,6 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) } if (it == NULL) { - KMALLOC(new, ipftoken_t *); - if (new != NULL) - bzero((char *)new, sizeof(*new)); - it = new; new = NULL; if (it == NULL) { @@ -7482,6 +7482,11 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) it->ipt_type = type; it->ipt_ref = 1; } else { + if (new != NULL) { + KFREE(new); + new = NULL; + } + if (it->ipt_complete > 0) it = NULL; else From nobody Sun Aug 10 05:24:44 2025 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 4c05ms07CFz63pNV; Sun, 10 Aug 2025 05:24:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05mr6RYmz3JJn; Sun, 10 Aug 2025 05:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803484; 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=G1ZTgiFqrd0Fw3sVWtaMdCZiAlt8jmd989wMoCLqbME=; b=ttBbQYhYpUaFqx1lBzAq0kqcAFtj2ko9V0O6C7URtzRrlTSSUbPdrS+w79aD42GI8Vyuro lo4678Fq7khKZteqqSMVgFC03UL2JJskx3VeuQaLTTtH3YhnfHym0XNp4ArgoVIYQ/wjqE 2nvH6uRVB1eyz6GfSwZQlsKQYOJ/LrfPTIp5ZIrudwd5tTohRmqMSQ+KvYAPCDb9FTmtUi SQXFb6/trwl0YUiPEoTj3Sz66Vd0PpavYCHD8EZmIzjDFHJzrsvD5tT2HZmOyKRWrWUiRL SCs0mOaJb9+netKPihCYQNSSc1uInVEvap23Zs3YDeVHrjWMxy7YlA80B4E6tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803484; 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=G1ZTgiFqrd0Fw3sVWtaMdCZiAlt8jmd989wMoCLqbME=; b=eGBaMJm06YTYBQLpyBCpJGwnT2iPBQ6rHwprsAfkthqGlFy1N/Q7RkTBWix4GmmmaOZdKl EpWMsWDcHiBeMdVMD2PCTtceX9t//0c0GJRKlfbgmaxIQtWpzqQn1vLgFufnftZB2X9BDA B4JaGR80MLQYlJLZ15jueLerdvcVW+c5/Xu8xCv6Fs/uB3FADPymCBsJrb4uW1q6D7m/Ni QFLc4YUo4n8+PwPXbRu09nMHlYszcDJmY+IezPZVjRfJ8diJM4cJiKX+ntQYctjUSFt6mK DFDSRk+DZMj/YVVEzx80tFY5f13HpmMtU9IZsjTlkRgvC+bga9R0Lp/cyeys+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803484; a=rsa-sha256; cv=none; b=NGT2N7aI15hHnvDcwGt4VknnEdQpfnNaRMXkc4YIRjT/t6BgZ4wTUijj4SkIfqtmVUVLp4 gvHhFxumqtyLudw/jK46u/K4FyOsjmLPyuscLXahX8zYaB7PYF3R+M9C+r1Fkb3j9BOn2v enhuvFyw0OoPya5cuJMiBGDa7+b53ZoD3z/k6lzzbbyoahLAUnuXdn2TPX26Qm+Xz7KRto wSQ1Rnv9G36kKlIL1w3skfKF4XGTmdCDUNMrQjraS24A3RiI6pbvC9oVKUCTXvdeNISyjy mNAHNFzg4aB5YSwK5hFdnXwoKIx7iZnObQxunhwds3CyorWd5tb68T033pCpVg== 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 4c05mr62TRztVM; Sun, 10 Aug 2025 05:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5Oisd020546; Sun, 10 Aug 2025 05:24:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Oi3M020543; Sun, 10 Aug 2025 05:24:44 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:44 GMT Message-Id: <202508100524.57A5Oi3M020543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 389e57881be8 - stable/14 - ipfilter: End (cleanup) the iterative search key 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 389e57881be84106e3036ef1b205a17826fb33dc Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=389e57881be84106e3036ef1b205a17826fb33dc commit 389e57881be84106e3036ef1b205a17826fb33dc Author: Cy Schubert AuthorDate: 2025-07-07 23:37:07 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:57 +0000 ipfilter: End (cleanup) the iterative search key This results in not finding nodes in subsequent hash table listings. MFC after: 3 days (cherry picked from commit ac2e39b5ddf5d5c6bc3848e392670a00e5834450) --- sbin/ipf/libipf/printhash_live.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/ipf/libipf/printhash_live.c b/sbin/ipf/libipf/printhash_live.c index 3caaa5e022fe..b8ee31b27597 100644 --- a/sbin/ipf/libipf/printhash_live.c +++ b/sbin/ipf/libipf/printhash_live.c @@ -61,5 +61,8 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields) if ((opts & OPT_DEBUG) == 0) PRINTF(" };\n"); + + (void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key); + return (hp->iph_next); } From nobody Sun Aug 10 05:24:45 2025 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 4c05mw1rPQz63pFR; Sun, 10 Aug 2025 05:24:48 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05mv3d57z3JjN; Sun, 10 Aug 2025 05:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803487; 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=UaNEMbC8aciZFZuVg6ENdEcipFA+bAtNfX+7FPFkSuc=; b=kTYJpb0LOQEsfNCCfx7uPsRSmHc2+bOUtua2yGzAe1xWGM7GmVsn6HJFozjvVFQ1erZ8Rx S0zjFhjIj07FHMahB++s8e+NTCxVV614Jb36z/Rx6TiS4m2tKaVnQVtIrM8hzQgsvKyUbk v5vex5FN28YNgZfE6zuiFaNZXSrAjvR6BrZG3aK3BcjvYJR7EG6+GwyZpdjUc3LFWdzdVz vCd+HHffDWS/pu3erwkL+ErysYQkkbhrmQrPwv+Udttpgkv8x1bZvcSQYO+Z4IxHzReN6R L1R7BrKkCKPQmogtKFqbpEM8KTEFOhjnpCRYFnZXEp3qjd8BhPTy1tV9anfm/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803487; 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=UaNEMbC8aciZFZuVg6ENdEcipFA+bAtNfX+7FPFkSuc=; b=ICzPRr/3eF+qvIj137uc8ei4Bs0i4IaFERO/ZaboT/6sgtI6yixL9DyN8XvENLtDMCKAQQ ODW5K2shEhpgZENSghwKFfa2BJq6bc36E7Jf++FdJDTT5t06IkOUan2p55o4X5ZR+Bvip2 b+6H336yj9tLQUmJYryrSbcVV+CsyopOOg//zJJM1lataiJURq4ppwIyLKfIrqwLZtZgbq u61TsJSlVcikvOXLOE30ldT1NJk+YFXkmk5xf6QE9B/dp4SuhPXxEoip5uXBJAk82LSxhj Mk7MMdkj7v/JTt7nEl4Y6tr068/kT4GOqvU593Ei5V+suaqaNZ4bLPVKMfcPDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803487; a=rsa-sha256; cv=none; b=SKH9kqI16/T9PenKXgdYuR+bR7pgJghqRe5SQ+Wo8ZQrHsABIRCjaNoiu3K9fl0uSgq3jp tVN0rR6Pv+hNtaJ6dMNPxlDjHEsoovJ2TrIZzMY9qpTIFyp1y9D7ehuN1BbZRqv3EquYpB iLl7ytB3ydiTtL7fPORGYwYJNGCZypSfIOEphvbfHR/yofFRLP/hNAvzFfkpbjrnSH9UgK yfPBkVvsH+Jq/Dwk4xxUhzH9WMU2pk0GbdmDaW/PrgMvyTcVrnd1zPAXHbgNiSuj/tBtkM hvwefJPd/+ZjsKhxmejrP4+Zva03C3GZzXSmYlWjRebBHkM3GW+TqXJNAM/+Og== 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 4c05mv34rfztQH; Sun, 10 Aug 2025 05:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5OlqP020583; Sun, 10 Aug 2025 05:24:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Ojjf020577; Sun, 10 Aug 2025 05:24:45 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:45 GMT Message-Id: <202508100524.57A5Ojjf020577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 30e9075a5439 - stable/14 - sqlite3: Vendor import of sqlite3 3.50.2 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 30e9075a5439e7b3da6a19a4903aee2bc5d889fd Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=30e9075a5439e7b3da6a19a4903aee2bc5d889fd commit 30e9075a5439e7b3da6a19a4903aee2bc5d889fd Author: Cy Schubert AuthorDate: 2025-07-07 23:49:17 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:58 +0000 sqlite3: Vendor import of sqlite3 3.50.2 Release notes at https://www.sqlite.org/releaselog/3_50_2.html. Obtained from: https://www.sqlite.org/2025/sqlite-autoconf-3500200.tar.gz MFC after: 1 month Merge commit '89922daaa168292633b1a7a523bcd0559487c6ad' (cherry picked from commit 17f0f75308f287efea825457364e2a4de2e107d4) --- contrib/sqlite3/INSTALL | 370 - contrib/sqlite3/Makefile.am | 20 - contrib/sqlite3/Makefile.in | 1326 +- contrib/sqlite3/Makefile.msc | 50 +- contrib/sqlite3/README.txt | 98 +- contrib/sqlite3/VERSION | 1 + contrib/sqlite3/aclocal.m4 | 10204 -------- contrib/sqlite3/auto.def | 25 + contrib/sqlite3/autosetup/LICENSE | 35 + contrib/sqlite3/autosetup/README.autosetup | 11 + contrib/sqlite3/autosetup/README.md | 453 + contrib/sqlite3/autosetup/autosetup | 2540 ++ .../autosetup-config.guess} | 111 +- .../{config.sub => autosetup/autosetup-config.sub} | 942 +- contrib/sqlite3/autosetup/autosetup-find-tclsh | 16 + contrib/sqlite3/autosetup/autosetup-test-tclsh | 20 + contrib/sqlite3/autosetup/cc-db.tcl | 15 + contrib/sqlite3/autosetup/cc-lib.tcl | 187 + contrib/sqlite3/autosetup/cc-shared.tcl | 113 + contrib/sqlite3/autosetup/cc.tcl | 758 + contrib/sqlite3/autosetup/find_tclconfig.tcl | 24 + contrib/sqlite3/autosetup/jimsh0.c | 24519 +++++++++++++++++++ contrib/sqlite3/autosetup/pkg-config.tcl | 168 + contrib/sqlite3/autosetup/proj.tcl | 2236 ++ contrib/sqlite3/autosetup/sqlite-config.tcl | 2174 ++ contrib/sqlite3/autosetup/system.tcl | 420 + contrib/sqlite3/autosetup/teaish/README.txt | 4 + contrib/sqlite3/autosetup/teaish/core.tcl | 2539 ++ contrib/sqlite3/autosetup/teaish/feature.tcl | 214 + contrib/sqlite3/autosetup/teaish/tester.tcl | 228 + contrib/sqlite3/compile | 348 - contrib/sqlite3/configure | 16891 +------------ contrib/sqlite3/configure.ac | 270 - contrib/sqlite3/depcomp | 791 - contrib/sqlite3/install-sh | 541 - contrib/sqlite3/ltmain.sh | 11251 --------- contrib/sqlite3/missing | 215 - contrib/sqlite3/shell.c | 7696 ++++-- contrib/sqlite3/sqlite3.c | 17725 +++++++++----- contrib/sqlite3/sqlite3.h | 618 +- contrib/sqlite3/sqlite3.pc.in | 2 +- contrib/sqlite3/sqlite3.rc | 2 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/Makefile.in | 1006 +- contrib/sqlite3/tea/README | 36 - contrib/sqlite3/tea/README.txt | 104 + contrib/sqlite3/tea/_teaish.tester.tcl.in | 49 + contrib/sqlite3/tea/aclocal.m4 | 9 - contrib/sqlite3/tea/auto.def | 8 + contrib/sqlite3/tea/configure | 10186 +------- contrib/sqlite3/tea/configure.ac | 227 - contrib/sqlite3/tea/doc/sqlite3.n | 4 +- contrib/sqlite3/tea/generic/tclsqlite3.c | 231 +- contrib/sqlite3/tea/pkgIndex.tcl.in | 40 +- contrib/sqlite3/tea/tclconfig/install-sh | 528 - contrib/sqlite3/tea/tclconfig/tcl.m4 | 4067 --- contrib/sqlite3/tea/teaish.tcl | 565 + contrib/sqlite3/tea/teaish.test.tcl | 14 + contrib/sqlite3/tea/win/makefile.vc | 430 - contrib/sqlite3/tea/win/nmakehlp.c | 815 - contrib/sqlite3/tea/win/rules.vc | 711 - 62 files changed, 56587 insertions(+), 68620 deletions(-) diff --git a/contrib/sqlite3/INSTALL b/contrib/sqlite3/INSTALL deleted file mode 100644 index a1e89e18ad20..000000000000 --- a/contrib/sqlite3/INSTALL +++ /dev/null @@ -1,370 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, -Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/contrib/sqlite3/Makefile.am b/contrib/sqlite3/Makefile.am deleted file mode 100644 index 1eaa560ff884..000000000000 --- a/contrib/sqlite3/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ - -AM_CFLAGS = @BUILD_CFLAGS@ -lib_LTLIBRARIES = libsqlite3.la -libsqlite3_la_SOURCES = sqlite3.c -libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 - -bin_PROGRAMS = sqlite3 -sqlite3_SOURCES = shell.c sqlite3.h -EXTRA_sqlite3_SOURCES = sqlite3.c -sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ -sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ -sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_DQS=0 -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) - -include_HEADERS = sqlite3.h sqlite3ext.h - -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc sqlite3rc.h README.txt Replace.cs Makefile.fallback -pkgconfigdir = ${libdir}/pkgconfig -pkgconfig_DATA = sqlite3.pc - -man_MANS = sqlite3.1 diff --git a/contrib/sqlite3/Makefile.in b/contrib/sqlite3/Makefile.in index fe708a0a9d84..a77386faed7c 100644 --- a/contrib/sqlite3/Makefile.in +++ b/contrib/sqlite3/Makefile.in @@ -1,1050 +1,298 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - +######################################################################## +# This is a main makefile for the "autoconf" bundle of SQLite. This is +# a trimmed-down version of the canonical makefile, devoid of most +# documentation. For the full docs, see /main.mk in the canonical +# source tree. +# +# Maintenance reminders: +# +# - To keep this working with an out-of-tree build, be sure to prefix +# input file names with $(TOP)/ where appropriate (which is most +# places). +# +# - The original/canonical recipes can be found in /main.mk in the +# canonical source tree. +all: + +TOP = @abs_top_srcdir@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +# +# Filename extensions for binaries and libraries +# +B.exe = @BUILD_EXEEXT@ +T.exe = @TARGET_EXEEXT@ +B.dll = @BUILD_DLLEXT@ +T.dll = @TARGET_DLLEXT@ +B.lib = @BUILD_LIBEXT@ +T.lib = @TARGET_LIBEXT@ + +# +# Autotools-compatibility dirs +# +prefix = @prefix@ +datadir = @datadir@ +mandir = @mandir@ +includedir = @includedir@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -bin_PROGRAMS = sqlite3$(EXEEXT) -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = sqlite3.pc -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \ - "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(includedir)" -PROGRAMS = $(bin_PROGRAMS) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -LTLIBRARIES = $(lib_LTLIBRARIES) -libsqlite3_la_LIBADD = -am_libsqlite3_la_OBJECTS = sqlite3.lo -libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libsqlite3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ -am_sqlite3_OBJECTS = sqlite3-shell.$(OBJEXT) -sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) -sqlite3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sqlite3_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/sqlite3-shell.Po \ - ./$(DEPDIR)/sqlite3-sqlite3.Po ./$(DEPDIR)/sqlite3.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ - $(EXTRA_sqlite3_SOURCES) -DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ - $(EXTRA_sqlite3_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -man1dir = $(mandir)/man1 -NROFF = nroff -MANS = $(man_MANS) -DATA = $(pkgconfig_DATA) -HEADERS = $(include_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -AM_RECURSIVE_TARGETS = cscope -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/sqlite3.pc.in \ - INSTALL compile config.guess config.sub depcomp install-sh \ - ltmain.sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -# Exists only to be overridden by the user if desired. -AM_DISTCHECK_DVI_TARGET = dvi -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +# +# Required binaries +# +INSTALL = @BIN_INSTALL@ AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BUILD_CFLAGS = @BUILD_CFLAGS@ +AR.flags = cr CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SHELL_CFLAGS = @SHELL_CFLAGS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CFLAGS = @BUILD_CFLAGS@ -lib_LTLIBRARIES = libsqlite3.la -libsqlite3_la_SOURCES = sqlite3.c -libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 -sqlite3_SOURCES = shell.c sqlite3.h -EXTRA_sqlite3_SOURCES = sqlite3.c -sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ -sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ -sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_DQS=0 -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) -include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc sqlite3rc.h README.txt Replace.cs Makefile.fallback -pkgconfigdir = ${libdir}/pkgconfig -pkgconfig_DATA = sqlite3.pc -man_MANS = sqlite3.1 -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): -sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) *** 143881 LINES SKIPPED *** From nobody Sun Aug 10 05:24:48 2025 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 4c05mw6mlVz63p8p; Sun, 10 Aug 2025 05:24:48 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05mw45Wmz3Jb1; Sun, 10 Aug 2025 05:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803488; 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=08DWJ3g2WslnA40td7F8F7FULd6VDpMEw5AUPg6fASI=; b=fZi5PFkGOgOiBrAuSfamKT7iwZto4RddlHE/UtOBCaM9xrkMypbYcel6W5YSqSDNZIvX8B PjwGMgkPyHWxgs91i+LRYHfoXv4iQ8CjerX6AqZp2b5CxS03bW/usixgP8WO9OobpCjHx5 UOkMtBpikdnkE2CPVtp/EGM6gWPos+OqfaKRo32ExZidEIe2BA1EZ9LvrSlDqvEatzjQMK xA6GhHIWXt/ErmCUu2y6I4T9ZviIfkqLQOtW3eqa7mNJfBTGp837APvQXrGgCPJ1MjTFv7 Akj4hHYKrQhvl0XOdVjhvnYsJB40/wWzL1isKWpokKTQBW2vrVAGaKHdBFuInA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803488; 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=08DWJ3g2WslnA40td7F8F7FULd6VDpMEw5AUPg6fASI=; b=d66QUxXnjZTgdHUxIYX/b7oWM6efGeT+XpSyZP2Y0HpSEEoKgct3jlt8chQ/5k78X8Yy7m jboC2hnQPEiufVBuK6SgodYEk/p7NJEMhzDHDzkchZs6n+0nu8orpdnD0AcLGzXWXVhf9N GwrZu9HfluQMGU/rCe1xyB5XWEwnQGq47U97eOP8a1q4GyIYwCbDZ1MzFf48rb8XI2WWo2 0/wWKgDWBkkZDwHpXJI3gq/OPfS+G7rO0TgX9D1yulxqw4F4uImRKiDCGvEWIpVrcuucs1 95rCoUd1LZuGX55Lyjjqo0IAW7Bz3KR7Ul/0qRlAsGqYH5HUFcvYuU/PuxU1pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803488; a=rsa-sha256; cv=none; b=QE0XEgc2sZnrcjZxUJLgwb5Xq6cIg196yoW2uomEohSuj1czALtK+orpomUG4y0S8U1rlc yOCgXm/QD9VokahyfjlAPdMNFKRinyqcL+ZNMhzbNAwHnr73RSbZq161M16gWq7vCUnP29 zhintrr1iGI0ZsXDktaNiYU7z063RbdSzH+4Yk3rBa+XTE2RYViJ0kd5B8Cq2AovIG+V5o DLRO4AFrm1W47TUnf/5nuqQQWrLPQb78E7wt+1lXlfamHTFQooaKIfv75jUuNyvnLL58mu 3FlCtY8PJCMewxWrMTzU+jqAlWseKZuGHmTi9ef9NBJR618z/ILEl0Ar279LyA== 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 4c05mw3ZYyztY7; Sun, 10 Aug 2025 05:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5OmnU020622; Sun, 10 Aug 2025 05:24:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Omwu020619; Sun, 10 Aug 2025 05:24:48 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:48 GMT Message-Id: <202508100524.57A5Omwu020619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 21ef66f326d3 - stable/14 - ip_nat6.c: fix non-trivial unused variable warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 21ef66f326d356db9992de218f718298e4d71990 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=21ef66f326d356db9992de218f718298e4d71990 commit 21ef66f326d356db9992de218f718298e4d71990 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:58 +0000 ip_nat6.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 2bbaeb717b690f796e751be63a656fb097ef786d) --- sys/netpfil/ipfilter/netinet/ip_nat6.c | 52 +++++++++------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat6.c b/sys/netpfil/ipfilter/netinet/ip_nat6.c index 20482126790c..0839dfacc2c3 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat6.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat6.c @@ -1133,9 +1133,6 @@ ipf_nat6_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; - - flags = nat->nat_flags; switch (fin->fin_p) { @@ -1358,8 +1355,8 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - struct icmp6_hdr *icmp6, *orgicmp; - int flags = 0, type, minlen; + struct icmp6_hdr *orgicmp; + int flags = 0, minlen; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -1368,8 +1365,6 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) u_int p; minlen = 40; - icmp6 = fin->fin_dp; - type = icmp6->icmp6_type; nside = &softn->ipf_nat_stats.ns_side6[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -1503,9 +1498,8 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) i6addr_t l1, l2, d; u_short *s1, *s2, *ds; u_32_t r; - int i, neg; + int i; - neg = 0; l1 = *ip1; l2 = *ip2; s1 = (u_short *)&l1; @@ -1522,7 +1516,6 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) } if (s2[0] > s1[0]) { ds[0] = s2[0] + 0x10000 - s1[0]; - neg = 1; } else { ds[0] = s2[0] - s1[0]; } @@ -1872,9 +1865,9 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; - u_int sflags; +#endif nat_t *nat; int nflags; i6addr_t dst; @@ -1884,10 +1877,7 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ifp = fin->fin_ifp; sport = 0; dport = 0; - gre = NULL; dst.in6 = *mapdst; - sflags = flags & NAT_TCPUDPICMP; - switch (p) { case IPPROTO_TCP : @@ -1965,8 +1955,8 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, if ((nat->nat_flags & IPN_TCPUDP) != 0) { - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2195,14 +2185,14 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; +#endif nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; sport = 0; dport = 0; @@ -2283,8 +2273,8 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, break; } - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2571,7 +2561,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) ipf_nat_softc_t *softn = softc->ipf_nat_soft; struct icmp6_hdr *icmp6 = NULL; struct ifnet *ifp, *sifp; - tcphdr_t *tcp = NULL; int rval, natfailed; ipnat_t *np = NULL; u_int nflags = 0; @@ -2624,9 +2613,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) default : break; } - - if ((nflags & IPN_TCPUDP)) - tcp = fin->fin_dp; } ipa = fin->fin_src6; @@ -2968,7 +2954,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) int rval, natfailed; struct ifnet *ifp; i6addr_t ipa, iph; - tcphdr_t *tcp; +#ifdef IPF_V6_PROXIES + tcphdr_t *tcp = NULL; +#endif u_short dport; ipnat_t *np; nat_t *nat; @@ -2976,7 +2964,6 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) if (softn->ipf_nat_stats.ns_rules == 0 || softn->ipf_nat_lock != 0) return (0); - tcp = NULL; icmp6 = NULL; dport = 0; natadd = 1; @@ -3017,7 +3004,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) } if ((nflags & IPN_TCPUDP)) { +#ifdef IPF_V6_PROXIES tcp = fin->fin_dp; +#endif dport = fin->fin_data[1]; } } @@ -3805,32 +3794,19 @@ ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; i6addr_t newip, new; - u_32_t amin, amax; int error; new.i6[0] = 0; new.i6[1] = 0; new.i6[2] = 0; new.i6[3] = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Sun Aug 10 05:24:49 2025 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 4c05my1vjvz63ngL; Sun, 10 Aug 2025 05:24:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05mx55cSz3Jdh; Sun, 10 Aug 2025 05:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803489; 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=Q67cHh5GCtEhpf05y/KBvoJ3OTSTTYKyijx3wmmGPH0=; b=liCBCP4HEz8NHsIb8erjGWF3jtGMa867wG3szpC0budV7NHLMjIzM5aTL64wZ48GcikX/u sVUaWKM1zoIFPSVVxqIEn+ZZzdxnMwMuJ9G8jgWMAYbEk/0a+pBxNZX+KcrGH6u3lmQ4H1 pb7BwdO7VmBndRLNexetU/WPTGIhsN0awIYuxhwFky7Kt6/MP9cusj1jhDWlBSqYd+fN0c PRYjJVtMcktyXmt4SnOQlWDL2d6oFlABxzOFauLraX+qdQK2TgSfNK//0tZagYzXcbTqvt bstcPmFJnrlx6QSYzWfJ9Ce77smGr7/D1YM6H7B9s80MRdVKMDxaEaV8dzSt1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803489; 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=Q67cHh5GCtEhpf05y/KBvoJ3OTSTTYKyijx3wmmGPH0=; b=DZ6ldanKQuo1+pSs8uvyCDDWnH1FvX3JhteqI+FUiXo2gdUXv4DJ3EFBlgz3ahgBy7YUch sR62piga7AEotXA5ZhBsGB3txk3BtRJsCipCb2vZG30GnhEBLMKY8pR6szeIwSRK6ebBV0 k/9nK8jpzVNnK1ZXCXv7VuBj63DWY58Qgzr2DKyDWqnpxybGlKjiA2yD/Lt5D3UDSWrlxW UQY+nuVyWkZi3xZKpsJ0AATmilj+O05VRz8M3S4+ERK8kiyfX2X+vVwBGS7vnluy0b2oYF zsF7YDMrkB4hkuqclSVepkzptbEhr2+a8nU8KyKKKijoGMUbqt+zgfjzRrGVjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803489; a=rsa-sha256; cv=none; b=BCGLFrA8C/2ftFKk0yFEXmJZyhRsSpKSaV3QzPp1n4plC7JrapD9QQCOT4Zuanq8ZT7IkL q5F/93t081olJHps9nt+4T5beMGZ3KsaD674LG8vo27PLiuBwuPoAwzobJSvABqjTBIGk1 Jlw2y+bytuf0JWzDllcoqVQt+7W6AYhsKMkbbow6pqC8/dgdxqPxaSEmpqRsYT3jH50KMX WjcOY8Xq6iCwJ1PcxAjJk6sb+g5PIMlj114aSSWm7SaWOTrDtuhpGdL8+c6987DzgSD6pi RhAZbWhtCE/8+I1gIqYoOW9wLlzUw8bNe2SSbpAdsHYGlesbxC9YZiDANtfsWQ== 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 4c05mx4ZBtztSD; Sun, 10 Aug 2025 05:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5On7v020660; Sun, 10 Aug 2025 05:24:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5OnR2020657; Sun, 10 Aug 2025 05:24:49 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:49 GMT Message-Id: <202508100524.57A5OnR2020657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 1203f96d41ff - stable/14 - netpfil/ipfilter: fix remaining trivial unused variable warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1203f96d41ff697bf05038786b75fdb3d96cc593 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1203f96d41ff697bf05038786b75fdb3d96cc593 commit 1203f96d41ff697bf05038786b75fdb3d96cc593 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:58 +0000 netpfil/ipfilter: fix remaining trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 79d23845179a534f533185763cb92032202729a7) --- sys/netpfil/ipfilter/netinet/fil.c | 16 +++++----------- sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c | 8 ++++---- sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_irc_pxy.c | 7 ++----- sys/netpfil/ipfilter/netinet/ip_lookup.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c | 5 +---- sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c | 5 ----- sys/netpfil/ipfilter/netinet/ip_proxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c | 8 +------- sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_state.c | 22 ++-------------------- sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ipf_rb.h | 2 -- 14 files changed, 23 insertions(+), 82 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 18ef46e25805..ce96558fe99a 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -441,7 +441,7 @@ static inline void ipf_pr_ipv6hdr(fr_info_t *fin) { ip6_t *ip6 = (ip6_t *)fin->fin_ip; - int p, go = 1, i, hdrcount; + int p, go = 1, i; fr_ip_t *fi = &fin->fin_fi; fin->fin_off = 0; @@ -468,7 +468,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) if (IN6_IS_ADDR_MULTICAST(&fi->fi_dst.in6)) fin->fin_flx |= FI_MULTICAST|FI_MBCAST; - hdrcount = 0; while (go && !(fin->fin_flx & FI_SHORT)) { switch (p) { @@ -546,7 +545,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) go = 0; break; } - hdrcount++; /* * It is important to note that at this point, for the @@ -2594,14 +2592,13 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass) /* functions called from the IPFilter "mainline" in ipf_check(). */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_acctpkt(fr_info_t *fin, u_32_t *passp) +ipf_acctpkt(fr_info_t *fin, u_32_t *passp __unused) { ipf_main_softc_t *softc = fin->fin_main_soft; char group[FR_GROUPLEN]; frentry_t *fr, *frsave; u_32_t pass, rulen; - passp = passp; fr = softc->ipf_acct[fin->fin_out][softc->ipf_active]; if (fr != NULL) { @@ -4204,7 +4201,7 @@ ipf_getstat(ipf_main_softc_t *softc, friostat_t *fiop, int rev) (rev / 10000) % 100, (rev / 100) % 100); #else - rev = rev; + (void)rev; /* UNUSED */ (void) strncpy(fiop->f_version, ipfilter_version, sizeof(fiop->f_version)); #endif @@ -4412,13 +4409,12 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, OP_ZERO /* zero statistics and counters */ } addrem = OP_ADD; frentry_t frd, *fp, *f, **fprev, **ftail; - void *ptr, *uptr, *cptr; + void *ptr, *uptr; u_int *p, *pp; frgroup_t *fg; char *group; ptr = NULL; - cptr = NULL; fg = NULL; fp = &frd; if (makecopy != 0) { @@ -4536,7 +4532,6 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, } ptr = NULL; - cptr = NULL; if (FR_ISACCOUNT(fp->fr_flags)) unit = IPL_LOGCOUNT; @@ -7318,11 +7313,10 @@ ipf_resolvedest(ipf_main_softc_t *softc, char *base, frdest_t *fdp, int v) /* for both IPv4 and IPv6 on the same physical NIC. */ /* ------------------------------------------------------------------------ */ void * -ipf_resolvenic(ipf_main_softc_t *softc, char *name, int v) +ipf_resolvenic(ipf_main_softc_t *softc __unused, char *name, int v) { void *nic; - softc = softc; /* gcc -Wextra */ if (name[0] == '\0') return (NULL); diff --git a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c index 3bc74247251a..ca0a07f92ea3 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c @@ -219,7 +219,7 @@ ipf_p_ftp_soft_destroy(ipf_main_softc_t *softc, void *arg) int -ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ftpinfo_t *ftp; ftpside_t *f; @@ -228,8 +228,6 @@ ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (ftp == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = ftp; aps->aps_psiz = sizeof(ftpinfo_t); aps->aps_sport = htons(fin->fin_sport); @@ -1715,7 +1713,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, return (0); if (c != delim) return (0); - addr |= addr; +#if 0 + addr |= (addr << 0); +#endif /* * Get the port number diff --git a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c index c6e4be17e22e..d5103c2944dc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c @@ -341,15 +341,13 @@ ipf_p_ipsec_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) * UDP/TCP port numbers). */ int -ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ipsec_pxy_t *ipsec; u_32_t cookies[4]; mb_t *m; int off; - nat = nat; /* LINT */ - if ((fin->fin_dlen < sizeof(cookies)) || (fin->fin_flx & FI_FRAG)) return (-1); diff --git a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c index 026459299efd..aa9e84be19ed 100644 --- a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c @@ -221,7 +221,7 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) int -ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ircinfo_t *irc; @@ -232,8 +232,6 @@ ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (irc == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = irc; aps->aps_psiz = sizeof(ircinfo_t); @@ -422,8 +420,7 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) int -ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat) { - aps = aps; /* LINT */ return (ipf_p_irc_send(fin, nat)); } diff --git a/sys/netpfil/ipfilter/netinet/ip_lookup.c b/sys/netpfil/ipfilter/netinet/ip_lookup.c index 470bdac76283..f9e00d3ec40b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_lookup.c +++ b/sys/netpfil/ipfilter/netinet/ip_lookup.c @@ -233,13 +233,11 @@ ipf_lookup_soft_destroy(ipf_main_softc_t *softc, void *arg) /* ------------------------------------------------------------------------ */ int ipf_lookup_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, int uid, void *ctx) + int mode __unused, int uid, void *ctx) { int err; SPL_INT(s); - mode = mode; /* LINT */ - SPL_NET(s); switch (cmd) diff --git a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c index 2ad642adfbcd..f9c1ab50b8a2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c @@ -67,7 +67,7 @@ ipf_p_netbios_main_unload(void) int -ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat __unused) { char dgmbuf[6]; int off, dlen; @@ -75,9 +75,6 @@ ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip_t *ip; mb_t *m; - aps = aps; /* LINT */ - nat = nat; /* LINT */ - m = fin->fin_m; dlen = fin->fin_dlen - sizeof(*udp); /* diff --git a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c index 17ba01ce8d94..2aafe5bc0b72 100644 --- a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c @@ -281,7 +281,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) tcphdr_t *tcp; int dlen, off; u_short len; - char *msg; tcp = fin->fin_dp; dlen = fin->fin_dlen - (TCP_OFF(tcp) << 2); @@ -310,8 +309,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) return (-1); } - msg = (char *)fin->fin_dp + (TCP_OFF(tcp) << 2); - while (dlen > 0) { off += pptps->pptps_bytes; if (pptps->pptps_gothdr == 0) { @@ -337,7 +334,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) } } dlen -= len; - msg += len; off += len; pptps->pptps_gothdr = 1; @@ -381,7 +377,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) pptps->pptps_len = 0; start += len; - msg += len; dlen -= len; } diff --git a/sys/netpfil/ipfilter/netinet/ip_proxy.c b/sys/netpfil/ipfilter/netinet/ip_proxy.c index 7cb4604f3e87..0682dd3f1a1e 100644 --- a/sys/netpfil/ipfilter/netinet/ip_proxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_proxy.c @@ -682,14 +682,12 @@ ipf_proxy_ok(fr_info_t *fin, tcphdr_t *tcp, ipnat_t *np) /* ------------------------------------------------------------------------ */ int ipf_proxy_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, void *ctx) + int mode __unused, void *ctx) { ap_ctl_t ctl; caddr_t ptr; int error; - mode = mode; /* LINT */ - switch (cmd) { case SIOCPROXY : diff --git a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c index 2cfaaa58200f..94f0e3ada707 100644 --- a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c @@ -49,12 +49,10 @@ ipf_p_raudio_main_unload(void) * Setup for a new proxy to handle Real Audio. */ int -ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -72,7 +70,7 @@ ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap = aps->aps_data; unsigned char membuf[512 + 1], *s; @@ -82,8 +80,6 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int len = 0; mb_t *m; - nat = nat; /* LINT */ - /* * If we've already processed the start messages, then nothing left * for the proxy to do. diff --git a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c index 13c989cba660..a8bff51c9b9b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c @@ -63,18 +63,12 @@ ipf_p_rcmd_main_unload(void) * Setup for a new RCMD proxy. */ int -ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rcmd_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { tcphdr_t *tcp = (tcphdr_t *)fin->fin_dp; rcmdinfo_t *rc; ipnat_t *ipn; - ipnat_t *np; - int size; - fin = fin; /* LINT */ - - np = nat->nat_ptr; - size = np->in_size; KMALLOC(rc, rcmdinfo_t *); if (rc == NULL) { #ifdef IP_RCMD_PROXY_DEBUG diff --git a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c index 7af11dd4a2dd..bd971d156e37 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c @@ -144,12 +144,10 @@ ipf_p_rpcb_main_unload(void) /* Allocate resources for per-session proxy structures. */ /* -------------------------------------------------------------------- */ int -ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { rpcb_session_t *rs; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -1023,10 +1021,8 @@ ipf_p_rpcb_lookup(rpcb_session_t *rs, u_32_t xid) /* Free the RPCB transaction record rx from the chain of entries. */ /* -------------------------------------------------------------------- */ static void -ipf_p_rpcb_deref(rpcb_session_t *rs, rpcb_xact_t *rx) +ipf_p_rpcb_deref(rpcb_session_t *rs __unused, rpcb_xact_t *rx) { - rs = rs; /* LINT */ - if (rx == NULL) return; diff --git a/sys/netpfil/ipfilter/netinet/ip_state.c b/sys/netpfil/ipfilter/netinet/ip_state.c index afa8b416c07a..88570273c588 100644 --- a/sys/netpfil/ipfilter/netinet/ip_state.c +++ b/sys/netpfil/ipfilter/netinet/ip_state.c @@ -887,7 +887,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, { ipstate_t *is, *isn; ipstate_save_t ips; - int error, out, i; + int error, i; frentry_t *fr; char *name; @@ -933,7 +933,6 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, return (ENOMEM); } bcopy((char *)&ips.ips_fr, (char *)fr, sizeof(*fr)); - out = fr->fr_flags & FR_OUTQUE ? 1 : 0; isn->is_rule = fr; ips.ips_is.is_rule = fr; MUTEX_NUKE(&fr->fr_lock); @@ -2211,20 +2210,6 @@ ipf_state_tcpinwindow(fr_info_t *fin, tcpdata_t *fdata, tcpdata_t *tdata, (ackskew >= -1) && (ackskew <= 1)) { inseq = 1; } else if (!(flags & IS_TCPFSM)) { - int i; - - i = (fin->fin_rev << 1) + fin->fin_out; - -#if 0 - if (is_pkts[i]0 == 0) { - /* - * Picking up a connection in the middle, the "next" - * packet seen from a direction that is new should be - * accepted, even if it appears out of sequence. - */ - inseq = 1; - } else -#endif if (!(fdata->td_winflags & (TCP_WSCALE_SEEN|TCP_WSCALE_FIRST))) { /* @@ -2620,7 +2605,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) icmphdr_t *icmp; fr_info_t ofin; tcphdr_t *tcp; - int type, len; + int len; u_char pr; ip_t *oip; u_int hv; @@ -2638,7 +2623,6 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) return (NULL); } ic = fin->fin_dp; - type = ic->icmp_type; oip = (ip_t *)((char *)ic + ICMPERR_ICMPHLEN); /* @@ -4366,7 +4350,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) ip6_t *oip6; u_char pr; u_int hv; - int type; /* * Does it at least have the return (basic) IP header ? @@ -4381,7 +4364,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) } ic6 = fin->fin_dp; - type = ic6->icmp6_type; oip6 = (ip6_t *)((char *)ic6 + ICMPERR_ICMPHLEN); if (fin->fin_plen < sizeof(*oip6)) { diff --git a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c index d81de100120b..3c737b38aacc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c @@ -151,7 +151,7 @@ ipf_p_tftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_tftp_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { udphdr_t *udp; tftpinfo_t *ti; @@ -159,8 +159,6 @@ ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ipnat_t *np; int size; - fin = fin; /* LINT */ - np = nat->nat_ptr; size = np->in_size; diff --git a/sys/netpfil/ipfilter/netinet/ipf_rb.h b/sys/netpfil/ipfilter/netinet/ipf_rb.h index e047c7f44a4a..334311502aab 100644 --- a/sys/netpfil/ipfilter/netinet/ipf_rb.h +++ b/sys/netpfil/ipfilter/netinet/ipf_rb.h @@ -305,13 +305,11 @@ _n##_rb_walktree(struct _n##_rb_head *head, _n##_rb_walker_t func, void *arg)\ _t *prev; \ _t *next; \ _t *node = head->top._f.right; \ - _t *base; \ \ while (node != &_n##_rb_zero) \ node = node->_f.left; \ \ for (;;) { \ - base = node; \ prev = node; \ while ((node->_f.parent->_f.right == node) && \ (node != &_n##_rb_zero)) { \ From nobody Sun Aug 10 05:24:50 2025 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 4c05mz229Mz63p8w; Sun, 10 Aug 2025 05:24:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05my60PQz3JVX; Sun, 10 Aug 2025 05:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803490; 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=tnCo8C9ZG68M6Ydfz6MYZPYtJUJ3RZFIEwZ88V5Mob0=; b=QhfqEMey+473iRcF3ivnM+WP5z3AnntBbK91dofe8QpOX9cv1oit0RJYTGbeBNHX0ZpIqS UVrpxfji/pIfuV2a/mlYGetBNnnhdt3k8uYYcka0tZ4HBqIh22iMZ0fa21n3BvhnZWIMMb iWNQO2Lh0xhkc2DlZut9Qg6uD9Na2qvGN1N25P55geIxxmYDqcFBG3GD64vcg37u+y+5MK KfmnRbmaNh2hU0VwqrjKeFxKxt2U5/xelnYBERWiLXTao6OMZOtIYhhzgJxuJHS/hKypg7 qFey62akKwfdFbf67DwnSRlejU6za8RKVskrCMXq2/9JGAk/c7KYdyQVBYA2Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803490; 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=tnCo8C9ZG68M6Ydfz6MYZPYtJUJ3RZFIEwZ88V5Mob0=; b=JUflsvkhQ3yT7tHrw64z9bdnUGVp0VGggnuCcJY8SInatjCKMJ6uWiTf9jRMUp34B2cpqO lKhMsOiWdL2XovolTGIFbt9KE7WI17l7VE4atYYsj7rOvrBFnq1jRvimavt0yJXzvtfbYn DCCjuJmmHkrKWvvZwKL1vTEf6TpOpq29AnPCm8S8IJI9M2uqS1WXm9Plu2oiXd9KMAJogh o+y4X6MXrDV15Tw2xrrmxb25AtG4G9Onf/azW+R42zKxrbZICZTFqw4KtWA2Yl3es/SmDi vFYBOmiDspO3AosULetSA2UvERjVPfoh8m9962X3qrN4tfgN5P3cTSTsThUMgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803490; a=rsa-sha256; cv=none; b=R7K8xPQ5cK1K4wQsNiK3qh1MIXIy0ToZVfRUe+cU8e1vaLDtAb833PrdOHadl9hndpfAUA GXiSzJYCVqcVNzRu01sbAzuCfSJagofGTxLWIRenXkWi8G6M8erKAVii7NAXWNSqNu04Pi DDvIC6ZnlvSxWu3G/vRoqEY9YhEAQ/CHg7oTx6l6hccZgK1jq1wh6+D5Q1tnGpYNAEGiO1 oyF5KCM0AIGgffC2ZmLtr6QXmEpnc+BnLMeVJvLTy3ZdBTRgo8MtDhS5XGKNnnVjJm/cz1 QDnzp+NElOvdzXZEJfW+ped529xybYunD/vX/WvM4MOkh9uZc9rFLPuoCffD6g== 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 4c05my5Wlpzt29; Sun, 10 Aug 2025 05:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5OoFF020696; Sun, 10 Aug 2025 05:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Oo2X020693; Sun, 10 Aug 2025 05:24:50 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:50 GMT Message-Id: <202508100524.57A5Oo2X020693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 0947920999dc - stable/14 - files: add new IPFILTER_C rule for netpfil/ipfilter sources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0947920999dcf405faa7554c8b0bc9d2bc4e5c0a Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0947920999dcf405faa7554c8b0bc9d2bc4e5c0a commit 0947920999dcf405faa7554c8b0bc9d2bc4e5c0a Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:59 +0000 files: add new IPFILTER_C rule for netpfil/ipfilter sources This re-enables all compiler warnings for these sources. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 45730dd3ed334d265fc77cf6df1f82013fd5bf69) --- sys/conf/files | 54 ++++++++++++++++++---------------------------------- sys/conf/kern.pre.mk | 4 ++++ 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index d0e6ee1eb477..30559540a5c0 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -594,42 +594,24 @@ contrib/dev/acpica/components/utilities/utxface.c optional acpi contrib/dev/acpica/components/utilities/utxferror.c optional acpi contrib/dev/acpica/components/utilities/utxfinit.c optional acpi contrib/dev/acpica/os_specific/service_layers/osgendbg.c optional acpi acpi_debug -netpfil/ipfilter/netinet/fil.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" -netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/fil.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet compile-with "${IPFILTER_C}" contrib/libfdt/fdt.c optional fdt contrib/libfdt/fdt_ro.c optional fdt contrib/libfdt/fdt_rw.c optional fdt diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 6c027ca7c208..2eb3c166959d 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -341,6 +341,10 @@ BNXT_CFLAGS= -I$S/dev/bnxt/bnxt_en ${OFEDCFLAGS} BNXT_C_NOIMP= ${CC} -c -o ${.TARGET} ${BNXT_CFLAGS} ${WERROR} BNXT_C= ${BNXT_C_NOIMP} ${.IMPSRC} +# IP Filter +IPFILTER_CFLAGS= -I$S/netpfil/ipfilter +IPFILTER_C= ${NORMAL_C} ${IPFILTER_CFLAGS} + GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c SYSTEM_DEP= Makefile ${SYSTEM_OBJS} From nobody Sun Aug 10 05:24:51 2025 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 4c05n05VxFz63ngQ; Sun, 10 Aug 2025 05:24:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05mz6yMRz3Jpw; Sun, 10 Aug 2025 05:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803492; 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=Po1R+Zm/N/Q+STokt0oxZz3vgCnn5qeNLKRobkfDJe0=; b=qljbBHS4BjgIviiKBbOUo0qs4Bi4gFcEjywivx+2qtZX5/iHfOYcxNTu9Pna9Dqt1fSLYC Wn0YIsIsEjn1tMjpTPc8XIQoZpYzNMkXbRJ2MwytrynCsFuNNHI1nk6evCUrP+gH2NveOv hMeQNXLokJKarvBeCUpJSCGQ6odY3DAbHB6qvLvu4Vu9vyxy1fiOpTm9Tphnp8Tck+d4IG YCcn8OrggNdASS38l8tkFvIaRIihJYj366kJdS5zIrJvkq9ohBDbFDZbi1iN3mLLhVRu7D td2v2KNNxlFv23e9EKWEH7b/SI1Ycr5V2rTnSIlXackIEltJQGnKNBeTcbRgIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803492; 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=Po1R+Zm/N/Q+STokt0oxZz3vgCnn5qeNLKRobkfDJe0=; b=DmJKeXq12dDhKByAX1vpPfSSpIYzistFRz6OFUte1KuNswyK/cvt+2qBsa29gpHJHDrUr0 GiHrRF0aDh5Fw4kvK1WBxstEcSS4LNwBGugIcNGQvkM+KH44mAwE95vp7t4Ey6F9euPte5 FeqIe5i++5mkzmIeZD1pfpcnaxoYyQ81ryDIE7FHXXl6D97KqCVPq9BgPCKeyJgSq0RXwP kDp0nqV8LXyaB+nR5f9jKOPB8xjVNGDDHTGz6ZeDyWBKJK0J0XdP1PFA5eJcr8gqLhH47M iECdLAS01/4LeOMYed3QhL45EnYLKfPeEIpeZ6uuxDHwulT/Tz70NS2f0RuqnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803492; a=rsa-sha256; cv=none; b=pMEpnR6l+DoxViRkTg6NMlWz+sq9cgqg9r2GpDdsEHphet/A4n6eMK/CF6AZTGeSGYbIX2 r2Um7GOTat1b2G9n6VhuuD7N6MdBUfswLy+XowS2wpCr5ORZOXvcwZ4z095M+WE5lRVxDb K6lq6wVJ4aQc73oqUd0odC5bxBlE/UTY7C9jtZKOuEsx7CIcsOJdrautOI6LxFID4GuJ3T BTS7iSvcZpSvlSDX54LYv1GZYnbnbkZ5jRK6Wkq/iN47WDh+eK+viDTP2RUl8Sv6NhKubn lX6DVcD+HDCHB2tUOmvahj9vFm/bPuPUi2p2L300i4+rGXz1fQDntkTgfHRsXg== 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 4c05mz6TVrzt0c; Sun, 10 Aug 2025 05:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5Opx1020731; Sun, 10 Aug 2025 05:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Op5L020728; Sun, 10 Aug 2025 05:24:51 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:51 GMT Message-Id: <202508100524.57A5Op5L020728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 18a405b1ac7f - stable/14 - ip_nat.c: fix non-trivial unused variable warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18a405b1ac7fd681377bc9db27bb199b0b2a9133 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=18a405b1ac7fd681377bc9db27bb199b0b2a9133 commit 18a405b1ac7fd681377bc9db27bb199b0b2a9133 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:59 +0000 ip_nat.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c) --- sys/netpfil/ipfilter/netinet/ip_nat.c | 43 +++++++++++------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index 136bc31ba0f4..290af20e4765 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -3228,13 +3228,10 @@ ipf_nat_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; #if SOLARIS && defined(_KERNEL) && defined(ICK_M_CTL_MAGIC) qpktinfo_t *qpi = fin->fin_qpi; #endif - flags = nat->nat_flags; - switch (nat->nat_pr[0]) { case IPPROTO_ICMP : @@ -3542,8 +3539,8 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - int flags = 0, type, minlen; - icmphdr_t *icmp, *orgicmp; + int flags = 0, minlen; + icmphdr_t *orgicmp; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -3551,8 +3548,6 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) ip_t *oip; u_int p; - icmp = fin->fin_dp; - type = icmp->icmp_type; nside = &softn->ipf_nat_stats.ns_side[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -4003,9 +3998,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; ipnat_t *ipn; - u_int sflags; nat_t *nat; int nflags; u_32_t dst; @@ -4013,9 +4006,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, u_int hv, rhv; ifp = fin->fin_ifp; - gre = NULL; dst = mapdst.s_addr; - sflags = flags & NAT_TCPUDPICMP; switch (p) { @@ -4334,14 +4325,12 @@ ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; ipnat_t *ipn; nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; switch (p) { @@ -4760,7 +4749,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) struct ifnet *ifp, *sifp; ipf_main_softc_t *softc; ipf_nat_softc_t *softn; - icmphdr_t *icmp = NULL; tcphdr_t *tcp = NULL; int rval, natfailed; u_int nflags = 0; @@ -4806,8 +4794,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) nflags = IPN_UDP; break; case IPPROTO_ICMP : - icmp = fin->fin_dp; - /* * This is an incoming packet, so the destination is * the icmp_id and the source port equals 0 @@ -5467,7 +5453,10 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t sumd, ipsumd, sum1, sum2; + u_32_t sumd, sum1, sum2; +#if !defined(_KERNEL) || SOLARIS + u_32_t ipsumd; +#endif icmphdr_t *icmp; tcphdr_t *tcp; ipnat_t *np; @@ -5503,7 +5492,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) ipf_sync_update(softc, SMC_NAT, fin, nat->nat_sync); +#if !defined(_KERNEL) || SOLARIS ipsumd = nat->nat_ipsumd; +#endif /* * Fix up checksums, not by recalculating them, but * simply computing adjustments. @@ -5525,7 +5516,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_osrcaddr; sum2 = nat->nat_nsrcaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_ndstip; fin->fin_daddr = nat->nat_ndstaddr; @@ -5542,7 +5535,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_odstaddr; sum2 = nat->nat_ndstaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; @@ -7356,30 +7351,18 @@ ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t amin, amax, new; + u_32_t new; i6addr_t newip; int error; new = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Sun Aug 10 05:24:52 2025 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 4c05n13XZFz63pCp; Sun, 10 Aug 2025 05:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05n10jmtz3Jbg; Sun, 10 Aug 2025 05:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803493; 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=tiDcxqiZNfnEDUgrXPHXRjRLzTYJ4bG2JtOXQu5oZ6I=; b=nlvgSDNn2pxPfiqBA4zEKNTrksLNqc7hXeeTI++0ZjVf/qslkL0mtpm2u4HPx3ZBM5teCx FZGCRaqPdGmiX3ZijB4lzHsv1PuCAWcnA5PY94X0xuXbu1R8riOsDqjdjRBHfNJxMFdVG2 x9whNgMqYvTijDKZASnW7sMublbsivDYCzz4EmfuY08R9pcQGsodiZ3oj1zXM9UogPPBvA xN9VRVqHuo0I2PfsZ3k1Ixi1TUN3suRsmth/3knvApv1/4QsJqB509xnSQ7DiWNSmK4oMG syVgYWd0CsSNY2D4m5mX4eI/PxL/iWRCw2/sXjgEaIgJNIu4P9JIfVUl26jqCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803493; 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=tiDcxqiZNfnEDUgrXPHXRjRLzTYJ4bG2JtOXQu5oZ6I=; b=rzSvw2R3jHD2FFPwQJCLzAJ49YL/FytZTZMrJwZ8acrZqTPo71FhpYg5bTu6SKLmo74qGQ JiDjh4wGXWe3A615YHVCuk2QuyqXv8RHh/kjjxu//ZLT2hT9wPl/1Dcz56q41tK8IDhpRC H34YDhdBDwglwby5EVhcKka08B3DWlZNuHKRosIO248MiiINXdL/ogPmEiUZ8aOZL01Z47 Shpr6d9H6giOHCm5R+GkloJcnbLfJmLHTlq6fz/g2F32s+R3/kFOa1SPY5z5sdsrYdAaxo gMOgx0AZpzhGqNjQ+drFxGmbKDWGrqWFI310vw3m+WufoL6FO5J+3v3sbDuYog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803493; a=rsa-sha256; cv=none; b=dUp4pOYjACAwCoW/8c4TqvnMHNp74su5+a+0HAj9LCqtGeHkTewnIL2Lub1Hkd5DVnFNSs HOduaLngyVcZnAW4WVNSD9YyRt62XB5gwVTYR2tYGjREipsp12IpQ4yg0y97xohdfY8kcB 78u0LjQWQc90SPZ1Gig8Zy3I+Ndlv7dMwSEhQjrxPrxc8/Fu1LFe37AfG1fer64ueYiyJ9 B6ROMgHFVUpnXRsUQt9e1n50KRKQs1m1j32j2VWelNG62PfzQr4K7W4S4T/LVHZ1bR3cJJ dcnvj3ub16/PZfoPwSV9S9R7c+ecvJyFFYXx/pYUWBwn06iSUFie/xqR9ihwAw== 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 4c05n10JBjzt0d; Sun, 10 Aug 2025 05:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5OqqN020766; Sun, 10 Aug 2025 05:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Oq8N020763; Sun, 10 Aug 2025 05:24:52 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:52 GMT Message-Id: <202508100524.57A5Oq8N020763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 3922d7f62778 - stable/14 - ip_htable: fix -Wtautological-pointer-compare warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3922d7f6277847dd0d0337a802fa4437e8d2ff60 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=3922d7f6277847dd0d0337a802fa4437e8d2ff60 commit 3922d7f6277847dd0d0337a802fa4437e8d2ff60 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:59 +0000 ip_htable: fix -Wtautological-pointer-compare warnings This also fixes a few other trivial -Wunused-but-set-variable warnings. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit e4c864e5550544e5ff7e395309c5098d84058403) --- sys/netpfil/ipfilter/netinet/ip_htable.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index d405df99558e..1907aa0f9f5f 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -606,7 +606,7 @@ ipf_htent_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, switch (iph->iph_type & ~IPHASH_ANON) { case IPHASH_GROUPMAP : - if (ipe->ipe_group != NULL) + if (ipe->ipe_ptr != NULL) ipf_group_del(softc, ipe->ipe_ptr, NULL); break; @@ -976,7 +976,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) { iphtent_t ipe, *ent; u_int hv; - int bits; bcopy((char *)ipeo, (char *)&ipe, sizeof(ipe)); ipe.ipe_addr.i6[0] &= ipe.ipe_mask.i6[0]; @@ -984,7 +983,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) ipe.ipe_addr.i6[2] &= ipe.ipe_mask.i6[2]; ipe.ipe_addr.i6[3] &= ipe.ipe_mask.i6[3]; if (ipe.ipe_family == AF_INET) { - bits = count4bits(ipe.ipe_mask.in4_addr); ipe.ipe_addr.i6[1] = 0; ipe.ipe_addr.i6[2] = 0; ipe.ipe_addr.i6[3] = 0; @@ -996,7 +994,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) } else #ifdef USE_INET6 if (ipe.ipe_family == AF_INET6) { - bits = count6bits(ipe.ipe_mask.i6); hv = IPE_V6_HASH_FN(ipe.ipe_addr.i6, ipe.ipe_mask.i6, iph->iph_size); } else From nobody Sun Aug 10 05:55:31 2025 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 4c06SM6Skpz63sgK; Sun, 10 Aug 2025 05:55:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06SM5n71z3PtS; Sun, 10 Aug 2025 05:55:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805331; 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=tisaShUo4wy62tK4N47qE3TB96ZSpktTK6OOXd8OyY0=; b=PQBLUfzLZkBbdvdtU6Lgy8nanCocRll1c2H4q1PrZQhOILcdP6hiSlZ25ifrxt1VwWzS5s XpC28R6Vrt8RsxcDh866iQv9ETRTrjySYJ0n4PDYcHNMe1a9mv8R6/y+RhbQwP7IqWQG+k IKuIr0u3/+Ni0OWS62RYQdninMuStcxhghZgLIUaWcjTWsTFZIo8c8k4FUsZg2CVf40KYC SUij9aEJgY8SuD5c8LakxgS+gxfLxQrqcNAlZTR1OFbZCo+en/Y49biuOOdzPyDGZdjTGd JzxJe4lgoH83sCxaaNTUlhZl2YK4gqtXLhbhCz3VWYvixabnQocPyKcnx0aOnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805331; 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=tisaShUo4wy62tK4N47qE3TB96ZSpktTK6OOXd8OyY0=; b=ElP9IyXeQVwe7MKYZMbAywyjAuMCtwf0sKlA6701Li3cWFMJi0QEh0wkRkXcCaspKuDGrZ x1K67kEKMJ0r+rRiBc3+fTRtTr0u8Yuet4bUr06zEqJtNfQqeuX029PKEXbi1ksU6BG2HT AUHhH4u1U8H00ucwNDDVkktTIrhxdvcU2G5e12Q20JR8IKCFiVjs6Fe9lx8LWXDBqv41a+ kk8QhjSd0dVck2S6Xcj+ERpd4pzvAGmSBwpoUXp/PRdUytwOiLVCJ611sXgD3Ip/tiqvPg ETGWD/TdB9Ovp97hhiHcqbnpV382XeIHnVk1tphw1fpqaoXKq1tbcvKleOE8aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805331; a=rsa-sha256; cv=none; b=aYv7ylxcm7gBY8xPSNCtwu7Qae6+SawEXfauRmkr7y5wGvRZQxOXSSbXzVsFsZhi+egKx+ X6itpvOJKb5CKmJbWO/2Lba4/hTGiGKkwT0Fwx1OlYSz8UJpzqOjJsMGbSerXkjoo02ZKs SxJkRh6JEF262LhqpCAn3RbkvsAjNDNQY3g1BKCf/v1rVMJxve3VsWQnmWFm7MDb+AJO3R es2vs3h7u9C2o7AqUalrIh0v6xJlx5h+nVT4HRJB+Os26iDH/4wlHrdMYSfviBHk8iGJBr taxPoWdhc1PNgjXKaVRGUj7CbN1l0R0c+rXSHmHYzfq1O6pgbsQzOAJ7HLDmLQ== 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 4c06SM518hzv5P; Sun, 10 Aug 2025 05:55:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5tVpS077534; Sun, 10 Aug 2025 05:55:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5tV05077531; Sun, 10 Aug 2025 05:55:31 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:31 GMT Message-Id: <202508100555.57A5tV05077531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9c1615a1a141 - stable/13 - Revert "ipfilter: Avoid allocating a new ipf token when not needed" 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c1615a1a141c36c2486b0b5d3ea75bf182aea5f Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9c1615a1a141c36c2486b0b5d3ea75bf182aea5f commit 9c1615a1a141c36c2486b0b5d3ea75bf182aea5f Author: Cy Schubert AuthorDate: 2025-07-07 16:50:27 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:13 +0000 Revert "ipfilter: Avoid allocating a new ipf token when not needed" malloc() outside of a write lock will reduce potential contention. MFC after: 3 days This reverts commit 7f5e3b9fa3d159b7f061b4d01a767cbe5d0527f3. (cherry picked from commit cf9b6857545371ab5becc6a785c62bc844cb2f94) --- sys/netpfil/ipfilter/netinet/fil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 76fde8622498..18ef46e25805 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -7459,6 +7459,10 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) { ipftoken_t *it, *new; + KMALLOC(new, ipftoken_t *); + if (new != NULL) + bzero((char *)new, sizeof(*new)); + WRITE_ENTER(&softc->ipf_tokens); for (it = softc->ipf_token_head; it != NULL; it = it->ipt_next) { if ((ptr == it->ipt_ctx) && (type == it->ipt_type) && @@ -7467,10 +7471,6 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) } if (it == NULL) { - KMALLOC(new, ipftoken_t *); - if (new != NULL) - bzero((char *)new, sizeof(*new)); - it = new; new = NULL; if (it == NULL) { @@ -7482,6 +7482,11 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) it->ipt_type = type; it->ipt_ref = 1; } else { + if (new != NULL) { + KFREE(new); + new = NULL; + } + if (it->ipt_complete > 0) it = NULL; else From nobody Sun Aug 10 05:55:32 2025 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 4c06SN713Qz63sZK; Sun, 10 Aug 2025 05:55:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06SN5y3pz3PrJ; Sun, 10 Aug 2025 05:55:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805332; 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=kM6RtrnHk80LkHVyjXaBDUBgv7ncGXwDtURlFLO5GjA=; b=txKY1xIJCmSKWknskqXcyB3jVI4PsivdRgyszb6nnZXo8WFALDlH551eURVgl2pmZ0plZH y2UKO4ETvH2K1YCoVQ3f/7McAg3r70VthehVOash5iy1VhtxcIpBZhRwDmEipxCqx9Z1qB gXHdNRl2R8FSSTerlL3m0tlzKX7+qxplRB+I131MlplqE3BgzrALTyx3gjSCNCKWs1saZy chTejJ+LLOfUJ5wdDKreY1ky43k+icSkzxQtHVp5SffNqKapBI3BXw9APQqd9pAi854YO6 kMNaNsSufxWxiyN1LMs8XSqjmIq6eaXQ8PYEjW0m4KjB6ysBDwHX4OMgo+IaXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805332; 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=kM6RtrnHk80LkHVyjXaBDUBgv7ncGXwDtURlFLO5GjA=; b=Y7uDw462N4tUFN2CWJAWDzomR3DyJ9k+fd9CGFBp/n9l5EDDz4PyILR9p/EeY/Xz2HtfYw D5l39oEaYSjCZ7vh2rTcpMKDzJ8bUfgS9oQ4NcYLVRGrsaXfkiJqv5rf+Ti1omee0w7MY6 qHAZpIDtYuWozsZDNQXNCu8V0d/isxJ0fxAcpowUyeQkzE00A+oIMCSTuCuisxIJl4VoMq deg0qVaUAshmXwPP0fp/LbB0O/sK1xTUbJGOR0kcic/LslO15ivzRvQg4UiCs5P74xWPlf CdPxG3tM+BnMUSBOKzGkcmmCSTPIV2d2U+ieJQiCqCGZpo4ywT0dULs7LnUWhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805332; a=rsa-sha256; cv=none; b=VCCYP87xl7kryOGngg8Ye/82WqqrVDWNjV/LyN9c1PJV5PEU4iqx97JEhsVtx+5KBAAmyp qALUh4LBFok1gL9vqr5fk0UozJ8/Mt43HPGRlvrb6SDuGCc1RZNLsMHPkFTLWwFsiYIMF3 MPzM1Imab8Lb7vaIwXGM20t+xLErmR8bWHioDpuW+UO1M134W8ek8kPORnYnKgPxQf+cBZ Y7FF8tDxtwIIcxMd1EvWZIXbU/r66woRPkN5Z4uK1AALJBQ5H3gfcZuT1szL6sFME3PxFx V4by58f1uktAb5oYpc245tsP0MZzc5Mg0/dbD+exAIvuqEYrDxhBGgUl+uZ0MA== 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 4c06SN5Nfwztrw; Sun, 10 Aug 2025 05:55:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5tWPA077568; Sun, 10 Aug 2025 05:55:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5tWHl077565; Sun, 10 Aug 2025 05:55:32 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:32 GMT Message-Id: <202508100555.57A5tWHl077565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 597601a23d5d - stable/13 - ipfilter: End (cleanup) the iterative search key 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 597601a23d5de22dc6d25dad0f7d7ee054e60b08 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=597601a23d5de22dc6d25dad0f7d7ee054e60b08 commit 597601a23d5de22dc6d25dad0f7d7ee054e60b08 Author: Cy Schubert AuthorDate: 2025-07-07 23:37:07 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:14 +0000 ipfilter: End (cleanup) the iterative search key This results in not finding nodes in subsequent hash table listings. MFC after: 3 days (cherry picked from commit ac2e39b5ddf5d5c6bc3848e392670a00e5834450) --- sbin/ipf/libipf/printhash_live.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/ipf/libipf/printhash_live.c b/sbin/ipf/libipf/printhash_live.c index 3caaa5e022fe..b8ee31b27597 100644 --- a/sbin/ipf/libipf/printhash_live.c +++ b/sbin/ipf/libipf/printhash_live.c @@ -61,5 +61,8 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields) if ((opts & OPT_DEBUG) == 0) PRINTF(" };\n"); + + (void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key); + return (hp->iph_next); } From nobody Sun Aug 10 05:55:33 2025 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 4c06SS17ybz63slh; Sun, 10 Aug 2025 05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06SR31Pnz3PmC; Sun, 10 Aug 2025 05:55:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805335; 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=wXE5eK48aJlwVSvOBuDXM4rusJHAPTSCVXsmnUb7nUk=; b=WIqwWIojgFdGO0q79lG5z83kBFlZn0xY0/dA7raCalFS7parX3pBRzBYinZHqzf4dqF+TK w209f1BxIuP9IUEe4vRihwowDhujhB5WynuM2H8+IdGS6Q3vLOTJHGi66C2htXs2Wgd68o 2TELqafqP9Rt6jrIxcMdxjb5QR+76G1agosqEyBb12mCTFvBLv7Ob9GWe09GVTTZ/CBcLn svFJxT2xR7/O9puv2m4kK8ZePHBLI/zcr6D/N/akgO7H/VGELMj97C98BvGRghaOHY3Dn5 hzer3PLdRgxe+CywI8lyHg1+Z9KNE2u1k368FRCrzT36RrurtFraNyGA022HRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805335; 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=wXE5eK48aJlwVSvOBuDXM4rusJHAPTSCVXsmnUb7nUk=; b=NzDLsdvl3eKLBAL0bJuQVdKrRcJN7lpCJ8FC83Q/AkNFRljqadwkcl2pav1wGDZED3Of9Q nfuVy8hu1dpu+qsE9KpjNOdRDJ2S9xIzQiqONMSvV0jz4UrTb5KhkRWADuYzHu0bW7vZaf q2cNUm7jgDPqey1Jjgsr1kgPapiJvTaqBTXQ70/v6ZvCkbwjuY0Fo9EFMrPJRcUPvs9Ad2 wJyB8aMiZIT6Wljo2CsjWJTWftjKL+Vlm8DsnqPiwhpPLoBwS7CHdJjvWmtAl9elQnWNUR lXzqDuz88bMnSbV5OejaHWiezSSGR2F69sqfeAzB+6dIeH7WIeDnoWJdndXZWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805335; a=rsa-sha256; cv=none; b=CwuLV35xTU75w/2ch/RAxob+vC2x6JYHM6VcnC61wnUvg6EZ6uzWfZ/yp7Rvz3VpIxVKGn fMgeBouer8yw6rW71u633ok/lg74hS4+LzJPXFGt2lr96WJb/PoYD4H8g+yye5FRh6CbcW 3I2QAJti8LyfwHfn2ZreovS0N35NeSRGr/iAcXzELcR8rXb16HDKay/H/uWz9z1pCuobOA lL71dN2oposYGNrHfZzoLm70VGKWTo5BJEAMjaNaLYrSC80XrYpdXg7XY+OiPPCfWJaA7B h3DfVkWE5n0Z00d7cm8WSDGVDWxxGEN+AXYyuv6gYwVs+uKdd9EkhBfkKveWmQ== 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 4c06SR2cCHztpp; Sun, 10 Aug 2025 05:55:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5tZiP077617; Sun, 10 Aug 2025 05:55:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5tXbU077603; Sun, 10 Aug 2025 05:55:33 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:33 GMT Message-Id: <202508100555.57A5tXbU077603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9a34cc3bd99d - stable/13 - sqlite3: Vendor import of sqlite3 3.50.2 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9a34cc3bd99dae7d7c3d6004c022c46937a5c114 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9a34cc3bd99dae7d7c3d6004c022c46937a5c114 commit 9a34cc3bd99dae7d7c3d6004c022c46937a5c114 Author: Cy Schubert AuthorDate: 2025-07-07 23:49:17 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:14 +0000 sqlite3: Vendor import of sqlite3 3.50.2 Release notes at https://www.sqlite.org/releaselog/3_50_2.html. Obtained from: https://www.sqlite.org/2025/sqlite-autoconf-3500200.tar.gz MFC after: 1 month Merge commit '89922daaa168292633b1a7a523bcd0559487c6ad' (cherry picked from commit 17f0f75308f287efea825457364e2a4de2e107d4) --- contrib/sqlite3/INSTALL | 370 - contrib/sqlite3/Makefile.am | 20 - contrib/sqlite3/Makefile.in | 1326 +- contrib/sqlite3/Makefile.msc | 50 +- contrib/sqlite3/README.txt | 98 +- contrib/sqlite3/VERSION | 1 + contrib/sqlite3/aclocal.m4 | 10204 -------- contrib/sqlite3/auto.def | 25 + contrib/sqlite3/autosetup/LICENSE | 35 + contrib/sqlite3/autosetup/README.autosetup | 11 + contrib/sqlite3/autosetup/README.md | 453 + contrib/sqlite3/autosetup/autosetup | 2540 ++ .../autosetup-config.guess} | 111 +- .../{config.sub => autosetup/autosetup-config.sub} | 942 +- contrib/sqlite3/autosetup/autosetup-find-tclsh | 16 + contrib/sqlite3/autosetup/autosetup-test-tclsh | 20 + contrib/sqlite3/autosetup/cc-db.tcl | 15 + contrib/sqlite3/autosetup/cc-lib.tcl | 187 + contrib/sqlite3/autosetup/cc-shared.tcl | 113 + contrib/sqlite3/autosetup/cc.tcl | 758 + contrib/sqlite3/autosetup/find_tclconfig.tcl | 24 + contrib/sqlite3/autosetup/jimsh0.c | 24519 +++++++++++++++++++ contrib/sqlite3/autosetup/pkg-config.tcl | 168 + contrib/sqlite3/autosetup/proj.tcl | 2236 ++ contrib/sqlite3/autosetup/sqlite-config.tcl | 2174 ++ contrib/sqlite3/autosetup/system.tcl | 420 + contrib/sqlite3/autosetup/teaish/README.txt | 4 + contrib/sqlite3/autosetup/teaish/core.tcl | 2539 ++ contrib/sqlite3/autosetup/teaish/feature.tcl | 214 + contrib/sqlite3/autosetup/teaish/tester.tcl | 228 + contrib/sqlite3/compile | 348 - contrib/sqlite3/configure | 16891 +------------ contrib/sqlite3/configure.ac | 270 - contrib/sqlite3/depcomp | 791 - contrib/sqlite3/install-sh | 541 - contrib/sqlite3/ltmain.sh | 11251 --------- contrib/sqlite3/missing | 215 - contrib/sqlite3/shell.c | 7696 ++++-- contrib/sqlite3/sqlite3.c | 17725 +++++++++----- contrib/sqlite3/sqlite3.h | 618 +- contrib/sqlite3/sqlite3.pc.in | 2 +- contrib/sqlite3/sqlite3.rc | 2 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/Makefile.in | 1006 +- contrib/sqlite3/tea/README | 36 - contrib/sqlite3/tea/README.txt | 104 + contrib/sqlite3/tea/_teaish.tester.tcl.in | 49 + contrib/sqlite3/tea/aclocal.m4 | 9 - contrib/sqlite3/tea/auto.def | 8 + contrib/sqlite3/tea/configure | 10186 +------- contrib/sqlite3/tea/configure.ac | 227 - contrib/sqlite3/tea/doc/sqlite3.n | 4 +- contrib/sqlite3/tea/generic/tclsqlite3.c | 231 +- contrib/sqlite3/tea/pkgIndex.tcl.in | 40 +- contrib/sqlite3/tea/tclconfig/install-sh | 528 - contrib/sqlite3/tea/tclconfig/tcl.m4 | 4067 --- contrib/sqlite3/tea/teaish.tcl | 565 + contrib/sqlite3/tea/teaish.test.tcl | 14 + contrib/sqlite3/tea/win/makefile.vc | 430 - contrib/sqlite3/tea/win/nmakehlp.c | 815 - contrib/sqlite3/tea/win/rules.vc | 711 - 62 files changed, 56587 insertions(+), 68620 deletions(-) diff --git a/contrib/sqlite3/INSTALL b/contrib/sqlite3/INSTALL deleted file mode 100644 index a1e89e18ad20..000000000000 --- a/contrib/sqlite3/INSTALL +++ /dev/null @@ -1,370 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, -Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/contrib/sqlite3/Makefile.am b/contrib/sqlite3/Makefile.am deleted file mode 100644 index 1eaa560ff884..000000000000 --- a/contrib/sqlite3/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ - -AM_CFLAGS = @BUILD_CFLAGS@ -lib_LTLIBRARIES = libsqlite3.la -libsqlite3_la_SOURCES = sqlite3.c -libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 - -bin_PROGRAMS = sqlite3 -sqlite3_SOURCES = shell.c sqlite3.h -EXTRA_sqlite3_SOURCES = sqlite3.c -sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ -sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ -sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_DQS=0 -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) - -include_HEADERS = sqlite3.h sqlite3ext.h - -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc sqlite3rc.h README.txt Replace.cs Makefile.fallback -pkgconfigdir = ${libdir}/pkgconfig -pkgconfig_DATA = sqlite3.pc - -man_MANS = sqlite3.1 diff --git a/contrib/sqlite3/Makefile.in b/contrib/sqlite3/Makefile.in index fe708a0a9d84..a77386faed7c 100644 --- a/contrib/sqlite3/Makefile.in +++ b/contrib/sqlite3/Makefile.in @@ -1,1050 +1,298 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - +######################################################################## +# This is a main makefile for the "autoconf" bundle of SQLite. This is +# a trimmed-down version of the canonical makefile, devoid of most +# documentation. For the full docs, see /main.mk in the canonical +# source tree. +# +# Maintenance reminders: +# +# - To keep this working with an out-of-tree build, be sure to prefix +# input file names with $(TOP)/ where appropriate (which is most +# places). +# +# - The original/canonical recipes can be found in /main.mk in the +# canonical source tree. +all: + +TOP = @abs_top_srcdir@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +# +# Filename extensions for binaries and libraries +# +B.exe = @BUILD_EXEEXT@ +T.exe = @TARGET_EXEEXT@ +B.dll = @BUILD_DLLEXT@ +T.dll = @TARGET_DLLEXT@ +B.lib = @BUILD_LIBEXT@ +T.lib = @TARGET_LIBEXT@ + +# +# Autotools-compatibility dirs +# +prefix = @prefix@ +datadir = @datadir@ +mandir = @mandir@ +includedir = @includedir@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -bin_PROGRAMS = sqlite3$(EXEEXT) -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = sqlite3.pc -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \ - "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(includedir)" -PROGRAMS = $(bin_PROGRAMS) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -LTLIBRARIES = $(lib_LTLIBRARIES) -libsqlite3_la_LIBADD = -am_libsqlite3_la_OBJECTS = sqlite3.lo -libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libsqlite3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ -am_sqlite3_OBJECTS = sqlite3-shell.$(OBJEXT) -sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) -sqlite3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sqlite3_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/sqlite3-shell.Po \ - ./$(DEPDIR)/sqlite3-sqlite3.Po ./$(DEPDIR)/sqlite3.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ - $(EXTRA_sqlite3_SOURCES) -DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ - $(EXTRA_sqlite3_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -man1dir = $(mandir)/man1 -NROFF = nroff -MANS = $(man_MANS) -DATA = $(pkgconfig_DATA) -HEADERS = $(include_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -AM_RECURSIVE_TARGETS = cscope -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/sqlite3.pc.in \ - INSTALL compile config.guess config.sub depcomp install-sh \ - ltmain.sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -# Exists only to be overridden by the user if desired. -AM_DISTCHECK_DVI_TARGET = dvi -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +# +# Required binaries +# +INSTALL = @BIN_INSTALL@ AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BUILD_CFLAGS = @BUILD_CFLAGS@ +AR.flags = cr CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SHELL_CFLAGS = @SHELL_CFLAGS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CFLAGS = @BUILD_CFLAGS@ -lib_LTLIBRARIES = libsqlite3.la -libsqlite3_la_SOURCES = sqlite3.c -libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 -sqlite3_SOURCES = shell.c sqlite3.h -EXTRA_sqlite3_SOURCES = sqlite3.c -sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ -sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ -sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_DQS=0 -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) -include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc sqlite3rc.h README.txt Replace.cs Makefile.fallback -pkgconfigdir = ${libdir}/pkgconfig -pkgconfig_DATA = sqlite3.pc -man_MANS = sqlite3.1 -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): -sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) *** 143881 LINES SKIPPED *** From nobody Sun Aug 10 05:55:36 2025 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 4c06SS74XRz63sd7; Sun, 10 Aug 2025 05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06SS3xz4z3PZk; Sun, 10 Aug 2025 05: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=1754805336; 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=NxgeEsqKUvCAXB4CPPPWMFNvij9/PWAXmY0BAXS1sZQ=; b=PQcy8U/PUHnQQfOmLtwH6SHxoYa154hm4602BhX7Q97W0YZWEaRL1MYpCij5bJTUZ2UDCS PziHRbrEtefriMKAvR2bbV2NHX+mUd36qrxjwul+YDqYhYoUdpwwO0Qfde2v0EuuuNWLmZ KyULxcdMbZvZig0aN2uePDfW5qg6rf/861u4LeED2RitVIbYKnh0hJtj7S48nsJIwYgMCx 3kp1tO1HnvqvwlHtrQyKLIVLsXK6izClUBrz/ZgG5I4QrAqplDQsottJJKGbMNOMuVRDOk /64DhIgWMuCeM7KI/JeCtQnl7qbrQ/oyzr4wE0vedCX3jQDqNPzN6ar1Ubz7Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805336; 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=NxgeEsqKUvCAXB4CPPPWMFNvij9/PWAXmY0BAXS1sZQ=; b=MSdcYtle42d3soRKl++bOSFOwcYIhhb3nBdvMUBIQfSlkVRSvjZ10ofvCMz6BWrX3vcYoV rll69bBC6yE0PzxtC2lP8CdP3xtlgjAO8WWP3Anvu95dApoRTFf569CMxZlQ24rEQiuaFg d/4SeUvxZBv06j8s1htg+yfoRPC1lLXtYGAbbA+mwJqo35uzny2+SskH3RVG/15INTDMN9 rvB7vFXV67+tE5XGfF9W3c5DK93O0+tfZAHgcp0I7JndnvRER6VtZaM+VlJ37ArrN4BbQX iRhoL1Cq7ByieTRdVDdkiiDEoopVZcvEV6QtMREo9BlSoM7SraSMCQv288vj8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805336; a=rsa-sha256; cv=none; b=XLTB3TvjqOSyIu1zzi7q8jMCSiT+/5b8AKdjgG1xD/+nwIXOsenJEG9vpvduM4Nw+x3j4A rUsd5eqzivtMDrI2L1TZDNzG0PKWkT7bpZ+zVTtdWn9s8rolFuzwjbjC+PW7c6AcvLkhKR x5xblyDMEjLGyLCz8SVRayd6KiHdMRgfJjC91yOxQ4w23/ekdkt5reNQjZdowP6nmVEb5X S4LW+sekb6SjBRfVILT/rLLaX4spx6T2VI5aioTGhTYhrC3CIw/T/rZOjtv/oMgDRnCUVF hv8Bvk6dVKoxYfrZfDypV9LS0IbU9iB0Wo3Pq0wFr2qJsGBbHmFxCcf5qr0kEQ== 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 4c06SS3X08ztrx; Sun, 10 Aug 2025 05:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5taFa077654; Sun, 10 Aug 2025 05:55:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5taVr077651; Sun, 10 Aug 2025 05:55:36 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:36 GMT Message-Id: <202508100555.57A5taVr077651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5a248f1b90d3 - stable/13 - ip_nat6.c: fix non-trivial unused variable warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a248f1b90d30442c635fd55c6584fb6d9d5a86e Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5a248f1b90d30442c635fd55c6584fb6d9d5a86e commit 5a248f1b90d30442c635fd55c6584fb6d9d5a86e Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:14 +0000 ip_nat6.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 2bbaeb717b690f796e751be63a656fb097ef786d) --- sys/netpfil/ipfilter/netinet/ip_nat6.c | 52 +++++++++------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat6.c b/sys/netpfil/ipfilter/netinet/ip_nat6.c index c8b61afa25bc..b284dfaf65f2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat6.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat6.c @@ -1133,9 +1133,6 @@ ipf_nat6_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; - - flags = nat->nat_flags; switch (fin->fin_p) { @@ -1358,8 +1355,8 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - struct icmp6_hdr *icmp6, *orgicmp; - int flags = 0, type, minlen; + struct icmp6_hdr *orgicmp; + int flags = 0, minlen; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -1368,8 +1365,6 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) u_int p; minlen = 40; - icmp6 = fin->fin_dp; - type = icmp6->icmp6_type; nside = &softn->ipf_nat_stats.ns_side6[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -1503,9 +1498,8 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) i6addr_t l1, l2, d; u_short *s1, *s2, *ds; u_32_t r; - int i, neg; + int i; - neg = 0; l1 = *ip1; l2 = *ip2; s1 = (u_short *)&l1; @@ -1522,7 +1516,6 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) } if (s2[0] > s1[0]) { ds[0] = s2[0] + 0x10000 - s1[0]; - neg = 1; } else { ds[0] = s2[0] - s1[0]; } @@ -1872,9 +1865,9 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; - u_int sflags; +#endif nat_t *nat; int nflags; i6addr_t dst; @@ -1884,10 +1877,7 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ifp = fin->fin_ifp; sport = 0; dport = 0; - gre = NULL; dst.in6 = *mapdst; - sflags = flags & NAT_TCPUDPICMP; - switch (p) { case IPPROTO_TCP : @@ -1965,8 +1955,8 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, if ((nat->nat_flags & IPN_TCPUDP) != 0) { - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2190,14 +2180,14 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; +#endif nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; sport = 0; dport = 0; @@ -2278,8 +2268,8 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, break; } - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2566,7 +2556,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) ipf_nat_softc_t *softn = softc->ipf_nat_soft; struct icmp6_hdr *icmp6 = NULL; struct ifnet *ifp, *sifp; - tcphdr_t *tcp = NULL; int rval, natfailed; ipnat_t *np = NULL; u_int nflags = 0; @@ -2619,9 +2608,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) default : break; } - - if ((nflags & IPN_TCPUDP)) - tcp = fin->fin_dp; } ipa = fin->fin_src6; @@ -2963,7 +2949,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) int rval, natfailed; struct ifnet *ifp; i6addr_t ipa, iph; - tcphdr_t *tcp; +#ifdef IPF_V6_PROXIES + tcphdr_t *tcp = NULL; +#endif u_short dport; ipnat_t *np; nat_t *nat; @@ -2971,7 +2959,6 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) if (softn->ipf_nat_stats.ns_rules == 0 || softn->ipf_nat_lock != 0) return (0); - tcp = NULL; icmp6 = NULL; dport = 0; natadd = 1; @@ -3012,7 +2999,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) } if ((nflags & IPN_TCPUDP)) { +#ifdef IPF_V6_PROXIES tcp = fin->fin_dp; +#endif dport = fin->fin_data[1]; } } @@ -3800,32 +3789,19 @@ ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; i6addr_t newip, new; - u_32_t amin, amax; int error; new.i6[0] = 0; new.i6[1] = 0; new.i6[2] = 0; new.i6[3] = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Sun Aug 10 05:55:37 2025 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 4c06SV1svrz63sgN; Sun, 10 Aug 2025 05:55:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06ST4YW7z3Q1H; Sun, 10 Aug 2025 05: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=1754805337; 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=vaCfQuVK5q5twFcNtul1v31N+ro8/D3LPIRZQM261OU=; b=UnalZ+oUs3QRLMf7Uh14TdTsfz1aPmnqCJJMfXe9r8p/UPy/AuC4MwuPm+kZ2B/Rs6j+60 T6lkKC6d7juKD2M9Bvt9HPAxyOiSMSEVirlLVXk828EKdMT8d+XRcROGIClIsovaX1lygN DNS79e6kOEKo9hczSwA8MmOJLnsR+1r9yoxjt5SXMA5aUF7gDIe2hB2KItgmDY9XsoR3+0 sNOaWm1g339bZXK9JXV7BmpFWZoEk85/T8cespo9dccCCFt46iPjAsRAQNLgPQhglVJB/+ gQFwEiN1h99+9fLeUMU1Eql1WmDZ+NuzpC5Omx+DzXUST+aOBfmUNR2JuNa7fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805337; 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=vaCfQuVK5q5twFcNtul1v31N+ro8/D3LPIRZQM261OU=; b=jEPnREt/PzjIoziMjiUjcltPTmJSMdEqv/rhOiaDQsEkHK/YMuROcdho1h1K89giG9bXYp g1opyfu/ufXm8doUpznLgHeYWUqwIS5m/F0I0QgKSjZw6p6jyKpLFBGmq8QJTIoK0xs5x6 4up6SvCntZ1mFACgRdzUU2vA/3FuPg97QETAXS/SQ16Y+Ypq3cqDiH5Upz/GHavAZGrqmb lcxo4BkaQgbJC/lb3koKE+mhTIUkrNAKbtd7zimarTSYA+/AvXWbPEYRspef8gqVLjmE/O cG5rxcafkOOmNmn9XhTufsZnk0d0yN3NP0OTUjlJtdhiPcHRtG1JPQYRlvpwMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805337; a=rsa-sha256; cv=none; b=yDuKmTC5KSIqe33+f20qGOOLq/EodxwPQMnv6vVPEGXKl2y9vOxniLxui2cD+qWwThH48z yUNnxeneaF8kgjk3AoLinb13/heCOXebGeb4klj2aaGZIZ3W9YCmymOUHNmg5Slz66fqgX Q93UMJp+MOn0p0dIqEbpRzCS5k6Yotvq/ssF4+YdtGoo19NI3Io4NZr+iEuyMd3Kn4zKTK wOaD7vMEyAicoyB06GNoJ2RuUqku3VuEEYZNXGO81RP32kipXJ4/RBGduwsa3i1w8sjSQi 9PhjnjzcAzntX/bKdCIzd+DY9z0JLGtltKNSf2lTD7IVaDWwyzk45gPCrWvA9A== 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 4c06ST3yGRzvK2; Sun, 10 Aug 2025 05:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5tb2e077688; Sun, 10 Aug 2025 05:55:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5tbZN077685; Sun, 10 Aug 2025 05:55:37 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:37 GMT Message-Id: <202508100555.57A5tbZN077685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 8777d3a9b857 - stable/13 - netpfil/ipfilter: fix remaining trivial unused variable warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8777d3a9b857f71f37b0cdb872f4a9597efb1e5a Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8777d3a9b857f71f37b0cdb872f4a9597efb1e5a commit 8777d3a9b857f71f37b0cdb872f4a9597efb1e5a Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:15 +0000 netpfil/ipfilter: fix remaining trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 79d23845179a534f533185763cb92032202729a7) --- sys/netpfil/ipfilter/netinet/fil.c | 16 +++++----------- sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c | 8 ++++---- sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_irc_pxy.c | 7 ++----- sys/netpfil/ipfilter/netinet/ip_lookup.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c | 5 +---- sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c | 5 ----- sys/netpfil/ipfilter/netinet/ip_proxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c | 8 +------- sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_state.c | 22 ++-------------------- sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ipf_rb.h | 2 -- 14 files changed, 23 insertions(+), 82 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 18ef46e25805..ce96558fe99a 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -441,7 +441,7 @@ static inline void ipf_pr_ipv6hdr(fr_info_t *fin) { ip6_t *ip6 = (ip6_t *)fin->fin_ip; - int p, go = 1, i, hdrcount; + int p, go = 1, i; fr_ip_t *fi = &fin->fin_fi; fin->fin_off = 0; @@ -468,7 +468,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) if (IN6_IS_ADDR_MULTICAST(&fi->fi_dst.in6)) fin->fin_flx |= FI_MULTICAST|FI_MBCAST; - hdrcount = 0; while (go && !(fin->fin_flx & FI_SHORT)) { switch (p) { @@ -546,7 +545,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) go = 0; break; } - hdrcount++; /* * It is important to note that at this point, for the @@ -2594,14 +2592,13 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass) /* functions called from the IPFilter "mainline" in ipf_check(). */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_acctpkt(fr_info_t *fin, u_32_t *passp) +ipf_acctpkt(fr_info_t *fin, u_32_t *passp __unused) { ipf_main_softc_t *softc = fin->fin_main_soft; char group[FR_GROUPLEN]; frentry_t *fr, *frsave; u_32_t pass, rulen; - passp = passp; fr = softc->ipf_acct[fin->fin_out][softc->ipf_active]; if (fr != NULL) { @@ -4204,7 +4201,7 @@ ipf_getstat(ipf_main_softc_t *softc, friostat_t *fiop, int rev) (rev / 10000) % 100, (rev / 100) % 100); #else - rev = rev; + (void)rev; /* UNUSED */ (void) strncpy(fiop->f_version, ipfilter_version, sizeof(fiop->f_version)); #endif @@ -4412,13 +4409,12 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, OP_ZERO /* zero statistics and counters */ } addrem = OP_ADD; frentry_t frd, *fp, *f, **fprev, **ftail; - void *ptr, *uptr, *cptr; + void *ptr, *uptr; u_int *p, *pp; frgroup_t *fg; char *group; ptr = NULL; - cptr = NULL; fg = NULL; fp = &frd; if (makecopy != 0) { @@ -4536,7 +4532,6 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, } ptr = NULL; - cptr = NULL; if (FR_ISACCOUNT(fp->fr_flags)) unit = IPL_LOGCOUNT; @@ -7318,11 +7313,10 @@ ipf_resolvedest(ipf_main_softc_t *softc, char *base, frdest_t *fdp, int v) /* for both IPv4 and IPv6 on the same physical NIC. */ /* ------------------------------------------------------------------------ */ void * -ipf_resolvenic(ipf_main_softc_t *softc, char *name, int v) +ipf_resolvenic(ipf_main_softc_t *softc __unused, char *name, int v) { void *nic; - softc = softc; /* gcc -Wextra */ if (name[0] == '\0') return (NULL); diff --git a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c index 7e16bbaf7ccc..fb26112450c6 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c @@ -219,7 +219,7 @@ ipf_p_ftp_soft_destroy(ipf_main_softc_t *softc, void *arg) int -ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ftpinfo_t *ftp; ftpside_t *f; @@ -228,8 +228,6 @@ ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (ftp == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = ftp; aps->aps_psiz = sizeof(ftpinfo_t); aps->aps_sport = htons(fin->fin_sport); @@ -1717,7 +1715,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, return (0); if (c != delim) return (0); - addr |= addr; +#if 0 + addr |= (addr << 0); +#endif /* * Get the port number diff --git a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c index c6e4be17e22e..d5103c2944dc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c @@ -341,15 +341,13 @@ ipf_p_ipsec_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) * UDP/TCP port numbers). */ int -ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ipsec_pxy_t *ipsec; u_32_t cookies[4]; mb_t *m; int off; - nat = nat; /* LINT */ - if ((fin->fin_dlen < sizeof(cookies)) || (fin->fin_flx & FI_FRAG)) return (-1); diff --git a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c index 026459299efd..aa9e84be19ed 100644 --- a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c @@ -221,7 +221,7 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) int -ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ircinfo_t *irc; @@ -232,8 +232,6 @@ ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (irc == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = irc; aps->aps_psiz = sizeof(ircinfo_t); @@ -422,8 +420,7 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) int -ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat) { - aps = aps; /* LINT */ return (ipf_p_irc_send(fin, nat)); } diff --git a/sys/netpfil/ipfilter/netinet/ip_lookup.c b/sys/netpfil/ipfilter/netinet/ip_lookup.c index 470bdac76283..f9e00d3ec40b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_lookup.c +++ b/sys/netpfil/ipfilter/netinet/ip_lookup.c @@ -233,13 +233,11 @@ ipf_lookup_soft_destroy(ipf_main_softc_t *softc, void *arg) /* ------------------------------------------------------------------------ */ int ipf_lookup_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, int uid, void *ctx) + int mode __unused, int uid, void *ctx) { int err; SPL_INT(s); - mode = mode; /* LINT */ - SPL_NET(s); switch (cmd) diff --git a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c index 2ad642adfbcd..f9c1ab50b8a2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c @@ -67,7 +67,7 @@ ipf_p_netbios_main_unload(void) int -ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat __unused) { char dgmbuf[6]; int off, dlen; @@ -75,9 +75,6 @@ ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip_t *ip; mb_t *m; - aps = aps; /* LINT */ - nat = nat; /* LINT */ - m = fin->fin_m; dlen = fin->fin_dlen - sizeof(*udp); /* diff --git a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c index 17ba01ce8d94..2aafe5bc0b72 100644 --- a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c @@ -281,7 +281,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) tcphdr_t *tcp; int dlen, off; u_short len; - char *msg; tcp = fin->fin_dp; dlen = fin->fin_dlen - (TCP_OFF(tcp) << 2); @@ -310,8 +309,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) return (-1); } - msg = (char *)fin->fin_dp + (TCP_OFF(tcp) << 2); - while (dlen > 0) { off += pptps->pptps_bytes; if (pptps->pptps_gothdr == 0) { @@ -337,7 +334,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) } } dlen -= len; - msg += len; off += len; pptps->pptps_gothdr = 1; @@ -381,7 +377,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) pptps->pptps_len = 0; start += len; - msg += len; dlen -= len; } diff --git a/sys/netpfil/ipfilter/netinet/ip_proxy.c b/sys/netpfil/ipfilter/netinet/ip_proxy.c index 7cb4604f3e87..0682dd3f1a1e 100644 --- a/sys/netpfil/ipfilter/netinet/ip_proxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_proxy.c @@ -682,14 +682,12 @@ ipf_proxy_ok(fr_info_t *fin, tcphdr_t *tcp, ipnat_t *np) /* ------------------------------------------------------------------------ */ int ipf_proxy_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, void *ctx) + int mode __unused, void *ctx) { ap_ctl_t ctl; caddr_t ptr; int error; - mode = mode; /* LINT */ - switch (cmd) { case SIOCPROXY : diff --git a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c index 2cfaaa58200f..94f0e3ada707 100644 --- a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c @@ -49,12 +49,10 @@ ipf_p_raudio_main_unload(void) * Setup for a new proxy to handle Real Audio. */ int -ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -72,7 +70,7 @@ ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap = aps->aps_data; unsigned char membuf[512 + 1], *s; @@ -82,8 +80,6 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int len = 0; mb_t *m; - nat = nat; /* LINT */ - /* * If we've already processed the start messages, then nothing left * for the proxy to do. diff --git a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c index 13c989cba660..a8bff51c9b9b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c @@ -63,18 +63,12 @@ ipf_p_rcmd_main_unload(void) * Setup for a new RCMD proxy. */ int -ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rcmd_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { tcphdr_t *tcp = (tcphdr_t *)fin->fin_dp; rcmdinfo_t *rc; ipnat_t *ipn; - ipnat_t *np; - int size; - fin = fin; /* LINT */ - - np = nat->nat_ptr; - size = np->in_size; KMALLOC(rc, rcmdinfo_t *); if (rc == NULL) { #ifdef IP_RCMD_PROXY_DEBUG diff --git a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c index 7af11dd4a2dd..bd971d156e37 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c @@ -144,12 +144,10 @@ ipf_p_rpcb_main_unload(void) /* Allocate resources for per-session proxy structures. */ /* -------------------------------------------------------------------- */ int -ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { rpcb_session_t *rs; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -1023,10 +1021,8 @@ ipf_p_rpcb_lookup(rpcb_session_t *rs, u_32_t xid) /* Free the RPCB transaction record rx from the chain of entries. */ /* -------------------------------------------------------------------- */ static void -ipf_p_rpcb_deref(rpcb_session_t *rs, rpcb_xact_t *rx) +ipf_p_rpcb_deref(rpcb_session_t *rs __unused, rpcb_xact_t *rx) { - rs = rs; /* LINT */ - if (rx == NULL) return; diff --git a/sys/netpfil/ipfilter/netinet/ip_state.c b/sys/netpfil/ipfilter/netinet/ip_state.c index 7dc87d52bf07..e2ab064e5058 100644 --- a/sys/netpfil/ipfilter/netinet/ip_state.c +++ b/sys/netpfil/ipfilter/netinet/ip_state.c @@ -887,7 +887,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, { ipstate_t *is, *isn; ipstate_save_t ips; - int error, out, i; + int error, i; frentry_t *fr; char *name; @@ -933,7 +933,6 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, return (ENOMEM); } bcopy((char *)&ips.ips_fr, (char *)fr, sizeof(*fr)); - out = fr->fr_flags & FR_OUTQUE ? 1 : 0; isn->is_rule = fr; ips.ips_is.is_rule = fr; MUTEX_NUKE(&fr->fr_lock); @@ -2211,20 +2210,6 @@ ipf_state_tcpinwindow(fr_info_t *fin, tcpdata_t *fdata, tcpdata_t *tdata, (ackskew >= -1) && (ackskew <= 1)) { inseq = 1; } else if (!(flags & IS_TCPFSM)) { - int i; - - i = (fin->fin_rev << 1) + fin->fin_out; - -#if 0 - if (is_pkts[i]0 == 0) { - /* - * Picking up a connection in the middle, the "next" - * packet seen from a direction that is new should be - * accepted, even if it appears out of sequence. - */ - inseq = 1; - } else -#endif if (!(fdata->td_winflags & (TCP_WSCALE_SEEN|TCP_WSCALE_FIRST))) { /* @@ -2620,7 +2605,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) icmphdr_t *icmp; fr_info_t ofin; tcphdr_t *tcp; - int type, len; + int len; u_char pr; ip_t *oip; u_int hv; @@ -2638,7 +2623,6 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) return (NULL); } ic = fin->fin_dp; - type = ic->icmp_type; oip = (ip_t *)((char *)ic + ICMPERR_ICMPHLEN); /* @@ -4366,7 +4350,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) ip6_t *oip6; u_char pr; u_int hv; - int type; /* * Does it at least have the return (basic) IP header ? @@ -4381,7 +4364,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) } ic6 = fin->fin_dp; - type = ic6->icmp6_type; oip6 = (ip6_t *)((char *)ic6 + ICMPERR_ICMPHLEN); if (fin->fin_plen < sizeof(*oip6)) { diff --git a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c index d81de100120b..3c737b38aacc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c @@ -151,7 +151,7 @@ ipf_p_tftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_tftp_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { udphdr_t *udp; tftpinfo_t *ti; @@ -159,8 +159,6 @@ ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ipnat_t *np; int size; - fin = fin; /* LINT */ - np = nat->nat_ptr; size = np->in_size; diff --git a/sys/netpfil/ipfilter/netinet/ipf_rb.h b/sys/netpfil/ipfilter/netinet/ipf_rb.h index e047c7f44a4a..334311502aab 100644 --- a/sys/netpfil/ipfilter/netinet/ipf_rb.h +++ b/sys/netpfil/ipfilter/netinet/ipf_rb.h @@ -305,13 +305,11 @@ _n##_rb_walktree(struct _n##_rb_head *head, _n##_rb_walker_t func, void *arg)\ _t *prev; \ _t *next; \ _t *node = head->top._f.right; \ - _t *base; \ \ while (node != &_n##_rb_zero) \ node = node->_f.left; \ \ for (;;) { \ - base = node; \ prev = node; \ while ((node->_f.parent->_f.right == node) && \ (node != &_n##_rb_zero)) { \ From nobody Sun Aug 10 05:55:38 2025 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 4c06SW1dYrz63sgP; Sun, 10 Aug 2025 05:55:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06SV5ZZgz3Q54; Sun, 10 Aug 2025 05:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805338; 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=a/ACEefffPDCSEVe3+PYQML1c2JR3xDbmX/e0VmbEAA=; b=PpY38Dq1Y7QjHFsDa5uSNvLFGAe+iEuRAggAkQZdlxDB9W7M/rJDWGVlJBhDeLMHznQn9s IH2zjgtl3xHmOXH0nFHoDCmAXOt/lTw5uxieVymwB3UmQ+TbTdZVMRljdIWU+q8tgneYCj EAg6nDdiEXV+KjuIOr+1yqbckSiNjk6PXITnXm3ZqG/kfNmmutdiPm6rQaSkK8I7bnigKr lXnGRTym6XG2MHhez6U8W+pp8vVgzT8xu/JeKYhu99zn8aSGcPFH+aOOKxYKNCxe9iKMKw 2em1prqcGUH3JxNZPBcpTTUvqiNXDUS6RPa5bP2EOsSHAy4ljt/xZenUC4IGgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805338; 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=a/ACEefffPDCSEVe3+PYQML1c2JR3xDbmX/e0VmbEAA=; b=u5fj3Ld+IgOWE+urzeK2kC1yxFInq5NSU8fvfnnb2CBwd/HFOT406TVeaz9sFhDmzZNeP0 8hMjnWvCY54uCvkaVCKoJ/Dejy57zUVfUluRUnrPVZzxqGVgMCHxtdWKQOicZ+NZUVt0W9 FJLetx9RSZtglN3RK814R4DG5xm0vUAXfRidq2cbtguZ4Cz496DLkkkeU1h2B6vYZx6V3z sXTpmMH6i/FR8WmKBk5iNe0hO3EjGjqEV2auXuJ9IUT90KIp6fqEE4c0xpyxtNEHx+++Rp 6YmnRJT4FeXS7hqVtBPnu74oPxjjunoccgTIStKtda+zg3AWqdJJ78UQLAuVbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805338; a=rsa-sha256; cv=none; b=whBwc+LXzgJwNXkE1Rv1sBpKLpx3Yr3fCE6KL4wWW6+VbeibBJusO7rvYivNkPjQ6Gq41e pgjjb5yVhBROgXIIjuCFCNiDzk83MofrvCVH8sj+PGMGfzvDQqPtBFQj4kHsZIvfpcccx/ 8nZzPm37BH8uT9oEyyvqaCXnEU0C3GHHlTOi1TF5FWtnf5PzszGupq+rZ0AD6kf+cSnZNP uEgiy7kskYVG5Eo/K0a7+7/+eKTmypAZuPGv8yfvsNpYn/EB+wq7uUXaBg+hoJ4zUhIth7 MhgKuOyJskkW91mrk6H3wBBETDmRJv/YLAWRVTj095VDGcNqtLkQE+U2x8QgRA== 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 4c06SV5B8tztlt; Sun, 10 Aug 2025 05:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5tcQK077722; Sun, 10 Aug 2025 05:55:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5tcVr077719; Sun, 10 Aug 2025 05:55:38 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:38 GMT Message-Id: <202508100555.57A5tcVr077719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 4134e9a11ca3 - stable/13 - files: add new IPFILTER_C rule for netpfil/ipfilter sources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4134e9a11ca370b1f5133fbfc41275079c2a3344 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4134e9a11ca370b1f5133fbfc41275079c2a3344 commit 4134e9a11ca370b1f5133fbfc41275079c2a3344 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:15 +0000 files: add new IPFILTER_C rule for netpfil/ipfilter sources This re-enables all compiler warnings for these sources. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 45730dd3ed334d265fc77cf6df1f82013fd5bf69) --- sys/conf/files | 54 ++++++++++++++++++---------------------------------- sys/conf/kern.pre.mk | 4 ++++ 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 20495b57b7c0..328e61e3471a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -601,42 +601,24 @@ contrib/dev/acpica/components/utilities/utxface.c optional acpi contrib/dev/acpica/components/utilities/utxferror.c optional acpi contrib/dev/acpica/components/utilities/utxfinit.c optional acpi contrib/dev/acpica/os_specific/service_layers/osgendbg.c optional acpi acpi_debug -netpfil/ipfilter/netinet/fil.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" -netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/fil.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet compile-with "${IPFILTER_C}" contrib/libfdt/fdt.c optional fdt contrib/libfdt/fdt_ro.c optional fdt contrib/libfdt/fdt_rw.c optional fdt diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index ea3cc1986575..cc32a24cf06b 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -341,6 +341,10 @@ MLXFW_C= ${OFED_C_NOIMP} \ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \ ${.IMPSRC} +# IP Filter +IPFILTER_CFLAGS= -I$S/netpfil/ipfilter +IPFILTER_C= ${NORMAL_C} ${IPFILTER_CFLAGS} + GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c SYSTEM_DEP= Makefile ${SYSTEM_OBJS} From nobody Sun Aug 10 05:55:39 2025 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 4c06SX1smwz63slm; Sun, 10 Aug 2025 05:55:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06SW6s8xz3PsF; Sun, 10 Aug 2025 05:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805340; 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=GuIBpEBVcG1rhte0UTnrHExIDWtlmEuH6B/h0SApvfg=; b=sVJuLwv4VoOqbSHxU1PQYasmuhJrjyOLgpHV2WONIXLzQaWhE+0b4e3LsFMcb96I7TV12d gKn4PpnPpWtPU0ByICMz42x6iJzX0vM6Ojmr3LA8YTVudChjJIbYeJw5jTUckpqcXevS2z yz6wSl+s9F0tRw0diOraSrXUgXDq3+Go/aHj8sDc8qbgDLIKzt8PDCGWSMTnSEza07/o0y cBKlnatuSZ+E5eWDpKnIfHaSCLrYycRrxemxweKWvcG8UEo1OlbytGiu9Ccdoh83n6CMeN JPUy2smiP5s9/rJL051Rvsc3jt9iFa4CcHO4mfoAiX3eNfhFdkWcctKYSk0DIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805340; 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=GuIBpEBVcG1rhte0UTnrHExIDWtlmEuH6B/h0SApvfg=; b=qvd1PSvSZySEkjSavgxUvaIRieJRjb20cguMi9+EXAqiNG3sir29VCby3FKpMs7sfo9NsY 06YBGmBol5b/IyHBoKTvSzgEfW/hAH+Czf6C28/V1TYJ3yXR6EMwiw5ohxU3rrvyHo3Q3H +Xu0RXcaUzsW5xwokPYCgGyRc1E4/dGpecy9F4bQRruW+sQ4F60NJ0Mm1GkmZAN5m2zpJ9 lajqUGf3a95uaW4Pk5w11D0JyoFUpX+gDRPxA+Npjv3MNsT4RMBYXIRobOyfsYzlsh5o30 k+71W3KMWfxRncl6d/4iEOnWud8z3l9KQIIWtSQW6z5PgvGVEjtR+38Vtm3IDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805340; a=rsa-sha256; cv=none; b=NOo4IW/dITW+S7701KhjMiViyjf23sQV03wZU6eKcXGKlIGuPOqeniVZ/wYdqGb5t58NBe 11ImnoDEia3ttFfxsGmO9CrpSUh1ljwFyqqx95OLQvrDIwVWzrVMZC3WDQkr/QVrVjmCdy X1KO7ZFf7VNktBtIZvHoZgRBEKzSFvQhOy9Tmg8NWOaNyVC9Z/IQXhSIJdluFZQnKqzX72 GGTjtowQR9piYNK1diKrU6sbIh4Lyh6gcwY4EFeX5VNqBVkP4fhv+isEWCs83DgNmnP9DA S0BdJe9FdP3u3EmrkPIbkpYYPhrZF96WD5bktqoSrsbltstEZ3WKIVDLRvs/ng== 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 4c06SW6Bdjztpq; Sun, 10 Aug 2025 05:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5tdj0077756; Sun, 10 Aug 2025 05:55:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5td8b077753; Sun, 10 Aug 2025 05:55:39 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:39 GMT Message-Id: <202508100555.57A5td8b077753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 3b6536d03006 - stable/13 - ip_nat.c: fix non-trivial unused variable warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b6536d03006240e938abbf0e6fa1d926647225e Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=3b6536d03006240e938abbf0e6fa1d926647225e commit 3b6536d03006240e938abbf0e6fa1d926647225e Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:15 +0000 ip_nat.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit 2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c) --- sys/netpfil/ipfilter/netinet/ip_nat.c | 43 +++++++++++------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index cc62e93ba2f8..35b18575ac6f 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -3228,13 +3228,10 @@ ipf_nat_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; #if SOLARIS && defined(_KERNEL) && defined(ICK_M_CTL_MAGIC) qpktinfo_t *qpi = fin->fin_qpi; #endif - flags = nat->nat_flags; - switch (nat->nat_pr[0]) { case IPPROTO_ICMP : @@ -3545,8 +3542,8 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - int flags = 0, type, minlen; - icmphdr_t *icmp, *orgicmp; + int flags = 0, minlen; + icmphdr_t *orgicmp; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -3554,8 +3551,6 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) ip_t *oip; u_int p; - icmp = fin->fin_dp; - type = icmp->icmp_type; nside = &softn->ipf_nat_stats.ns_side[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -4006,9 +4001,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; ipnat_t *ipn; - u_int sflags; nat_t *nat; int nflags; u_32_t dst; @@ -4016,9 +4009,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, u_int hv, rhv; ifp = fin->fin_ifp; - gre = NULL; dst = mapdst.s_addr; - sflags = flags & NAT_TCPUDPICMP; switch (p) { @@ -4337,14 +4328,12 @@ ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; ipnat_t *ipn; nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; switch (p) { @@ -4763,7 +4752,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) struct ifnet *ifp, *sifp; ipf_main_softc_t *softc; ipf_nat_softc_t *softn; - icmphdr_t *icmp = NULL; tcphdr_t *tcp = NULL; int rval, natfailed; u_int nflags = 0; @@ -4809,8 +4797,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) nflags = IPN_UDP; break; case IPPROTO_ICMP : - icmp = fin->fin_dp; - /* * This is an incoming packet, so the destination is * the icmp_id and the source port equals 0 @@ -5470,7 +5456,10 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t sumd, ipsumd, sum1, sum2; + u_32_t sumd, sum1, sum2; +#if !defined(_KERNEL) || SOLARIS + u_32_t ipsumd; +#endif icmphdr_t *icmp; tcphdr_t *tcp; ipnat_t *np; @@ -5506,7 +5495,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) ipf_sync_update(softc, SMC_NAT, fin, nat->nat_sync); +#if !defined(_KERNEL) || SOLARIS ipsumd = nat->nat_ipsumd; +#endif /* * Fix up checksums, not by recalculating them, but * simply computing adjustments. @@ -5528,7 +5519,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_osrcaddr; sum2 = nat->nat_nsrcaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_ndstip; fin->fin_daddr = nat->nat_ndstaddr; @@ -5545,7 +5538,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_odstaddr; sum2 = nat->nat_ndstaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; @@ -7359,30 +7354,18 @@ ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t amin, amax, new; + u_32_t new; i6addr_t newip; int error; new = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Sun Aug 10 05:55:40 2025 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 4c06SY37pgz63slq; Sun, 10 Aug 2025 05:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c06SY0Hqmz3PsN; Sun, 10 Aug 2025 05:55:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805341; 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=lOIxZCDyCobS6ibL103LfbLOT5nv4ae4N58s1PEuJmo=; b=AwX3+0pz/3Y2an2YWWuu8AntwJRCCF2KOt68/Q6wtufnoy8s4n2cklEaMD2waTEKEw+q2D vLQLvydruYUAM6AKUMIsPgCNgBV/3PLCCw68VB2aJMkK4/WFDnIdmkaEA7IuYnKPHxKTFe JzLYl5hHHAjhTC9xSUY2iiYmVSElnJxx/linRgSJjcjfb2GZZjwzCgIEbbCok8Ylaf/0kc 5JaPLyx19U/ozR5Q3M75dpdIL5wX86ieYMipW55UK9D15yguY0I8aEq3D6sCLm4rTUHG9E z6CVr7vZzeE5BodImtErV2DMuxmXmFb2ZLapttOnKwZ8Ww5hVHlU/c29tCtORw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754805341; 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=lOIxZCDyCobS6ibL103LfbLOT5nv4ae4N58s1PEuJmo=; b=Gcl87hqNKU8qfAuRRByjLaEC0UnFXvMoR5z1Y5PuBrq1aapqJhAghqvjg3fkeFHNor8cp7 b4D0h6uIhMwaDKlc5nbEsYBl/y+rwLn/b8JwrFx5Hjzw/9i5RJpSEh1B8tWvUt8STIzPeH A4U3NT/XE2o6aveoicBdcXL39RuIkx1PgeOE68PSiVKpTdo8Q0nRiEgVN0Xo0S+UglVYRw EkeNxhF0Rm13pUmNzxEahKDOlecZ0uQ2djy7vmBAme7Y2TMH1kNxpFxy/3XM60SaboG+5h 3PAZCH46TRd3f50S2J9JN8KA5r32k/YsxZkifErONLiObBmHama7oH3TnqtkqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754805341; a=rsa-sha256; cv=none; b=WGhUSo3f54dwBT92YkdjRJT3/74gZXyQttRXz8473lL6MYOCqziifLTiuICHJbFHeEFXFF ltXHjOxLsbJKgCJrkJoIse5M+alY4biOQW6HQ8WD2U77zCHjD3FlmwYmBvjO8thwkO3d+N Oi8U2GPFi5RojFDmpxyAxabFCrBy210XnUUlikeDgpS6QYDIwyOhpH9RcNGaCeN558H8Hx axk2FOj8VhefZmG0h+mfoBeJFrlHuzf8f8nDGgrKVKjkKYiWSRiKo96Qig/ABZSN4wG/vk qSdxRu6+O6QXqXqTCTieWIPiGD/zVJknS+xWiLIHw/NBwkpwxlnBz90AnbDOUQ== 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 4c06SX70P0zv3K; Sun, 10 Aug 2025 05:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5tejZ077794; Sun, 10 Aug 2025 05:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5tedr077790; Sun, 10 Aug 2025 05:55:40 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:55:40 GMT Message-Id: <202508100555.57A5tedr077790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 8bbb1f4ce7a2 - stable/13 - ip_htable: fix -Wtautological-pointer-compare warnings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8bbb1f4ce7a28236bcdce072c2113c43a2a7acd0 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8bbb1f4ce7a28236bcdce072c2113c43a2a7acd0 commit 8bbb1f4ce7a28236bcdce072c2113c43a2a7acd0 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:55:15 +0000 ip_htable: fix -Wtautological-pointer-compare warnings This also fixes a few other trivial -Wunused-but-set-variable warnings. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month (cherry picked from commit e4c864e5550544e5ff7e395309c5098d84058403) --- sys/netpfil/ipfilter/netinet/ip_htable.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index 1119deb031a4..b47a1aa2d795 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -608,7 +608,7 @@ ipf_htent_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, switch (iph->iph_type & ~IPHASH_ANON) { case IPHASH_GROUPMAP : - if (ipe->ipe_group != NULL) + if (ipe->ipe_ptr != NULL) ipf_group_del(softc, ipe->ipe_ptr, NULL); break; @@ -978,7 +978,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) { iphtent_t ipe, *ent; u_int hv; - int bits; bcopy((char *)ipeo, (char *)&ipe, sizeof(ipe)); ipe.ipe_addr.i6[0] &= ipe.ipe_mask.i6[0]; @@ -986,7 +985,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) ipe.ipe_addr.i6[2] &= ipe.ipe_mask.i6[2]; ipe.ipe_addr.i6[3] &= ipe.ipe_mask.i6[3]; if (ipe.ipe_family == AF_INET) { - bits = count4bits(ipe.ipe_mask.in4_addr); ipe.ipe_addr.i6[1] = 0; ipe.ipe_addr.i6[2] = 0; ipe.ipe_addr.i6[3] = 0; @@ -998,7 +996,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) } else #ifdef USE_INET6 if (ipe.ipe_family == AF_INET6) { - bits = count6bits(ipe.ipe_mask.i6); hv = IPE_V6_HASH_FN(ipe.ipe_addr.i6, ipe.ipe_mask.i6, iph->iph_size); } else From nobody Sun Aug 10 23:23:40 2025 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 4c0Yjm66s3z63X9R; Sun, 10 Aug 2025 23:23:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c0Yjm5Wdbz3fw9; Sun, 10 Aug 2025 23:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754868220; 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=bTV1n2rn8O5ncQ7YEFsZxal0VK6deHECM9OWXCP9bpQ=; b=thgNVTG8XVKi3LVNNNw4h02T52OBprfRCxsaPYgID1reyYnN980tnqotc5w4RaVxteyJdd xnKqp8JcD9AaR7X/26tsj7Mm1RxSncBM6xP+JB0ZcuS7rjlNjK9WO69mtayCivzedWnoEU 99lQoZjhYuCVugBTOBsPQQd+vdcKnr6bxJ4RzfLlbVb1rdFWt+hQK+VzSLzruJ2iHmLbMK DGvYfcpek4sfkTS1QQ8Ww4mnpWCKLuenwBBE7wryU8NNl7VLUP5+BIzuNm95XcuM9xQayS e0Idc/SbUqI8xXs7cMfszhEa7bbb30Sjtgd8xwQX7TP0NLRdvz2nDVBcT1sBHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754868220; 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=bTV1n2rn8O5ncQ7YEFsZxal0VK6deHECM9OWXCP9bpQ=; b=H9eOmGLm+GH/Swmp8k5L5Z0cMQVNzZmSR1FNNkuT2XePxaw5QPZDxHup5yBWeuH8B/APC4 6Yxu665ALMtiEW73sqWC487WyrcTyy+bgQR4wEP1tTVF6Vg0q7lrv89EPsLKwFS5n9n1vp SglNj2mlJkZ4CwWnL0MD7cGfdOLNOGU1w2/3thzncpHA5aQ1iP7yULWv5UbeFadhm5Km8I 5/DSH+tM7zWMp4fQsyiSD+6NXhVGLVcgHqTl/QrzJZgMc7lUBgeQY4Uh1GVMl0H4oJcRes BVk37IpY5mKWeKViC0LTfzptt43w2JzTkPIO07Olc3FmrRnquFGjCGSuC9f/gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754868220; a=rsa-sha256; cv=none; b=kItZnAaUDDF5VFLdABHf7xgjL6DJ/ag3Bidv0RlYP4wsYsEuwT/UgfbPOIwZhCwR9j5idy mJWT06t7dlDh3bbOMkCst+pNpcBJ0fhoFq97DT1rX7X23dkT6eVcpuTr1BZXUl0ppJjoui XKD2pIAPJNgaoLGKn6I5aZN6bL1EgCatSSyDMHjmiSRgZc2FO2MrJWUby+G+T3z+mHg0kN 7EiB43My245DGqBy8EwybGypoMw79tXq6lSZzQIda70P2MQDpWLxItha10LNfN9zLKrGJ6 vA6Mk+dkP2ids3Tz+EKmPjDNTev5bmmTRy/8hlZdmrfi32UxqIRWLlwO74rSdA== 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 4c0Yjm5145zBqt; Sun, 10 Aug 2025 23:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57ANNevL054066; Sun, 10 Aug 2025 23:23:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57ANNeqr054063; Sun, 10 Aug 2025 23:23:40 GMT (envelope-from git) Date: Sun, 10 Aug 2025 23:23:40 GMT Message-Id: <202508102323.57ANNeqr054063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: c0e04a22331e - stable/14 - arm64 pmap: do not panic when unable to insert PTP into trie 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c0e04a22331ebab8e639d69a0da7de71dd4119c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=c0e04a22331ebab8e639d69a0da7de71dd4119c3 commit c0e04a22331ebab8e639d69a0da7de71dd4119c3 Author: Alan Cox AuthorDate: 2025-07-08 23:31:26 +0000 Commit: Alan Cox CommitDate: 2025-08-10 16:01:06 +0000 arm64 pmap: do not panic when unable to insert PTP into trie When pmap_enter_l2() needs to destroy an existing kernel superpage mapping, do not remove the saved page table page (PTP) from the pm_root trie and remap it into the page table. Instead, simply zero it. Then, later the PTP does not need to be unmapped and reinserted into the trie. If the kernel region is not mapped by a superpage, then try to insert the PTP into the pm_root trie before clearing the PTEs. If the PTP insertion fails, then we can return failure with the old mappings still in place. Convert an assertion from a panic to a KASSERT. (cherry picked from commit 2cfd6342ac84c6915106fbe141795ca23a96cbba) --- sys/arm64/arm64/pmap.c | 84 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 30 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 8e3161736467..f8dec0d3a82b 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -464,7 +464,8 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, static int pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, vm_page_t m, struct rwlock **lockp); static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, - pd_entry_t l1e, struct spglist *free, struct rwlock **lockp); + pd_entry_t l1e, bool demote_kl2e, struct spglist *free, + struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp); static void pmap_reset_asid_set(pmap_t pmap); @@ -3411,8 +3412,7 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) PMAP_LOCK_ASSERT(pmap, MA_OWNED); ml3 = pmap_remove_pt_page(pmap, va); - if (ml3 == NULL) - panic("pmap_remove_kernel_l2: Missing pt page"); + KASSERT(ml3 != NULL, ("pmap_remove_kernel_l2: missing pt page")); ml3pa = VM_PAGE_TO_PHYS(ml3); newl2 = PHYS_TO_PTE(ml3pa) | L2_TABLE; @@ -3437,8 +3437,8 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int -pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, - pd_entry_t l1e, struct spglist *free, struct rwlock **lockp) +pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pd_entry_t l1e, + bool demote_kl2e, struct spglist *free, struct rwlock **lockp) { struct md_page *pvh; pt_entry_t old_l2; @@ -3474,9 +3474,7 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, vm_page_aflag_clear(mt, PGA_WRITEABLE); } } - if (pmap == kernel_pmap) { - pmap_remove_kernel_l2(pmap, l2, sva); - } else { + if (pmap != kernel_pmap) { ml3 = pmap_remove_pt_page(pmap, sva); if (ml3 != NULL) { KASSERT(vm_page_any_valid(ml3), @@ -3487,6 +3485,14 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, ml3->ref_count = 0; pmap_add_delayed_free_list(ml3, free, FALSE); } + } else if (demote_kl2e) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = vm_radix_lookup(&pmap->pm_root, pmap_l2_pindex(sva)); + if (vm_page_any_valid(ml3)) { + ml3->valid = 0; + pmap_zero_page(ml3); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } @@ -3689,7 +3695,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) { if (sva + L2_SIZE == va_next && eva >= va_next) { pmap_remove_l2(pmap, l2, sva, pmap_load(l1), - &free, &lock); + true, &free, &lock); continue; } else if (pmap_demote_l2_locked(pmap, l2, sva, &lock) == NULL) @@ -4849,33 +4855,51 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, } } SLIST_INIT(&free); - if ((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK) + if ((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK) { (void)pmap_remove_l2(pmap, l2, va, - pmap_load(pmap_l1(pmap, va)), &free, lockp); - else + pmap_load(pmap_l1(pmap, va)), false, &free, lockp); + } else { + if (ADDR_IS_KERNEL(va)) { + /* + * Try to save the ptp in the trie + * before any changes to mappings are + * made. Abort on failure. + */ + mt = PHYS_TO_VM_PAGE(PTE_TO_PHYS(old_l2)); + if (pmap_insert_pt_page(pmap, mt, false, + false)) { + CTR1(KTR_PMAP, + "pmap_enter_l2: cannot ins kern ptp va %#lx", + va); + return (KERN_RESOURCE_SHORTAGE); + } + /* + * Both pmap_remove_l2() and + * pmap_remove_l3_range() will zero fill + * the L3 kernel page table page. + */ + } pmap_remove_l3_range(pmap, old_l2, va, va + L2_SIZE, &free, lockp); + if (ADDR_IS_KERNEL(va)) { + /* + * The TLB could have an intermediate + * entry for the L3 kernel page table + * page, so request an invalidation at + * all levels after clearing the + * L2_TABLE entry. + */ + pmap_clear(l2); + pmap_s1_invalidate_page(pmap, va, false); + } + } + KASSERT(pmap_load(l2) == 0, + ("pmap_enter_l2: non-zero L2 entry %p", l2)); if (!ADDR_IS_KERNEL(va)) { vm_page_free_pages_toq(&free, true); - KASSERT(pmap_load(l2) == 0, - ("pmap_enter_l2: non-zero L2 entry %p", l2)); } else { KASSERT(SLIST_EMPTY(&free), ("pmap_enter_l2: freed kernel page table page")); - - /* - * Both pmap_remove_l2() and pmap_remove_l3_range() - * will leave the kernel page table page zero filled. - * Nonetheless, the TLB could have an intermediate - * entry for the kernel page table page, so request - * an invalidation at all levels after clearing - * the L2_TABLE entry. - */ - mt = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l2))); - if (pmap_insert_pt_page(pmap, mt, false, false)) - panic("pmap_enter_l2: trie insert failed"); - pmap_clear(l2); - pmap_s1_invalidate_page(pmap, va, false); } } @@ -7018,8 +7042,8 @@ pmap_demote_l2_abort(pmap_t pmap, vm_offset_t va, pt_entry_t *l2, struct spglist free; SLIST_INIT(&free); - (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), &free, - lockp); + (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), true, + &free, lockp); vm_page_free_pages_toq(&free, true); } From nobody Sun Aug 10 23:23:41 2025 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 4c0Yjp0CTNz63X4L; Sun, 10 Aug 2025 23:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c0Yjn6NVvz3fdv; Sun, 10 Aug 2025 23:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754868221; 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=gD1NDPLPmos2iAzzEYmjO8L6TCd1iiX6ppJ/J3jjlSY=; b=edK53LAGyGRQHAS5Ovvznjp4o48jNSJNyaLK5l09gpgxh5691pLiy0h2XWNv1021M00HWH qw5lWJmjHBaciDpK5ltl76Y6lPK/3/kr+p5F96+vagoHl0i2UbTFgT861wyEeY3qaqBtIB TJL/8SRWjoTGhMxrcNbhHXxYpcca97EQnJzZCAUy2oP/wTlmWrnvOWinrMxEsswGmRL74l 7ExQ2PpRnYOb7SFCoaJn9k3adc/MZQKPqeGrl5+YymU22tm0qQBZLVgql1X9mOAF+i2jZl FVxZxtbjj/g6JhCVwv6fuTw0xW/DzY7yal5oHu5HHeotHWnhplRtbqiI1tAGQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754868221; 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=gD1NDPLPmos2iAzzEYmjO8L6TCd1iiX6ppJ/J3jjlSY=; b=nTYIyJnOQoYNq/0mSN3svSjpvTCbiO4HqBmu0Ve0xHLHgXotvDfJ/CixYe8fWPXMsTWLXw RAuhI8HSimzzNnPHFRqvVXnY3+0kWwnQm204wBWI3YXSg3gmzFjZVAhc7kiEquhEdpjNkT E+JGbbQ0uou0aDKqF4DbC1Qe0/16SkWnUXNF/tCRah/sV1hjO5Odn5bcEY+a1Yn7qG5zw3 3SMaqQEyysx9MG+Si3exl8xcyN6p/yJR8YMuDttPiJKB81DXSkCGK5/BVJLXKtW3qTuNEY M7CyYvN0kI8eruN/OlPHBk6oXe0n9H0FggTNolOfXOlw0WGjmYULLpyRYcXkjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754868221; a=rsa-sha256; cv=none; b=G5zhPH+8G0tYIMX09DCOApdJTloBZmxNOqXD+ghRlhvSOYwe4sFm1Bgebgzd5c1lkLqt32 a6wXmebZiQCDJ0MbKycDMyMf0mAeKetoGSu7r3P4yuY4hXNuvcX3MLYHT9zpMtjatDBqlR 7WCsMWOE9RVmnBX6qwvZFNFy3lwJB086pGf7cYq3IqXOxUhSLk1SrZ6cVGg9NWNOuNGwAo 7rAoN+3O5/7KBZK7D2Owj/7t+AyM7kYQY0gj1FVa7zIzBzDfCEUZO1v2VAI++r8G1VrCj1 yZOX+ZPCQIUBD6HBkEzeUcLpqekZqb7i85e9UcHrr80+GFfajsJm2CHpC+pPjA== 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 4c0Yjn6040zBbC; Sun, 10 Aug 2025 23:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57ANNfXb054100; Sun, 10 Aug 2025 23:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57ANNfvk054097; Sun, 10 Aug 2025 23:23:41 GMT (envelope-from git) Date: Sun, 10 Aug 2025 23:23:41 GMT Message-Id: <202508102323.57ANNfvk054097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: f406b54c806a - stable/14 - pmap_enter_{l2,pde}: correct the handling of an error case 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f406b54c806a3348ef4d4aab5e7290ce74ba9d71 Auto-Submitted: auto-generated The branch stable/14 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=f406b54c806a3348ef4d4aab5e7290ce74ba9d71 commit f406b54c806a3348ef4d4aab5e7290ce74ba9d71 Author: Alan Cox AuthorDate: 2025-07-16 08:08:49 +0000 Commit: Alan Cox CommitDate: 2025-08-10 16:01:06 +0000 pmap_enter_{l2,pde}: correct the handling of an error case When pmap_enter_object()'s call to pmap_enter_{l2,pde}() fails to create a managed mapping within the kernel address space due to the inability to allocate a PV entry, it needs to remove the kernel page table page from the pmap's trie of idle page table pages. Previously, it did not. (cherry picked from commit 5a846c48f209d04dad36aa35a9968f557c4516f7) --- sys/amd64/amd64/pmap.c | 11 +++++++++++ sys/arm64/arm64/pmap.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index ba0ce76c5335..8aea7ad6d622 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -7500,6 +7500,9 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, PG_RW = pmap_rw_bit(pmap); KASSERT((newpde & (pmap_modified_bit(pmap) | PG_RW)) != PG_RW, ("pmap_enter_pde: newpde is missing PG_M")); + KASSERT((flags & (PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM)) != + PMAP_ENTER_NORECLAIM, + ("pmap_enter_pde: flags is missing PMAP_ENTER_NOREPLACE")); PG_V = pmap_valid_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -7629,6 +7632,14 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, if (!pmap_pv_insert_pde(pmap, va, newpde, flags, lockp)) { if (pdpg != NULL) pmap_abort_ptp(pmap, va, pdpg); + else { + KASSERT(va >= VM_MAXUSER_ADDRESS && + (*pde & (PG_PS | PG_V)) == PG_V, + ("pmap_enter_pde: invalid kernel PDE")); + mt = pmap_remove_pt_page(pmap, va); + KASSERT(mt != NULL, + ("pmap_enter_pde: missing kernel PTP")); + } if (uwptpg != NULL) { mt = pmap_remove_pt_page(pmap, va); KASSERT(mt == uwptpg, diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index f8dec0d3a82b..05cb0df4a1ae 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -4822,6 +4822,9 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(ADDR_IS_CANONICAL(va), ("%s: Address not in canonical form: %lx", __func__, va)); + KASSERT((flags & (PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM)) != + PMAP_ENTER_NORECLAIM, + ("pmap_enter_l2: flags is missing PMAP_ENTER_NOREPLACE")); if ((l2 = pmap_alloc_l2(pmap, va, &l2pg, (flags & PMAP_ENTER_NOSLEEP) != 0 ? NULL : lockp)) == NULL) { @@ -4928,6 +4931,15 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, if (!pmap_pv_insert_l2(pmap, va, new_l2, flags, lockp)) { if (l2pg != NULL) pmap_abort_ptp(pmap, va, l2pg); + else { + KASSERT(ADDR_IS_KERNEL(va) && + (pmap_load(l2) & ATTR_DESCR_MASK) == + L2_TABLE, + ("pmap_enter_l2: invalid kernel L2E")); + mt = pmap_remove_pt_page(pmap, va); + KASSERT(mt != NULL, + ("pmap_enter_l2: missing kernel PTP")); + } if (uwptpg != NULL) { mt = pmap_remove_pt_page(pmap, va); KASSERT(mt == uwptpg, From nobody Sun Aug 10 23:23:42 2025 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 4c0Yjq4r2Jz63XQq; Sun, 10 Aug 2025 23:23:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c0Yjq1cq1z3fwB; Sun, 10 Aug 2025 23:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754868223; 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=On+vzg6nakLZXpAOAiBgfiFU906aI1eKFN7IP3Zb/9Y=; b=VXgszX9uZp4yY9j+9P3ak1ywE7ndQitJpexpxbMV8n66gbqkGTfaz6O+AzI4QNV4ixCl2L StGPcviUV7KjPlPGwk0gCyBMBJ6JkvXcb2qHUtunehJxCCAtKMU+p/ekm/G6RdoaXMoVSN ESASnSEvmBcCaFw/FQSZ8GHWxU3/HDG4Q7PZ2YoI6QVE2IezCC3jwAKaT+YRRkXmrjEiTo 0Nclt/M4uRBVW4zGwx/YEcS3SwTIEs5+p0y8jN6l8sO/CdDro0S+0YFqJDgwI601uN+Tqg Q2A9WhWrf2ceUxsBh3sm8qLizgW3GalFLhk67ZTyi9AGituDuG1gQm32N015Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754868223; 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=On+vzg6nakLZXpAOAiBgfiFU906aI1eKFN7IP3Zb/9Y=; b=lQuc7jfPlfAlPBFn/TfYSmrB5T0IhRk1ZNhNBITPe0yHXdlG6BSVr8ETdxzWjEanW0IUrd MlOQeb6n2zF8G9g4MHK/IvXHxCxpMQwi5eeRCfNFhNIdHIJNQPLGd6idL2tYTBMJveUxYt VQUz9d7vKMtEf30S+Grvbmit0C/B/B4IO3b7Jom5lWh6t32lnVU4vE0Qj6JzBOIJogv6IZ Csj4C8vrS6awmyyuGkLBN97myZVhiKsdHwaCFx+Sf7+Hzqfg6X9+vA7A6VdeMjN5xI9xkB +R91SE/hOWmUmypH08mOQsBtMg00YhIq8LAdLKh2uX4CXz7Re4Cy6TdApfTTMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754868223; a=rsa-sha256; cv=none; b=x4o79KHnSdJjIkTITEwMgjiHZsFgqJaItCsD7n1NLtDX09q23M/sdWhc7kjAAfwagN4k6Y R7Y/IBtpxsEhaL9xGEOuKp5g+6lWymGaHvec9LpOqPhCtOvrZZXLwPuoGvQQjKnN5XUVLS lIJ6DioluoYvYIXa9atl8vGRscLF4+xWPAgVRAGU1Ct5LXii8pFLTQKT4groora+jQnBvU wbIcjI7LcVmw8hHk560z+WViH4ysB1Dw8AMG7bjCC8LCFUKz6XUD+XvehiYHBHpiu/kolJ s964IiMkTjU91dLYVmF6rz2WnDhppnMDvnJuy+l4VnttXaPI2utZ40fbVtX05g== 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 4c0Yjp71HzzBnq; Sun, 10 Aug 2025 23:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57ANNg41054139; Sun, 10 Aug 2025 23:23:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57ANNgf8054136; Sun, 10 Aug 2025 23:23:42 GMT (envelope-from git) Date: Sun, 10 Aug 2025 23:23:42 GMT Message-Id: <202508102323.57ANNgf8054136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: d88f8a306cfe - stable/14 - pmap_demote_{l2,pde}: never invalidate wired mappings 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d88f8a306cfe7ba0a629108102ed2be0b090a876 Auto-Submitted: auto-generated The branch stable/14 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=d88f8a306cfe7ba0a629108102ed2be0b090a876 commit d88f8a306cfe7ba0a629108102ed2be0b090a876 Author: Alan Cox AuthorDate: 2025-07-19 20:18:04 +0000 Commit: Alan Cox CommitDate: 2025-08-10 21:02:57 +0000 pmap_demote_{l2,pde}: never invalidate wired mappings Rather than demoting a superpage mapping that hasn't been accessed, we ordinarily invalidate it. However, if the mapping is wired, invalidation is problematic because the page fault to reinstantiate the mapping could sleep. Instead, demote the wired mapping with the accessed flag cleared in the PTEs. (cherry picked from commit 7502c1f270827434bb9661cbb4b9652fdb836521) --- sys/amd64/amd64/pmap.c | 21 +++++++++++---------- sys/arm64/arm64/pmap.c | 24 +++++++++++++----------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8aea7ad6d622..9fd6c4091c95 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -6043,17 +6043,18 @@ pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, if (mpte == NULL) { /* * Invalidate the 2MB page mapping and return "failure" if the - * mapping was never accessed. + * mapping was never accessed and not wired. */ if ((oldpde & PG_A) == 0) { - KASSERT((oldpde & PG_W) == 0, - ("pmap_demote_pde: a wired mapping is missing PG_A")); - pmap_demote_pde_abort(pmap, va, pde, oldpde, lockp); - return (FALSE); - } - - mpte = pmap_remove_pt_page(pmap, va); - if (mpte == NULL) { + if ((oldpde & PG_W) == 0) { + pmap_demote_pde_abort(pmap, va, pde, oldpde, + lockp); + return (false); + } + mpte = pmap_remove_pt_page(pmap, va); + /* Fill the PTP with PTEs that have PG_A cleared. */ + mpte->valid = 0; + } else if ((mpte = pmap_remove_pt_page(pmap, va)) == NULL) { KASSERT((oldpde & PG_W) == 0, ("pmap_demote_pde: page table page for a wired mapping is missing")); @@ -6105,7 +6106,7 @@ pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, /* * If the PTP is not leftover from an earlier promotion or it does not * have PG_A set in every PTE, then fill it. The new PTEs will all - * have PG_A set. + * have PG_A set, unless this is a wired mapping with PG_A clear. */ if (!vm_page_all_valid(mpte)) pmap_fill_ptp(firstpte, newpte); diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 05cb0df4a1ae..a3014fd5cee3 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -7093,18 +7093,20 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, /* * Invalidate the 2MB page mapping and return "failure" if the - * mapping was never accessed. + * mapping was never accessed and not wired. */ if ((oldl2 & ATTR_AF) == 0) { - KASSERT((oldl2 & ATTR_SW_WIRED) == 0, - ("pmap_demote_l2: a wired mapping is missing ATTR_AF")); - pmap_demote_l2_abort(pmap, va, l2, lockp); - CTR2(KTR_PMAP, "pmap_demote_l2: failure for va %#lx in pmap %p", - va, pmap); - goto fail; - } - - if ((ml3 = pmap_remove_pt_page(pmap, va)) == NULL) { + if ((oldl2 & ATTR_SW_WIRED) == 0) { + pmap_demote_l2_abort(pmap, va, l2, lockp); + CTR2(KTR_PMAP, + "pmap_demote_l2: failure for va %#lx in pmap %p", + va, pmap); + goto fail; + } + ml3 = pmap_remove_pt_page(pmap, va); + /* Fill the PTP with L3Es that have ATTR_AF cleared. */ + ml3->valid = 0; + } else if ((ml3 = pmap_remove_pt_page(pmap, va)) == NULL) { KASSERT((oldl2 & ATTR_SW_WIRED) == 0, ("pmap_demote_l2: page table page for a wired mapping" " is missing")); @@ -7160,7 +7162,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, /* * If the PTP is not leftover from an earlier promotion or it does not * have ATTR_AF set in every L3E, then fill it. The new L3Es will all - * have ATTR_AF set. + * have ATTR_AF set, unless this is a wired mapping with ATTR_AF clear. * * When pmap_update_entry() clears the old L2 mapping, it (indirectly) * performs a dsb(). That dsb() ensures that the stores for filling