From nobody Mon Jun 23 05:40:04 2025 X-Original-To: dev-commits-src-main@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 4bQcNj07Hdz5ypJp; Mon, 23 Jun 2025 05:40: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 4bQcNh6H4Rz3MYn; Mon, 23 Jun 2025 05:40:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750657204; 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=7Q3be3uwn/UtgFljaaehrrlRk3c6/ahQGFYoBcFhElw=; b=rOhPXeDs0T6BKwXTIrhhmVbyG8lhx/RWHg5N+QJcnfkGMN6DNF4xCcmbaZQxMiiZo8em0s 4syyTEmfVc8Z4Ctk+E7DZVlE0DTBy5qWFK/JLGzGHsKUZeinOnUJmpRQE5P6t2lMctTzNv hoNV39DiDfnkjLKkcW3hGIwhj7H9WBI7MVbFO2g+sahei95i986w+udS9RPKCc9ew8ijDy NN1hfN65ANFxG+HixHqUAUgDLcUOHz0WnBlcJJDYcmoQhBtkyz3e0Q0AQd/Ycw5/bDOAIx jCQa5DEZLedyu0hGkcOhdn4/oN4lpKCz31UqtbYN0Py2RFHKwW6ys5olpfcR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750657204; 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=7Q3be3uwn/UtgFljaaehrrlRk3c6/ahQGFYoBcFhElw=; b=AYvA/+lWXWvuduPciEk0C9P4TfLl4cWFAXyuyrRuAN44sjjEcp+7BrsFqNcTTo0aBvMMqG xf3jm0AuRJamqMdEPgBy82B296roE9Lp291s7ZMbTo6NZt+bKcAw07icExR1OUCXht62U/ uNjMuS+eAPKzLX4A5r2syAFgOqzB+AiPDQf4ReWBISBbHPIQvY7ShtGpjTybZCPHpseVcK llwIquS4M7PXrR0bziGjxdl/4HCKcXHsIOZjkOazV1YywFFi1UakMAeRYXdZs6mKchL3ZS 2PnzzZFiPLdprP8XU2XCBP1i1FX6SscJUdW+lC1MkbRL4v1DmVzGQzYHdNi5pQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750657204; a=rsa-sha256; cv=none; b=B3Uby593NP0N0cT3hHMnP8v9n3cBjtvqOXPsdVqrfTxasgEvZEgDzmPBykaWIwcz5Cgrze 18gq1JjByGB9G5FXr5w3g+4eUQxDrk9LtBtjXEElpwNWLGuqh6+9S2n59zdubMz6BdUPlf Vkl2trL7NmkDfTyFkNM8lh5O+BnYWdyYhAN6gFB7XXEeY1C0FD4EzVykgD7truzX6V/o64 LWLtw9Z7bE9xGvA3KZTA/MbKzzQSI2h97sD077Ukj/yyuacOb1mKue5/i9jP3+AqTouBPB sn3/+HMiVzEmgmly2nOcy8jPm8h9ZLBdAZhauRyVcHJWxvlMeCmHmFC+fdlndA== 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 4bQcNh5s7hzqkG; Mon, 23 Jun 2025 05:40: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 55N5e4TC027276; Mon, 23 Jun 2025 05:40:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N5e4t9027271; Mon, 23 Jun 2025 05:40:04 GMT (envelope-from git) Date: Mon, 23 Jun 2025 05:40:04 GMT Message-Id: <202506230540.55N5e4t9027271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 27aec148ea4b - main - mididumpl.1: update link to Standard MIDI-File Format Spec. 1.1, updated List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27aec148ea4bfa2ccd2170ed1ccc6665aa819607 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=27aec148ea4bfa2ccd2170ed1ccc6665aa819607 commit 27aec148ea4bfa2ccd2170ed1ccc6665aa819607 Author: Wolfram Schneider AuthorDate: 2025-06-23 05:36:51 +0000 Commit: Wolfram Schneider CommitDate: 2025-06-23 05:36:51 +0000 mididumpl.1: update link to Standard MIDI-File Format Spec. 1.1, updated PR: 287588 MFC after: 1 week --- usr.bin/mididump/mididump.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/mididump/mididump.1 b/usr.bin/mididump/mididump.1 index 7b2bc649eb24..2f7f75d41e2d 100644 --- a/usr.bin/mididump/mididump.1 +++ b/usr.bin/mididump/mididump.1 @@ -64,7 +64,7 @@ argument corresponds to the MIDI device (e.g. .Re .Rs .%T Standard MIDI-File Format Spec. 1.1, updated -.%U https://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html +.%U https://midimusic.github.io/tech/midispec.html .Re .Rs .%T MIDI CC List for Continuous Controllers From nobody Mon Jun 23 06:27:41 2025 X-Original-To: dev-commits-src-main@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 4bQdRf4yxwz5yrQm; Mon, 23 Jun 2025 06:27: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 4bQdRf04YQz3gMr; Mon, 23 Jun 2025 06:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750660062; 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=kiJUVOYNSdlaRgeeKikjgMYdabZOX5k8fE7irCWCZxs=; b=Rk75SdOs+DuZWts4Y5r/eSaNKOdWvRBuTtUfaZsL2MT2VuRDGsi+gPVE07icD3zvKmKxO9 Zxa2/ej3+FJhnVAx8WmqboDWpQ1eDN7ISOmMIksatkSGWfcDwcu8MMqxFbAhTxMDWsUVAh ak4T2w59yy8Q2IVvI7f4pRyOPpv9L0IPmvEi024FaghmdxevRtlVqtZNHGxxgb24mVFq85 AnvvyItjUGeF55KZVcfd4Lwh90R8R5Pr78mT+oDa78zLTAD5u4f3bVPpdXlkTH66uRAcvu HK1oDh86Sj1PmtbvL4zv73bnKiEppruZaOnIBYwhOuoSy9WxxsM3MQWSNuBfIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750660062; 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=kiJUVOYNSdlaRgeeKikjgMYdabZOX5k8fE7irCWCZxs=; b=BHGzBkR7JXH18RuNIMi/dqNObiQ1bhK4UIkDz2DBXtedD/toDBkAM6bmhkQiSbvBNtpGKb VRjxkqCoO9TOslUuL/6a+W0XPCLsPFs/y7wT8Kx28C5OfLcDQIByhKgyn9pqN0YDPhxXF7 f1STOBCHol/YhUTtXUlif8vO75gDkroD7VL2bhmS26UA1S7/w9dJw/jmW932EdWKGRrnSp deFnUHpWJSRx4cw3BdYaP4RqyPdQT2jvxijiLlG31vbr61TMah2hKRYbw6hZdNw6TfKLvp ZOtJt16C9XSioLexAl6AlF2LpMjZtyGwgI10PjuS29KbVJVZzoZ02bxfqt2OmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750660062; a=rsa-sha256; cv=none; b=V3GFlwO0PpXSEdgdM11DV88ME6Zg3VwXQtAYR5SwnGdAiKdJZ3YKXO9x8v35xsgSHtj0LE tkRFqSt2P0Iu7ts9mjy/lL6Lk0TaYK0aszlSKnqejoGRwgBLzSiH2iUNoDBseo46uaKhH/ ygUSdkRJFfIpVCB3B3UUzg1JnMxKcQa458Nyupi3u8HhWzj8vadcQ8LY9b0fufC4ZH5jJf gIEKmysI+mDADv2pUnRO95LG/nRcX+D9KjNXZsOBlgrslkjpisvbn0rCiKcNZ5snb/a4xn ZCm1fMj+QEZuouxMZNIrT1pzHSqEnSEaH+N3mfRpP5oudCBlT+S7AoxqeZPDkg== 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 4bQdRd6Vjszrjx; Mon, 23 Jun 2025 06:27: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 55N6RfDp017775; Mon, 23 Jun 2025 06:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N6RfDl017772; Mon, 23 Jun 2025 06:27:41 GMT (envelope-from git) Date: Mon, 23 Jun 2025 06:27:41 GMT Message-Id: <202506230627.55N6RfDl017772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: b2e0dfc808c1 - main - vt_fb: account for endianness List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2e0dfc808c16566d734e15477382ea2bc74853e Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=b2e0dfc808c16566d734e15477382ea2bc74853e commit b2e0dfc808c16566d734e15477382ea2bc74853e Author: Ahmad Khalifa AuthorDate: 2025-06-23 04:39:21 +0000 Commit: Ahmad Khalifa CommitDate: 2025-06-23 06:23:21 +0000 vt_fb: account for endianness Account for endianness when writing to 24bpp framebuffers. Also create a vt_fb_mem_wr3 function to avoid code duplication. Reviewed by: manu, imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50843 --- sys/dev/vt/hw/fb/vt_fb.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index 151129208f27..6130dc4061b4 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,22 @@ vt_fb_mem_wr2(struct fb_info *sc, uint32_t o, uint16_t v) *(uint16_t *)(sc->fb_vbase + o) = v; } +static void +vt_fb_mem_wr3(struct fb_info *sc, uint32_t o, uint32_t v) +{ + uint8_t *b = (uint8_t *)sc->fb_vbase + o; + + KASSERT((o + 2 < sc->fb_size), ("Offset %#08x out of fb size", o + 2)); + /* + * We want to write three bytes, independent + * of endianness. Multiply _QUAD_LOWWORD and + * _QUAD_HIGHWORD by 2 to skip the middle byte. + */ + b[_QUAD_LOWWORD * 2] = v & 0xff; + b[1] = (v >> 8) & 0xff; + b[_QUAD_HIGHWORD * 2] = (v >> 16) & 0xff; +} + static void vt_fb_mem_wr4(struct fb_info *sc, uint32_t o, uint32_t v) { @@ -187,9 +204,7 @@ vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color) vt_fb_mem_wr2(info, o, c); break; case 3: - vt_fb_mem_wr1(info, o, (c >> 16) & 0xff); - vt_fb_mem_wr1(info, o + 1, (c >> 8) & 0xff); - vt_fb_mem_wr1(info, o + 2, c & 0xff); + vt_fb_mem_wr3(info, o, c); break; case 4: vt_fb_mem_wr4(info, o, c); @@ -246,12 +261,7 @@ vt_fb_blank(struct vt_device *vd, term_color_t color) case 3: for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride - 2; o += 3) { - vt_fb_mem_wr1(info, h*info->fb_stride + o, - (c >> 16) & 0xff); - vt_fb_mem_wr1(info, h*info->fb_stride + o + 1, - (c >> 8) & 0xff); - vt_fb_mem_wr1(info, h*info->fb_stride + o + 2, - c & 0xff); + vt_fb_mem_wr3(info, h*info->fb_stride + o, c); } break; case 4: @@ -317,10 +327,7 @@ vt_fb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, vt_fb_mem_wr2(info, o, cc); break; case 3: - /* Packed mode, so unaligned. Byte access. */ - vt_fb_mem_wr1(info, o, (cc >> 16) & 0xff); - vt_fb_mem_wr1(info, o + 1, (cc >> 8) & 0xff); - vt_fb_mem_wr1(info, o + 2, cc & 0xff); + vt_fb_mem_wr3(info, o, cc); break; case 4: vt_fb_mem_wr4(info, o, cc); From nobody Mon Jun 23 08:44:59 2025 X-Original-To: dev-commits-src-main@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 4bQhV36fxKz604yt; Mon, 23 Jun 2025 08:44:59 +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 4bQhV34kGCz3S2d; Mon, 23 Jun 2025 08:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750668299; 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=yILM9WRxb1v46EC8q2Q/zCCLkgPDR6Qi/F3VVuW4M58=; b=FhnarHXo+sVJmuAwpnlIAHOL5nxkM26oLH8sfdRCxXd10LYrEpHBnBKTu13Tx7Y9fh3cIa 0FTXaRKlyOwUu/8fIDhoQTZoHM76Uq8CxzfrFan2qGXEkCesKV5vadgtLcLv00B0kYPkU7 y8YL9Lu3K+BcMDv1bJmoOyCyEBc9wLayrmbcmnCKAPfr6VCDGZ4EatHNb2DnSEZ8Hsq0Tx U9z+LbSaj9w5rsMbKI+dDEvQprMzDIBg29/DROqE/exche8hKABINr0U/8zSIA4Tmpl5ER 0MWCmuGKpQLoDsF0d39+tQgpdVchVyUsLNCG84QOdKON4tEcvZLHhtzHj7d35Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750668299; 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=yILM9WRxb1v46EC8q2Q/zCCLkgPDR6Qi/F3VVuW4M58=; b=CHxuHPCdoQhyFuR28YfZy+JdcNbYVGVaZs0+TrM4vClDweu3SXtpUdsIzAvwtKQZbFUUXA d3Foagz1M2sW3cpKKGT49T6uyvPcA72FYaQMb6G0wQcohSAVsUswo4UGx3l+NS+Kw6J6Rv xr4cIIfVawYVoi9cHudMRmpr0ZBPqGJumzE1oYucTv6AAO2CFFpJchRb7vyL83jeYZ/ZI8 l2Im3hYg4UMM9gISF0ezk1rHksZS7iOkm/y0QZ9B14iFppebWSuhUnK9aO0W9ufhlGUGrm EtAeGZ7AP2w/1YXJJ4yWlbDTZ+c8CcmQjNj32YCUTiOb1s3QvHUbSeBpUdE3fA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750668299; a=rsa-sha256; cv=none; b=ma3DlPgkupurfQyatDyrwqdf2Y44e198xHNr4DKVyO0VNhw6T6JEVsvabyXm0bC49nWxAV Y1wQUlImSC7GFlz9HmBfJYT0OWxoJKI5e7E2d8n1eFeMzT5kTTph6XiQ7iJ+OurfT6jyqf APFvTlKCTYIUUgyQAemBZJSdkdRg3c4YZ+MxT5UY4Odo0RQ7X6iLCos7meZZAieLnWXod0 vh91Qv/9MOoektjBww9/H/jAznflIk7WXyTbgNzkzy3BJeC5xm4QtfLvRUf254vQ4EGBoS 15Mud7qkxoVEK0N4mACJLz+zxWxDjge2ZCXAYvHYPriclsU83JJiXd5Xg/P+QA== 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 4bQhV32TTMzwSH; Mon, 23 Jun 2025 08:44:59 +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 55N8ixxo081532; Mon, 23 Jun 2025 08:44:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N8ixJP081529; Mon, 23 Jun 2025 08:44:59 GMT (envelope-from git) Date: Mon, 23 Jun 2025 08:44:59 GMT Message-Id: <202506230844.55N8ixJP081529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 7fe39bec801a - main - glob: Improve callback tests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 7fe39bec801a08f541d0111219fe8701a6a20cf1 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7fe39bec801a08f541d0111219fe8701a6a20cf1 commit 7fe39bec801a08f541d0111219fe8701a6a20cf1 Author: Dag-Erling Smørgrav AuthorDate: 2025-06-23 08:44:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-23 08:44:31 +0000 glob: Improve callback tests. Most importantly, they need to run without privileges, since root is allowed to read a directory regardless of its permission bits. PR: 287694 Fixes: 4d7c31bca252 Sponsored by: Klara, Inc. Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D50965 --- lib/libc/tests/gen/glob2_test.c | 47 +++++++++++++++++++++----------- lib/libc/tests/gen/glob_blocks_test.c | 51 ++++++++++++++++++++++------------- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/lib/libc/tests/gen/glob2_test.c b/lib/libc/tests/gen/glob2_test.c index 45d17b063593..ff1b36b830b8 100644 --- a/lib/libc/tests/gen/glob2_test.c +++ b/lib/libc/tests/gen/glob2_test.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -38,8 +39,6 @@ #include -static int glob_callback_invoked; - /* * Derived from Russ Cox' pathological case test program used for the * https://research.swtch.com/glob article. @@ -129,34 +128,50 @@ ATF_TC_BODY(glob_period, tc) "glob(3) should match files starting with a period when using '.*'"); } +static bool glob_callback_invoked; + static int errfunc(const char *path, int err) { - ATF_REQUIRE_STREQ(path, "test/"); - ATF_REQUIRE(err == EACCES); - glob_callback_invoked = 1; + ATF_CHECK_STREQ(path, "test/"); + ATF_CHECK(err == EACCES); + glob_callback_invoked = true; /* Suppress EACCES errors. */ return (0); } -ATF_TC_WITHOUT_HEAD(glob_callback_test); -ATF_TC_BODY(glob_callback_test, tc) +ATF_TC(glob_callback); +ATF_TC_HEAD(glob_callback, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test ability of callback function to suppress errors"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(glob_callback, tc) { - int rv; glob_t g; + int rv; - glob_callback_invoked = 0; - ATF_REQUIRE_EQ(0, mkdir("test", 0007)); + ATF_REQUIRE_EQ(0, mkdir("test", 0755)); + ATF_REQUIRE_EQ(0, symlink("foo", "test/foo")); + ATF_REQUIRE_EQ(0, chmod("test", 0)); + + glob_callback_invoked = false; rv = glob("test/*", 0, errfunc, &g); - ATF_REQUIRE_MSG(glob_callback_invoked == 1, + ATF_CHECK_MSG(glob_callback_invoked, "glob(3) failed to invoke callback function"); - ATF_REQUIRE_MSG(rv == GLOB_NOMATCH, - "error callback function failed to suppress EACCES"); + ATF_CHECK_EQ_MSG(GLOB_NOMATCH, rv, + "callback function failed to suppress EACCES"); + globfree(&g); /* GLOB_ERR should ignore the suppressed error. */ + glob_callback_invoked = false; rv = glob("test/*", GLOB_ERR, errfunc, &g); - ATF_REQUIRE_MSG(rv == GLOB_ABORTED, - "GLOB_ERR didn't override error callback function"); + ATF_CHECK_MSG(glob_callback_invoked, + "glob(3) failed to invoke callback function"); + ATF_CHECK_EQ_MSG(GLOB_ABORTED, rv, + "GLOB_ERR didn't override callback function"); + globfree(&g); } ATF_TP_ADD_TCS(tp) @@ -164,6 +179,6 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, glob_pathological_test); ATF_TP_ADD_TC(tp, glob_period); - ATF_TP_ADD_TC(tp, glob_callback_test); + ATF_TP_ADD_TC(tp, glob_callback); return (atf_no_error()); } diff --git a/lib/libc/tests/gen/glob_blocks_test.c b/lib/libc/tests/gen/glob_blocks_test.c index a20aad17ce31..629b90bee762 100644 --- a/lib/libc/tests/gen/glob_blocks_test.c +++ b/lib/libc/tests/gen/glob_blocks_test.c @@ -8,42 +8,55 @@ #include #include +#include #include -static int glob_callback_invoked; - -ATF_TC_WITHOUT_HEAD(glob_b_callback_test); -ATF_TC_BODY(glob_b_callback_test, tc) +ATF_TC(glob_b_callback); +ATF_TC_HEAD(glob_b_callback, tc) { - int rv; - glob_t g; - - glob_callback_invoked = 0; - ATF_REQUIRE_EQ(0, mkdir("test", 0007)); - int (^errblk)(const char *, int) = + atf_tc_set_md_var(tc, "descr", + "Test ability of callback block to suppress errors"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(glob_b_callback, tc) +{ + static bool glob_callback_invoked; + static int (^errblk)(const char *, int) = ^(const char *path, int err) { - ATF_REQUIRE_STREQ(path, "test/"); - ATF_REQUIRE(err == EACCES); - glob_callback_invoked = 1; + ATF_CHECK_STREQ(path, "test/"); + ATF_CHECK(err == EACCES); + glob_callback_invoked = true; /* Suppress EACCES errors. */ return (0); }; + glob_t g; + int rv; + ATF_REQUIRE_EQ(0, mkdir("test", 0755)); + ATF_REQUIRE_EQ(0, symlink("foo", "test/foo")); + ATF_REQUIRE_EQ(0, chmod("test", 0)); + + glob_callback_invoked = false; rv = glob_b("test/*", 0, errblk, &g); - ATF_REQUIRE_MSG(glob_callback_invoked == 1, + ATF_CHECK_MSG(glob_callback_invoked, "glob(3) failed to invoke callback block"); - ATF_REQUIRE_MSG(rv == GLOB_NOMATCH, - "error callback function failed to suppress EACCES"); + ATF_CHECK_EQ_MSG(GLOB_NOMATCH, rv, + "callback function failed to suppress EACCES"); + globfree(&g); /* GLOB_ERR should ignore the suppressed error. */ + glob_callback_invoked = false; rv = glob_b("test/*", GLOB_ERR, errblk, &g); - ATF_REQUIRE_MSG(rv == GLOB_ABORTED, - "GLOB_ERR didn't override error callback block"); + ATF_CHECK_MSG(glob_callback_invoked, + "glob(3) failed to invoke callback block"); + ATF_CHECK_EQ_MSG(GLOB_ABORTED, rv, + "GLOB_ERR didn't override callback block"); + globfree(&g); } ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, glob_b_callback_test); + ATF_TP_ADD_TC(tp, glob_b_callback); return (atf_no_error()); } From nobody Mon Jun 23 09:35:32 2025 X-Original-To: dev-commits-src-main@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 4bQjcP2CqZz6074n; Mon, 23 Jun 2025 09:35: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 4bQjcN54Nkz3jY5; Mon, 23 Jun 2025 09:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750671332; 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=eqJFZMo0bPIqkNUSzBi3LxStVi5ovZh6bJfsNO+Qrto=; b=xPKWCjs+ZezEY4YoUkfek0znkcpSLSUl8b2MYz4FodTZqi67i3BsoVejtFmYNqslMfkDYW CG49f4E/QJ5T1vCQDE8FVMkJkmBa+RRnDNnrrM/IxUArCfcWKfGPgAoS4grslgOWSjn0Th I8evcOBomyVLi5TX3cImn0fcWqCXvY2zW7p8BObK6TulqglPfboUDHShn6VqFv8L/5Jihh 5JA0ab5SpYNnCScW8y70KKBngpQXhsqy10aAU6u2DEGPG2se/OS/MFUEcKSsWbZDNnHhkx 2VzwXiHDE98XFiooyLX/DOZIx+RohfpApL7iuhBdg2b16FAJmL3mL8ceu7dPKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750671332; 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=eqJFZMo0bPIqkNUSzBi3LxStVi5ovZh6bJfsNO+Qrto=; b=rwLcUrRFQ1UsGwEug9Bzz/ZBNDNA/HP8vx4YOUB3gT4AER0EbYLrYfm7Ol9UsuuglkEZfQ dFj3OowWEaWIeSmWJz8vBXRnFjgQbH+b+x9gS5fZgxlWFSVDZOo3NABTGGfDVV3H2QuS9U GqI1onA0E8r1CjlCb2J3zve/2zUeb770yDupWV5d0MfFTbjb1nHKJ+n1XAAXV6AwVhY55J Ukj5BzFvDF/JAkZyK+/DzYXuS3q0aEP6JZ2omvBj6jMz2JQHRQNlHFxv4+JWePHNDhcb3G auzb7Ga1N9Y9x8E6Cioo2UXPwIO2RuufVMi7Q73K3rwcUZMfIxCE8fRPg5rTJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750671332; a=rsa-sha256; cv=none; b=P5OMjuB6+ZAHeUcU5fqMgdTUlJOTZ88AjLZYNqPoUIrr8kfWC7GsEiVVvOixkjUALfay82 CAtBThTotal8BImzP05/ETksk9/mS3o8Hm6gVFbYJWf+V0iSnBhsqTUVEWFlZlfZZL2uAA qeonAJZ2NsogUWt0mr63ip8AUc7dI5uISOUVe6gprMgI2QT6JI3mXZRt92z7v+OMwu9555 3hSGeg+nCCiT7B/wTgRETIyhN86GFDs97AUt4TRAQ7ROtkKIijL8LOh0tswE1mKl9j7g4j aOcrEzP6v8CX15xbTbQvhw5A060/SrQ0Dkeq48fvIuLy1dTGTl9e5o4FUVg7uw== 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 4bQjcN4fL2zwVJ; Mon, 23 Jun 2025 09:35: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 55N9ZWaM075794; Mon, 23 Jun 2025 09:35:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N9ZWXV075791; Mon, 23 Jun 2025 09:35:32 GMT (envelope-from git) Date: Mon, 23 Jun 2025 09:35:32 GMT Message-Id: <202506230935.55N9ZWXV075791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 66d780ab1d83 - main - glob.3: Fix punctuation mistakes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66d780ab1d83e7036ca28493f2d66f515d4857a9 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=66d780ab1d83e7036ca28493f2d66f515d4857a9 commit 66d780ab1d83e7036ca28493f2d66f515d4857a9 Author: Bojan Novković AuthorDate: 2025-06-23 09:31:39 +0000 Commit: Bojan Novković CommitDate: 2025-06-23 09:34:45 +0000 glob.3: Fix punctuation mistakes Fixes: 1e0743f54d2d Sponsored by: Klara, Inc. --- lib/libc/gen/glob.3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/glob.3 b/lib/libc/gen/glob.3 index 9f15b2edb63a..839d98ce02b5 100644 --- a/lib/libc/gen/glob.3 +++ b/lib/libc/gen/glob.3 @@ -27,12 +27,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 02, 2025 +.Dd June 23, 2025 .Dt GLOB 3 .Os .Sh NAME .Nm glob , -.Nm glob_b, +.Nm glob_b , .Nm globfree .Nd generate pathnames matching a pattern .Sh LIBRARY @@ -353,7 +353,7 @@ contains the total number of matched pathnames so far. This includes other matches from previous invocations of .Fn glob or -.Fn glob_b . +.Fn glob_b if .Dv GLOB_APPEND was specified. From nobody Mon Jun 23 10:02:06 2025 X-Original-To: dev-commits-src-main@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 4bQkC2543hz608hv; Mon, 23 Jun 2025 10:02: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 4bQkC22ph2z3tGB; Mon, 23 Jun 2025 10:02:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750672926; 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=unR6CszeFYrm0QnwzcoBWodR3FrsFm0Ex+clOcz6hvU=; b=Zv6RK06gRi5b07sAHOBadLwyEPMCLEBYVgBtLRdTWP5Vh0NKvwyln44ItY1Atq9eeasU+W vw6khVfhAzVOPjXiJZVf48Xr4xa/bVYllR8n1LD9PfRJu71gjDQRdycpndzXewPxsQJapW 9rFjQQ6ttSENRtZTYgMypZ2TheJOJL+QzXKGS2UBhuuuyg8ZKUKNHkU+W9lMckjXqUYL4H g5sKX+wkeL4UrDhE4Xdoi1nfMv5R3HWQlXGmuTYSUIu9So3jV0n8u/VrrzopEx7bx87m4i C6+tneLmbm2qd5DC2tkfoKEICMdb+YhXywpNTJCqx4IkPXmSMtB9TJXkxH7i5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750672926; 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=unR6CszeFYrm0QnwzcoBWodR3FrsFm0Ex+clOcz6hvU=; b=PwvuxRGP99x3j7R9+ZFbKSKQxbl7SA+KaA0TuUbOu78V3FUmD3lpa3PP593En+EdN/ZbMG nJ2uKtHpY4R016gZWgQWEPUbODMlKXdEQhQMU0emAzoWUtEMGB3sRvDjGBWNb8Mp37fP6p WQApymUTGLdzCo3mnqpHffI3hDVhx4hys4rhvOUJo1vWF0A6XgbulMwoFoA8FRR6a8/3nK OQYxokuYBBJ1xJDEmgyqzdhKDaGCNW1rJwVG+Y1cUFCZWTxOEkkgQp1mp6bD3p1mV4O+z3 /NeqrKY7Erd87qxvKNjSKiRMieYz3jkzgximyeoiARRK2fB60HZlJo9UTZA4mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750672926; a=rsa-sha256; cv=none; b=VQL7u41wj0ipG0H6dhMMA+e+tHgfv4PaQWAqv4QUygkglZmpBu2eYokWObzQxiQjUCfHWF sN/VcJMP8idiC79aCsHWIkszahdSCgWCC2ZpHAOcsCqWzJ0VE4KvkenFsK+kNOAd3TSa4t PsZQXbTeCmSweMCGjds9+QUnf0sqJ0GsDpBAtpGIVOnwWCJCVUY2U0CZfl5hjhO18nwlTh c/1f0pvl3O0DVGSptt3c0WmoGTfhVQrWyehP7jVPSKiunpBjGJuAnGXQc3jg2Bv083DDRb R+jO+HcEnxei9dwJgCfTBURD1YuKQrBZs6Z+XALlqLH93g8sSmmDy/eycgdTow== 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 4bQkC22Pmpzxrg; Mon, 23 Jun 2025 10:02: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 55NA262N028270; Mon, 23 Jun 2025 10:02:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NA26ja028267; Mon, 23 Jun 2025 10:02:06 GMT (envelope-from git) Date: Mon, 23 Jun 2025 10:02:06 GMT Message-Id: <202506231002.55NA26ja028267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: b2ac169802eb - main - glob: Delete trailing whitespace in 'struct glob_limit' definition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2ac169802eb8673e152c675d1974a75c702b02a Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=b2ac169802eb8673e152c675d1974a75c702b02a commit b2ac169802eb8673e152c675d1974a75c702b02a Author: Bojan Novković AuthorDate: 2025-06-23 09:58:41 +0000 Commit: Bojan Novković CommitDate: 2025-06-23 09:58:41 +0000 glob: Delete trailing whitespace in 'struct glob_limit' definition Sponsored by: Klara, Inc. --- lib/libc/gen/glob.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 921db0a7b5a8..f7da5f0cda09 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -107,8 +107,8 @@ typedef DECLARE_BLOCK(int, glob_b_block, const char*, int); struct glob_limit { size_t l_brace_cnt; size_t l_path_lim; - size_t l_readdir_cnt; - size_t l_stat_cnt; + size_t l_readdir_cnt; + size_t l_stat_cnt; size_t l_string_cnt; }; From nobody Mon Jun 23 12:07:34 2025 X-Original-To: dev-commits-src-main@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 4bQmzq0wPsz60Gnv; Mon, 23 Jun 2025 12:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQmzp4ZCcz3gDw; Mon, 23 Jun 2025 12:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680454; 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=iWqwuB+nzVDjj60RV6gqQeQLLt9jpwd+p1b24Wysy/0=; b=BCN0RnVdq49qkUJMqKXqFPSIfZyam+46gGF0R8aBtBQC0OqLOvyYQtmxIxZK9BDe8LkvIS bB551npF1jS7q2M3mPuQywo2nggU7gobrhvUF+LT/YmjgbJYe9ddzP/M5Txl5/fmxFZ9LO Y1W2ffhj5vMa5DsoWL5+yCQQ9fBqa9mvYjGuIfUdxEjPH0p6oYtUHKf/WaJBcFRgBTZeVz v69xYtJ+i8DE88SBN2M8D0Gb25TJwyaUrKQTAmujpSZWdVUREOBJu+hvy8WLNoAZCtWDh7 u/Wafcw5uvPf0c81BCeJ9Ef0QdbMKL1BFvXScmeVTdoMioStdk5PHv7udGtmYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680454; 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=iWqwuB+nzVDjj60RV6gqQeQLLt9jpwd+p1b24Wysy/0=; b=dTfr9JR9pusjxiJmK2rdNnMqi5W7wYK1USjESFmCt8MdcC6WPEzksYOHHu9XYlVrlTVBX7 wXBlZwY0Z5umn2lwuVOPavd0jep9O6zkjEf3oFvkpDEZ5hKbbYwU1UfHLRLEhMeFvY285+ +Q/5XtQBww6Ty2/uKn8rbTGAhJy6RS9BUGtFY4/2502vYqKOvAnZ3whDoHsJ1cSZHLg+uc FfQmqT0LjlLr/GyOjzK3gNRBLvPd6QzPVsBHllvSR5NTy96BldTc8Th9P01GjRRCyQe7ko Y6SXFttNwcpXCEv3Uk0ajNWBtuiCVetJq8SLl9PHVq87B1AXH4cSybro72FNJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750680454; a=rsa-sha256; cv=none; b=SHWleamSsPWOIiIYUdm6MkbrNow0jZUlxICZQ+ySSCRx0nw88CNbay/opABzyJPxxiFll/ DXrFd1GbcaecfJA4DVa2GSeEWbPJ01i2TcqBxygXmMCQH06SnQN7jQlL1SPykEzKWoGv6H f17dTrf5rgPxoJ3GbWbU17mE8V10AgKXfQhyhMKLtMoV1AkG4z472pE81pcPBVCRSJqNOh prtrVaxcgiuqY/UhW3PMYL6js3POf/RYn6TmvTkc1eIyAYf/FVHOtU/jZTruzNRmBE7y6E fj5NHZZnMDXPbKRVNAs4FUAPj0HGG6Dnk+xbWfJnWEGcveevajJ9bKhxyk0vqA== 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 4bQmzp3ty4z121l; Mon, 23 Jun 2025 12:07:34 +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 55NC7YCF059194; Mon, 23 Jun 2025 12:07:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NC7YWU059191; Mon, 23 Jun 2025 12:07:34 GMT (envelope-from git) Date: Mon, 23 Jun 2025 12:07:34 GMT Message-Id: <202506231207.55NC7YWU059191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3113ac28cf84 - main - arm64: Add get_user_reg List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3113ac28cf846c685a4560db910bba8855abc430 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3113ac28cf846c685a4560db910bba8855abc430 commit 3113ac28cf846c685a4560db910bba8855abc430 Author: Andrew Turner AuthorDate: 2025-06-23 10:14:51 +0000 Commit: Andrew Turner CommitDate: 2025-06-23 10:18:19 +0000 arm64: Add get_user_reg This is similar to get_kernel_reg such that it gives us a common view of the userspace ID register. This will be used to replace extract_user_id_field in a future change. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50902 --- sys/arm64/arm64/identcpu.c | 18 ++++++++++++++++++ sys/arm64/include/cpu.h | 1 + 2 files changed, 19 insertions(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 6dc9c447ee29..0f0e727f5b1f 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -2555,6 +2555,24 @@ get_kernel_reg_masked(u_int reg, uint64_t *valp, uint64_t mask) return (false); } +bool +get_user_reg(u_int reg, uint64_t *val, bool fbsd) +{ + int i; + + for (i = 0; i < nitems(user_regs); i++) { + if (user_regs[i].reg == reg) { + if (fbsd) + *val = CPU_DESC_FIELD(user_cpu_desc, i); + else + *val = CPU_DESC_FIELD(l_user_cpu_desc, i); + return (true); + } + } + + return (false); +} + static uint64_t update_special_reg_field(uint64_t user_reg, u_int type, uint64_t value, u_int width, u_int shift, bool sign) diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index df38c69fdb30..6ac5d53f28fc 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -236,6 +236,7 @@ void update_special_reg(u_int reg, uint64_t, uint64_t); bool extract_user_id_field(u_int, u_int, uint8_t *); bool get_kernel_reg(u_int, uint64_t *); bool get_kernel_reg_masked(u_int, uint64_t *, uint64_t); +bool get_user_reg(u_int, uint64_t *, bool); void cpu_desc_init(void); From nobody Mon Jun 23 12:07:35 2025 X-Original-To: dev-commits-src-main@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 4bQmzr1T76z60GhN; Mon, 23 Jun 2025 12:07: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 4bQmzq5PD0z3gMl; Mon, 23 Jun 2025 12:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680455; 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=npx/j3IeL5UACTj/1vTHAugQC5DDV1qb8AwK/3OCnak=; b=YxESK5KRDX22LYaYbEzhParzhLwAVj6+i2m+M58By7MvPwOxlnsSLJ6ORXSwQGsGFTjhwZ GEdiWFJt4RzQcUPClvrIMhgbYRNzeC3siuRTldqnnokbqkceq+YjT7soO6BQmhhNnuLApI zaVF7/M7c50TUJOgGlH2Y9lxEPdhw6IK2WMdDb/BJhCxRNEkCRmcsPATBhY/xaAHwDaip5 TFspPGVzhMdgsXfe8kj0moxcct37amh/hnvPeyLw3scz1l3W9qUCrPjD2qcyn4U/kevzuD LXkxfqUom6eLsoCvH0PGkiM06lllA7JxWzlrWMr5iSmwQ/x17d3eSacJVVUsaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680455; 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=npx/j3IeL5UACTj/1vTHAugQC5DDV1qb8AwK/3OCnak=; b=YirVF2Ol+3ly8NkepcHyEbriRMJ2QgczV+0Nr6RVCwTiAR7+GYVLLYGVor8jTBOjrrcRpB ekE5EVOR94LKVDl3hMPZl5Gy6BDt44pSkl1wYR2Bu988YWv/q+U1OveGHWtXFwmKBClac3 ZPEA7Nm0FbkI2hyHNaGpUWei72tC+LEgNt0JXqw6XySql8SP3mLh2wqZKwoaA7SpC53JH8 gxPmCug8iTkZ5mpdYvxwzsg5/BLkAfyj2tbmc5Z37TD7C/9pjnKocZrZlZbWVQARmNvVGX Ly5JY3PkrXs3yTZja1nqdMixWhtTapexgGrCvUMTpEeRCw3vIa4+x4RsbHJQJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750680455; a=rsa-sha256; cv=none; b=bcJJGsRssdq4Hh/lBzoK11k+d3dbMHP6K8KDuc2dT+uE5KqGVGGoECau5vzoJcUbFLjWX4 Ziq3iOmslxd3cfwkjH7iIORA1lRGqxep6MSKdzJM/zEP4A2HaEovB8VHRTVChWd3q4zpYm FYhVzWfteY7DEN22oivz3m+O/0rQlfd2jFGYeBcclt+4cd+xP8OCgGSsgvOmE0fmFdu664 qj7vPe430LmcxH/w/S/qcuI2X620FNFF/n7KYSwv6J3SaG7YN7f2cxT80nHmyqPIS+64en JfHOBpKLoQo/dlSbsIok9/oUJJ3wRxQNWv8u3UnleDnwnkxjqeTaVpB7TvQkVQ== 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 4bQmzq4p30z12TB; Mon, 23 Jun 2025 12:07: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 55NC7ZLl059237; Mon, 23 Jun 2025 12:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NC7Z6R059234; Mon, 23 Jun 2025 12:07:35 GMT (envelope-from git) Date: Mon, 23 Jun 2025 12:07:35 GMT Message-Id: <202506231207.55NC7Z6R059234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f820b6ed34d5 - main - arm64: Switch to get_user_reg in fill_dbregs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f820b6ed34d5e97835d7f55d63076f07ed5d7ef5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f820b6ed34d5e97835d7f55d63076f07ed5d7ef5 commit f820b6ed34d5e97835d7f55d63076f07ed5d7ef5 Author: Andrew Turner AuthorDate: 2025-06-23 10:15:00 +0000 Commit: Andrew Turner CommitDate: 2025-06-23 10:18:19 +0000 arm64: Switch to get_user_reg in fill_dbregs This lets us read the register in one go then decode it, rather than searching for the register 3 times. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50903 --- sys/arm64/arm64/exec_machdep.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c index 6a536233a62d..751329affd91 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -191,17 +191,27 @@ int fill_dbregs(struct thread *td, struct dbreg *regs) { struct debug_monitor_state *monitor; + uint64_t dfr0; int i; uint8_t debug_ver, nbkpts, nwtpts; memset(regs, 0, sizeof(*regs)); - extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_DebugVer_SHIFT, - &debug_ver); - extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_BRPs_SHIFT, - &nbkpts); - extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_WRPs_SHIFT, - &nwtpts); + /* + * Read these the Debug Feature Register 0 to get info we need. + * It will be identical on FreeBSD and Linux, so there is no need + * to check which the target is. + */ + if (!get_user_reg(ID_AA64DFR0_EL1, &dfr0, true)) { + debug_ver = ID_AA64DFR0_DebugVer_8; + nbkpts = 0; + nwtpts = 0; + } else { + debug_ver = ID_AA64DFR0_DebugVer_VAL(dfr0) >> + ID_AA64DFR0_DebugVer_SHIFT; + nbkpts = ID_AA64DFR0_BRPs_VAL(dfr0) >> ID_AA64DFR0_BRPs_SHIFT; + nwtpts = ID_AA64DFR0_WRPs_VAL(dfr0) >> ID_AA64DFR0_WRPs_SHIFT; + } /* * The BRPs field contains the number of breakpoints - 1. Armv8-A From nobody Mon Jun 23 12:07:36 2025 X-Original-To: dev-commits-src-main@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 4bQmzs4DfMz60GLl; Mon, 23 Jun 2025 12:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQmzs06qwz3g94; Mon, 23 Jun 2025 12:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680457; 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=PYD9qRI3Wj5FKtRWRXsAVA5h2ILmBwEtg/mBgbEtxdo=; b=Gdagf01G6RGnnV0rHvEK1OMsPMi27/UA0HjmRT/GXcroPXch7odhMLVvZcDHy4wW6YlwBp t2gw4epDY36GlrgYfUvjrullxKGGmx9ElO7pzkmDbi2OLZRV9gILKYMKZg167y7Duj9GR3 rdqkqw2v7m7tfltLQD2iSDtFYZsmudVfOID6YXQIwan1DT60b/Qz6uFIPRMVObt0oiqUI4 ZbqCBTEErVa92j8honbvcYG5YqZGX3lepKn4drjrX8NQzKozl8oyV+2VVmxlkTs+2fz4Nh o/kSpYxnM/MmMTfTif5Mq7RH6YA+GxMlVEB+aSWsoHRUCXxqe9rl2m8gK1PhpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680457; 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=PYD9qRI3Wj5FKtRWRXsAVA5h2ILmBwEtg/mBgbEtxdo=; b=Vs288y8g96d4O7uJZrvuXmftAiehZr7vsca9RphFb44vj4TNLEKJAMRl0Ks1Yvl+hLDXOr A0HDcUVAtcJ9KdvOl2prbWeETGZ88cfAj9IapymzlY1UK3VBQRdy1w1em8cKayWfGLNuB7 ZUU2rUX/7gdn+yj6grUBwj0yATmY9C8B7SYQEvlWoF5V+O5pFk+NPyxK6RbFLXQZJBqLZG q9DhVIXkICblmGKZEWkGnKh3SYgupmq74E68/Oxt+5xji4rMG2UEVmJSKPb9D10zoHExoF CPPQcCC1Htl5vd40kvYdyxYwvalxYbarBQdLVRi9ZRE7CiY3ZiQFRTAZZWkehg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750680457; a=rsa-sha256; cv=none; b=qjeGMxcnssaQ6sxRxOk0ED8McsiIrhyQqz5/Z0db2shT3taF6hFDWqp7FWKk1ESVw5//zj pyyB7MR0Wymoz4np/Xu/IpvjLPbv1AWsrNnEttPeLpad1wHnoSccMLpx+iCi8mEyUUnnge cmL8pPF22N2hxk3au0S9aGLwhnGMWdqLSmcEh1+ACtnHqKhtCsfLCgpnOmwiJoonGTULWc YSLxmkRZErJm+wqxj+We2Gp4VHwEwo3jSR/J7HxJ6l3h9BYmnoGD2SEizeNOcEWjX6uuar yMgLz12pfnUs2QfB/TvE3NsNSwn0kaKDydvYBRvGEj5vnfleQXqfdj7rUZxH9g== 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 4bQmzr5sLpz11sP; Mon, 23 Jun 2025 12:07: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 55NC7aIg059272; Mon, 23 Jun 2025 12:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NC7ajl059269; Mon, 23 Jun 2025 12:07:36 GMT (envelope-from git) Date: Mon, 23 Jun 2025 12:07:36 GMT Message-Id: <202506231207.55NC7ajl059269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 59486443cccd - main - arm64: Remove extract_user_id_field List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59486443cccdf65b3a312a8896e177e2e17b216c Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=59486443cccdf65b3a312a8896e177e2e17b216c commit 59486443cccdf65b3a312a8896e177e2e17b216c Author: Andrew Turner AuthorDate: 2025-06-23 10:15:08 +0000 Commit: Andrew Turner CommitDate: 2025-06-23 10:18:19 +0000 arm64: Remove extract_user_id_field It's unneeded now we have get_user_reg. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50904 --- sys/arm64/arm64/identcpu.c | 17 ----------------- sys/arm64/include/cpu.h | 1 - 2 files changed, 18 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 0f0e727f5b1f..c1960812928f 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -2496,23 +2496,6 @@ mrs_field_cmp(uint64_t a, uint64_t b, u_int shift, int width, bool sign) return (a - b); } -bool -extract_user_id_field(u_int reg, u_int field_shift, uint8_t *val) -{ - uint64_t value; - int i; - - for (i = 0; i < nitems(user_regs); i++) { - if (user_regs[i].reg == reg) { - value = CPU_DESC_FIELD(user_cpu_desc, i); - *val = value >> field_shift; - return (true); - } - } - - return (false); -} - bool get_kernel_reg(u_int reg, uint64_t *val) { diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 6ac5d53f28fc..2dd1a905b2b7 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -233,7 +233,6 @@ void ptrauth_mp_start(uint64_t); /* Functions to read the sanitised view of the special registers */ void update_special_regs(u_int); void update_special_reg(u_int reg, uint64_t, uint64_t); -bool extract_user_id_field(u_int, u_int, uint8_t *); bool get_kernel_reg(u_int, uint64_t *); bool get_kernel_reg_masked(u_int, uint64_t *, uint64_t); bool get_user_reg(u_int, uint64_t *, bool); From nobody Mon Jun 23 12:07:38 2025 X-Original-To: dev-commits-src-main@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 4bQmzv4vwmz60GbZ; Mon, 23 Jun 2025 12:07: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 4bQmzv1vT8z3g1m; Mon, 23 Jun 2025 12:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680459; 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=jIcaCM50QN1w/eNaIurCHLF6ts5g2a8z/ikKI1/EuLM=; b=Ijld9zdyVAjkiAVZsXShUpesBKt7g/QxyL68L1xjaI7cyO5kihv4fKQ8RKgynNxpGFBc26 alBTkXeXvahRc+GKasIStZfWHr50FpQ+WeI2JNp1ZJX2h8LBvvOPgNNe0kaXGFLh5PLQ7L +pUMfKNVjXPGq6g3hIUNKXJF7jz5qNLVWYCTDzs3MGtqFszCchKRdNj0BN8WORbyvNfcNY 3RtzxGdjje/9E/gYlZRUShRzawHTfLqILvX/NRy4VyBXWyZPWm9lCIcXFzvKA/d9CE6x5L sN6AwKCZT7elmed589em3jUGTi35uLaOu2H+8u8/DEmaAL6wy5eiCJ/vsDx2oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680459; 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=jIcaCM50QN1w/eNaIurCHLF6ts5g2a8z/ikKI1/EuLM=; b=m27Rc3T0U5B2udtpP6FDppuIixYKOzzaZXptY8IYcxeaBYvHgUqy7alsWyFtfc6YFcwBgD BBWgdXBTvlw4JoaQT4DNfH/FMrkLlX9ED+dvw5VPQj+zI5AXgBApOsGM97+hXEFmohKNdd 35e4lOS5VrhZSZka5tg444FU0Q/ZHSyShynOluAVzT5oTAJBggzlpHUG16sUA80wp9eXxm iqyOtplSWpMkApQPvSjYRJs1RY39Nt8gCWJ+qhT8sfu0vCVtpUVz1fz9vMPnzh+tpsAor2 gIa6X0UzBbY26elWENS/5G5CXwvRj39PnYaqwg1Pnq9AtIs0KV5G+doAo4jmxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750680459; a=rsa-sha256; cv=none; b=JMMeemz7XM6RAcvLSVh9HavYaVPmzr13ynJKMj36rZuIn0jqcDsCl6xIehv8ghyJ0Q0tLp q2YqVJdoSLH1RD79uP5hLURWNLdtM7govlevayd0MqCSPHMYmf1vY6rrz8NZo/403MFYRa e6Bdk7jUIdk+FcQwdXEo0iDBhGE/lcZRaPoriLsvgaOGoTgCd6Br0pE9Iu8rqk9igXd9jc 58DXSewnnZ8k899Vbw5usnAc9CKbFdwlsDt9qldUOU/OfjLpd8ioaV3dpek8tqemB/Ww9E R1Ler/HRPxErocOOeEd2Vx17c9Rnlcid4XIe4hgPwNF4SxMnLkcLVcQya9SjqA== 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 4bQmzv0J5Mz12GP; Mon, 23 Jun 2025 12:07: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 55NC7c3f059344; Mon, 23 Jun 2025 12:07:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NC7cOJ059341; Mon, 23 Jun 2025 12:07:38 GMT (envelope-from git) Date: Mon, 23 Jun 2025 12:07:38 GMT Message-Id: <202506231207.55NC7cOJ059341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 1e4b86aaf28a - main - arm64: Remove the MRS_REG macro and it's users List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e4b86aaf28a52a354f19cca330a4fc53c26e1e4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1e4b86aaf28a52a354f19cca330a4fc53c26e1e4 commit 1e4b86aaf28a52a354f19cca330a4fc53c26e1e4 Author: Andrew Turner AuthorDate: 2025-06-23 10:15:22 +0000 Commit: Andrew Turner CommitDate: 2025-06-23 10:18:19 +0000 arm64: Remove the MRS_REG macro and it's users These are now unused so can be removed. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50906 --- sys/arm64/include/armreg.h | 82 ---------------------------------------------- 1 file changed, 82 deletions(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 33866d7f822b..a44cc4343dee 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -54,12 +54,6 @@ #define MRS_Op2_MASK 0x000000e0 #define MRS_Rt_SHIFT 0 #define MRS_Rt_MASK 0x0000001f -#define __MRS_REG(op0, op1, crn, crm, op2) \ - (((op0) << MRS_Op0_SHIFT) | ((op1) << MRS_Op1_SHIFT) | \ - ((crn) << MRS_CRn_SHIFT) | ((crm) << MRS_CRm_SHIFT) | \ - ((op2) << MRS_Op2_SHIFT)) -#define MRS_REG(reg) \ - __MRS_REG(reg##_op0, reg##_op1, reg##_CRn, reg##_CRm, reg##_op2) #define __MRS_REG_ALT_NAME(op0, op1, crn, crm, op2) \ S##op0##_##op1##_C##crn##_C##crm##_##op2 @@ -234,7 +228,6 @@ #define CLIDR_CTYPE_UNIFIED 0x4 /* Unified */ /* CNTKCTL_EL1 - Counter-timer Kernel Control Register */ -#define CNTKCTL_EL1 MRS_REG(CNTKCTL_EL0) #define CNTKCTL_EL1_op0 3 #define CNTKCTL_EL1_op1 0 #define CNTKCTL_EL1_CRn 14 @@ -242,7 +235,6 @@ #define CNTKCTL_EL1_op2 0 /* CNTKCTL_EL12 - Counter-timer Kernel Control Register */ -#define CNTKCTL_EL12 MRS_REG(CNTKCTL_EL0) #define CNTKCTL_EL12_op0 3 #define CNTKCTL_EL12_op1 5 #define CNTKCTL_EL12_CRn 14 @@ -250,7 +242,6 @@ #define CNTKCTL_EL12_op2 0 /* CNTP_CTL_EL0 - Counter-timer Physical Timer Control register */ -#define CNTP_CTL_EL0 MRS_REG(CNTP_CTL_EL0) #define CNTP_CTL_EL0_op0 3 #define CNTP_CTL_EL0_op1 3 #define CNTP_CTL_EL0_CRn 14 @@ -261,7 +252,6 @@ #define CNTP_CTL_ISTATUS (1 << 2) /* CNTP_CVAL_EL0 - Counter-timer Physical Timer CompareValue register */ -#define CNTP_CVAL_EL0 MRS_REG(CNTP_CVAL_EL0) #define CNTP_CVAL_EL0_op0 3 #define CNTP_CVAL_EL0_op1 3 #define CNTP_CVAL_EL0_CRn 14 @@ -269,7 +259,6 @@ #define CNTP_CVAL_EL0_op2 2 /* CNTP_TVAL_EL0 - Counter-timer Physical Timer TimerValue register */ -#define CNTP_TVAL_EL0 MRS_REG(CNTP_TVAL_EL0) #define CNTP_TVAL_EL0_op0 3 #define CNTP_TVAL_EL0_op1 3 #define CNTP_TVAL_EL0_CRn 14 @@ -277,7 +266,6 @@ #define CNTP_TVAL_EL0_op2 0 /* CNTPCT_EL0 - Counter-timer Physical Count register */ -#define CNTPCT_EL0 MRS_REG(CNTPCT_EL0) #define CNTPCT_EL0_ISS ISS_MSR_REG(CNTPCT_EL0) #define CNTPCT_EL0_op0 3 #define CNTPCT_EL0_op1 3 @@ -286,7 +274,6 @@ #define CNTPCT_EL0_op2 1 /* CNTV_CTL_EL0 - Counter-timer Virtual Timer Control register */ -#define CNTV_CTL_EL0 MRS_REG(CNTV_CTL_EL0) #define CNTV_CTL_EL0_op0 3 #define CNTV_CTL_EL0_op1 3 #define CNTV_CTL_EL0_CRn 14 @@ -294,7 +281,6 @@ #define CNTV_CTL_EL0_op2 1 /* CNTV_CTL_EL02 - Counter-timer Virtual Timer Control register */ -#define CNTV_CTL_EL02 MRS_REG(CNTV_CTL_EL02) #define CNTV_CTL_EL02_op0 3 #define CNTV_CTL_EL02_op1 5 #define CNTV_CTL_EL02_CRn 14 @@ -302,7 +288,6 @@ #define CNTV_CTL_EL02_op2 1 /* CNTV_CVAL_EL0 - Counter-timer Virtual Timer CompareValue register */ -#define CNTV_CVAL_EL0 MRS_REG(CNTV_CVAL_EL0) #define CNTV_CVAL_EL0_op0 3 #define CNTV_CVAL_EL0_op1 3 #define CNTV_CVAL_EL0_CRn 14 @@ -310,7 +295,6 @@ #define CNTV_CVAL_EL0_op2 2 /* CNTV_CVAL_EL02 - Counter-timer Virtual Timer CompareValue register */ -#define CNTV_CVAL_EL02 MRS_REG(CNTV_CVAL_EL02) #define CNTV_CVAL_EL02_op0 3 #define CNTV_CVAL_EL02_op1 5 #define CNTV_CVAL_EL02_CRn 14 @@ -318,7 +302,6 @@ #define CNTV_CVAL_EL02_op2 2 /* CONTEXTIDR_EL1 - Context ID register */ -#define CONTEXTIDR_EL1 MRS_REG(CONTEXTIDR_EL1) #define CONTEXTIDR_EL1_REG MRS_REG_ALT_NAME(CONTEXTIDR_EL1) #define CONTEXTIDR_EL1_op0 3 #define CONTEXTIDR_EL1_op1 0 @@ -366,7 +349,6 @@ #define CSSELR_InD 0x00000001 /* CTR_EL0 - Cache Type Register */ -#define CTR_EL0 MRS_REG(CTR_EL0) #define CTR_EL0_REG MRS_REG_ALT_NAME(CTR_EL0) #define CTR_EL0_ISS ISS_MSR_REG(CTR_EL0) #define CTR_EL0_op0 3 @@ -503,7 +485,6 @@ #define DCZID_BS_SIZE(reg) (((reg) & DCZID_BS_MASK) >> DCZID_BS_SHIFT) /* DBGAUTHSTATUS_EL1 */ -#define DBGAUTHSTATUS_EL1 MRS_REG(DBGAUTHSTATUS_EL1) #define DBGAUTHSTATUS_EL1_op0 2 #define DBGAUTHSTATUS_EL1_op1 0 #define DBGAUTHSTATUS_EL1_CRn 7 @@ -511,7 +492,6 @@ #define DBGAUTHSTATUS_EL1_op2 6 /* DBGCLAIMCLR_EL1 */ -#define DBGCLAIMCLR_EL1 MRS_REG(DBGCLAIMCLR_EL1) #define DBGCLAIMCLR_EL1_op0 2 #define DBGCLAIMCLR_EL1_op1 0 #define DBGCLAIMCLR_EL1_CRn 7 @@ -519,7 +499,6 @@ #define DBGCLAIMCLR_EL1_op2 6 /* DBGCLAIMSET_EL1 */ -#define DBGCLAIMSET_EL1 MRS_REG(DBGCLAIMSET_EL1) #define DBGCLAIMSET_EL1_op0 2 #define DBGCLAIMSET_EL1_op1 0 #define DBGCLAIMSET_EL1_CRn 7 @@ -527,7 +506,6 @@ #define DBGCLAIMSET_EL1_op2 6 /* DBGPRCR_EL1 */ -#define DBGPRCR_EL1 MRS_REG(DBGPRCR_EL1) #define DBGPRCR_EL1_op0 2 #define DBGPRCR_EL1_op1 0 #define DBGPRCR_EL1_CRn 1 @@ -737,7 +715,6 @@ #define ICC_PMR_EL1_PRIO_MASK (0xFFUL) /* ICC_SGI1R_EL1 */ -#define ICC_SGI1R_EL1 MRS_REG(ICC_SGI1R_EL1) #define ICC_SGI1R_EL1_op0 3 #define ICC_SGI1R_EL1_op1 0 #define ICC_SGI1R_EL1_CRn 12 @@ -767,7 +744,6 @@ #define ICC_SRE_EL1_SRE (1U << 0) /* ID_AA64AFR0_EL1 */ -#define ID_AA64AFR0_EL1 MRS_REG(ID_AA64AFR0_EL1) #define ID_AA64AFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64AFR0_EL1) #define ID_AA64AFR0_EL1_ISS ISS_MSR_REG(ID_AA64AFR0_EL1) #define ID_AA64AFR0_EL1_op0 3 @@ -777,7 +753,6 @@ #define ID_AA64AFR0_EL1_op2 4 /* ID_AA64AFR1_EL1 */ -#define ID_AA64AFR1_EL1 MRS_REG(ID_AA64AFR1_EL1) #define ID_AA64AFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64AFR1_EL1) #define ID_AA64AFR1_EL1_ISS ISS_MSR_REG(ID_AA64AFR1_EL1) #define ID_AA64AFR1_EL1_op0 3 @@ -787,7 +762,6 @@ #define ID_AA64AFR1_EL1_op2 5 /* ID_AA64DFR0_EL1 */ -#define ID_AA64DFR0_EL1 MRS_REG(ID_AA64DFR0_EL1) #define ID_AA64DFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64DFR0_EL1) #define ID_AA64DFR0_EL1_ISS ISS_MSR_REG(ID_AA64DFR0_EL1) #define ID_AA64DFR0_EL1_op0 3 @@ -895,7 +869,6 @@ #define ID_AA64DFR0_HPMN0_DEFINED (UL(0x1) << ID_AA64DFR0_HPMN0_SHIFT) /* ID_AA64DFR1_EL1 */ -#define ID_AA64DFR1_EL1 MRS_REG(ID_AA64DFR1_EL1) #define ID_AA64DFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64DFR1_EL1) #define ID_AA64DFR1_EL1_ISS ISS_MSR_REG(ID_AA64DFR1_EL1) #define ID_AA64DFR1_EL1_op0 3 @@ -923,7 +896,6 @@ #define ID_AA64DFR1_DPFZS_IMPL (UL(0x1) << ID_AA64DFR1_DPFZS_SHIFT) /* ID_AA64ISAR0_EL1 */ -#define ID_AA64ISAR0_EL1 MRS_REG(ID_AA64ISAR0_EL1) #define ID_AA64ISAR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64ISAR0_EL1) #define ID_AA64ISAR0_EL1_ISS ISS_MSR_REG(ID_AA64ISAR0_EL1) #define ID_AA64ISAR0_EL1_op0 3 @@ -1026,7 +998,6 @@ #define ID_AA64ISAR0_RNDR_IMPL (UL(0x1) << ID_AA64ISAR0_RNDR_SHIFT) /* ID_AA64ISAR1_EL1 */ -#define ID_AA64ISAR1_EL1 MRS_REG(ID_AA64ISAR1_EL1) #define ID_AA64ISAR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64ISAR1_EL1) #define ID_AA64ISAR1_EL1_ISS ISS_MSR_REG(ID_AA64ISAR1_EL1) #define ID_AA64ISAR1_EL1_op0 3 @@ -1146,7 +1117,6 @@ #define ID_AA64ISAR1_LS64_ACCDATA (UL(0x3) << ID_AA64ISAR1_LS64_SHIFT) /* ID_AA64ISAR2_EL1 */ -#define ID_AA64ISAR2_EL1 MRS_REG(ID_AA64ISAR2_EL1) #define ID_AA64ISAR2_EL1_REG MRS_REG_ALT_NAME(ID_AA64ISAR2_EL1) #define ID_AA64ISAR2_EL1_ISS ISS_MSR_REG(ID_AA64ISAR2_EL1) #define ID_AA64ISAR2_EL1_op0 3 @@ -1232,7 +1202,6 @@ #define ID_AA64ISAR2_ATS1A_IMPL (UL(0x1) << ID_AA64ISAR2_ATS1A_SHIFT) /* ID_AA64MMFR0_EL1 */ -#define ID_AA64MMFR0_EL1 MRS_REG(ID_AA64MMFR0_EL1) #define ID_AA64MMFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR0_EL1) #define ID_AA64MMFR0_EL1_ISS ISS_MSR_REG(ID_AA64MMFR0_EL1) #define ID_AA64MMFR0_EL1_op0 3 @@ -1340,7 +1309,6 @@ #define ID_AA64MMFR0_ECV_CNTHCTL (UL(0x2) << ID_AA64MMFR0_ECV_SHIFT) /* ID_AA64MMFR1_EL1 */ -#define ID_AA64MMFR1_EL1 MRS_REG(ID_AA64MMFR1_EL1) #define ID_AA64MMFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR1_EL1) #define ID_AA64MMFR1_EL1_ISS ISS_MSR_REG(ID_AA64MMFR1_EL1) #define ID_AA64MMFR1_EL1_op0 3 @@ -1451,7 +1419,6 @@ #define ID_AA64MMFR1_ECBHB_IMPL (UL(0x1) << ID_AA64MMFR1_ECBHB_SHIFT) /* ID_AA64MMFR2_EL1 */ -#define ID_AA64MMFR2_EL1 MRS_REG(ID_AA64MMFR2_EL1) #define ID_AA64MMFR2_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR2_EL1) #define ID_AA64MMFR2_EL1_ISS ISS_MSR_REG(ID_AA64MMFR2_EL1) #define ID_AA64MMFR2_EL1_op0 3 @@ -1554,7 +1521,6 @@ #define ID_AA64MMFR2_E0PD_IMPL (UL(0x1) << ID_AA64MMFR2_E0PD_SHIFT) /* ID_AA64MMFR3_EL1 */ -#define ID_AA64MMFR3_EL1 MRS_REG(ID_AA64MMFR3_EL1) #define ID_AA64MMFR3_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR3_EL1) #define ID_AA64MMFR3_EL1_ISS ISS_MSR_REG(ID_AA64MMFR3_EL1) #define ID_AA64MMFR3_EL1_op0 3 @@ -1642,7 +1608,6 @@ #define ID_AA64MMFR3_Spec_FPACC_IMPL (UL(0x1) << ID_AA64MMFR3_Spec_FPACC_SHIFT) /* ID_AA64MMFR4_EL1 */ -#define ID_AA64MMFR4_EL1 MRS_REG(ID_AA64MMFR4_EL1) #define ID_AA64MMFR4_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR4_EL1) #define ID_AA64MMFR4_EL1_ISS ISS_MSR_REG(ID_AA64MMFR4_EL1) #define ID_AA64MMFR4_EL1_op0 3 @@ -1652,7 +1617,6 @@ #define ID_AA64MMFR4_EL1_op2 4 /* ID_AA64PFR0_EL1 */ -#define ID_AA64PFR0_EL1 MRS_REG(ID_AA64PFR0_EL1) #define ID_AA64PFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64PFR0_EL1) #define ID_AA64PFR0_EL1_ISS ISS_MSR_REG(ID_AA64PFR0_EL1) #define ID_AA64PFR0_EL1_op0 3 @@ -1769,7 +1733,6 @@ #define ID_AA64PFR0_CSV3_ISOLATED (UL(0x1) << ID_AA64PFR0_CSV3_SHIFT) /* ID_AA64PFR1_EL1 */ -#define ID_AA64PFR1_EL1 MRS_REG(ID_AA64PFR1_EL1) #define ID_AA64PFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64PFR1_EL1) #define ID_AA64PFR1_EL1_ISS ISS_MSR_REG(ID_AA64PFR1_EL1) #define ID_AA64PFR1_EL1_op0 3 @@ -1868,7 +1831,6 @@ #define ID_AA64PFR1_PFAR_IMPL (UL(0x1) << ID_AA64PFR1_PFAR_SHIFT) /* ID_AA64PFR2_EL1 */ -#define ID_AA64PFR2_EL1 MRS_REG(ID_AA64PFR2_EL1) #define ID_AA64PFR2_EL1_REG MRS_REG_ALT_NAME(ID_AA64PFR2_EL1) #define ID_AA64PFR2_EL1_ISS ISS_MSR_REG(ID_AA64PFR2_EL1) #define ID_AA64PFR2_EL1_op0 3 @@ -1878,7 +1840,6 @@ #define ID_AA64PFR2_EL1_op2 2 /* ID_AA64ZFR0_EL1 */ -#define ID_AA64ZFR0_EL1 MRS_REG(ID_AA64ZFR0_EL1) #define ID_AA64ZFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64ZFR0_EL1) #define ID_AA64ZFR0_EL1_ISS ISS_MSR_REG(ID_AA64ZFR0_EL1) #define ID_AA64ZFR0_EL1_op0 3 @@ -1945,7 +1906,6 @@ #define ID_AA64ZFR0_F64MM_IMPL (UL(0x1) << ID_AA64ZFR0_F64MM_SHIFT) /* ID_ISAR5_EL1 */ -#define ID_ISAR5_EL1 MRS_REG(ID_ISAR5_EL1) #define ID_ISAR5_EL1_ISS ISS_MSR_REG(ID_ISAR5_EL1) #define ID_ISAR5_EL1_op0 0x3 #define ID_ISAR5_EL1_op1 0x0 @@ -2020,7 +1980,6 @@ #define MAIR_EL12_op2 0 /* MDCCINT_EL1 */ -#define MDCCINT_EL1 MRS_REG(MDCCINT_EL1) #define MDCCINT_EL1_op0 2 #define MDCCINT_EL1_op1 0 #define MDCCINT_EL1_CRn 0 @@ -2028,7 +1987,6 @@ #define MDCCINT_EL1_op2 0 /* MDCCSR_EL0 */ -#define MDCCSR_EL0 MRS_REG(MDCCSR_EL0) #define MDCCSR_EL0_op0 2 #define MDCCSR_EL0_op1 3 #define MDCCSR_EL0_CRn 0 @@ -2036,7 +1994,6 @@ #define MDCCSR_EL0_op2 0 /* MDSCR_EL1 - Monitor Debug System Control Register */ -#define MDSCR_EL1 MRS_REG(MDSCR_EL1) #define MDSCR_EL1_op0 2 #define MDSCR_EL1_op1 0 #define MDSCR_EL1_CRn 0 @@ -2050,7 +2007,6 @@ #define MDSCR_MDE (UL(0x1) << MDSCR_MDE_SHIFT) /* MIDR_EL1 - Main ID Register */ -#define MIDR_EL1 MRS_REG(MIDR_EL1) #define MIDR_EL1_op0 3 #define MIDR_EL1_op1 0 #define MIDR_EL1_CRn 0 @@ -2058,7 +2014,6 @@ #define MIDR_EL1_op2 0 /* MPIDR_EL1 - Multiprocessor Affinity Register */ -#define MPIDR_EL1 MRS_REG(MPIDR_EL1) #define MPIDR_EL1_op0 3 #define MPIDR_EL1_op1 0 #define MPIDR_EL1_CRn 0 @@ -2082,7 +2037,6 @@ #define MPIDR_AFF3_VAL(x) ((x) & MPIDR_AFF3_MASK) /* MVFR0_EL1 */ -#define MVFR0_EL1 MRS_REG(MVFR0_EL1) #define MVFR0_EL1_ISS ISS_MSR_REG(MVFR0_EL1) #define MVFR0_EL1_op0 0x3 #define MVFR0_EL1_op1 0x0 @@ -2142,7 +2096,6 @@ #define MVFR0_FPRound_IMPL (UL(0x1) << MVFR0_FPRound_SHIFT) /* MVFR1_EL1 */ -#define MVFR1_EL1 MRS_REG(MVFR1_EL1) #define MVFR1_EL1_ISS ISS_MSR_REG(MVFR1_EL1) #define MVFR1_EL1_op0 0x3 #define MVFR1_EL1_op1 0x0 @@ -2202,7 +2155,6 @@ #define MVFR1_SIMDFMAC_IMPL (UL(0x1) << MVFR1_SIMDFMAC_SHIFT) /* OSDLR_EL1 */ -#define OSDLR_EL1 MRS_REG(OSDLR_EL1) #define OSDLR_EL1_op0 2 #define OSDLR_EL1_op1 0 #define OSDLR_EL1_CRn 1 @@ -2210,7 +2162,6 @@ #define OSDLR_EL1_op2 4 /* OSLAR_EL1 */ -#define OSLAR_EL1 MRS_REG(OSLAR_EL1) #define OSLAR_EL1_op0 2 #define OSLAR_EL1_op1 0 #define OSLAR_EL1_CRn 1 @@ -2218,7 +2169,6 @@ #define OSLAR_EL1_op2 4 /* OSLSR_EL1 */ -#define OSLSR_EL1 MRS_REG(OSLSR_EL1) #define OSLSR_EL1_op0 2 #define OSLSR_EL1_op1 0 #define OSLSR_EL1_CRn 1 @@ -2248,7 +2198,6 @@ #define PAR_S_MASK (0x1 << PAR_S_SHIFT) /* PMBIDR_EL1 */ -#define PMBIDR_EL1 MRS_REG(PMBIDR_EL1) #define PMBIDR_EL1_REG MRS_REG_ALT_NAME(PMBIDR_EL1) #define PMBIDR_EL1_op0 3 #define PMBIDR_EL1_op1 0 @@ -2263,7 +2212,6 @@ #define PMBIDR_F (UL(0x1) << PMBIDR_F_SHIFT) /* PMBLIMITR_EL1 */ -#define PMBLIMITR_EL1 MRS_REG(PMBLIMITR_EL1) #define PMBLIMITR_EL1_REG MRS_REG_ALT_NAME(PMBLIMITR_EL1) #define PMBLIMITR_EL1_op0 3 #define PMBLIMITR_EL1_op1 0 @@ -2281,7 +2229,6 @@ (UL(0xfffffffffffff) << PMBLIMITR_LIMIT_SHIFT) /* PMBPTR_EL1 */ -#define PMBPTR_EL1 MRS_REG(PMBPTR_EL1) #define PMBPTR_EL1_REG MRS_REG_ALT_NAME(PMBPTR_EL1) #define PMBPTR_EL1_op0 3 #define PMBPTR_EL1_op1 0 @@ -2293,7 +2240,6 @@ (UL(0xffffffffffffffff) << PMBPTR_PTR_SHIFT) /* PMBSR_EL1 */ -#define PMBSR_EL1 MRS_REG(PMBSR_EL1) #define PMBSR_EL1_REG MRS_REG_ALT_NAME(PMBSR_EL1) #define PMBSR_EL1_op0 3 #define PMBSR_EL1_op1 0 @@ -2316,7 +2262,6 @@ #define PMBSR_EC_MASK (UL(0x3f) << PMBSR_EC_SHIFT) /* PMCCFILTR_EL0 */ -#define PMCCFILTR_EL0 MRS_REG(PMCCFILTR_EL0) #define PMCCFILTR_EL0_op0 3 #define PMCCFILTR_EL0_op1 3 #define PMCCFILTR_EL0_CRn 14 @@ -2324,7 +2269,6 @@ #define PMCCFILTR_EL0_op2 7 /* PMCCNTR_EL0 */ -#define PMCCNTR_EL0 MRS_REG(PMCCNTR_EL0) #define PMCCNTR_EL0_op0 3 #define PMCCNTR_EL0_op1 3 #define PMCCNTR_EL0_CRn 9 @@ -2332,7 +2276,6 @@ #define PMCCNTR_EL0_op2 0 /* PMCEID0_EL0 */ -#define PMCEID0_EL0 MRS_REG(PMCEID0_EL0) #define PMCEID0_EL0_op0 3 #define PMCEID0_EL0_op1 3 #define PMCEID0_EL0_CRn 9 @@ -2340,7 +2283,6 @@ #define PMCEID0_EL0_op2 6 /* PMCEID1_EL0 */ -#define PMCEID1_EL0 MRS_REG(PMCEID1_EL0) #define PMCEID1_EL0_op0 3 #define PMCEID1_EL0_op1 3 #define PMCEID1_EL0_CRn 9 @@ -2348,7 +2290,6 @@ #define PMCEID1_EL0_op2 7 /* PMCNTENCLR_EL0 */ -#define PMCNTENCLR_EL0 MRS_REG(PMCNTENCLR_EL0) #define PMCNTENCLR_EL0_op0 3 #define PMCNTENCLR_EL0_op1 3 #define PMCNTENCLR_EL0_CRn 9 @@ -2356,7 +2297,6 @@ #define PMCNTENCLR_EL0_op2 2 /* PMCNTENSET_EL0 */ -#define PMCNTENSET_EL0 MRS_REG(PMCNTENSET_EL0) #define PMCNTENSET_EL0_op0 3 #define PMCNTENSET_EL0_op1 3 #define PMCNTENSET_EL0_CRn 9 @@ -2364,7 +2304,6 @@ #define PMCNTENSET_EL0_op2 1 /* PMCR_EL0 - Perfomance Monitoring Counters */ -#define PMCR_EL0 MRS_REG(PMCR_EL0) #define PMCR_EL0_op0 3 #define PMCR_EL0_op1 3 #define PMCR_EL0_CRn 9 @@ -2429,7 +2368,6 @@ #define PMEVTYPER_P (1 << 31) /* Privileged filtering */ /* PMINTENCLR_EL1 */ -#define PMINTENCLR_EL1 MRS_REG(PMINTENCLR_EL1) #define PMINTENCLR_EL1_op0 3 #define PMINTENCLR_EL1_op1 0 #define PMINTENCLR_EL1_CRn 9 @@ -2437,7 +2375,6 @@ #define PMINTENCLR_EL1_op2 2 /* PMINTENSET_EL1 */ -#define PMINTENSET_EL1 MRS_REG(PMINTENSET_EL1) #define PMINTENSET_EL1_op0 3 #define PMINTENSET_EL1_op1 0 #define PMINTENSET_EL1_CRn 9 @@ -2445,7 +2382,6 @@ #define PMINTENSET_EL1_op2 1 /* PMMIR_EL1 */ -#define PMMIR_EL1 MRS_REG(PMMIR_EL1) #define PMMIR_EL1_op0 3 #define PMMIR_EL1_op1 0 #define PMMIR_EL1_CRn 9 @@ -2453,7 +2389,6 @@ #define PMMIR_EL1_op2 6 /* PMOVSCLR_EL0 */ -#define PMOVSCLR_EL0 MRS_REG(PMOVSCLR_EL0) #define PMOVSCLR_EL0_op0 3 #define PMOVSCLR_EL0_op1 3 #define PMOVSCLR_EL0_CRn 9 @@ -2461,7 +2396,6 @@ #define PMOVSCLR_EL0_op2 3 /* PMOVSSET_EL0 */ -#define PMOVSSET_EL0 MRS_REG(PMOVSSET_EL0) #define PMOVSSET_EL0_op0 3 #define PMOVSSET_EL0_op1 3 #define PMOVSSET_EL0_CRn 9 @@ -2469,7 +2403,6 @@ #define PMOVSSET_EL0_op2 3 /* PMSCR_EL1 */ -#define PMSCR_EL1 MRS_REG(PMSCR_EL1) #define PMSCR_EL1_REG MRS_REG_ALT_NAME(PMSCR_EL1) #define PMSCR_EL1_op0 3 #define PMSCR_EL1_op1 0 @@ -2490,7 +2423,6 @@ #define PMSCR_PCT_MASK (UL(0x3) << PMSCR_PCT_SHIFT) /* PMSELR_EL0 */ -#define PMSELR_EL0 MRS_REG(PMSELR_EL0) #define PMSELR_EL0_op0 3 #define PMSELR_EL0_op1 3 #define PMSELR_EL0_CRn 9 @@ -2499,7 +2431,6 @@ #define PMSELR_SEL_MASK 0x1f /* PMSEVFR_EL1 */ -#define PMSEVFR_EL1 MRS_REG(PMSEVFR_EL1) #define PMSEVFR_EL1_REG MRS_REG_ALT_NAME(PMSEVFR_EL1) #define PMSEVFR_EL1_op0 3 #define PMSEVFR_EL1_op1 0 @@ -2508,7 +2439,6 @@ #define PMSEVFR_EL1_op2 5 /* PMSFCR_EL1 */ -#define PMSFCR_EL1 MRS_REG(PMSFCR_EL1) #define PMSFCR_EL1_REG MRS_REG_ALT_NAME(PMSFCR_EL1) #define PMSFCR_EL1_op0 3 #define PMSFCR_EL1_op1 0 @@ -2531,7 +2461,6 @@ #define PMSFCR_ST (UL(0x1) << PMSFCR_ST_SHIFT) /* PMSICR_EL1 */ -#define PMSICR_EL1 MRS_REG(PMSICR_EL1) #define PMSICR_EL1_REG MRS_REG_ALT_NAME(PMSICR_EL1) #define PMSICR_EL1_op0 3 #define PMSICR_EL1_op1 0 @@ -2544,7 +2473,6 @@ #define PMSICR_ECOUNT_MASK (UL(0xff) << PMSICR_ECOUNT_SHIFT) /* PMSIDR_EL1 */ -#define PMSIDR_EL1 MRS_REG(PMSIDR_EL1) #define PMSIDR_EL1_REG MRS_REG_ALT_NAME(PMSIDR_EL1) #define PMSIDR_EL1_op0 3 #define PMSIDR_EL1_op1 0 @@ -2577,7 +2505,6 @@ #define PMSIDR_PBT (UL(0x1) << PMSIDR_PBT_SHIFT) /* PMSIRR_EL1 */ -#define PMSIRR_EL1 MRS_REG(PMSIRR_EL1) #define PMSIRR_EL1_REG MRS_REG_ALT_NAME(PMSIRR_EL1) #define PMSIRR_EL1_op0 3 #define PMSIRR_EL1_op1 0 @@ -2590,7 +2517,6 @@ #define PMSIRR_INTERVAL_MASK (UL(0xffffff) << PMSIRR_INTERVAL_SHIFT) /* PMSLATFR_EL1 */ -#define PMSLATFR_EL1 MRS_REG(PMSLATFR_EL1) #define PMSLATFR_EL1_REG MRS_REG_ALT_NAME(PMSLATFR_EL1) #define PMSLATFR_EL1_op0 3 #define PMSLATFR_EL1_op1 0 @@ -2601,7 +2527,6 @@ #define PMSLATFR_MINLAT_MASK (UL(0xfff) << PMSLATFR_MINLAT_SHIFT) /* PMSNEVFR_EL1 */ -#define PMSNEVFR_EL1 MRS_REG(PMSNEVFR_EL1) #define PMSNEVFR_EL1_REG MRS_REG_ALT_NAME(PMSNEVFR_EL1) #define PMSNEVFR_EL1_op0 3 #define PMSNEVFR_EL1_op1 0 @@ -2610,7 +2535,6 @@ #define PMSNEVFR_EL1_op2 1 /* PMSWINC_EL0 */ -#define PMSWINC_EL0 MRS_REG(PMSWINC_EL0) #define PMSWINC_EL0_op0 3 #define PMSWINC_EL0_op1 3 #define PMSWINC_EL0_CRn 9 @@ -2618,7 +2542,6 @@ #define PMSWINC_EL0_op2 4 /* PMUSERENR_EL0 */ -#define PMUSERENR_EL0 MRS_REG(PMUSERENR_EL0) #define PMUSERENR_EL0_op0 3 #define PMUSERENR_EL0_op1 3 #define PMUSERENR_EL0_CRn 9 @@ -2626,7 +2549,6 @@ #define PMUSERENR_EL0_op2 0 /* PMXEVCNTR_EL0 */ -#define PMXEVCNTR_EL0 MRS_REG(PMXEVCNTR_EL0) #define PMXEVCNTR_EL0_op0 3 #define PMXEVCNTR_EL0_op1 3 #define PMXEVCNTR_EL0_CRn 9 @@ -2634,7 +2556,6 @@ #define PMXEVCNTR_EL0_op2 2 /* PMXEVTYPER_EL0 */ -#define PMXEVTYPER_EL0 MRS_REG(PMXEVTYPER_EL0) #define PMXEVTYPER_EL0_op0 3 #define PMXEVTYPER_EL0_op1 3 #define PMXEVTYPER_EL0_CRn 9 @@ -2642,7 +2563,6 @@ #define PMXEVTYPER_EL0_op2 1 /* RNDRRS */ -#define RNDRRS MRS_REG(RNDRRS) #define RNDRRS_REG MRS_REG_ALT_NAME(RNDRRS) #define RNDRRS_op0 3 #define RNDRRS_op1 3 @@ -2777,7 +2697,6 @@ #define SPSR_EL12_op2 0 /* REVIDR_EL1 - Revision ID Register */ -#define REVIDR_EL1 MRS_REG(REVIDR_EL1) #define REVIDR_EL1_op0 3 #define REVIDR_EL1_op1 0 #define REVIDR_EL1_CRn 0 @@ -2955,7 +2874,6 @@ #define VBAR_EL12_op2 0 /* ZCR_EL1 - SVE Control Register */ -#define ZCR_EL1 MRS_REG(ZCR_EL1) #define ZCR_EL1_REG MRS_REG_ALT_NAME(ZCR_EL1) #define ZCR_EL1_op0 3 #define ZCR_EL1_op1 0 From nobody Mon Jun 23 12:07:37 2025 X-Original-To: dev-commits-src-main@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 4bQmzt6Ls7z60GVH; Mon, 23 Jun 2025 12:07: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 4bQmzt0TpLz3g6Y; Mon, 23 Jun 2025 12:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680458; 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=SXs3qS7EWHUxuGN46gKVTdN7Ra73YP1tgsMQE6vnKok=; b=vGlfx1nSMbhj27NOnqeLDdtCcO3qQx8FZa09DdAJbRGYFZox+UfcRS3UnhMMIN9htfflxU sXpS4EHrkdsXr0626DB6gHXOj8OxB8/1L3yfplUcEC3WjK01SmRKe4qw4KDwUpai7IaeHx Xo8X7BHkW4xpfMMNrBQHBUI/guHAmIVAWvvWAjBPkQM5QKWczETr2V1lrl+qV1pZiFuxek vjKr5l7KRbV6JHEHKI/D4gFOgeqqgGQiuWBlNqljdR3pgBxI/P/WL86rat6z4mTMNoX8OW lcwHyNShEhrSLlyq/xv+VL7Vv2x1jY1O+teyUSE0yrlH+9r8TUr9/W67QriTYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680458; 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=SXs3qS7EWHUxuGN46gKVTdN7Ra73YP1tgsMQE6vnKok=; b=nZZmj4SdiIcGEzGn6F4ryYSqJS2jYagU9BVZCKch9EeRw8R08FvsepsXV2IflX72gHTdsE bWi/8/QqBIMqd26k5NEoHYp9iKYMJmSLYCuMcVlJXEAFVcsx3kprzQhf0KujNrbMxBQgKm NGtJabJEIQ0TLaAmnCT09jDu5u101JGpukJgjLqvF+Vy15nkEc0ScU4dUgGRBI7I6aHw8s 1ktLHwbSH6YHY97tVeGF6DXuEbgi+4YIJSD2i4ylZZ7KViQly3szjyoRCf1sITGRigdIVr gDTD1Fj3pHQmijA7HtDrXche+WLh+klifBZWG2m+6bTWM7STr7OyRkrlElPDDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750680458; a=rsa-sha256; cv=none; b=qTUIUj42VNgndvQnBSsa4yidGwPPlXh2xTlAfVQA4Acmd2Qpw/UZsiemGL5+Q80BwyXWS+ RQec8DXBzr7+rCEv06tdRxCNOiL0/lcgAJ36/MBeu7mhMPWKE6PT0H8kHgehdIJ/bPqv7C f/pYiekd2UU3hgFJhXbWAHFThNXi1xLrClFxg1rCfQWPmHJijrq5l7hgLZYabmNLHIaq22 iY2FOb7OjGlR7OCDxakR3tAA/TJLdN+OmaLvZpSBKgPSzgg9Re7fRmvTG7A+dlrPCIoFNB cY4xjcRy6Im85MfUENBB7cgBULxgFeg2McAO+WSa5syP3055gmKu2xDuA4ZQRg== 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 4bQmzs6kHdz11sQ; Mon, 23 Jun 2025 12:07: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 55NC7b0V059306; Mon, 23 Jun 2025 12:07:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NC7bLf059303; Mon, 23 Jun 2025 12:07:37 GMT (envelope-from git) Date: Mon, 23 Jun 2025 12:07:37 GMT Message-Id: <202506231207.55NC7bLf059303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 128085a3e7f3 - main - arm64: Use ISS to search for a special register List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 128085a3e7f3afc2f89845e81730a1d2340b3f04 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=128085a3e7f3afc2f89845e81730a1d2340b3f04 commit 128085a3e7f3afc2f89845e81730a1d2340b3f04 Author: Andrew Turner AuthorDate: 2025-06-23 10:15:14 +0000 Commit: Andrew Turner CommitDate: 2025-06-23 10:18:19 +0000 arm64: Use ISS to search for a special register Previously we would use part of the msr/mrs instruction to find what register was being asked for. This was the only use for these values. We now have ESR_EL1 ISS field values for the same register so can use this new value to find what register is asked for. This lets us remove the old reg field from struct mrs_user_reg. Add macros to keep the old KPI. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50905 --- sys/arm64/arm64/identcpu.c | 18 ++++++++---------- sys/arm64/include/cpu.h | 16 ++++++++++++---- sys/arm64/vmm/vmm.c | 3 ++- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index c1960812928f..72ef94531f54 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -2195,7 +2195,6 @@ static const struct mrs_field mvfr1_fields[] = { #endif /* COMPAT_FREEBSD32 */ struct mrs_user_reg { - u_int reg; u_int iss; bool is64bit; size_t offset; @@ -2204,7 +2203,6 @@ struct mrs_user_reg { #define USER_REG(name, field_name, _is64bit) \ { \ - .reg = name, \ .iss = name##_ISS, \ .offset = __offsetof(struct cpu_desc, field_name), \ .fields = field_name##_fields, \ @@ -2497,12 +2495,12 @@ mrs_field_cmp(uint64_t a, uint64_t b, u_int shift, int width, bool sign) } bool -get_kernel_reg(u_int reg, uint64_t *val) +get_kernel_reg_iss(u_int iss, uint64_t *val) { int i; for (i = 0; i < nitems(user_regs); i++) { - if (user_regs[i].reg == reg) { + if (user_regs[i].iss == iss) { *val = CPU_DESC_FIELD(kern_cpu_desc, i); return (true); } @@ -2516,13 +2514,13 @@ get_kernel_reg(u_int reg, uint64_t *val) * do not exceed those in the mask. */ bool -get_kernel_reg_masked(u_int reg, uint64_t *valp, uint64_t mask) +get_kernel_reg_iss_masked(u_int iss, uint64_t *valp, uint64_t mask) { const struct mrs_field *fields; uint64_t val; for (int i = 0; i < nitems(user_regs); i++) { - if (user_regs[i].reg == reg) { + if (user_regs[i].iss == iss) { val = CPU_DESC_FIELD(kern_cpu_desc, i); fields = user_regs[i].fields; for (int j = 0; fields[j].type != 0; j++) { @@ -2539,12 +2537,12 @@ get_kernel_reg_masked(u_int reg, uint64_t *valp, uint64_t mask) } bool -get_user_reg(u_int reg, uint64_t *val, bool fbsd) +get_user_reg_iss(u_int iss, uint64_t *val, bool fbsd) { int i; for (i = 0; i < nitems(user_regs); i++) { - if (user_regs[i].reg == reg) { + if (user_regs[i].iss == iss) { if (fbsd) *val = CPU_DESC_FIELD(user_cpu_desc, i); else @@ -2694,7 +2692,7 @@ update_special_regs(u_int cpu) * HWCAPs are set the check for these is enough. */ void -update_special_reg(u_int reg, uint64_t clear, uint64_t set) +update_special_reg_iss(u_int iss, uint64_t clear, uint64_t set) { MPASS(hwcaps_set == false); /* There is no locking here, so we only support changing this on CPU0 */ @@ -2702,7 +2700,7 @@ update_special_reg(u_int reg, uint64_t clear, uint64_t set) MPASS(PCPU_GET(cpuid) == 0); for (int i = 0; i < nitems(user_regs); i++) { - if (user_regs[i].reg != reg) + if (user_regs[i].iss != iss) continue; clear_set_special_reg_idx(i, clear, set); diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 2dd1a905b2b7..4ef01e9a47ed 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -232,10 +232,18 @@ void ptrauth_mp_start(uint64_t); /* Functions to read the sanitised view of the special registers */ void update_special_regs(u_int); -void update_special_reg(u_int reg, uint64_t, uint64_t); -bool get_kernel_reg(u_int, uint64_t *); -bool get_kernel_reg_masked(u_int, uint64_t *, uint64_t); -bool get_user_reg(u_int, uint64_t *, bool); +void update_special_reg_iss(u_int, uint64_t, uint64_t); +#define update_special_reg(reg, clear, set) \ + update_special_reg_iss(reg ## _ISS, clear, set) +bool get_kernel_reg_iss(u_int, uint64_t *); +#define get_kernel_reg(reg, valp) \ + get_kernel_reg_iss(reg ## _ISS, valp) +bool get_kernel_reg_iss_masked(u_int, uint64_t *, uint64_t); +#define get_kernel_reg_masked(reg, valp, mask) \ + get_kernel_reg_iss_masked(reg ## _ISS, valp, mask) +bool get_user_reg_iss(u_int, uint64_t *, bool); +#define get_user_reg(reg, valp, fbsd) \ + get_user_reg_iss(reg ## _ISS, valp, fbsd) void cpu_desc_init(void); diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index f28643db99d2..3082d2941221 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -245,7 +245,8 @@ vmm_regs_init(struct vmm_regs *regs, const struct vmm_regs *masks) { #define _FETCH_KERN_REG(reg, field) do { \ regs->field = vmm_arch_regs_masks.field; \ - if (!get_kernel_reg_masked(reg, ®s->field, masks->field)) \ + if (!get_kernel_reg_iss_masked(reg ## _ISS, ®s->field, \ + masks->field)) \ regs->field = 0; \ } while (0) _FETCH_KERN_REG(ID_AA64AFR0_EL1, id_aa64afr0); From nobody Mon Jun 23 12:07:40 2025 X-Original-To: dev-commits-src-main@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 4bQmzw3yCxz60Gbb; Mon, 23 Jun 2025 12:07: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 4bQmzw1s5tz3g1s; Mon, 23 Jun 2025 12:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680460; 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=xHzzQJvget24DkT7JdhbyJtr3KU6H4J6f47r37AaCLY=; b=GUVAFBTHox/Usidz08p4O3MNb7kryH+CAHMqNvFC+zDO3Ak+wpQ3kzBF//NKhYoealOEB8 e+7XTHFmXDXimZLJio7LarLgjRRwT3q9Nk5JPlGbIBMUgc0CBbURAGRIbkKJU/CanhKa6Y s/o2/fShYLKH4w0Q5/XarJ8KXPqPQIaRFvp8l8WcvBqW4jXlRECD9tU7bEQHSMp3LCwAEj +aCkIgcbMWmiTWNAnjSG2JP39cqO4zHHWIEujR29L6BgAC3U+7lxQRtGiTHmig/2opDjOL oI48HzlGKMjN3TUMlBdRSmlq5qkAttq1gW5bJF9FNNFeC11ZxSPanAq0aflksg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750680460; 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=xHzzQJvget24DkT7JdhbyJtr3KU6H4J6f47r37AaCLY=; b=CApgLIBVbaXwIj1vSJCB4gabOHzhPgD0s4Iq8HTm/yhg0zkOD0Vs5J88FaANRaf1Kl/x2n 7MjFRGp127kroMJiBXZr64VIX9Dez1Hw8k7A4qowBgDNjEBNxxK5dUEU+SWDxGLvCyNaEN YrGV3OoIlks0SK47dq15NkQ2fKr3KMz6qaXx/w7vJEOhazL78J0KzxpX5QskqnVyH2sraM yM39BbEMuuZar4m4wfuR9GNZF+YcEBVs3+kqZvwO3zgPsZ5XeyAFa8LsgB6DFQyE/1mmTT 9ux+2WlUrwcOjKqMHXh237TOI83VzLSP0RKuAMAx+/fxL2law7fOIXg5xVKtXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750680460; a=rsa-sha256; cv=none; b=baUb8M9C7XG1qal/Fu1BNf2mrn7koJniEk9cZK86lUB0Ka7M10LVrUtxoV+vovHbA9a+Kj nR0IUgoRU4jlkBsW2lHrXJNzySKetXf2TjvT6AZr7NUwfiTEJUv5Fh7jxNPms3/AJ3MZbd F51x2cU2lNlKCag5Y4rFzBqRG1+rnBLgAeW9pAe5k2xFnZG4dnC5J2FDTjzdR12p1YaCfC cQhEisaCUziWRJagiLsEDmwZAiBuk6wVR2LNVM784yIM88qijrFyoCEFyg+R9MDFUPtehN yGW2Zsr0EaUXe87wwCQxy6M01hV93cJco42pinIGhYLP8NLLC1uDJeP5mwRBzA== 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 4bQmzw0hLPz12TC; Mon, 23 Jun 2025 12:07: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 55NC7eRB059378; Mon, 23 Jun 2025 12:07:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NC7eUN059375; Mon, 23 Jun 2025 12:07:40 GMT (envelope-from git) Date: Mon, 23 Jun 2025 12:07:40 GMT Message-Id: <202506231207.55NC7eUN059375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b47a6c93e262 - main - arm64: Reduce where we decode msr/mrs instructions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b47a6c93e262f4245492c947af8a600a4b1fe308 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b47a6c93e262f4245492c947af8a600a4b1fe308 commit b47a6c93e262f4245492c947af8a600a4b1fe308 Author: Andrew Turner AuthorDate: 2025-06-23 10:16:03 +0000 Commit: Andrew Turner CommitDate: 2025-06-23 10:18:19 +0000 arm64: Reduce where we decode msr/mrs instructions We only use the mrs_Op* and mrs_CR* functions and MRS_* macros when handling userspace executing a msr/msr instruction. Move the macros to where they are used and expand the functions to just use the macros directly. While here update MRS_Op0_MASK to include bit 20 as this will cause the correct op0 value to be calculated for all instructions we decode. Reviewed by: Harry Moulton Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50214 --- sys/arm64/arm64/undefined.c | 49 ++++++++++++++++++++++++++++++++++++------- sys/arm64/include/armreg.h | 19 ----------------- sys/arm64/include/undefined.h | 20 ------------------ 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/sys/arm64/arm64/undefined.c b/sys/arm64/arm64/undefined.c index a88d47c182cf..19f34fa91702 100644 --- a/sys/arm64/arm64/undefined.c +++ b/sys/arm64/arm64/undefined.c @@ -327,16 +327,30 @@ static bool undef_sys_insn(struct trapframe *frame, uint32_t insn) { uint64_t esr; - int op0; bool read; +#define MRS_MASK 0xfff00000 +#define MRS_VALUE 0xd5300000 +#define MSR_REG_VALUE 0xd5100000 +#define MSR_IMM_VALUE 0xd5000000 +#define MRS_REGISTER(insn) ((insn) & 0x0000001f) +#define MRS_Op0_SHIFT 19 +#define MRS_Op0_MASK 0x00180000 +#define MRS_Op1_SHIFT 16 +#define MRS_Op1_MASK 0x00070000 +#define MRS_CRn_SHIFT 12 +#define MRS_CRn_MASK 0x0000f000 +#define MRS_CRm_SHIFT 8 +#define MRS_CRm_MASK 0x00000f00 +#define MRS_Op2_SHIFT 5 +#define MRS_Op2_MASK 0x000000e0 + read = false; switch (insn & MRS_MASK) { case MRS_VALUE: read = true; - /* FALLTHROUGH */ + break; case MSR_REG_VALUE: - op0 = mrs_Op0(insn); break; case MSR_IMM_VALUE: /* @@ -346,9 +360,10 @@ undef_sys_insn(struct trapframe *frame, uint32_t insn) */ if (MRS_REGISTER(insn) != 31) return (false); - if (mrs_CRn(insn) != 4) + if ((insn & MRS_CRn_MASK) >> MRS_CRn_SHIFT != 4) + return (false); + if ((insn & MRS_Op0_MASK) >> MRS_Op0_SHIFT != 0) return (false); - op0 = 0; break; default: return (false); @@ -357,12 +372,32 @@ undef_sys_insn(struct trapframe *frame, uint32_t insn) /* Create a fake EXCP_MSR esr value */ esr = EXCP_MSR << ESR_ELx_EC_SHIFT; esr |= ESR_ELx_IL; - esr |= __ISS_MSR_REG(op0, mrs_Op1(insn), mrs_CRn(insn), mrs_CRm(insn), - mrs_Op2(insn)); + esr |= __ISS_MSR_REG( + (insn & MRS_Op0_MASK) >> MRS_Op0_SHIFT, + (insn & MRS_Op1_MASK) >> MRS_Op1_SHIFT, + (insn & MRS_CRn_MASK) >> MRS_CRn_SHIFT, + (insn & MRS_CRm_MASK) >> MRS_CRm_SHIFT, + (insn & MRS_Op2_MASK) >> MRS_Op2_SHIFT); esr |= MRS_REGISTER(insn) << ISS_MSR_Rt_SHIFT; if (read) esr |= ISS_MSR_DIR; +#undef MRS_MASK +#undef MRS_VALUE +#undef MSR_REG_VALUE +#undef MSR_IMM_VALUE +#undef MRS_REGISTER +#undef MRS_Op0_SHIFT +#undef MRS_Op0_MASK +#undef MRS_Op1_SHIFT +#undef MRS_Op1_MASK +#undef MRS_CRn_SHIFT +#undef MRS_CRn_MASK +#undef MRS_CRm_SHIFT +#undef MRS_CRm_MASK +#undef MRS_Op2_SHIFT +#undef MRS_Op2_MASK + return (undef_sys(esr, frame)); } diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index a44cc4343dee..cd770386f852 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -36,25 +36,6 @@ #define INSN_SIZE 4 -#define MRS_MASK 0xfff00000 -#define MRS_VALUE 0xd5300000 -#define MSR_REG_VALUE 0xd5100000 -#define MSR_IMM_VALUE 0xd5000000 -#define MRS_SPECIAL(insn) ((insn) & 0x000fffe0) -#define MRS_REGISTER(insn) ((insn) & 0x0000001f) -#define MRS_Op0_SHIFT 19 -#define MRS_Op0_MASK 0x00080000 -#define MRS_Op1_SHIFT 16 -#define MRS_Op1_MASK 0x00070000 -#define MRS_CRn_SHIFT 12 -#define MRS_CRn_MASK 0x0000f000 -#define MRS_CRm_SHIFT 8 -#define MRS_CRm_MASK 0x00000f00 -#define MRS_Op2_SHIFT 5 -#define MRS_Op2_MASK 0x000000e0 -#define MRS_Rt_SHIFT 0 -#define MRS_Rt_MASK 0x0000001f - #define __MRS_REG_ALT_NAME(op0, op1, crn, crm, op2) \ S##op0##_##op1##_C##crn##_C##crm##_##op2 #define _MRS_REG_ALT_NAME(op0, op1, crn, crm, op2) \ diff --git a/sys/arm64/include/undefined.h b/sys/arm64/include/undefined.h index c23b020e960f..71b2eed22a84 100644 --- a/sys/arm64/include/undefined.h +++ b/sys/arm64/include/undefined.h @@ -37,26 +37,6 @@ typedef int (*undef_handler_t)(vm_offset_t, uint32_t, struct trapframe *, uint32_t); typedef bool (*undef_sys_handler_t)(uint64_t, struct trapframe *); -static inline int -mrs_Op0(uint32_t insn) -{ - - /* op0 is encoded without the top bit in a mrs instruction */ - return (2 | ((insn & MRS_Op0_MASK) >> MRS_Op0_SHIFT)); -} - -#define MRS_GET(op) \ -static inline int \ -mrs_##op(uint32_t insn) \ -{ \ - \ - return ((insn & MRS_##op##_MASK) >> MRS_##op##_SHIFT); \ -} -MRS_GET(Op1) -MRS_GET(CRn) -MRS_GET(CRm) -MRS_GET(Op2) - void undef_init(void); void install_sys_handler(undef_sys_handler_t); void *install_undef_handler(undef_handler_t); From nobody Mon Jun 23 13:03:30 2025 X-Original-To: dev-commits-src-main@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 4bQpDL4KQLz60Kj8; Mon, 23 Jun 2025 13:03: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 4bQpDL1mntz41pN; Mon, 23 Jun 2025 13:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750683810; 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=YePokqWg3N8O9SRbx1Y9Ob5KCo3wjbloaostekWwUDc=; b=iZG72+7OpnKEbzrQEEgWXDX25C+AxAk9IaSEEVgKEtfgb6xFRFKp1GLeGsO5YUjoLGrrvg Mq/6hyPwFhaeqBLs4iAsZiP1P/U9QT1sFY+Z6Aw/uQYCVyJ2ydd2Et19JkjMj3OjqSdx/2 Nx77wFsozhNPFRImgz5Ne4cs3moCrOeEPpDH0Hf68rVaXOavKSSJYnpKykHHn4Dy5+xSvx BhuHaIRRWuCqxwX1B1s3a+C6wFZvY8kP7dB4XGwIdn7SoQQFE2IyYmFgEZeYBd2A8jzbuA NSSO/+q2qbCLJfh2QQ9D7rQAAz5blSQttNe2PR3lCIYkE8VVjpVQyks6W92mWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750683810; 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=YePokqWg3N8O9SRbx1Y9Ob5KCo3wjbloaostekWwUDc=; b=XOkZ61ZP45P/OHNSwkb1qz06laJ8gXF7cuepJyIAEREwtfopYGN8HfA/qRHdvtW+r3QLJm e0EcEw5A+bZevrrE0cf75fH1KOt7BRoUb7/3UWlfkiCrVlhQdCHc4C1qCnDUCDPRSob1D1 nBxtsiTiITgQ91OZQsHa64naJBtDK4v0/ZoMgPAwcpWhCxP7kf3zWjEtFREkECga9uI3Ru FcbI9mJVfnGJJAvUmNIfsSX3gTPemL91EX1MxHa7kYEMQJ9MFb6c6o2XIe3bREXhix/eCT +dXjoUdkB0kuqO7W/HuNHbxWn5iHTG2gJGEuEZG1GmTKuA7lG+CiXsuMRYjfGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750683810; a=rsa-sha256; cv=none; b=SYujP/v5Yj1u+8ZVoUE6mh9u+9C4AbWYqzEDhvCmFfogWN5vhseESSjiae4aQNCG98U5Uz 4IXzUDV4EXrX4Mp8du1X8OSfQ5cCJZ2/9qGIUoRlyvy6v763lBHcnUoT/zhw22SZcGh9GP wQ7C8ZcTwXF0wZhK8w9MmDN0Oh1D0AUK2GiWgqYPgbwCPqztILkM6yKcO3ocofdFXDv5t3 5MIGk28Ddse0yGc0hudREWuSRip38zaaG2XB6Ii9K1Pt+q+/GwKAnqLBwvBb1mzrMh191m GiktYYnh5lELJYKaXT+3P8U7t5s7Y5EipgqcaroJ7c93iyk3/C6SP5clb2GR7w== 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 4bQpDL18LLz13VL; Mon, 23 Jun 2025 13:03: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 55ND3Uat070759; Mon, 23 Jun 2025 13:03:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55ND3Uqr070756; Mon, 23 Jun 2025 13:03:30 GMT (envelope-from git) Date: Mon, 23 Jun 2025 13:03:30 GMT Message-Id: <202506231303.55ND3Uqr070756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0a5b763d98b9 - main - libc: Rename fscandir{,_b}() to fdscandir{,_b}(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0a5b763d98b921f921243525ff25a70bbe00cfaa Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0a5b763d98b921f921243525ff25a70bbe00cfaa commit 0a5b763d98b921f921243525ff25a70bbe00cfaa Author: Dag-Erling Smørgrav AuthorDate: 2025-06-23 13:02:53 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-23 13:03:10 +0000 libc: Rename fscandir{,_b}() to fdscandir{,_b}(). This seems to fit the pattern better (e.g. fdopendir()). I've added weak references to ease the transition, but since it's only been a few days, we can remove them (and the ObsoleteFiles entries for the manual pages) before we branch stable/15. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50980 --- ObsoleteFiles.inc | 4 ++++ include/dirent.h | 4 ++-- lib/libc/gen/Makefile.inc | 4 ++-- lib/libc/gen/Symbol.map | 2 ++ lib/libc/gen/scandir.3 | 28 ++++++++++++++-------------- lib/libc/gen/scandir.c | 14 ++++++++++---- lib/libc/tests/gen/scandir_blocks_test.c | 12 ++++++------ lib/libc/tests/gen/scandir_test.c | 12 ++++++------ usr.bin/diff/diffdir.c | 2 +- 9 files changed, 47 insertions(+), 35 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 3dc879fe5b0b..cab8949b635b 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20250623: fscandir() renamed to fdscandir() +OLD_FILES+=usr/share/man/man3/fscandir.3.gz +OLD_FILES+=usr/share/man/man3/fscandir_b.3.gz + # 20250615: don't install man page for absent function OLD_FILES+=usr/share/man/man9/vm_map_simplify_entry.9.gz diff --git a/include/dirent.h b/include/dirent.h index 00319c0a8bd0..dff0e8675722 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -130,11 +130,11 @@ int scandir_b(const char *, struct dirent ***, #endif #endif #if __BSD_VISIBLE -int fscandir(int, struct dirent ***, +int fdscandir(int, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); #ifdef __BLOCKS__ -int fscandir_b(int, struct dirent ***, +int fdscandir_b(int, struct dirent ***, int (^)(const struct dirent *), int (^)(const struct dirent **, const struct dirent **)); #endif diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index f2f5afbb24d8..ad13aaa65621 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -499,8 +499,8 @@ MLINKS+=rand48.3 _rand48.3 \ MLINKS+=rtld_get_var.3 \ rtld_set_var.3 MLINKS+=scandir.3 alphasort.3 \ - scandir.3 fscandir.3 \ - scandir.3 fscandir_b.3 \ + scandir.3 fdscandir.3 \ + scandir.3 fdscandir_b.3 \ scandir.3 scandir_b.3 \ scandir.3 scandirat.3 \ scandir.3 scandirat_b.3 \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index e7483d3e6ec2..8faecf4b3048 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -460,6 +460,8 @@ FBSD_1.8 { execvpe; fscandir; fscandir_b; + fdscandir; + fdscandir_b; fts_open_b; glob_b; psiginfo; diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3 index 21df9316d511..9ced9fa4ef9d 100644 --- a/lib/libc/gen/scandir.3 +++ b/lib/libc/gen/scandir.3 @@ -30,11 +30,11 @@ .Os .Sh NAME .Nm scandir , -.Nm fscandir , +.Nm fdscandir , .Nm scandirat , .Nm scandir_b , -.Nm fscandir_b , -.Nm fscandirat_b , +.Nm fdscandir_b , +.Nm fdscandirat_b , .Nm alphasort , .Nm versionsort .Nd scan a directory @@ -50,7 +50,7 @@ .Fa "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" .Fc .Ft int -.Fo fscandir +.Fo fdscandir .Fa "int dirfd" .Fa "struct dirent ***namelist" .Fa "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp" @@ -72,7 +72,7 @@ .Fa "int \*(lp^compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" .Fc .Ft int -.Fo fscandir_b +.Fo fdscandir_b .Fa "int dirfd" .Fa "struct dirent ***namelist" .Fa "int \*(lp^select\*(rp\*(lpconst struct dirent *\*(rp" @@ -144,7 +144,7 @@ The memory allocated for the array can be deallocated with by freeing each pointer in the array and then the array itself. .Pp The -.Fn fscandir +.Fn fdscandir function is similar to .Fn scandir , but takes a file descriptor referencing a directory instead of a path. @@ -185,12 +185,12 @@ for additional details. .Pp The .Fn scandir_b , -.Fn fscandir_b , +.Fn fdscandir_b , and .Fn scandirat_b functions behave in the same way as .Fn scandir , -.Fn fscandir , +.Fn fdscandir , and .Fn scandirat , respectively, @@ -201,10 +201,10 @@ rather than .Sh DIAGNOSTICS The .Fn scandir , -.Fn fscandir , +.Fn fdscandir , .Fn scandirat , .Fn scandir_b , -.Fn fscandir_b , +.Fn fdscandir_b , and .Fn scandirat_b functions return the number of directory entries found on succes. @@ -236,9 +236,9 @@ and .Fn versionsort functions are GNU extensions and conform to no standard. The -.Fn fscandir , +.Fn fdscandir , .Fn scandir_b , -.Fn fscandir_b , +.Fn fdscandir_b , and .Fn scandirat_b functions are @@ -262,8 +262,8 @@ and functions were added in .Fx 13.2 . The -.Fn fscandir , -.Fn fscandir_b , +.Fn fdscandir , +.Fn fdscandir_b , and .Fn scandirat_b functions were added in diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index d8033a985862..134c88713d39 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -159,10 +159,10 @@ scandir(const char *dirname, struct dirent ***namelist, int #ifdef I_AM_SCANDIR_B -fscandir_b(int dirfd, struct dirent ***namelist, select_block select, +fdscandir_b(int dirfd, struct dirent ***namelist, select_block select, dcomp_block dcomp) #else -fscandir(int dirfd, struct dirent ***namelist, +fdscandir(int dirfd, struct dirent ***namelist, int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, const struct dirent **)) #endif @@ -203,9 +203,9 @@ scandirat(int dirfd, const char *dirname, struct dirent ***namelist, return (-1); ret = #ifdef I_AM_SCANDIR_B - fscandir_b + fdscandir_b #else - fscandir + fdscandir #endif (fd, namelist, select, dcomp); serrno = errno; @@ -242,3 +242,9 @@ scandir_thunk_cmp(const void *p1, const void *p2, void *thunk) return (dc((const struct dirent **)p1, (const struct dirent **)p2)); } #endif + +#ifdef I_AM_SCANDIR_B +__weak_reference(fdscandir_b, fscandir_b); +#else +__weak_reference(fdscandir, fscandir); +#endif diff --git a/lib/libc/tests/gen/scandir_blocks_test.c b/lib/libc/tests/gen/scandir_blocks_test.c index 28aeef4e7d4c..b94270bc410e 100644 --- a/lib/libc/tests/gen/scandir_blocks_test.c +++ b/lib/libc/tests/gen/scandir_blocks_test.c @@ -57,19 +57,19 @@ ATF_TC_BODY(scandir_b_test, tc) free(namelist); } -ATF_TC(fscandir_b_test); -ATF_TC_HEAD(fscandir_b_test, tc) +ATF_TC(fdscandir_b_test); +ATF_TC_HEAD(fdscandir_b_test, tc) { - atf_tc_set_md_var(tc, "descr", "Test fscandir_b()"); + atf_tc_set_md_var(tc, "descr", "Test fdscandir_b()"); } -ATF_TC_BODY(fscandir_b_test, tc) +ATF_TC_BODY(fdscandir_b_test, tc) { struct dirent **namelist = NULL; int fd, i, ret; scandir_blocks_prepare(tc); ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); - ret = fscandir_b(fd, &namelist, + ret = fdscandir_b(fd, &namelist, ^(const struct dirent *ent) { return (strcmp(ent->d_name, "skip") != 0); }, @@ -112,7 +112,7 @@ ATF_TC_BODY(scandirat_b_test, tc) ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, scandir_b_test); - ATF_TP_ADD_TC(tp, fscandir_b_test); + ATF_TP_ADD_TC(tp, fdscandir_b_test); ATF_TP_ADD_TC(tp, scandirat_b_test); return (atf_no_error()); } diff --git a/lib/libc/tests/gen/scandir_test.c b/lib/libc/tests/gen/scandir_test.c index dcd73fe94df5..9a9940aca881 100644 --- a/lib/libc/tests/gen/scandir_test.c +++ b/lib/libc/tests/gen/scandir_test.c @@ -63,19 +63,19 @@ ATF_TC_BODY(scandir_test, tc) free(namelist); } -ATF_TC(fscandir_test); -ATF_TC_HEAD(fscandir_test, tc) +ATF_TC(fdscandir_test); +ATF_TC_HEAD(fdscandir_test, tc) { - atf_tc_set_md_var(tc, "descr", "Test fscandir()"); + atf_tc_set_md_var(tc, "descr", "Test fdscandir()"); } -ATF_TC_BODY(fscandir_test, tc) +ATF_TC_BODY(fdscandir_test, tc) { struct dirent **namelist = NULL; int fd, i, ret; scandir_prepare(tc); ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); - ret = fscandir(fd, &namelist, scandir_select, scandir_compare); + ret = fdscandir(fd, &namelist, scandir_select, scandir_compare); scandir_verify(tc, ret, namelist); for (i = 0; i < ret; i++) free(namelist[i]); @@ -127,7 +127,7 @@ ATF_TC_BODY(scandir_none, tc) ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, scandir_test); - ATF_TP_ADD_TC(tp, fscandir_test); + ATF_TP_ADD_TC(tp, fdscandir_test); ATF_TP_ADD_TC(tp, scandirat_test); ATF_TP_ADD_TC(tp, scandir_none); return (atf_no_error()); diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c index fb76a5768e1a..a55a2bec70ee 100644 --- a/usr.bin/diff/diffdir.c +++ b/usr.bin/diff/diffdir.c @@ -83,7 +83,7 @@ vscandir(struct inodetree *tree, const char *path, struct dirent ***dirp, *dirp = NULL; return (0); } - if ((ret = fscandir(fd, dirp, selectf, comparf)) < 0) + if ((ret = fdscandir(fd, dirp, selectf, comparf)) < 0) goto fail; RB_INSERT(inodetree, tree, ino); close(fd); From nobody Mon Jun 23 13:20:04 2025 X-Original-To: dev-commits-src-main@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 4bQpbT1TvDz60L00; Mon, 23 Jun 2025 13:20: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 4bQpbT0RMkz4637; Mon, 23 Jun 2025 13:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750684805; 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=QwOy3bvwWrwWgADf/va98LIvuP1qaJ7V7sYuLS0XSIQ=; b=MleJKPg5ql3u5431+0DxIhi2iVRNRV4/7Eta2INQPuXcPpoOpvTKcRBF645QWPA2ugsxbD bGK4QqPvkBaiO3ZQLx2qd7CKG3IUpK4KiB4DGiLkyScVLxMJTn/cmOoQnQzsVJemfTfWP6 f3KdexmZxaJKg0yy+jGQBiPZ6iilZAlQB2NYqD1Ib8g12cE7j1tTAuWNxHz1zaIZjgKgHq xQ0WUgCZmSPdrUv2sxQeIukmSTEg9C8UqTsq+evC3S2E1t2WXCyRXxZ1qh6OkgdvMzVlW0 UypUn6dsX32/kk9rweF7deYHUSTC12j4Oc8cfsyoHgAVKVmdljYulO4RO4GSwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750684805; 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=QwOy3bvwWrwWgADf/va98LIvuP1qaJ7V7sYuLS0XSIQ=; b=plEwJxwFG5QpA52LloDhF6iKxiI6orscwJZjOiaHuy2z2ah+I4O+Xl13jxT50+8tKWNxkI aZ2sDeVifI2wExPqSAEWDTp3/KcrhapR2MdqS+mRMtWTbOTS4Xsj0/TVeF8ndknNs8HxV+ VbV8qgrJhsqhtLBwsl3bXP9qDWsTnVtgzcxjg6to4Gw+bP8h7jL5pUARqln0eHPk6Qi/qL 7CGylW/9VuUxSbYdCfeUA6cKiA8GgS+FgliMUlFlvhuSYSDhnqCquLF4tArZF9oWhbc8w/ cj6eswERikMxh0/VgcyfGbC9BOK+8wvVaVIKuBimPy0PId3Pc0CSuHGJM7oAbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750684805; a=rsa-sha256; cv=none; b=lAloeb7KLZNn854Cw5R1zc98SH8xSc+dmEN4e3U3S/V1P4d1As9bNlPEceiuU7Dmay9PN3 LfsCR2qGiNUtepqFV0Q3o+n3aBx33LpIHs82jqtCi63n5gWh2+HBE7N0y3Xtcm1odffe9G 4oJuXBDsLPQOgqNfnJTGY4R423N/rm/55JGx3HegSJf9WC5n+lg3gO1weoPHHwOPt1xgDh 0izFUwyL83S+evy0z/hz9r51GaG9vyX2YfaEsN+vM8htHd6okzDPAUZ8cu/JAyTtZWrR7c bfrsrNELuVInP1Bj3CLn1K9L23VA4yw4N5XnwzTD8ZC6sdvcc+cKKIhNaZ1OrA== 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 4bQpbS6SQsz144G; Mon, 23 Jun 2025 13:20: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 55NDK4V3094250; Mon, 23 Jun 2025 13:20:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NDK4A1094245; Mon, 23 Jun 2025 13:20:04 GMT (envelope-from git) Date: Mon, 23 Jun 2025 13:20:04 GMT Message-Id: <202506231320.55NDK4A1094245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: cbc2e34613c4 - main - virtio_blk: Limit use of indirect descriptors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbc2e34613c48c0b7955d5d970dcc08cd52da9b4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=cbc2e34613c48c0b7955d5d970dcc08cd52da9b4 commit cbc2e34613c48c0b7955d5d970dcc08cd52da9b4 Author: Andrew Turner AuthorDate: 2025-06-23 12:27:10 +0000 Commit: Andrew Turner CommitDate: 2025-06-23 12:55:24 +0000 virtio_blk: Limit use of indirect descriptors Pass 0 as the number of indirect descriptors when they are not supported. This fixes an issue on the Arm FVP model where we don't negotiate them, however pass a number of segments greater than VIRTIO_MAX_INDIRECT. This leads to virtqueue_alloc failing and virtio_blk failing to attach. Reviewed by: Harry Moulton Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50909 --- sys/dev/virtio/block/virtio_blk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c index 76068c91df11..5eb681128e9c 100644 --- a/sys/dev/virtio/block/virtio_blk.c +++ b/sys/dev/virtio/block/virtio_blk.c @@ -699,10 +699,14 @@ vtblk_alloc_virtqueue(struct vtblk_softc *sc) { device_t dev; struct vq_alloc_info vq_info; + int indir_segs; dev = sc->vtblk_dev; - VQ_ALLOC_INFO_INIT(&vq_info, sc->vtblk_max_nsegs, + indir_segs = 0; + if (sc->vtblk_flags & VTBLK_FLAG_INDIRECT) + indir_segs = sc->vtblk_max_nsegs; + VQ_ALLOC_INFO_INIT(&vq_info, indir_segs, vtblk_vq_intr, sc, &sc->vtblk_vq, "%s request", device_get_nameunit(dev)); From nobody Mon Jun 23 13:22:33 2025 X-Original-To: dev-commits-src-main@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 4bQpfK5qPSz60L3N; Mon, 23 Jun 2025 13:22: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 4bQpfK29PVz49F6; Mon, 23 Jun 2025 13:22:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750684953; 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=KU83t/WeYeq3Mo3s08BEwqWLxSLsHbykBRnGA+tDW18=; b=XGw8Opgl01mMHKlcnBpBiC+63Hjv9IZ1dSRO+EYS2eRDVIsjs3sdX4hqb7EwIxnjvC8OH6 fd2x8yzfU1kYOZa7hwN911eKpvrWfHEs71xMZHUvE8ZrjT8b0EfBL8uMLqI0LN7g3PUfk7 DKHL1PYP+Ti/UD4PrIoyuZKykcgvlUmNPIofnmv5WFxFi0bCUXnjM3rGdtl6e117spxZFp AiCpASbJzOnXCZM/E4mYbcmsRMDxeNYy+a9OjlvV5NBSFh5UPCnd2wjtyx3bSN1wMK4eRp qUzwgEP2X1DT7cUJRxHHf81Geof7i5wjUdkKpqJUx3kRoAIMyy5YBncLs3LiZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750684953; 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=KU83t/WeYeq3Mo3s08BEwqWLxSLsHbykBRnGA+tDW18=; b=gJEWsXUIAl2jmTOS0HDNm2B838IbRIxHMbp5XtV36/2E6ywA96Zjm2LOM5hu1M1cpSWSAY PFCCVfIC4betCn1PwLyXWTsF+N04GvwJhG11NUytEwphS7LvyF078rTtw9AN6/h9o5JJmO TDJ4OufvYIoPlVjI/yWR0zQ1NFtFJ9ZgEg8ctKG5sl+IABhhMf+Zvt4kkkVfDV26fS1D+l 5mJNV/LIyiHJnZC6eHxbv534Y2fXxHNSD8PdSu334chNMYiepZa+dZEra+yd/KiMZfz9jX U+tFtq7zu2YkaXY7GV9Rn1UWhEIKzjBXk9e9CLpXuRL3Ts9hKtiLIYWaJS41uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750684953; a=rsa-sha256; cv=none; b=EyMGX4uBrTCPFCCGqIkKaY2z99QFP7RfhjZiqZSj55ewpydi1fpf+S1ewMJgSlqDODHCYU bSkX3rFZk18TDuUFTFpnL8+dMOJwFKhv662eKO8Uonl8K5Zqs3vG97ubeJt76AlP8I25IU cN654dXbuarnGxxSaNL+ot4Zmn2gsyTfno2p7HzFI+0B9H2moFb5IY3zdcSLGL4oMCN1Lw EpeiN8nNEyybH+bK++Dwf/JMw3315ezxzxwkM2pV4/pff4K8O7x/syye44rwnhxiWjC7pd hhS/3xhttJHqKIH3S/TvFR3A69zecFnTPp75yTaTy9uXy0p6FBCEUyKoaAfhiw== 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 4bQpfK1TWmz14VK; Mon, 23 Jun 2025 13:22:33 +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 55NDMXMP007934; Mon, 23 Jun 2025 13:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NDMXX4007931; Mon, 23 Jun 2025 13:22:33 GMT (envelope-from git) Date: Mon, 23 Jun 2025 13:22:33 GMT Message-Id: <202506231322.55NDMXX4007931@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2669d26c6436 - main - intro.7: Reference tracing(7) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2669d26c64365c6e7f2e7cb17c07f91166786b2d Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=2669d26c64365c6e7f2e7cb17c07f91166786b2d commit 2669d26c64365c6e7f2e7cb17c07f91166786b2d Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-06-23 13:20:56 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-06-23 13:22:12 +0000 intro.7: Reference tracing(7) --- share/man/man7/intro.7 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man7/intro.7 b/share/man/man7/intro.7 index be6f68556895..d889c2dd299f 100644 --- a/share/man/man7/intro.7 +++ b/share/man/man7/intro.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 18, 2024 +.Dd June 23, 2025 .Dt INTRO 7 .Os .Sh NAME @@ -81,6 +81,8 @@ statistics utilities available in introduction to the .Fx Test Suite +.It Xr tracing 7 +introduction to tracing and performance monitoring facilities .It Xr tuning 7 general advice on tuning .Fx From nobody Mon Jun 23 14:45:15 2025 X-Original-To: dev-commits-src-main@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 4bQrTl58Fxz60Q3B; Mon, 23 Jun 2025 14:45: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 4bQrTl1svJz3b4C; Mon, 23 Jun 2025 14:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750689915; 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=HFVGTPuF4jZk1HAGgctDjX9EbC5r+S9jtrXHHazAxP4=; b=DvaszQqTH0pktqo2OGBEvxnnFwVXjuZa2fFgCoXisHVFBKJKffcBcof+wb0rz41ObAdVOV Kbj+tqy0t4x7ba525n7kjtHhlaOiCUmbkwCHQYCeU07Zjr4/WxUCIcbSrXDEzAB/m7z35S ctvdZc3JdOUFqEJmyodrnUAC7HFp/YK/qiPrNBeAjjSbeOL1T13XxbumXHUYt6Yz2w2EgR YVoL6J3Kh+DuElDPADormijT0BmVyUAFm6FRSzTcA6hI5Uamr7kzWfQn5EC/4UU79CVQbU 52Ryi1yepXFxx29MyPQKWCd3xq1OSjIHAgVul6XI/X3803Z+aSGB6SbUraPfDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750689915; 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=HFVGTPuF4jZk1HAGgctDjX9EbC5r+S9jtrXHHazAxP4=; b=DjLdf7iPZLGox7xhy0+CtpCuc5pp8SUEfc0LUWjcIXNudj8pEvydG84wC3f2k3moqrDh37 9coSepnEjYlERPX/BOaX5z4Mj6zcRDsM/jrvCtprU1s0sTU8FdUlMQ7h71v77kUB9Gcxs6 3s9yF1q7uvKca5oKwx4tMTR1jDOF/cj9KuWAl5lDV19093ALUZWOeUPnLc+Ax/uk7t2kWJ ZYfxIg8NEaeLc+G6wI0KRBrLukCIzKdidxb/wFhl7pTnlPKV/B5K3pNk/u3HnTwsCD8wbC 4wJaJGrr1UjGXtMuVPCNbYEW7T2HE376f0IRByFNDjWQrhrkQ1rqe1U2skAmvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750689915; a=rsa-sha256; cv=none; b=iGkSBiakjb3w8bXlNESPhXzGxaP20g3beMF1ssE5/OkHWdbApYYJn1/hCPHF0LckJYTvW1 ai4fO5r3uie8ZHWOIzXyRtgvsVcZhGO8YH4lCLAUlSwgfmxGLkJ8bvrJ1OG/L8zQfieh9b pKLZGWdltwgTd2wB8GmbSQQT8fZB79549sYkvjGTew9fkLLTH/T2+NSG8Ms6kSYIMLm5RS I/lDITvMHCjU07MRMX5o3c24FJitcP/2QgCptXBaOq7htlwcJYUD+IHYnYYuu7tVgTgvTW JHQoCQ5nSEKbtTbxdhxzp5SsN5Qg6atmCW08ldJxFCImuLmRpL2Sy9s/SPKvyg== 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 4bQrTl1Mdqz16N7; Mon, 23 Jun 2025 14:45: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 55NEjF8q058813; Mon, 23 Jun 2025 14:45:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NEjFeA058810; Mon, 23 Jun 2025 14:45:15 GMT (envelope-from git) Date: Mon, 23 Jun 2025 14:45:15 GMT Message-Id: <202506231445.55NEjFeA058810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3f494a4e5ce0 - main - release: Add NODISTSETS to skip legacy dist sets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f494a4e5ce005c04bd96ef75e52cca0fbaaa05f Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3f494a4e5ce005c04bd96ef75e52cca0fbaaa05f commit 3f494a4e5ce005c04bd96ef75e52cca0fbaaa05f Author: Ed Maste AuthorDate: 2025-06-18 18:46:10 +0000 Commit: Ed Maste CommitDate: 2025-06-23 14:44:14 +0000 release: Add NODISTSETS to skip legacy dist sets `make -DPKGBASE -DNODISTSETS` can now be used to build an installer without any support for dist sets. Reviewed by: Isaac Freund Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50919 --- release/Makefile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/release/Makefile b/release/Makefile index 4de2fe5264a6..5875a22a5bfd 100644 --- a/release/Makefile +++ b/release/Makefile @@ -21,6 +21,7 @@ # Variables affecting the build process: # WORLDDIR: location of src tree -- must have built world and default kernel # (by default, the directory above this one) +# NODISTSETS: if set, do not include dist sets or MANIFEST # PKGBASE: if set, include pkgbase packages rather than dist tarballs in # disc1 and dvd1 installation media # PORTSDIR: location of ports tree to distribute (default: /usr/ports) @@ -179,6 +180,12 @@ packagesystem: ${DISTRIBUTIONS} sh ${.CURDIR}/scripts/make-manifest.sh $$(ls *.txz | grep -v container) > MANIFEST touch ${.TARGET} +.if !defined(NODISTSETS) +disc1: packagesystem +bootonly: packagesystem +dvd1: packagesystem +.endif + .if defined(PKGBASE) PKGBASE_REPO= pkgbase-repo PKG_ABI= $$(${PKG_CMD} -o ABI_FILE=${.TARGET}/usr/bin/uname config ABI) @@ -188,7 +195,7 @@ pkgbase-repo: mkdir -p pkgbase-repo ( ${IMAKE} -C ${WORLDDIR} packages REPODIR=${.OBJDIR}/pkgbase-repo ) -disc1: packagesystem ${PKGBASE_REPO} +disc1: ${PKGBASE_REPO} # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -211,6 +218,7 @@ disc1: packagesystem ${PKGBASE_REPO} mtree -C -k type,mode,link,size | \ sed 's|^\.|./usr/freebsd-packages|g' >> ${.TARGET}/METALOG .endif +.if !defined(NODISTSETS) # Copy MANIFEST to provide legacy dist checksums in both modes mkdir -p ${.TARGET}/usr/freebsd-dist echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG @@ -223,6 +231,7 @@ disc1: packagesystem ${PKGBASE_REPO} echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \ done .endif +.endif .if ${.MAKE.OS} == "FreeBSD" && (!defined(NOPKG) || empty(NOPKG)) # Install packages onto release media. ${PKG_INSTALL} pkg || true @@ -245,7 +254,7 @@ disc1: packagesystem ${PKGBASE_REPO} echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG touch ${.TARGET} -bootonly: packagesystem +bootonly: # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -256,11 +265,13 @@ bootonly: packagesystem MK_TOOLCHAIN=no \ MK_RESCUE=no MK_DICT=no \ MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no) +.if !defined(NODISTSETS) # Copy manifest only (no distfiles) to get checksums mkdir -p ${.TARGET}/usr/freebsd-dist cp MANIFEST ${.TARGET}/usr/freebsd-dist echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG echo "./usr/freebsd-dist/MANIFEST type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG +.endif .if ${.MAKE.OS} == "FreeBSD" && (!defined(NOPKG) || empty(NOPKG)) # Install packages onto release media. ${PKG_INSTALL} pkg || true @@ -281,7 +292,7 @@ bootonly: packagesystem echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG -dvd: packagesystem ${PKGBASE_REPO} +dvd: ${PKGBASE_REPO} # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -300,6 +311,7 @@ dvd: packagesystem ${PKGBASE_REPO} mtree -C -k type,mode,link,size | \ sed 's|^\.|./usr/freebsd-packages|g' >> ${.TARGET}/METALOG .endif +.if !defined(NODISTSETS) # Copy MANIFEST to provide legacy dist checksums in both modes mkdir -p ${.TARGET}/usr/freebsd-dist echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG @@ -313,6 +325,7 @@ dvd: packagesystem ${PKGBASE_REPO} echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \ done .endif +.endif .if ${.MAKE.OS} == "FreeBSD" && (!defined(NOPKG) || empty(NOPKG)) # Install packages onto release media. ${PKG_INSTALL} pkg || true From nobody Mon Jun 23 16:21:13 2025 X-Original-To: dev-commits-src-main@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 4bQtcV1wHQz60VJ2; Mon, 23 Jun 2025 16:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQtcV18TQz46f9; Mon, 23 Jun 2025 16:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750695674; 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=/8BxXlSJL5D5O8oz2NVHmGf0YO+9tyjnjA8fFdBElho=; b=PdQutrNbRqDVtOT9Xh/6NRA/iLUV6cOifsQ89PD2v/CM5fsMBkEvszU6hS9WnLpWcn43It QNF+wUmh4jdCmMBbvi/AzJB/mEaMM9KRmOolNGJaZ2FLRbgMIiG1Z2bOYXRbr2TpZ3R4zx IjGbOzRWy2jPtUGqemGGeVlLNCQmYd9eIG/57MbQBnV8JOe77I6ANvtzLgzdKt0SkL+lt0 bpsc35y/jwNS3iftPEQW00t8xPi0cYw6uxqi4QTzp/BuRexuPBpY8sve81gdKOEG1AK2ee zI6O38FbGgFqYbEu83KbJQVMG6+vv2HB4dL7qzdbAFJlVjq3T9vttC26AxRUKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750695674; 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=/8BxXlSJL5D5O8oz2NVHmGf0YO+9tyjnjA8fFdBElho=; b=Ko4LjSfFPr6d8CH2vvcJQ25p9AwpZZhKkV+xGPPTA6B9+gra5p70vqY7kdiN9ZSfjv/Opz mOh9yJGvOu9hyk43iFkl50UhWmpB6TSgsvksv4qOVSp+zapxqbg0NYyi5f8RO6Mk2L1hvI WsAXkg1rHROZF5bfLyTAeJzY67zd1NO/+FcyXMVeTCDJIKizKb9B0SMrg0YgctP3w3alEe 67fZlUEg5KY98Cd8CVHDSNuO8Bl03A8PKqxPajtsrnkoWiraPZPy+FDTtS/qIR4knoqssn NMpvI+x3XvYsvYhkYXnpl4oVMi+NjOHXCeXduke5qPLyeLNDbVVEG5bH+3+Gng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750695674; a=rsa-sha256; cv=none; b=cuQX8Uy/vzzwwku/R0dPX8sJcY3x14QdZHaU7WdMMkjo0kdJAO4VaKAAXhSl98qDNtyDyw SLaibEYlLud0J1BqAkcKLtxdKPQweBOmNvl/uRRaKJro410FkeM0N8kMCHc7aDfmB0B7VF fjjck+yJAX4Dp+cu6B3jstl+oASFrBUxP0GBz51V43MOb8znWG2gjDILmM0Ohx655Wj68k 6agHT3iPBMW7Gr/2SPg+RBgIqQKDL4HGYyDODd8i5gmwqjU1zhDaXO057XnzNyJr8s3UUv S1nkc4i1dAR7q/gMuP5YzfP7vIJ+TRZXFA0iS3ctilJoB2HF7xRdVA+xC42ZkQ== 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 4bQtcV0g7cz18Z5; Mon, 23 Jun 2025 16:21:14 +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 55NGLDGa041538; Mon, 23 Jun 2025 16:21:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NGLDoq041535; Mon, 23 Jun 2025 16:21:13 GMT (envelope-from git) Date: Mon, 23 Jun 2025 16:21:13 GMT Message-Id: <202506231621.55NGLDoq041535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 60f970b85e44 - main - krb5: Fix install /usr/include INCS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 60f970b85e44644d76daa4faa8a8d45e490dbde1 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=60f970b85e44644d76daa4faa8a8d45e490dbde1 commit 60f970b85e44644d76daa4faa8a8d45e490dbde1 Author: Cy Schubert AuthorDate: 2025-06-23 14:21:05 +0000 Commit: Cy Schubert CommitDate: 2025-06-23 16:20:26 +0000 krb5: Fix install /usr/include INCS Build and install of subdirs does not need to include bsd.subdir.mk. As with include/, copies must always be built. And installincludes is placed after bsd.prog.mk. Reported by: fluffy --- krb5/include/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/krb5/include/Makefile b/krb5/include/Makefile index ee086e1ea07d..fb919434bf93 100644 --- a/krb5/include/Makefile +++ b/krb5/include/Makefile @@ -17,8 +17,6 @@ SUBDIR= krb5_private krb5 gssrpc gssapi SUBDIR_PARALLEL= -.include - INCSGROUPS= INCS COM_ERR VERTO GSSAPI_KRB5 INCSDIR= ${INCLUDEDIR} @@ -45,7 +43,6 @@ rebuild-error-tables: ${K5_ET_HEADERS} force: stage_includes: copies -installincludes: copies SDESTDIR?= ${SYSROOT:U${DESTDIR}} .PHONY: force rebuild-error-tables osconf.h @@ -61,7 +58,7 @@ VERTO= verto-module.h \ .PATH: ${KRB5_DIR}/include/krb5 -copies: +copies: .PHONY .META cd ${KRB5_DIR}/include; \ ${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m444 ${INCS} ${SDESTDIR}${INCLUDEDIR} cd ${KRB5_DIR}/util/et; \ @@ -71,3 +68,5 @@ copies: .include + +installincludes: copies From nobody Mon Jun 23 16:30:21 2025 X-Original-To: dev-commits-src-main@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 4bQtq50l9vz60VrP; Mon, 23 Jun 2025 16:30:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQtq458pvz4CYL; Mon, 23 Jun 2025 16:30:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id TfuBuTopv5MqyTk3ruu4IG; Mon, 23 Jun 2025 16:30:23 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id Tk3qujh1YJhBPTk3rux2nj; Mon, 23 Jun 2025 16:30:23 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=6859811f a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=VanQiltTAeBbaUYDtakA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id EF390199; Mon, 23 Jun 2025 09:30:21 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (Postfix) with ESMTP id B603E15F; Mon, 23 Jun 2025 09:30:21 -0700 (PDT) Date: Mon, 23 Jun 2025 09:30:21 -0700 From: Cy Schubert To: Dima Panov Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: <20250623093010.71b18c87@slippy> In-Reply-To: <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> Organization: KOMQUATS X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfMG3UqRDib59CrLPQQ/QqbIXW2ya6cTXQTTR/r+xeyJEMK+zf4NY+AkGa+fwyvWRsPZZW0k36xyC87XLg7blu3uZ/d0wtxjjPt39BcJeStq2cQSQS3k+ tLJJgWCnV5Z9il+k3xHAruhNZ3Z5TXAMBLQEfzRtGrt+9HOQAwLUem2sn4tHdd3wlBXWBTeJoct57uHNN4ayXA+KXwY5dJTRbFVi3exjpax1j5TmNRePKQh8 XFYdqG2bpeKGmkhYN85lz29tiBrvX4aME7Dc9lqU4RrxlxpjH0BSDtN9TWwWAsQKvnmD7JgTQtYVhy/EUMksrCpRPFUceuiji8jhnpgSXZdykMvPv4IV6s8b HH2W/S6B X-Rspamd-Queue-Id: 4bQtq458pvz4CYL X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] Thanks for pointing this out. This has been addressed. We will forego the warning as upstream doesn't include a warning. I prefer to let upstream decide whether to display a warning. Your testing is muchly appreciated. Is this work part of portmgr's exp-run? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 On Mon, 23 Jun 2025 01:19:52 +0300 Dima Panov wrote: > Hello! > > > BTW, another suggestion, as follow-up solution already exist in security/krb5-* ports. > provide compat shim /usr/include/krb5.h with next content: > > #include > > May be also add guard warning as it was done for gssapi.h: > #ifdef __GNUC__ > #warning "this file includes which is deprecated, use instead" > #endif > > > On 20.06.2025 17:30, Cy Schubert wrote: > > On Fri, 20 Jun 2025 12:27:09 +0300 > > Dima Panov wrote: > > > >> Hello! > >> > >> > >> Looks like something missing after the build with MIT Kerberos. > >> > >> got this with devel/gvfs build: > >> > >> == > >> In file included from ../daemon/pty_open.c:70: > >> /usr/include/util.h:36:10: fatal error: 'k5-int.h' file not found > >> 36 | #include "k5-int.h" > >> | ^~~~~~~~~~ > >> 1 error generated. > >> == > >> > >> Indeed, k5-int.h is missing in /usr/include :( > >> > >> On 16.06.2025 05:51, Cy Schubert wrote: > >>> The branch main has been updated by cy: > >>> > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=7e35117eb07f86c385656ecc6a2a92093be98131 > >>> > >>> commit 7e35117eb07f86c385656ecc6a2a92093be98131 > >>> Author: Cy Schubert > >>> AuthorDate: 2025-06-11 02:57:54 +0000 > >>> Commit: Cy Schubert > >>> CommitDate: 2025-06-16 02:49:37 +0000 > >>> > >>> Makefile: Hook MIT KRB5 into the build > >>> > >>> Add tests for MK_MITKRB5. If "yes" build MIT KRB5. If "no" build Heimdal. > >>> The default is MK_MITKRB5 = no, added by "krb5: Add build plumbing". > >>> > >>> At some point we will change the default to MK_MITKRB5 = yes. A ports > >>> exp-run will need to be successfully run first. > >>> > >>> Sponsored by: The FreeBSD Foundation > >>> Differential revision: https://reviews.freebsd.org/D50815 > >>> --- > >>> Makefile.inc1 | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > >>> Makefile.libcompat | 4 +++ > >>> tools/build/Makefile | 64 +++++++++++++++++++++++++++++++++++++ > >>> 3 files changed, 157 insertions(+) > >>> > > [...] > > > > The attached patch will fix the problem. It contains two parts. > > > > 1. Don't install the offending header files. They were in my first cut > > of the plugins build and were not removed as I cleaned up while > > rationalizing the installed files with the port. > > > > 2. OptionalObsoleteFiles.inc removes the files that were erroneously > > installed. > > > > It is enough to run make delete-old to fix the problem. The Maefile > > patch ensures they're not installed again. > > > > My buildworld/installworld test is still running to verify nothing else > > is broken. > > > > Sorry for the breakage. > > > From nobody Mon Jun 23 16:34:24 2025 X-Original-To: dev-commits-src-main@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 4bQtvh6xqBz60W3C; Mon, 23 Jun 2025 16:34: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 4bQtvh3fpfz4F1D; Mon, 23 Jun 2025 16:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750696464; 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=gsIWCWqj5NWOzgevdmqIjQnx0IfKYbuyRta/Vh7sZw4=; b=qRaHEliGQnrtMTlMQh+TmFZvUPd5+XAWQdT8TTv7aNqLaJPmOuZ+DTBWPZRHPaB2sQnCnO ruNtUj52AeS6CImdtOvxtDsHcqrt+JPaHShGEl7Nb/4c6Rpn5pTaZpp/XljraOg3q1xBzz CloGaC2oReAN8llyn+cqAp/eyL0w+74FMTZT8XbqhZeYtCBq3yAwFoR70Qm+/1I9QqNwM0 TQHyRbQBVlAd6z9fyH7gmLfL9WN+hnZheO83QVo2H2xskPLHLDq+D5K27+OTh4oWvyhZYE uhTDs3klrzcAZg2UgG/KC1O7vwO5XZ0TLGaWuu6uQAUa7YzDcvcmA3enGNLoew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750696464; 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=gsIWCWqj5NWOzgevdmqIjQnx0IfKYbuyRta/Vh7sZw4=; b=bD2RplLrrYAAPOjEen4swUmBAguMZ1jMqMsnVD5kTgnYGdbcxpdUU4/o86DsSxTlbp0ksR r0wjtSMUDf8VwkCQfQFUW4h17bwQ/fMRhMuKYZGsUPx+otRxvoLTX9J1LsGDzy1q1o2MUq wcikGRm8SFM8iOcqXET0Rz17CH5WAoDPeLyviTUASqa1exJQY9BQ2uME5fLdQFOpArKTOO p/RXNOu9KaVmpsMbfnqoUSZaruZd16F8ZQLQ5kXETT4viW61BoebKsCpywxcTUzBnPTxuQ q3gG6/7HWDxpzE9jX0iqGizIAbZ4TeoA9Jq2TXlXQCAuzdHRO3APPtSCW60o+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750696464; a=rsa-sha256; cv=none; b=aFlPR2gdhx7qBAzpxIPHnm78sajZZAVKxpP+FE0wt62DX3jQpaABifa5fteLr+RFzCErGO 9N5stGVJvqFP/6tblAoSaw8EuVdLr2piETjl8uWkexoqwkE5t5nV9SLvhK8KL0qv08cqWZ g32EyZ5A8jgPHMD4S7gIMJKegiRr/J3ZEzjoHoDvGDtT7fuctq5iVeP0GIoeFxct3uoYKh wr0e/x+QbrwQBGFW0yezg0os8OzXG6Kvpx9ptu/84HVqxnXaRVMvY+4CC5g/UWVPnrJBDN XURKRYz6BOC2FExuQuzmlJzYltLatSVxdJO1t8BfJEDS9OZd+O4Hkn5V0Q73eQ== 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 4bQtvh3CwTz195M; Mon, 23 Jun 2025 16:34: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 55NGYOFD066221; Mon, 23 Jun 2025 16:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NGYOeq066218; Mon, 23 Jun 2025 16:34:24 GMT (envelope-from git) Date: Mon, 23 Jun 2025 16:34:24 GMT Message-Id: <202506231634.55NGYOeq066218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: fe55780e5f10 - main - arm64: Enable pointer authentication with QARMA3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe55780e5f104d05475726eba0b05236358a9864 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fe55780e5f104d05475726eba0b05236358a9864 commit fe55780e5f104d05475726eba0b05236358a9864 Author: Andrew Turner AuthorDate: 2025-06-21 00:28:56 +0000 Commit: Andrew Turner CommitDate: 2025-06-21 00:28:56 +0000 arm64: Enable pointer authentication with QARMA3 When the QARMA3 algorithm is used the ID_AA64ISAR2_EL1.APA3 field is non-zero. Include this in the check for enabling pointer auth. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D49710 --- sys/arm64/arm64/ptrauth.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/ptrauth.c b/sys/arm64/arm64/ptrauth.c index dd36e66c85bb..a943220d66cd 100644 --- a/sys/arm64/arm64/ptrauth.c +++ b/sys/arm64/arm64/ptrauth.c @@ -85,7 +85,7 @@ ptrauth_disable(void) static bool ptrauth_check(const struct cpu_feat *feat __unused, u_int midr __unused) { - uint64_t isar1; + uint64_t isar; int pac_enable; /* @@ -100,9 +100,6 @@ ptrauth_check(const struct cpu_feat *feat __unused, u_int midr __unused) goto out; } - if (!get_kernel_reg(ID_AA64ISAR1_EL1, &isar1)) - goto out; - if (ptrauth_disable()) goto out; @@ -111,13 +108,36 @@ ptrauth_check(const struct cpu_feat *feat __unused, u_int midr __unused) * it will also be available on any non-boot CPUs. If this is ever * not the case we will have to add a quirk. */ - return (ID_AA64ISAR1_APA_VAL(isar1) > 0 || - ID_AA64ISAR1_API_VAL(isar1) > 0); + + /* + * The QARMA5 or implementation efined algorithms are reported in + * ID_AA64ISAR1_EL1. + */ + if (get_kernel_reg(ID_AA64ISAR1_EL1, &isar)) { + if (ID_AA64ISAR1_APA_VAL(isar) > 0 || + ID_AA64ISAR1_API_VAL(isar) > 0) { + return (true); + } + } + + /* The QARMA3 algorithm is reported in ID_AA64ISAR2_EL1. */ + if (get_kernel_reg(ID_AA64ISAR2_EL1, &isar)) { + if (ID_AA64ISAR2_APA3_VAL(isar) > 0) { + return (true); + } + } out: + /* + * Pointer authentication may be disabled, mask out the ID fields we + * expose to userspace and the rest of the kernel so they don't try + * to use it. + */ update_special_reg(ID_AA64ISAR1_EL1, ID_AA64ISAR1_API_MASK | ID_AA64ISAR1_APA_MASK | ID_AA64ISAR1_GPA_MASK | ID_AA64ISAR1_GPI_MASK, 0); + update_special_reg(ID_AA64ISAR2_EL1, ID_AA64ISAR2_APA3_MASK, 0); + return (false); } From nobody Mon Jun 23 20:39:00 2025 X-Original-To: dev-commits-src-main@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 4bR0Kw6g01z5ymSR; Mon, 23 Jun 2025 20:39:00 +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 4bR0Kw4G5Bz3ndP; Mon, 23 Jun 2025 20:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750711140; 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=8T1Zcaa3keI6jgJPw5WcbAYyR+KeL+WYS8RgDODc5lM=; b=IEsXCjl5DVOMlYy5AhkjHse+PyJTX6UMKCjyyaYDxvR3J9QrhoWP2j8N++2Fax7wRK2Spr 5gZXEv1B7tyvg0T43yvsDgcH6FHAGJ+r1ZQwUnXzt+SSyhFwb7NHcLLta/wu1EYgfBYQrE meoqFnVGDapxkcE7tO1Fv1547eVdpebdaPEWZ66J2Jf/eXYqbblqOJY5pw7VVbEr9dYOl8 By/Dl/eWHjnLhoUnH8BSH9ouuMhSWIU7HDrpTcBqzHYgIrLUJdHR07IkpQ1ZV5zoZlbFgJ d2/fo4VO5xQ2vFKdYy4Lwu5GtSsrvFc4KJyuXm6FHGbj4vg7p2hdxslYiUpnZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750711140; 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=8T1Zcaa3keI6jgJPw5WcbAYyR+KeL+WYS8RgDODc5lM=; b=DtLF6ZPb1TmX9CFos2YscSch2SrPrDQxvac6ks271ErgZTwdotS1ESMA2BF0h+H3W6CV2G wXsfZJLLM2MYb1YXFNx1Y7HZT97Wp5U0X4eduUZ9bXgy3p0tM2/5rQ9MvDyh40453elZPv 1xbQNiC52S0eHe5AJRbd0Y8wX+Qkb2QnDV3pMhsYZfK0kTrU2N62QnG/B8LOBB8yuLpGPz PK4qH3dkN7ZHM6OCsOKgJjydDu2n8YyOayEMe6Ie5zdqhNw8aatLV6QMSr/3T+oRbFxONZ HoR7ZOoMO+laIyeKQyMaPQUD/o5nLrwxqWb/tu+7RTJH4EmPBHoRqzuOJKIVFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750711140; a=rsa-sha256; cv=none; b=ruVfq6C6PTto4PZwXDemwwpmHw4F4JBeG68jwuaobXJlvClLss5iQ4dsp1b0N8MnitfjtX +JphId0akiReKyHJ+oJ5kh/OlfWiBXDynQ6FdfetL0D2RP7MKoIVoAGWw4dqyiCSCSBYGS jRwcn/PdIxfbCveF24fTFzmkRT4bhIXOsphL0RKCMt0XSwTlMZEhPC/Jw0MACWkrx8gLGn 4w/XyNis3hKNmUWYKFpKrruCPaykwNLC7vwRGSzi17yaiqxANIFAMstLjaKS82I7j9pnRD m9HWDPyaE7kR5OaKFONfLfmmsmB0awrQFATHrov8Q7jczHfnsMpmcAJ0XmBOXg== 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 4bR0Kw3jpxz36b; Mon, 23 Jun 2025 20:39:00 +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 55NKd04O023327; Mon, 23 Jun 2025 20:39:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NKd0v2023324; Mon, 23 Jun 2025 20:39:00 GMT (envelope-from git) Date: Mon, 23 Jun 2025 20:39:00 GMT Message-Id: <202506232039.55NKd0v2023324@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0e0df1fc6753 - main - cp: Fix improper use of O_PATH. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0e0df1fc6753567c0ba1dd81859073b5d59a5a33 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0e0df1fc6753567c0ba1dd81859073b5d59a5a33 commit 0e0df1fc6753567c0ba1dd81859073b5d59a5a33 Author: Dag-Erling Smørgrav AuthorDate: 2025-06-23 20:38:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-23 20:38:50 +0000 cp: Fix improper use of O_PATH. This does not appear to make any practical difference at the moment, but technically `O_PATH` means “I'm not going to use this descriptor for any other purposes than vnode lookups”, so using it to read the directory's ACLs is improper and might fail in the future. Fixes: 82fc0d09e8625 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50984 --- bin/cp/tests/cp_test.sh | 18 ++++++++++++++++++ bin/cp/utils.c | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index f06238c89367..d5268ed4c4c9 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -183,6 +183,7 @@ atf_test_case pflag_acls pflag_acls_body() { mkdir dir + ln -s dir lnk echo "hello" >dir/file if ! setfacl -m g:staff:D::allow dir || ! setfacl -m g:staff:d::allow dir/file ; then @@ -204,12 +205,21 @@ pflag_acls_body() atf_check cp -rp dir dst4 atf_check -o match:"group:staff:-+D-+" getfacl dst4 atf_check -o match:"group:staff:-+d-+" getfacl dst4/file + # source is a link without -p + atf_check cp -r lnk dst5 + atf_check -o not-match:"group:staff:-+D-+" getfacl dst5 + atf_check -o not-match:"group:staff:-+d-+" getfacl dst5/file + # source is a link with -p + atf_check cp -rp lnk dst6 + atf_check -o match:"group:staff:-+D-+" getfacl dst6 + atf_check -o match:"group:staff:-+d-+" getfacl dst6/file } atf_test_case pflag_flags pflag_flags_body() { mkdir dir + ln -s dir lnk echo "hello" >dir/file if ! chflags nodump dir || ! chflags nodump dir/file ; then @@ -231,6 +241,14 @@ pflag_flags_body() atf_check cp -rp dir dst4 atf_check -o match:"nodump" stat -f%Sf dst4 atf_check -o match:"nodump" stat -f%Sf dst4/file + # source is a link without -p + atf_check cp -r lnk dst5 + atf_check -o not-match:"nodump" stat -f%Sf dst5 + atf_check -o not-match:"nodump" stat -f%Sf dst5/file + # source is a link with -p + atf_check cp -rp lnk dst6 + atf_check -o match:"nodump" stat -f%Sf dst6 + atf_check -o match:"nodump" stat -f%Sf dst6/file } recursive_link_setup() diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 3e669b4b513d..cfc0f0f12603 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -458,7 +458,7 @@ preserve_dir_acls(const char *source_dir, const char *dest_dir) { int source_fd = -1, dest_fd = -1, ret; - if ((source_fd = open(source_dir, O_PATH)) < 0) { + if ((source_fd = open(source_dir, O_DIRECTORY | O_RDONLY)) < 0) { warn("%s: failed to copy ACLs", source_dir); return (-1); } From nobody Mon Jun 23 21:54:28 2025 X-Original-To: dev-commits-src-main@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 4bR21061Q9z5yr22; Mon, 23 Jun 2025 21:54: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 4bR2104Z65z3W57; Mon, 23 Jun 2025 21:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750715668; 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=oHixIfNmgA9LOz5VHDCNpN468m6cwREULlajE1ooCY8=; b=iPzoRpR9MnQqTnVsz27MU7l00atC8YXsdIsW71FzfNZtoeorjuIGwXXxWr12rfAGz1xg9+ Blktk50fY8kzh8s/ptkiN/txwAFhoHYY5S9coHYfvQpE6YEQsB41rB1+QjhU3MK1C2N0CW jCcIiL6MCuUE8MZA91z7gSlDSMgvUSPWJ0aOsYGbtvTz5Fjv9TMLD0ttbGg4fG4g9N6Jmm AdRH2Ma9Yi0ILknAc3dAsOxaKkry001NXhm/9H30JGvDkzbbzLWOe1JZfGbtzfAFBVIBne VyWLoMZv7YED+5ONHHsVX1fVLgw6LurJX26hwfI4eEBWea3CAcTLn2zch70kZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750715668; 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=oHixIfNmgA9LOz5VHDCNpN468m6cwREULlajE1ooCY8=; b=yNHmtPxKN4ykWMuR85ZmnDYAE4jsFjoFj5EaXA5WFQluUDjtH5gOJSwqkZBDOK5VrnFvdk /nBR7XkIikhP+TTHarsqE5bHbvQDimmsVDh7ijZmjkljvl8CxvNFqtBRvpusTvC4z6+eyG Nj+/blBPg++mX/mLqHRFWFk7bYIZNTBwZ8lqcXs1SUgvQ2OPQDEo/l3518h7rawvFUCzLk 3lucHZvwdDfTRIYopuGJ9K17ig4raFl2BWjt2DZhRH7ZLIYTaKALrjQBC+QhwFnYU/YMIM V0K6CG6Dc4noQBTSUfmSntS6z/o+vP9EWdwvRd5+Gv7aiUs+mczZYClxOdjveA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750715668; a=rsa-sha256; cv=none; b=tlLCRVh9eQpPJ70tHA/hjMILMJ8xQgzlNdW5XI6c8w1hgisqV4rcof57RQ1Y/UJkYyCROF pAuw75ClWtuCSmUoXOpeY69kdtihvLbcBMpL8zhTL8ZLffp1siAuo9D6w5wx8acYqsxgXc O9D6ghud6R1LAHEVtHLPyFfpgXRTQsMiN+kz3+0oCdIGk3C9MAZmVFIXedSi/6Qgd+KLzs d5J2qP0yzV6g3C1Avzp4F71NZzIbmlQVKZgPs+ldKii59oPudC2sIewc4JfjKx7X0J2341 b0J7DiRiY60mob9BOvymbdfwMe5MAdoN++XFYRYvKtd2SpqtsWP3TcAJPP947A== 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 4bR21044HPz5B9; Mon, 23 Jun 2025 21:54:28 +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 55NLsSXk071377; Mon, 23 Jun 2025 21:54:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NLsSIs071374; Mon, 23 Jun 2025 21:54:28 GMT (envelope-from git) Date: Mon, 23 Jun 2025 21:54:28 GMT Message-Id: <202506232154.55NLsSIs071374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: 81e6c0168d46 - main - lindebugfs.c: Fix possible NULL dereference List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81e6c0168d46b0f5d5d4c5d0405caca8da24c35e Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=81e6c0168d46b0f5d5d4c5d0405caca8da24c35e commit 81e6c0168d46b0f5d5d4c5d0405caca8da24c35e Author: Jean-Sébastien Pédron AuthorDate: 2025-06-18 20:32:13 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-06-23 21:43:51 +0000 lindebugfs.c: Fix possible NULL dereference If `debugfs_destroy()` is called early as part of error handling during initialzation, `pn->pn_data` is unset. This led to a panic in that if because `dm` is NULL. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50985 --- sys/compat/lindebugfs/lindebugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c index 97f73e79fb6c..50f9377ffec3 100644 --- a/sys/compat/lindebugfs/lindebugfs.c +++ b/sys/compat/lindebugfs/lindebugfs.c @@ -104,7 +104,7 @@ debugfs_destroy(PFS_DESTROY_ARGS) struct dentry_meta *dm; dm = pn->pn_data; - if (dm->dm_type == DM_SYMLINK) + if (dm != NULL && dm->dm_type == DM_SYMLINK) free(dm->dm_data, M_DFSINT); free(dm, M_DFSINT); From nobody Mon Jun 23 22:33:27 2025 X-Original-To: dev-commits-src-main@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 4bR2sz5fKRz5ytVw; Mon, 23 Jun 2025 22:33: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 4bR2sz4dcmz3v41; Mon, 23 Jun 2025 22:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750718007; 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=GQV+ymco8F1G6qQhzRYph2p1fN69kFp9d8heQE6FUsM=; b=M7VCmFLafbqAfnjf8Hw69WSxKej/HtnhQzOjmeYyQ3Ur6+ETmTVc9VD491u+V1v4/+tNWK 4oPMWZ22cK4yPMOmQ3gfl1Hk6Z50ISwzyLuxDEbCIba5wohya3nNq4CdMePemecBaMRYc1 y+m932U6D4qGaQE33ntz5N9SeHv3QXFfXFS72gqS0y/ZUlj4H5CaI4u4O0HVQCsa/HkQQs QRkpNr5nyvIn/faROTIH1tNMWKTJXWLI4boZJ9GXQNLwcYsXsIg+4Nyw8EPbjq1jHp4Y4J UXYU7LllMX3beu3A8Gi3BBtk9CNYhzgXPPRotWYW4FnczYRj+ydsm9/iiSo8bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750718007; 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=GQV+ymco8F1G6qQhzRYph2p1fN69kFp9d8heQE6FUsM=; b=dkpiOTcNB4i1lFsUsjVXG1echP4yQA3wSR6rwi735NXQYjX90kKY3w1RPg1npCbke0u4un UQ2VNtQZGWJphFTmdhwD31Za/tG3RBcfOpQ6EpFBGqM6dxc50iLD2lQpmaud5nYvJpMtpd yPa1rCZlB11Y7uMP1fiNyRrgwL6j5uZeOJgKnU6c4/1sNW+VSSeuit2bD0OsgimaUfwBYN 82jquS6IgTpy5SsTPUMT1ZnDjUZac3/9AzsA5Y57ESkdUAl5o44aK3lvGZ6/e3lP+Iy918 NFkyF20xVVllQo+AHPPwVqMNMoRy0Mr9KhQHxBcItr+HN5nt+BrmKvF/16hfqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750718007; a=rsa-sha256; cv=none; b=juN25KkqxJHyeu8KasC9yj49YCZ895YijwEVgilNcSbBjbaI0HpxuIjlbkV3+N3KcDIxZm 9NSrgBe0Iq71I8dXPyM93/xrEmSJwZMfjfmrhQkt+AaQW0b/td/oCJfrRlsMoQt63iuzH0 YrS5vSA+JxlIlDtC1x7T9UVLTtgUQ+WIXlCHemuiLvVUAvtE5RGglAipdNxBWWtoCUMIIi DatkFxhDMGy6nYCMTpxfeE+BDdbD/VGh7mFgOZQNDlUUKmlOKrVPezXpUoCwFsqKJMMjtz vjlZqd5fEucXOprTFIHbGhjE50kFPR5O0tX7ELYkZ1u7mgRsEmP4B+88fPTISg== 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 4bR2sz4Cccz6FZ; Mon, 23 Jun 2025 22:33: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 55NMXRWK047743; Mon, 23 Jun 2025 22:33:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NMXR3d047740; Mon, 23 Jun 2025 22:33:27 GMT (envelope-from git) Date: Mon, 23 Jun 2025 22:33:27 GMT Message-Id: <202506232233.55NMXR3d047740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: cf16d65c2e3a - main - linuxkpi: Define `div64_ul()` as a synonym to `div64_u64()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf16d65c2e3a7099319447f7ac464b9839af868b Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=cf16d65c2e3a7099319447f7ac464b9839af868b commit cf16d65c2e3a7099319447f7ac464b9839af868b Author: Jean-Sébastien Pédron AuthorDate: 2025-06-18 20:35:49 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-06-23 22:07:56 +0000 linuxkpi: Define `div64_ul()` as a synonym to `div64_u64()` Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50986 --- sys/compat/linuxkpi/common/include/linux/math64.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/math64.h b/sys/compat/linuxkpi/common/include/linux/math64.h index cae5e30b08df..a216d350570f 100644 --- a/sys/compat/linuxkpi/common/include/linux/math64.h +++ b/sys/compat/linuxkpi/common/include/linux/math64.h @@ -61,6 +61,8 @@ div64_u64(uint64_t dividend, uint64_t divisor) return (dividend / divisor); } +#define div64_ul(x, y) div64_u64((x), (y)) + static inline uint64_t div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder) { From nobody Mon Jun 23 22:33:28 2025 X-Original-To: dev-commits-src-main@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 4bR2t11S7Jz5ytJ7; Mon, 23 Jun 2025 22:33: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 4bR2t059L0z3v7X; Mon, 23 Jun 2025 22:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750718008; 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=4wG5eNsX6Dqm+2WHbkitL1u5SkEc/MhUSuPhf3TbAA8=; b=ucH8xl/pNXnRbIqkRgvwChswSZ4xP+q81GL0OuCzBAhzM3awqdjE51yzXTx0SzQ6PrFAVS dYMq7FkVfqSreAs+hcknf2VdsKDGCDfY4LSqkGxQZrcjt8JQZ8PJ3qVVqr/tX3jPtZZJfx WlpVPBsNNlzl1GublRpiBSCAmbOnfC59s/3rAWd6v9inbyi+LFh30alMB/G466FxSkPRVg QmQydk80wChxvcU3CT8LhbI8tFNe6LdGz9WYBXYyk1Y/RifSXgdnyt0HVD4GS9tzRxaFv2 iCm/Tl+ka+cA12PxpAb6+k9+n40mN2UT1FjQNZrYESKIZlrsCjcL5dtg2NcTHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750718008; 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=4wG5eNsX6Dqm+2WHbkitL1u5SkEc/MhUSuPhf3TbAA8=; b=S+HB48eGyre0HAeUgYCLfmloM61RbfSwEwgTX+gHma03HqHOVr4NYmGAC3XS4BQgz+lGVd Z/4pCG4FZxB4q25+x69hiV37kNcd3Qt/280kREIFAyjOeXALFYaDoE5JPuwopFnkjrUTj0 OA875kjUxP6VtkY3Rju5RaP6RQBnH83VUTxg2s7Di0wYdKy3wtwBFIBXMqrCj1AlTXrSv1 XJwdzK++uv04H4ZVJFAQykaGryXXRI3zBs6NlF8Cuc4PNfegGxK7VdXComVZzCkP/vZtLu 6ZnY+ASTwvJ2+hJe5LSfTzoEDXsupDH60e7tb3T9CB0eY8Azt2qcsMR83LMvPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750718008; a=rsa-sha256; cv=none; b=afR6Lz5KMhRtHy0q+FAEx4ErmSK5F/sL4GSpAmmnBnf0DjbwhfpvYwxtc0BBqELj12jjz/ VZNMvgvQLLcMEC7bJDAmTTenuByvc3hM2UoXvu2rvV4yX2R/KqOTC/5CaaLQsruyHRzwuw GeJnGBfWt6D4BB+6A0ml1Npq+FrWNnAOrACjtPyU1lN++gmYq6EUXpJZs/tcQUQr0FfHj5 hCOhhQbQzNC/LRj8drzeWpGDcnUOtM5SqJVN9qdOWLIUs8iuj4xu9PZeLSJa0Z5crBfUBF SO5z6cyFB9QINXx+k10KoCx4JAPTEMn3sO7IvYN7h6RzdNcKRxcorJb9C2gNDg== 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 4bR2t04gMNz6Jd; Mon, 23 Jun 2025 22:33:28 +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 55NMXSFw047783; Mon, 23 Jun 2025 22:33:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55NMXSao047780; Mon, 23 Jun 2025 22:33:28 GMT (envelope-from git) Date: Mon, 23 Jun 2025 22:33:28 GMT Message-Id: <202506232233.55NMXSao047780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: 1609b4d45610 - main - linuxkpi: Add `pm_runtime_get_if_active()` variant from Linux 6.9 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1609b4d456109ac2ec70bd1b38c559f13160f632 Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=1609b4d456109ac2ec70bd1b38c559f13160f632 commit 1609b4d456109ac2ec70bd1b38c559f13160f632 Author: Jean-Sébastien Pédron AuthorDate: 2025-06-20 19:06:23 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-06-23 22:16:04 +0000 linuxkpi: Add `pm_runtime_get_if_active()` variant from Linux 6.9 With Linux 6.9, `pm_runtime_get_if_active()` lost its second `bool` argument. This change is put behind a check of `LINUXKPI_VERSION` to keep compatibility. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50991 --- sys/compat/linuxkpi/common/include/linux/pm_runtime.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pm_runtime.h b/sys/compat/linuxkpi/common/include/linux/pm_runtime.h index 616dd508e562..6114b7b159d7 100644 --- a/sys/compat/linuxkpi/common/include/linux/pm_runtime.h +++ b/sys/compat/linuxkpi/common/include/linux/pm_runtime.h @@ -34,8 +34,13 @@ pm_runtime_get_if_in_use(struct device *dev) return 1; } +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION < 60900 static inline int pm_runtime_get_if_active(struct device *dev, bool x) +#else +static inline int +pm_runtime_get_if_active(struct device *dev) +#endif { return 1; } From nobody Tue Jun 24 01:11:27 2025 X-Original-To: dev-commits-src-main@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 4bR6NH6QhLz603NP; Tue, 24 Jun 2025 01:11: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 4bR6NH28KKz3NPG; Tue, 24 Jun 2025 01:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750727487; 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=1NN6uz+Lgy1+Dp3d5s6VektdRyAhw70f2eUk3vzUPTs=; b=KpkgByD81gOgrBUJbSjQYUjcFFrxXuNAIcVjf3BqjGvjEOZ1g8j1p7EzlYQdw3NpSK351L TPxUz8v3NWBU1vbVY1TOlcGwROg+wWmkfVQNnhXDg6pc/wQvZjmxAV4dtIRh2tckNI3bJC vwZNUFzXPWXeAT18MOkV3LjV3lt/1LZUIu569G2uOzx+fioMDCBTHkFC4DClmRF0oLw6Ua n0Umu7AwQlrlftNO92JDuWWkOcBIPptVtt/M8kR3ZqZIB1Bx2zZbES7o59tQFOHG9v0uaZ qzWCLI0w+eygG+7kkFeK7+iE3Pb7XFkz1bpeRIwOpkeV9WPCQ2AX7T6muI/hag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750727487; 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=1NN6uz+Lgy1+Dp3d5s6VektdRyAhw70f2eUk3vzUPTs=; b=IaooxTdBHhulV9z31tvLt4qRSGuxAB/foo3gsi3D8kVcMuhMW2skbE2Olh8/tzUL1kUQYS MQnHDO1q3y6mBtKt/cmW6QtbLyJsPIEhe3bqujvBaN1EHFaX4bj+tfyV2/PYqgwe1T1dBA zpdZ3GvttQ16sDFyb82mp+7GNfJHRo4u2gUzQ++nDkyFOZ47tARQF1S3wPd6L1evZeVGCH goJNCuuaiJzu4txUzbeFn7cO9CHMSkdVprdBfxTbEJvcnuqkPLC3nscyWtEAQmJ6gEOqq5 kWEc+03JeqMXtanPUPb7Th6qxCyTFjDdAu48zgs7pZ1oIASD/0clwWTp0x1UgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750727487; a=rsa-sha256; cv=none; b=UPa9be5RjECL1n3J9qE3UlG9EdyEoaZTBl3pxdBf8ZPBwqmmharAyrK+IevcoNW3dnKOuY AXgvSs7F2TK2JMioPuO6O4dzQU5Bzni3D2/425hX9e4GD8GbGGjVLXFoFjBM6oESmclri6 F8YrS6AiJHbGI+bNOTU87mvQtSoFZz6hE3urLLgmCtA4ww7eVal/mA92A36SSXRIfuLjoe K/Xue1U0MfId7sFbNw1wRHfL/wALsnuO05lp0yysCOuxu/ofC85nuZ3MES3MV/CfJaMHnz 2W/uBxoS3gw7PrHAm9S7JZ70b69nFJj0hfqmkDsl7HBC6qbXQNVn2rwAm6Ys1w== 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 4bR6NH1Y1szB36; Tue, 24 Jun 2025 01:11: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 55O1BRgh047002; Tue, 24 Jun 2025 01:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O1BRUN046999; Tue, 24 Jun 2025 01:11:27 GMT (envelope-from git) Date: Tue, 24 Jun 2025 01:11:27 GMT Message-Id: <202506240111.55O1BRUN046999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 64584008139f - main - csu: C standard requires errno on main() entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 64584008139f73b07fa7c7979c41780be458b8cc Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=64584008139f73b07fa7c7979c41780be458b8cc commit 64584008139f73b07fa7c7979c41780be458b8cc Author: Konstantin Belousov AuthorDate: 2025-06-23 23:46:43 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-24 01:11:17 +0000 csu: C standard requires errno on main() entry Reported by: Greg Becker Reviewed by: emaste, kevans, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Also see: https://reviews.freebsd.org/D50998 Differential revision: https://reviews.freebsd.org/D50997 --- lib/libc/csu/libc_start1.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index 045ea1e68141..5b08ba03ba8c 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "libc_private.h" @@ -169,6 +170,13 @@ __libc_start1(int argc, char *argv[], char *env[], void (*cleanup)(void), } handle_static_init(argc, argv, env); + + /* + * C17 4.3 paragraph 3: + * The value of errno in the initial thread is zero at program + * startup. + */ + errno = 0; exit(mainX(argc, argv, env)); } @@ -194,5 +202,6 @@ __libc_start1_gcrt(int argc, char *argv[], char *env[], monstartup(eprolp, etextp); handle_static_init(argc, argv, env); + errno = 0; exit(mainX(argc, argv, env)); } From nobody Tue Jun 24 01:24:21 2025 X-Original-To: dev-commits-src-main@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 4bR6gB1nK7z6040N; Tue, 24 Jun 2025 01:24: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 4bR6g95qPKz3WZJ; Tue, 24 Jun 2025 01:24:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750728261; 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=6r3pQcDRMWwKc9lmDxnRc5P3j6One/k+kM1BBH2kh1A=; b=KXlvyIzpItT++ItNvIMkRn1xbNLu8iFktU2NVz0jXy2wJL/yXmMRIDcVyUoj91sdocScV/ 7HWlI65cfkQ2zdfIbpwMaJE6TaUbqmwLwLt/pBKWQOJsuIQJSQ6t09VyBZ/ddSvNj0PXIG MJWyFeLA/TmWOsQpBOQ5oxkcm6VZQpezMrZVAoMRvkJFwGNGfa2Ss0RSWCY0xe1wk5XVGq QmMIJObA6xnopaUH+kOOaBTU8B27d/REsvW1XGpbMh/IZhnAL16NQXLcdlvwOLn1J5rnz2 6ZJkeFxkEgfDpAFjExyqLi6k1utzhHfqmMhH5x+XPr/+KhXHSXdo6DWi2LhEAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750728261; 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=6r3pQcDRMWwKc9lmDxnRc5P3j6One/k+kM1BBH2kh1A=; b=Q3sjj49smlQLz+fuhS5DWj3xmaDRjBbJTGTF8EtAzj5BumDLmIr2RaQ/WqZIy0gtC+PZaO 4+5TyFOXT0CVV9wa1Sr3uGkqlGYFO1KLWyv+vqZSfvVqBpDSwdDu7Lb/hMauUYD8ErZIq8 e9MoyhCyuTYQggFVa3GPK0TLjBW4kThZHb9EZ7/qwKHBn4cFXJCikBROHxpncr60R8LqDV vkn7o0yw3D51Bn++dq7JHlVNIpsUvZvpJDscYlFZ/Mci/ADmn9l+nBF87YBvNDpO1gfblB ROiCWom2Hr1/BDw74G07P+e69Yj6eGonFLJhMErRNObnEhC+ApDacvYUyGD1nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750728261; a=rsa-sha256; cv=none; b=kvF4jUlxw8u7RSPPwhk9SUNa4wGv3nytx1ygbRJFs6+HgOOzHoYdfK7v1mOLD7EAM50z6s hEaNryiO5A3TNsEkrnUdGIMsdIVrsUlgZUuzRrngf/h1C5X01p1UGfyAZu6MoruywzmLdt Sf1cByLBVq26f9G1W0z1VeTCIRqQoWlQ6FfqKwJnbmQzVDy4tz14ZoY/h3RoH/veJBkvYi NlVmt1WWVFfkmnCcWSWO52bLHGquLdWglSI8LPhFp1tK5kDLAlha7kovoIopmNtJMK7NpZ iNv8BiUNCLbCAhLuQlFLRvuCDHyU5OiqcCkPBAWt197RM7QVlQ61r6vTJdBaWg== 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 4bR6g95JhNzBVG; Tue, 24 Jun 2025 01:24: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 55O1OLHd066494; Tue, 24 Jun 2025 01:24:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O1OL8t066491; Tue, 24 Jun 2025 01:24:21 GMT (envelope-from git) Date: Tue, 24 Jun 2025 01:24:21 GMT Message-Id: <202506240124.55O1OL8t066491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 09c9cab2c2bc - main - netinet/tests: Mark broadcast:INADDR_BROADCAST as needing network access List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 09c9cab2c2bcbe50cc9653ad3f33497f45085d8e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=09c9cab2c2bcbe50cc9653ad3f33497f45085d8e commit 09c9cab2c2bcbe50cc9653ad3f33497f45085d8e Author: Mark Johnston AuthorDate: 2025-06-23 14:25:25 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 01:17:01 +0000 netinet/tests: Mark broadcast:INADDR_BROADCAST as needing network access The test fails in environments where there is no broadcast address configured, and this arises in some CI environments. Fixes: ad77d3177f3e ("tests/netinet: add few tests for sending a broadcast packet") --- tests/sys/netinet/broadcast.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/sys/netinet/broadcast.c b/tests/sys/netinet/broadcast.c index 32e6643a3d75..e7850d513663 100644 --- a/tests/sys/netinet/broadcast.c +++ b/tests/sys/netinet/broadcast.c @@ -90,7 +90,11 @@ firstbcast(struct in_addr *out) } /* Application sends to INADDR_BROADCAST, and this goes on the wire. */ -ATF_TC_WITHOUT_HEAD(INADDR_BROADCAST); +ATF_TC(INADDR_BROADCAST); +ATF_TC_HEAD(INADDR_BROADCAST, tc) +{ + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); +} ATF_TC_BODY(INADDR_BROADCAST, tc) { struct sockaddr_in sin = { From nobody Tue Jun 24 01:24:22 2025 X-Original-To: dev-commits-src-main@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 4bR6gC3JlZz6040Q; Tue, 24 Jun 2025 01:24: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 4bR6gB6g5rz3WnJ; Tue, 24 Jun 2025 01:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750728262; 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=e3TqvTUG5lXhZz7LFDR9KuPKt28hAhlCR26Ds4YHfi8=; b=MmXeCR4XYIEVMerU1an12t7h6JL1TUHLakSYgop9/YXDO7MSKvMQ0zLKACsvnwszZctwPd 9dhfYj9hY10cNzwFOv+vKda98xg3HRgHeBAiffiC9TZVOZImLkoIGaAHY5gBXnWoXrSRKl XIAn2eG8RGcDvHiOPtkozWf9X/CVB91ywGzLVlco+MvriY1zQNpyBpwey8SXrVvGSjLF/A 1zxuP/w1hE07hKyK6Bx3uD38r/9+GtnziuhjZ+JzRuM5p5bqSQ4i4iPK0z28rkcJZQ5pW3 dquW7XZGlNC6ZZ6zgtOKdzmdN3AMB19Mpbn78iuEWE0k+HZevtBoTrA7Gq/jgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750728262; 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=e3TqvTUG5lXhZz7LFDR9KuPKt28hAhlCR26Ds4YHfi8=; b=qEPW13jcg85Ow3aSRRysSZobguKixUjGDVJgpPhlh4Jky6fpEqVIY5/G9F4zns5JBuqDi8 DaXTlJ49WkjSRE/E/jGuFDvu5vPqmmvoVtpKZHLNBChkhLSzPExHaEFmL7Fwr+TNzFe/6Y tXLcIsn+Gy9SLfbFQA5Vr28c54JUInhgxP2LM/l2kgubUaB8xyBrv7iStv8K9SS1+Pt5lC FggF/7mSXtVcJYxZwoBBwiwnwo6ct+7XLSLR5qw5MwnPPRIGOBkvgi6PTkuR3czCasEz63 gOA6GTdiNywezuYLvBbrCGYOwsrrCQFGWYxjyrHEybYxMuATrs7cGH4tQ/88Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750728262; a=rsa-sha256; cv=none; b=E8BCY5modV6MeD6dLRcqcTQ9ig+5nkjcA2NTeSloPTJ6jXoAG/8EgadnvcdnwoCIzxAYqC AbBtbUpXlchmqxdTX+7qX0GccKz1a86ZJNffWITIID7avVHw2y8NKuv7nfnP5nVUFidMpi oG0opXcIXsknOvOqwfLAZ+6Ivkef2Wmg2zfpFD4Sugx9SNfqV6339EgLCFCbCMP95nP5em LVnC8FWHWP2ksd06aD3D+Ul4qqPzkXMEeSZ0A6bbwjm2UXP1QT3xD7Ggsl9XoiPGNhB8DB p6IwWH6uX1x1JR6K7XtE3HKC46Wu2sKWOT/YjQ2GENflJ/qc2XmKHW7mBH32SQ== 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 4bR6gB6FhfzBgw; Tue, 24 Jun 2025 01:24: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 55O1OMj4066527; Tue, 24 Jun 2025 01:24:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O1OMGF066524; Tue, 24 Jun 2025 01:24:22 GMT (envelope-from git) Date: Tue, 24 Jun 2025 01:24:22 GMT Message-Id: <202506240124.55O1OMGF066524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b5c04c8f96f6 - main - csu/tests: Add tests to verify that errno == 0 upon program startup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b5c04c8f96f6b51edb767e37aba0ea13b172723a Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b5c04c8f96f6b51edb767e37aba0ea13b172723a commit b5c04c8f96f6b51edb767e37aba0ea13b172723a Author: Mark Johnston AuthorDate: 2025-06-23 23:54:30 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 01:24:04 +0000 csu/tests: Add tests to verify that errno == 0 upon program startup Reviewed by: kib, kevans Differential Revision: https://reviews.freebsd.org/D50998 --- etc/mtree/BSD.tests.dist | 2 ++ lib/csu/tests/Makefile | 1 + lib/csu/tests/errno/Makefile | 18 ++++++++++++++++++ lib/csu/tests/errno/errno_test.c | 23 +++++++++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 7d21dcbd2cbf..183c88038742 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -318,6 +318,8 @@ .. dynamicpie .. + errno + .. static .. .. diff --git a/lib/csu/tests/Makefile b/lib/csu/tests/Makefile index c9a0e6eff5da..b76ef590c88f 100644 --- a/lib/csu/tests/Makefile +++ b/lib/csu/tests/Makefile @@ -4,6 +4,7 @@ SUBDIR= dso TESTS_SUBDIRS= dynamic TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= dynamicpie +TESTS_SUBDIRS+= errno TESTS_SUBDIRS+= static SUBDIR_DEPEND_dynamiclib=dso diff --git a/lib/csu/tests/errno/Makefile b/lib/csu/tests/errno/Makefile new file mode 100644 index 000000000000..eae54a936294 --- /dev/null +++ b/lib/csu/tests/errno/Makefile @@ -0,0 +1,18 @@ +PLAIN_TESTS_C= errno_test \ + errno_static_test \ + errno_thr_test \ + errno_thr_static_test + +SRCS.errno_static_test= errno_test.c +LDFLAGS.errno_static_test= -static + +SRCS.errno_thr_test= errno_test.c +LIBADD.errno_thr_test= pthread + +SRCS.errno_thr_static_test= errno_test.c +LDFLAGS.errno_thr_static_test= -static +LIBADD.errno_thr_static_test= pthread + +MK_PIE:= no + +.include diff --git a/lib/csu/tests/errno/errno_test.c b/lib/csu/tests/errno/errno_test.c new file mode 100644 index 000000000000..d190c7fd2959 --- /dev/null +++ b/lib/csu/tests/errno/errno_test.c @@ -0,0 +1,23 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Mark Johnston + */ + +#include +#include + +static void __attribute__((constructor)) +f(void) +{ + errno = 42; +} + +int +main(void) +{ + /* errno must be zero upon program startup. */ + if (errno != 0) + exit(1); + exit(0); +} From nobody Tue Jun 24 02:38:31 2025 X-Original-To: dev-commits-src-main@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 4bR8K71t2Sz607Gk for ; Tue, 24 Jun 2025 02:38:51 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.206]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bR8K66jGGz3Fr2 for ; Tue, 24 Jun 2025 02:38:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=lwzp3w61; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.206 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1750732724; bh=QrnIzeoYRKnTtYt0m/P2XYlJ3vWBGevgoFhMjVBJ70Y=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=lwzp3w61BPRxUkny8zLOFULQ8UzPGxusMISguPdJTpVkBs5uxFyvsEyeD41oAwY0zAblisCUJA9BpKviaY/e1z4pFEXm9EBYEsVR1avAlt9GZuit8TZfsI95xkPXp1e6JAsGolS8GtzizLTWsUETzCcf2WDW5RnqOHRfGn4tCnS9TldjlrJ97P2TtjkF7DIwKFZZtBrhLcQyTyZj91CMuxhLtL8aHn18LoZ89aUG83sMhcL1bdbNcVKY1aa/EgQONDCktA8MIJxQlAz4VGpsqYE5XBjgbylAV0hgntLZaRrd2SZqyFuTYBPnkJiYjUZtkGKdGi8n6HKfGnhbXwo2MQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1750732724; bh=dTkSUM16xEbJW+5B2yoMujVzPB8rzxYHgMtllWmpG0i=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=EU38cgfxGz510+7o4W1pZUZlySskbvP4R9AzViZje8sFTvist2dGGc+6CLKfrH+RRq8VfyxWf4NRCP74OJcC0ozKj1eW+dWNUUoMfP6/RYQ7GpFZO4mIWfldtGi9D/EjYhbLtq4ILozD5w39AlfyKEcqi3OBBHZoBLX+v/kkB2NlLJjZ93epPpJh73uxkMQEtEGHiRAtmgtw+NFHdUAgUvEfayfWv2cAc4a/ocpDONSG+vMMMTDe/SMitIT3X1WoDhVL4Ndn+DTEgydcAW5V/jKEa+OOlWyWmKG5D6N0hZ8/Or4mkolYEdc2wPtnS3rAVbPwLjtwfmzRK7UFzIscYg== X-YMail-OSG: XGbDHdAVM1mXexDNYbAhDmSzt7CWP7d19DtSZTAdXz.f8sdRdw8iVXf6BanXTWS ejz5pt_yOGKE_tAHEAwN2rTBSNWKtSFC0KwiKNFnfoVA9FCPo1zEoNXs8N6gRAugQgYRRblkkqH8 1vaMULus8m2A29wied6Me0BuSZv5CBZo3igMzTs3gT98LFrjxs4Te1ckWiSIRHAdm1JFijWKRgVT z8E4mUb26BHqA.ewGj3n0wBmpw8gZjuiGsDoMQOoml0VVzIwBfdHq4mUsruq9OcQwKuDtLcxnK2A 72IGQzuRhoX_NAHEd4uGH7WtgzN1J02rih.a3P0glmM2ttdYrJ_jOK5uhTkN0joM5tjDU1Pe1Szl RfPAWvhl.dT9ZtJbuDCnOjDJSC__zz8tHoc_xewKhvia2LSooGijsQQLe7_KiHDJ6GhsyiUNndLK rCQjXWVLcVQjz13oD6QI7cCKic0B_ij.BWQVE07NfxU3hmHKJWH4I12iw5jCQGyJojWY9xy736ZN sxqzgcP04iP_4HzV80UHaEXanLijpMlwzP5AL_.p07xKh56TDO.eiAtwwh9w2u0B3xPUbWGVwuOA S5jBzJczDlJ_sxv0Anfoa_cw2TVGjzzpYy8PJkePOLXRzus.uMGUx.BV5Mwx8ma.wUJfO_9iPxN6 4CszmwvfJajPhdkaaJWh3veZE0LLGF7D0FgwuHqw0Fc1nZ9IY4bt50Yh1Udq0ezkIe8MUCn3CJz8 UqX8LLnv5VJCh.XEOR6So1JmbX0StZgKal.ElK_5VVcFnekRgX4vwSdgB.Q2GO6LBd.ZAKV_kxbE vrjh9YvhnK90i8DmF2p7Uc75UOPy.qHCQHV_pcIaDybAXw61vROVtByzigXYtsObYxN1Q1q9UJNK peVBbY_AIYTkOODNbX6jTh6tGH2qM3Qj4FhRXs9BHJ4L8wwWllG_KDas_x5dWT0c_91m3lZyzoE. bOojwpNa0w2Is_VBPbHqktRtEYm7OltZXs9ApKzlxGGjzAJ2YR3oZotMdPnTWMnM2xVZLvHc0Icj KDEYmh31yCkyCNg7deDHXceZjFbaVO81PX4I8FGKu6ZuB9Ac6yw2ARsOh2rF_Irfr1phN3L_T0wy V9Xh6723j0ySy4JG0tGbGSy1nv5GBO4JVMo6Qbbhz1wke3W0PqWD.PhW1Wx0bJIrHgj38cnVVKPB ZNKu5Fw54rY_y9M1AhRQv5w5BiROzhh9jbqGijSB2tAz9YK_LSs9uJXYTihUVRQ8xGBIp2AUTxgQ sYmJ0_NA0O6KHPyVER0cKv3mYOtqIX_YqVaPTSx5Z3lJEsTdihdIEsWct.uS4lbC5N0R1KU3Y0LH .rOhuTYcdpZEWOecuY7LYF.xjz63tIpg5nDH1ZB6XCwInVyaJXurF7nuGpBTn8aY3T7Zu2bqylIM RdB1xW1ZpggV3sptGMeqxWH033oMdTsTSONCzjMKDfUu3xP.bAzFo4.Dh0TzJlyGMVzBFNTkn_zu AIjZx4xYlduS3wS_fJDZiA9hOvmL2Zbk6CM12e8cFfLGRBYXP0DTJ4q7rRF3qoS0pJ0H5tY_eeUi K8CrTC1IEVw4g8SLFgxDK0WzgTlGdb_ff.Ya1C22RgjMRt2QZRcBO5dNFDZtwGMVUDNk7X_chDIi C_ab2fRZbztz93bu.ggmovgcvOXBJHPhHaS54T6UI6LPPvGjDloEMjcH7d6Rsuyvjfx3DcVvgmvu FcGPS_QePVSzHugHYGT8PbI7c0qsD3uhhTzHPprxXQHaJom_KwAhalmk8fsAXdcGA0nZqwwhv0Ov us9Kl3GqPW5svMs2GWjbhz.uFJBBMKTZ56Kq33LcNniuGfen3dAyFiG350skDSw3cFrzRKG4wYEz FqCJdJvKSIFAYGy7L7rLKvIhdG4hsEvyshoz_novMUceDKHSZbuJNkBRWL2T2pnubTMf9teOSCfC LIdzPY1HCiITuCTlyeESP2KErxYZNUumk9pOs5WutCciHXEYYuttlTGDTaZ8KcVDyQyaXmybJaJa kT5hyRKAVkIyZJ.t9ig7nPqSSNaO4Pu.jrpdls1e8z4qy3P48tbes3IPGbUjp8DC8jth9l2qthsy 7ikdF9tWhatxNSnaGAtZDibRF4dUddmHDdgLyookQBlru_kJQxFbuDECyhnonPXswZ.crvIMcaxG 1PIht.srS95JcqtbCQAimhpiHsu54ErL5yYN72dXHY2DfwqYtctj3vuIHDfPeioNJSPqatoSfMEM 1FcnAvxQJKLuskUO03_OBUEtmfbaznKJdVwo0KSBc2zONXBRdvWYVdpxaQdhtOvv9RdItdyhijtZ 5K2yQzqIjbaXzalg7eBxB X-Sonic-MF: X-Sonic-ID: cdcfa0e7-4ca7-41aa-a33a-9007b31c0cae Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Tue, 24 Jun 2025 02:38:44 +0000 Received: by hermes--production-gq1-74d64bb7d7-5qmwx (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 14a908669b03e38ad5f5baecd96dba60; Tue, 24 Jun 2025 02:38:42 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: RE: git: 81e6c0168d46 - main - lindebugfs.c: Fix possible NULL dereference Message-Id: <98C6A324-35AD-471D-9A95-ABD34657BD98@yahoo.com> Date: Mon, 23 Jun 2025 19:38:31 -0700 To: "dumbbell@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3826.600.51.1.1) References: <98C6A324-35AD-471D-9A95-ABD34657BD98.ref@yahoo.com> X-Spamd-Result: default: False [-1.12 / 15.00]; NEURAL_SPAM_LONG(1.00)[1.000]; NEURAL_HAM_MEDIUM(-0.90)[-0.898]; NEURAL_HAM_SHORT(-0.72)[-0.722]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_FROM(0.00)[yahoo.com]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.206:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.206:from] X-Rspamd-Queue-Id: 4bR8K66jGGz3Fr2 X-Spamd-Bar: - Jean-S=C3=A9bastien P=C3=A9dron wrote on Date: Mon, 23 Jun 2025 21:54:28 UTC : > The branch main has been updated by dumbbell: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D81e6c0168d46b0f5d5d4c5d0405caca8= da24c35e >=20 > commit 81e6c0168d46b0f5d5d4c5d0405caca8da24c35e > Author: Jean-S=C3=A9bastien P=C3=A9dron > AuthorDate: 2025-06-18 20:32:13 +0000 > Commit: Jean-S=C3=A9bastien P=C3=A9dron > CommitDate: 2025-06-23 21:43:51 +0000 >=20 > lindebugfs.c: Fix possible NULL dereference > =20 > If `debugfs_destroy()` is called early as part of error handling = during > initialzation, `pn->pn_data` is unset. "is unset": Is this wording intended to mean: A) pn->pn_data could hold most any bit pattern? (not previously initialized to a known-valid pointer value [including NULL as an example of known-valid]) vs. B) guaranteed to have been set to either NULL or to a valid non-NULL pointer value? > This led to a panic in that if > because `dm` is NULL. Was NULL actually the only possible value that should not be dereferenced? > Reviewed by: bz > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D50985 > --- > sys/compat/lindebugfs/lindebugfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/sys/compat/lindebugfs/lindebugfs.c = b/sys/compat/lindebugfs/lindebugfs.c > index 97f73e79fb6c..50f9377ffec3 100644 > --- a/sys/compat/lindebugfs/lindebugfs.c > +++ b/sys/compat/lindebugfs/lindebugfs.c > @@ -104,7 +104,7 @@ debugfs_destroy(PFS_DESTROY_ARGS) > struct dentry_meta *dm; > =20 > dm =3D pn->pn_data; > - if (dm->dm_type =3D=3D DM_SYMLINK) > + if (dm !=3D NULL && dm->dm_type =3D=3D DM_SYMLINK) The above code would be sufficient for (B) but would not be for (A). If the context is an example of (A), it would appear that the context needs to be changed to be an example of (B). In other words: the new if above would not be what needs to be changed. > free(dm->dm_data, M_DFSINT); > =20 > free(dm, M_DFSINT); =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Tue Jun 24 06:14:54 2025 X-Original-To: dev-commits-src-main@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 4bRF6R4XpBz60MC7; Tue, 24 Jun 2025 06:14: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 4bRF6Q6JS1z3n3Y; Tue, 24 Jun 2025 06:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750745694; 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=PKKBq5hAPV6XXDX0qwsxcJSu0RncYi5Jj4CcExHvlm0=; b=lmO97kgxjHFXh0Y6o+PCHXLj/OgN8slElbgqkGt87EcDn/wKSToOfxGWM0wED6WqCvdzeM bM92UD9kfSavmDndoCqncdCMO3Q8MoixlBKLNrnhED7FoZDqId91nDc83a4WcYQeZHZnDz w7ccM5y5hXfBeHKyjtbx8OZ7FUjJ1aRtzRSAm7HJpsq0raGGhjFwwzJ0tB4Q1vY97vE1D4 3oSLAtg6hgDKjbYa1o0da1Hp2E+IDMH0FfWLLbe6Z3OKCsNqa1Tr2yzcimB2DdJ88qzJ44 IwDschQ6bTuFqyt7WYBiyN31ImeF5cFBcOktlR5w4357nGdcaqxokjbaq5b/Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750745694; 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=PKKBq5hAPV6XXDX0qwsxcJSu0RncYi5Jj4CcExHvlm0=; b=KjGoePdk5t0AwNj+VovgnSpVgSy1kA/b/oYt6L251Bmg9A+S6eCRtjokPL8BRIrBH/cjRc K4vx8LaA18kcaL6VYR3ky4YcMv9NynwaWqmdII4yZE9v7u7he1/g6BDLFiWsgXS+8nJAPH d84a7dS7GOF3TlZ/RuLwNuAwXNS/TO3l4zwqSkO5YoY0igTYcaWj/8Nw6KCSbpP9zNUUhE xYYDyJfFR7wLA0OIIL/HSU6lJt4PIDX5zb51PO1NUHz7kh5Gu2zoAQ5IwHyCuiMcnpFSer /WKDMJMSY6UnAc9U3KGQlmDdOF4qyZNAMEy1SaNPg+MnDGdrPceJf7MK7zQqzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750745694; a=rsa-sha256; cv=none; b=Ndlk08h5BwU6yrvNd54z/SxtdjeuemLkreBAFaN3uNbZxwlFvQACeZb2ReKDyG2R6L3FKC nIlhm9FGE6et/49jScAGtfe2PM7zNPrhE0cki0jMonbRqLDi4R1FfLgar7Exl7AnpmTCv9 ynqQToW+YTw0iL1ejV4s0/PEV8OV3UrnAG5nPTdzctIB7LSCeXb8hNz09N2HwA0lio4bw1 oXRWGJldugwpbN6KlbeaBTDKl6UFRCfLZnOSO4dQSNvsL9TEfPqI9QHvJjbPCjPECQB6+f NRSyy0CN5oP3XNFzOwEMRxswkEHQSHO8dyPDagbl3C+9N297Azct5VNASfH9WQ== 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 4bRF6Q5k4Lzcmm; Tue, 24 Jun 2025 06:14: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 55O6Esx9012117; Tue, 24 Jun 2025 06:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O6EsGo012114; Tue, 24 Jun 2025 06:14:54 GMT (envelope-from git) Date: Tue, 24 Jun 2025 06:14:54 GMT Message-Id: <202506240614.55O6EsGo012114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Corvin =?utf-8?Q?K=C3=B6hne?= Subject: git: b2221534a7bc - main - bhyve: support VBTs which lay outside of the OpRegion List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2221534a7bc16ea879c9fbb1a1fe4b337d2623b Auto-Submitted: auto-generated The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=b2221534a7bc16ea879c9fbb1a1fe4b337d2623b commit b2221534a7bc16ea879c9fbb1a1fe4b337d2623b Author: Corvin Köhne AuthorDate: 2023-12-14 14:50:59 +0000 Commit: Corvin Köhne CommitDate: 2025-06-24 06:11:52 +0000 bhyve: support VBTs which lay outside of the OpRegion Previously, all of our devices had an OpRegion with a VBT which lays inside the OpRegion. Unfortunately, the OpRegion has a fixed size and VBTs get more and more features/settings. A VBT can be larger than the allocated space of 6 KB inside the OpRegion. For larger VBTs, Intel added two fields to the OpRegion to report the VBT address and the VBT size. Make bhyve aware of those fields and put the VBT into the guest memory too. Unfortunately, Intel forgot to consider virtualization when defining OpRegion v2.0. OpRegion v2.0 uses an absolute address for pointing to the VBT. This address is useless in a guest environment. It's possible to patch that. However, it requires some more work and we can't test it because we have no test device with this combination. Therefore, we don't want to do that yet until we have a use case. Fortunately, Intel noticed the issue and from v2.1 onwards, the VBT address is a relative address. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D45337 --- usr.sbin/bhyve/amd64/pci_gvt-d.c | 112 +++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/pci_passthru.c | 2 +- 2 files changed, 113 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/amd64/pci_gvt-d.c b/usr.sbin/bhyve/amd64/pci_gvt-d.c index 8cd5d21c8e6d..60bf460d71ed 100644 --- a/usr.sbin/bhyve/amd64/pci_gvt-d.c +++ b/usr.sbin/bhyve/amd64/pci_gvt-d.c @@ -39,6 +39,7 @@ #define GVT_D_MAP_GSM 0 #define GVT_D_MAP_OPREGION 1 +#define GVT_D_MAP_VBT 2 static int gvt_d_probe(struct pci_devinst *const pi) @@ -177,13 +178,78 @@ gvt_d_setup_gsm(struct pci_devinst *const pi) passthru_cfgwrite_emulate)); } +static int +gvt_d_setup_vbt(struct pci_devinst *const pi, int memfd, uint64_t vbt_hpa, + uint64_t vbt_len, vm_paddr_t *vbt_gpa) +{ + struct passthru_softc *sc; + struct passthru_mmio_mapping *vbt; + + sc = pi->pi_arg; + + vbt = passthru_get_mmio(sc, GVT_D_MAP_VBT); + if (vbt == NULL) { + warnx("%s: Unable to access VBT", __func__); + return (-1); + } + + vbt->hpa = vbt_hpa; + vbt->len = vbt_len; + + vbt->hva = mmap(NULL, vbt->len, PROT_READ, MAP_SHARED, memfd, vbt->hpa); + if (vbt->hva == MAP_FAILED) { + warn("%s: Unable to map VBT", __func__); + return (-1); + } + + vbt->gpa = gvt_d_alloc_mmio_memory(vbt->hpa, vbt->len, + E820_ALIGNMENT_NONE, E820_TYPE_NVS); + if (vbt->gpa == 0) { + warnx( + "%s: Unable to add VBT to E820 table (hpa 0x%lx len 0x%lx)", + __func__, vbt->hpa, vbt->len); + munmap(vbt->hva, vbt->len); + e820_dump_table(); + return (-1); + } + vbt->gva = vm_map_gpa(pi->pi_vmctx, vbt->gpa, vbt->len); + if (vbt->gva == NULL) { + warnx("%s: Unable to map guest VBT", __func__); + munmap(vbt->hva, vbt->len); + return (-1); + } + + if (vbt->gpa != vbt->hpa) { + /* + * A 1:1 host to guest mapping is not required but this could + * change in the future. + */ + warnx( + "Warning: Unable to reuse host address of VBT. GPU passthrough might not work properly."); + } + + memcpy(vbt->gva, vbt->hva, vbt->len); + + /* + * Return the guest physical address. It's used to patch the OpRegion + * properly. + */ + *vbt_gpa = vbt->gpa; + + return (0); +} + static int gvt_d_setup_opregion(struct pci_devinst *const pi) { struct passthru_softc *sc; struct passthru_mmio_mapping *opregion; + struct igd_opregion *opregion_ptr; struct igd_opregion_header *header; + vm_paddr_t vbt_gpa = 0; + vm_paddr_t vbt_hpa; uint64_t asls; + int error = 0; int memfd; sc = pi->pi_arg; @@ -236,6 +302,38 @@ gvt_d_setup_opregion(struct pci_devinst *const pi) close(memfd); return (-1); } + + opregion_ptr = (struct igd_opregion *)opregion->hva; + if (opregion_ptr->mbox3.rvda != 0) { + /* + * OpRegion v2.0 contains a physical address to the VBT. This + * address is useless in a guest environment. It's possible to + * patch that but we don't support that yet. So, the only thing + * we can do is give up. + */ + if (opregion_ptr->header.over == 0x02000000) { + warnx( + "%s: VBT lays outside OpRegion. That's not yet supported for a version 2.0 OpRegion", + __func__); + close(memfd); + return (-1); + } + vbt_hpa = opregion->hpa + opregion_ptr->mbox3.rvda; + if (vbt_hpa < opregion->hpa) { + warnx( + "%s: overflow when calculating VBT address (OpRegion @ 0x%lx, RVDA = 0x%lx)", + __func__, opregion->hpa, opregion_ptr->mbox3.rvda); + close(memfd); + return (-1); + } + + if ((error = gvt_d_setup_vbt(pi, memfd, vbt_hpa, + opregion_ptr->mbox3.rvds, &vbt_gpa)) != 0) { + close(memfd); + return (error); + } + } + close(memfd); opregion->gpa = gvt_d_alloc_mmio_memory(opregion->hpa, opregion->len, @@ -263,6 +361,20 @@ gvt_d_setup_opregion(struct pci_devinst *const pi) memcpy(opregion->gva, opregion->hva, opregion->len); + /* + * Patch the VBT address to match our guest physical address. + */ + if (vbt_gpa != 0) { + if (vbt_gpa < opregion->gpa) { + warnx( + "%s: invalid guest VBT address 0x%16lx (OpRegion @ 0x%16lx)", + __func__, vbt_gpa, opregion->gpa); + return (-1); + } + + ((struct igd_opregion *)opregion->gva)->mbox3.rvda = vbt_gpa - opregion->gpa; + } + pci_set_cfgdata32(pi, PCIR_ASLS_CTL, opregion->gpa); return (set_pcir_handler(sc, PCIR_ASLS_CTL, 4, passthru_cfgread_emulate, diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c index 61983010192a..9d38ae9168a1 100644 --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -72,7 +72,7 @@ #define MSIX_TABLE_COUNT(ctrl) (((ctrl) & PCIM_MSIXCTRL_TABLE_SIZE) + 1) #define MSIX_CAPLEN 12 -#define PASSTHRU_MMIO_MAX 2 +#define PASSTHRU_MMIO_MAX 3 static int pcifd = -1; From nobody Tue Jun 24 06:14:55 2025 X-Original-To: dev-commits-src-main@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 4bRF6S1H0bz60Lyg; Tue, 24 Jun 2025 06:14:56 +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 4bRF6S07cbz3nHB; Tue, 24 Jun 2025 06:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750745696; 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=+1bxXvbdG+edytlxXJC7d6BEnakH6uearL5AA5hvG3Y=; b=sHbwhXHrbyTy98zxVWTR3leX+ANUZZW6uDDNrWEInrUQx0WaYvME4Pe9Aq+Md55Mjd67Dl +cPe7CMncibmMOF7Ub0lXFSfREX1man9B5jiTeDoAi7NSGz/0hSP5LACVAYNyP7GO4rwsV Ada6cXj8IVXfTROE2Ebk0588g+tFMDdq0H385N6aI2ehqrDs/29qHQkzbofPrWY93qBiiC 33AT8pz+49Msdih6YOrcbpmP7a+Tz59u1zwPqtgSSNGiLQ1ewRgstviRbgEbdZ3G22nTv9 C9ApAVYTQsHM8EOC/gZqdAZr9LYfZCdbwHRl/bHQY3BUlAsNX3e3giDxKpyJsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750745696; 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=+1bxXvbdG+edytlxXJC7d6BEnakH6uearL5AA5hvG3Y=; b=uDGL2dHO2hT78Qzl7g4LKKOTFda5V0n2PnlfFlSftoEUT9fvilBzIE8IG0Yd/OpqIGRMiC k9NdK8ssyoXmQQBk9qolG2djeMqF3ZMinCyhTFfGBcH7erqh+9lVU2y04+tx8n/ntzWQ9b JuvPIEwSOliT1zSjXjhzf2yfKS8HSmy9osR9w82kVVRWeswmN+/sIV/CT5tDvu8ZTLtwUf tOgJY/DUzMKW1HeNaVJ5YcMPZvw5iW6qmtIYykfpZYkRCtuqVESQNbehkmX6JLM9zu7EfV 6Mtj73RDgk0eEozMHXBoDrvj07Ggq33LcZQMhCMWd5HAIJEc7izfPdSwC0gdSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750745696; a=rsa-sha256; cv=none; b=vuPe0taMvjyvoXqhqRmlhx6w+/rm0ZtBoKBUAGLT9rmUjX+vnbG3S2q+1T9Xps0KetNU2X Vl5vdk2z3LRwkK0+RtZp85dyqLjEOMNfMMNCTXFWf4i1zDsrXV32w4hviApfN+QmReAnNw 4GT3bnpDfydNtyj7l4zKsyyTuDGHz49sgJ8JJw6F/UcwzqEFZMCVMhIxrKyOTHScJbSH6q zbGlwNxfgHKKppD3e3RTP5jORO0UhmZ7Rc/W7fKA2U7scdBNQ111mCNwmK/WBYkfKEXUio Ob2wyWafZO7YkVyyj5Dh2zn4Bajb2ofK/ow3Or0Gm+3cnXk1rAC6Do+slw8M8A== 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 4bRF6R6RpdzcBx; Tue, 24 Jun 2025 06:14: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 55O6EtKq012155; Tue, 24 Jun 2025 06:14:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O6Et3e012152; Tue, 24 Jun 2025 06:14:55 GMT (envelope-from git) Date: Tue, 24 Jun 2025 06:14:55 GMT Message-Id: <202506240614.55O6Et3e012152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Corvin =?utf-8?Q?K=C3=B6hne?= Subject: git: fb2b8c307d2e - main - bhyve: add PCI IDs of Intel GPUs from Linux v6.15 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb2b8c307d2e0d1cbe6539b4162f188d6c661991 Auto-Submitted: auto-generated The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=fb2b8c307d2e0d1cbe6539b4162f188d6c661991 commit fb2b8c307d2e0d1cbe6539b4162f188d6c661991 Author: Corvin Köhne AuthorDate: 2025-06-12 07:48:10 +0000 Commit: Corvin Köhne CommitDate: 2025-06-24 06:13:29 +0000 bhyve: add PCI IDs of Intel GPUs from Linux v6.15 Linux maintains a list of all known PCI IDs for Intel GPUs. We need this list in the future because the quirks applied by our GVT-d emulation don't work for the latest generation of Intels integrated graphcis devices. We have to detect the generation and then apply some generation specific quirks to it. Fortunately, Linux has macros for each graphic device type making it easy for us to use that header to detect the generation of the device in the next step. Copied from Linux v6.15: * https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/drm/intel/pciids.h?h=v6.15 Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D50806 --- usr.sbin/bhyve/pciids_intel_gpus.h | 873 +++++++++++++++++++++++++++++++++++++ 1 file changed, 873 insertions(+) diff --git a/usr.sbin/bhyve/pciids_intel_gpus.h b/usr.sbin/bhyve/pciids_intel_gpus.h new file mode 100644 index 000000000000..a7ce9523c50d --- /dev/null +++ b/usr.sbin/bhyve/pciids_intel_gpus.h @@ -0,0 +1,873 @@ +/* + * Copyright 2013 Intel Corporation + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#ifndef __PCIIDS_H__ +#define __PCIIDS_H__ + +#ifdef __KERNEL__ +#define INTEL_VGA_DEVICE(_id, _info) { \ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, (_id)), \ + .class = PCI_BASE_CLASS_DISPLAY << 16, .class_mask = 0xff << 16, \ + .driver_data = (kernel_ulong_t)(_info), \ +} + +#define INTEL_QUANTA_VGA_DEVICE(_info) { \ + .vendor = PCI_VENDOR_ID_INTEL, .device = 0x16a, \ + .subvendor = 0x152d, .subdevice = 0x8990, \ + .class = PCI_BASE_CLASS_DISPLAY << 16, .class_mask = 0xff << 16, \ + .driver_data = (kernel_ulong_t)(_info), \ +} +#endif + +#define INTEL_I810_IDS(MACRO__, ...) \ + MACRO__(0x7121, ## __VA_ARGS__), /* I810 */ \ + MACRO__(0x7123, ## __VA_ARGS__), /* I810_DC100 */ \ + MACRO__(0x7125, ## __VA_ARGS__) /* I810_E */ + +#define INTEL_I815_IDS(MACRO__, ...) \ + MACRO__(0x1132, ## __VA_ARGS__) /* I815*/ + +#define INTEL_I830_IDS(MACRO__, ...) \ + MACRO__(0x3577, ## __VA_ARGS__) + +#define INTEL_I845G_IDS(MACRO__, ...) \ + MACRO__(0x2562, ## __VA_ARGS__) + +#define INTEL_I85X_IDS(MACRO__, ...) \ + MACRO__(0x3582, ## __VA_ARGS__), /* I855_GM */ \ + MACRO__(0x358e, ## __VA_ARGS__) + +#define INTEL_I865G_IDS(MACRO__, ...) \ + MACRO__(0x2572, ## __VA_ARGS__) /* I865_G */ + +#define INTEL_I915G_IDS(MACRO__, ...) \ + MACRO__(0x2582, ## __VA_ARGS__), /* I915_G */ \ + MACRO__(0x258a, ## __VA_ARGS__) /* E7221_G */ + +#define INTEL_I915GM_IDS(MACRO__, ...) \ + MACRO__(0x2592, ## __VA_ARGS__) /* I915_GM */ + +#define INTEL_I945G_IDS(MACRO__, ...) \ + MACRO__(0x2772, ## __VA_ARGS__) /* I945_G */ + +#define INTEL_I945GM_IDS(MACRO__, ...) \ + MACRO__(0x27a2, ## __VA_ARGS__), /* I945_GM */ \ + MACRO__(0x27ae, ## __VA_ARGS__) /* I945_GME */ + +#define INTEL_I965G_IDS(MACRO__, ...) \ + MACRO__(0x2972, ## __VA_ARGS__), /* I946_GZ */ \ + MACRO__(0x2982, ## __VA_ARGS__), /* G35_G */ \ + MACRO__(0x2992, ## __VA_ARGS__), /* I965_Q */ \ + MACRO__(0x29a2, ## __VA_ARGS__) /* I965_G */ + +#define INTEL_G33_IDS(MACRO__, ...) \ + MACRO__(0x29b2, ## __VA_ARGS__), /* Q35_G */ \ + MACRO__(0x29c2, ## __VA_ARGS__), /* G33_G */ \ + MACRO__(0x29d2, ## __VA_ARGS__) /* Q33_G */ + +#define INTEL_I965GM_IDS(MACRO__, ...) \ + MACRO__(0x2a02, ## __VA_ARGS__), /* I965_GM */ \ + MACRO__(0x2a12, ## __VA_ARGS__) /* I965_GME */ + +#define INTEL_GM45_IDS(MACRO__, ...) \ + MACRO__(0x2a42, ## __VA_ARGS__) /* GM45_G */ + +#define INTEL_G45_IDS(MACRO__, ...) \ + MACRO__(0x2e02, ## __VA_ARGS__), /* IGD_E_G */ \ + MACRO__(0x2e12, ## __VA_ARGS__), /* Q45_G */ \ + MACRO__(0x2e22, ## __VA_ARGS__), /* G45_G */ \ + MACRO__(0x2e32, ## __VA_ARGS__), /* G41_G */ \ + MACRO__(0x2e42, ## __VA_ARGS__), /* B43_G */ \ + MACRO__(0x2e92, ## __VA_ARGS__) /* B43_G.1 */ + +#define INTEL_PNV_G_IDS(MACRO__, ...) \ + MACRO__(0xa001, ## __VA_ARGS__) + +#define INTEL_PNV_M_IDS(MACRO__, ...) \ + MACRO__(0xa011, ## __VA_ARGS__) + +#define INTEL_PNV_IDS(MACRO__, ...) \ + INTEL_PNV_G_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_PNV_M_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_ILK_D_IDS(MACRO__, ...) \ + MACRO__(0x0042, ## __VA_ARGS__) + +#define INTEL_ILK_M_IDS(MACRO__, ...) \ + MACRO__(0x0046, ## __VA_ARGS__) + +#define INTEL_ILK_IDS(MACRO__, ...) \ + INTEL_ILK_D_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_ILK_M_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_SNB_D_GT1_IDS(MACRO__, ...) \ + MACRO__(0x0102, ## __VA_ARGS__), \ + MACRO__(0x010A, ## __VA_ARGS__) + +#define INTEL_SNB_D_GT2_IDS(MACRO__, ...) \ + MACRO__(0x0112, ## __VA_ARGS__), \ + MACRO__(0x0122, ## __VA_ARGS__) + +#define INTEL_SNB_D_IDS(MACRO__, ...) \ + INTEL_SNB_D_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SNB_D_GT2_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_SNB_M_GT1_IDS(MACRO__, ...) \ + MACRO__(0x0106, ## __VA_ARGS__) + +#define INTEL_SNB_M_GT2_IDS(MACRO__, ...) \ + MACRO__(0x0116, ## __VA_ARGS__), \ + MACRO__(0x0126, ## __VA_ARGS__) + +#define INTEL_SNB_M_IDS(MACRO__, ...) \ + INTEL_SNB_M_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SNB_M_GT2_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_SNB_IDS(MACRO__, ...) \ + INTEL_SNB_D_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SNB_M_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_IVB_M_GT1_IDS(MACRO__, ...) \ + MACRO__(0x0156, ## __VA_ARGS__) /* GT1 mobile */ + +#define INTEL_IVB_M_GT2_IDS(MACRO__, ...) \ + MACRO__(0x0166, ## __VA_ARGS__) /* GT2 mobile */ + +#define INTEL_IVB_M_IDS(MACRO__, ...) \ + INTEL_IVB_M_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_IVB_M_GT2_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_IVB_D_GT1_IDS(MACRO__, ...) \ + MACRO__(0x0152, ## __VA_ARGS__), /* GT1 desktop */ \ + MACRO__(0x015a, ## __VA_ARGS__) /* GT1 server */ + +#define INTEL_IVB_D_GT2_IDS(MACRO__, ...) \ + MACRO__(0x0162, ## __VA_ARGS__), /* GT2 desktop */ \ + MACRO__(0x016a, ## __VA_ARGS__) /* GT2 server */ + +#define INTEL_IVB_D_IDS(MACRO__, ...) \ + INTEL_IVB_D_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_IVB_D_GT2_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_IVB_IDS(MACRO__, ...) \ + INTEL_IVB_M_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_IVB_D_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_IVB_Q_IDS(MACRO__, ...) \ + INTEL_QUANTA_VGA_DEVICE(__VA_ARGS__) /* Quanta transcode */ + +#define INTEL_HSW_ULT_GT1_IDS(MACRO__, ...) \ + MACRO__(0x0A02, ## __VA_ARGS__), /* ULT GT1 desktop */ \ + MACRO__(0x0A06, ## __VA_ARGS__), /* ULT GT1 mobile */ \ + MACRO__(0x0A0A, ## __VA_ARGS__), /* ULT GT1 server */ \ + MACRO__(0x0A0B, ## __VA_ARGS__) /* ULT GT1 reserved */ + +#define INTEL_HSW_ULX_GT1_IDS(MACRO__, ...) \ + MACRO__(0x0A0E, ## __VA_ARGS__) /* ULX GT1 mobile */ + +#define INTEL_HSW_GT1_IDS(MACRO__, ...) \ + INTEL_HSW_ULT_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_HSW_ULX_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x0402, ## __VA_ARGS__), /* GT1 desktop */ \ + MACRO__(0x0406, ## __VA_ARGS__), /* GT1 mobile */ \ + MACRO__(0x040A, ## __VA_ARGS__), /* GT1 server */ \ + MACRO__(0x040B, ## __VA_ARGS__), /* GT1 reserved */ \ + MACRO__(0x040E, ## __VA_ARGS__), /* GT1 reserved */ \ + MACRO__(0x0C02, ## __VA_ARGS__), /* SDV GT1 desktop */ \ + MACRO__(0x0C06, ## __VA_ARGS__), /* SDV GT1 mobile */ \ + MACRO__(0x0C0A, ## __VA_ARGS__), /* SDV GT1 server */ \ + MACRO__(0x0C0B, ## __VA_ARGS__), /* SDV GT1 reserved */ \ + MACRO__(0x0C0E, ## __VA_ARGS__), /* SDV GT1 reserved */ \ + MACRO__(0x0D02, ## __VA_ARGS__), /* CRW GT1 desktop */ \ + MACRO__(0x0D06, ## __VA_ARGS__), /* CRW GT1 mobile */ \ + MACRO__(0x0D0A, ## __VA_ARGS__), /* CRW GT1 server */ \ + MACRO__(0x0D0B, ## __VA_ARGS__), /* CRW GT1 reserved */ \ + MACRO__(0x0D0E, ## __VA_ARGS__) /* CRW GT1 reserved */ + +#define INTEL_HSW_ULT_GT2_IDS(MACRO__, ...) \ + MACRO__(0x0A12, ## __VA_ARGS__), /* ULT GT2 desktop */ \ + MACRO__(0x0A16, ## __VA_ARGS__), /* ULT GT2 mobile */ \ + MACRO__(0x0A1A, ## __VA_ARGS__), /* ULT GT2 server */ \ + MACRO__(0x0A1B, ## __VA_ARGS__) /* ULT GT2 reserved */ \ + +#define INTEL_HSW_ULX_GT2_IDS(MACRO__, ...) \ + MACRO__(0x0A1E, ## __VA_ARGS__) /* ULX GT2 mobile */ \ + +#define INTEL_HSW_GT2_IDS(MACRO__, ...) \ + INTEL_HSW_ULT_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_HSW_ULX_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x0412, ## __VA_ARGS__), /* GT2 desktop */ \ + MACRO__(0x0416, ## __VA_ARGS__), /* GT2 mobile */ \ + MACRO__(0x041A, ## __VA_ARGS__), /* GT2 server */ \ + MACRO__(0x041B, ## __VA_ARGS__), /* GT2 reserved */ \ + MACRO__(0x041E, ## __VA_ARGS__), /* GT2 reserved */ \ + MACRO__(0x0C12, ## __VA_ARGS__), /* SDV GT2 desktop */ \ + MACRO__(0x0C16, ## __VA_ARGS__), /* SDV GT2 mobile */ \ + MACRO__(0x0C1A, ## __VA_ARGS__), /* SDV GT2 server */ \ + MACRO__(0x0C1B, ## __VA_ARGS__), /* SDV GT2 reserved */ \ + MACRO__(0x0C1E, ## __VA_ARGS__), /* SDV GT2 reserved */ \ + MACRO__(0x0D12, ## __VA_ARGS__), /* CRW GT2 desktop */ \ + MACRO__(0x0D16, ## __VA_ARGS__), /* CRW GT2 mobile */ \ + MACRO__(0x0D1A, ## __VA_ARGS__), /* CRW GT2 server */ \ + MACRO__(0x0D1B, ## __VA_ARGS__), /* CRW GT2 reserved */ \ + MACRO__(0x0D1E, ## __VA_ARGS__) /* CRW GT2 reserved */ + +#define INTEL_HSW_ULT_GT3_IDS(MACRO__, ...) \ + MACRO__(0x0A22, ## __VA_ARGS__), /* ULT GT3 desktop */ \ + MACRO__(0x0A26, ## __VA_ARGS__), /* ULT GT3 mobile */ \ + MACRO__(0x0A2A, ## __VA_ARGS__), /* ULT GT3 server */ \ + MACRO__(0x0A2B, ## __VA_ARGS__), /* ULT GT3 reserved */ \ + MACRO__(0x0A2E, ## __VA_ARGS__) /* ULT GT3 reserved */ + +#define INTEL_HSW_GT3_IDS(MACRO__, ...) \ + INTEL_HSW_ULT_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x0422, ## __VA_ARGS__), /* GT3 desktop */ \ + MACRO__(0x0426, ## __VA_ARGS__), /* GT3 mobile */ \ + MACRO__(0x042A, ## __VA_ARGS__), /* GT3 server */ \ + MACRO__(0x042B, ## __VA_ARGS__), /* GT3 reserved */ \ + MACRO__(0x042E, ## __VA_ARGS__), /* GT3 reserved */ \ + MACRO__(0x0C22, ## __VA_ARGS__), /* SDV GT3 desktop */ \ + MACRO__(0x0C26, ## __VA_ARGS__), /* SDV GT3 mobile */ \ + MACRO__(0x0C2A, ## __VA_ARGS__), /* SDV GT3 server */ \ + MACRO__(0x0C2B, ## __VA_ARGS__), /* SDV GT3 reserved */ \ + MACRO__(0x0C2E, ## __VA_ARGS__), /* SDV GT3 reserved */ \ + MACRO__(0x0D22, ## __VA_ARGS__), /* CRW GT3 desktop */ \ + MACRO__(0x0D26, ## __VA_ARGS__), /* CRW GT3 mobile */ \ + MACRO__(0x0D2A, ## __VA_ARGS__), /* CRW GT3 server */ \ + MACRO__(0x0D2B, ## __VA_ARGS__), /* CRW GT3 reserved */ \ + MACRO__(0x0D2E, ## __VA_ARGS__) /* CRW GT3 reserved */ + +#define INTEL_HSW_IDS(MACRO__, ...) \ + INTEL_HSW_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_HSW_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_HSW_GT3_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_VLV_IDS(MACRO__, ...) \ + MACRO__(0x0f30, ## __VA_ARGS__), \ + MACRO__(0x0f31, ## __VA_ARGS__), \ + MACRO__(0x0f32, ## __VA_ARGS__), \ + MACRO__(0x0f33, ## __VA_ARGS__) + +#define INTEL_BDW_ULT_GT1_IDS(MACRO__, ...) \ + MACRO__(0x1606, ## __VA_ARGS__), /* GT1 ULT */ \ + MACRO__(0x160B, ## __VA_ARGS__) /* GT1 Iris */ + +#define INTEL_BDW_ULX_GT1_IDS(MACRO__, ...) \ + MACRO__(0x160E, ## __VA_ARGS__) /* GT1 ULX */ + +#define INTEL_BDW_GT1_IDS(MACRO__, ...) \ + INTEL_BDW_ULT_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_BDW_ULX_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x1602, ## __VA_ARGS__), /* GT1 ULT */ \ + MACRO__(0x160A, ## __VA_ARGS__), /* GT1 Server */ \ + MACRO__(0x160D, ## __VA_ARGS__) /* GT1 Workstation */ + +#define INTEL_BDW_ULT_GT2_IDS(MACRO__, ...) \ + MACRO__(0x1616, ## __VA_ARGS__), /* GT2 ULT */ \ + MACRO__(0x161B, ## __VA_ARGS__) /* GT2 ULT */ + +#define INTEL_BDW_ULX_GT2_IDS(MACRO__, ...) \ + MACRO__(0x161E, ## __VA_ARGS__) /* GT2 ULX */ + +#define INTEL_BDW_GT2_IDS(MACRO__, ...) \ + INTEL_BDW_ULT_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_BDW_ULX_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x1612, ## __VA_ARGS__), /* GT2 Halo */ \ + MACRO__(0x161A, ## __VA_ARGS__), /* GT2 Server */ \ + MACRO__(0x161D, ## __VA_ARGS__) /* GT2 Workstation */ + +#define INTEL_BDW_ULT_GT3_IDS(MACRO__, ...) \ + MACRO__(0x1626, ## __VA_ARGS__), /* ULT */ \ + MACRO__(0x162B, ## __VA_ARGS__) /* Iris */ \ + +#define INTEL_BDW_ULX_GT3_IDS(MACRO__, ...) \ + MACRO__(0x162E, ## __VA_ARGS__) /* ULX */ + +#define INTEL_BDW_GT3_IDS(MACRO__, ...) \ + INTEL_BDW_ULT_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_BDW_ULX_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x1622, ## __VA_ARGS__), /* ULT */ \ + MACRO__(0x162A, ## __VA_ARGS__), /* Server */ \ + MACRO__(0x162D, ## __VA_ARGS__) /* Workstation */ + +#define INTEL_BDW_ULT_RSVD_IDS(MACRO__, ...) \ + MACRO__(0x1636, ## __VA_ARGS__), /* ULT */ \ + MACRO__(0x163B, ## __VA_ARGS__) /* Iris */ + +#define INTEL_BDW_ULX_RSVD_IDS(MACRO__, ...) \ + MACRO__(0x163E, ## __VA_ARGS__) /* ULX */ + +#define INTEL_BDW_RSVD_IDS(MACRO__, ...) \ + INTEL_BDW_ULT_RSVD_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_BDW_ULX_RSVD_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x1632, ## __VA_ARGS__), /* ULT */ \ + MACRO__(0x163A, ## __VA_ARGS__), /* Server */ \ + MACRO__(0x163D, ## __VA_ARGS__) /* Workstation */ + +#define INTEL_BDW_IDS(MACRO__, ...) \ + INTEL_BDW_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_BDW_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_BDW_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_BDW_RSVD_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_CHV_IDS(MACRO__, ...) \ + MACRO__(0x22b0, ## __VA_ARGS__), \ + MACRO__(0x22b1, ## __VA_ARGS__), \ + MACRO__(0x22b2, ## __VA_ARGS__), \ + MACRO__(0x22b3, ## __VA_ARGS__) + +#define INTEL_SKL_ULT_GT1_IDS(MACRO__, ...) \ + MACRO__(0x1906, ## __VA_ARGS__), /* ULT GT1 */ \ + MACRO__(0x1913, ## __VA_ARGS__) /* ULT GT1.5 */ + +#define INTEL_SKL_ULX_GT1_IDS(MACRO__, ...) \ + MACRO__(0x190E, ## __VA_ARGS__), /* ULX GT1 */ \ + MACRO__(0x1915, ## __VA_ARGS__) /* ULX GT1.5 */ + +#define INTEL_SKL_GT1_IDS(MACRO__, ...) \ + INTEL_SKL_ULT_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SKL_ULX_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x1902, ## __VA_ARGS__), /* DT GT1 */ \ + MACRO__(0x190A, ## __VA_ARGS__), /* SRV GT1 */ \ + MACRO__(0x190B, ## __VA_ARGS__), /* Halo GT1 */ \ + MACRO__(0x1917, ## __VA_ARGS__) /* DT GT1.5 */ + +#define INTEL_SKL_ULT_GT2_IDS(MACRO__, ...) \ + MACRO__(0x1916, ## __VA_ARGS__), /* ULT GT2 */ \ + MACRO__(0x1921, ## __VA_ARGS__) /* ULT GT2F */ + +#define INTEL_SKL_ULX_GT2_IDS(MACRO__, ...) \ + MACRO__(0x191E, ## __VA_ARGS__) /* ULX GT2 */ + +#define INTEL_SKL_GT2_IDS(MACRO__, ...) \ + INTEL_SKL_ULT_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SKL_ULX_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x1912, ## __VA_ARGS__), /* DT GT2 */ \ + MACRO__(0x191A, ## __VA_ARGS__), /* SRV GT2 */ \ + MACRO__(0x191B, ## __VA_ARGS__), /* Halo GT2 */ \ + MACRO__(0x191D, ## __VA_ARGS__) /* WKS GT2 */ + +#define INTEL_SKL_ULT_GT3_IDS(MACRO__, ...) \ + MACRO__(0x1923, ## __VA_ARGS__), /* ULT GT3 */ \ + MACRO__(0x1926, ## __VA_ARGS__), /* ULT GT3e */ \ + MACRO__(0x1927, ## __VA_ARGS__) /* ULT GT3e */ + +#define INTEL_SKL_GT3_IDS(MACRO__, ...) \ + INTEL_SKL_ULT_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x192A, ## __VA_ARGS__), /* SRV GT3 */ \ + MACRO__(0x192B, ## __VA_ARGS__), /* Halo GT3e */ \ + MACRO__(0x192D, ## __VA_ARGS__) /* SRV GT3e */ + +#define INTEL_SKL_GT4_IDS(MACRO__, ...) \ + MACRO__(0x1932, ## __VA_ARGS__), /* DT GT4 */ \ + MACRO__(0x193A, ## __VA_ARGS__), /* SRV GT4e */ \ + MACRO__(0x193B, ## __VA_ARGS__), /* Halo GT4e */ \ + MACRO__(0x193D, ## __VA_ARGS__) /* WKS GT4e */ + +#define INTEL_SKL_IDS(MACRO__, ...) \ + INTEL_SKL_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SKL_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SKL_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_SKL_GT4_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_BXT_IDS(MACRO__, ...) \ + MACRO__(0x0A84, ## __VA_ARGS__), \ + MACRO__(0x1A84, ## __VA_ARGS__), \ + MACRO__(0x1A85, ## __VA_ARGS__), \ + MACRO__(0x5A84, ## __VA_ARGS__), /* APL HD Graphics 505 */ \ + MACRO__(0x5A85, ## __VA_ARGS__) /* APL HD Graphics 500 */ + +#define INTEL_GLK_IDS(MACRO__, ...) \ + MACRO__(0x3184, ## __VA_ARGS__), \ + MACRO__(0x3185, ## __VA_ARGS__) + +#define INTEL_KBL_ULT_GT1_IDS(MACRO__, ...) \ + MACRO__(0x5906, ## __VA_ARGS__), /* ULT GT1 */ \ + MACRO__(0x5913, ## __VA_ARGS__) /* ULT GT1.5 */ + +#define INTEL_KBL_ULX_GT1_IDS(MACRO__, ...) \ + MACRO__(0x590E, ## __VA_ARGS__), /* ULX GT1 */ \ + MACRO__(0x5915, ## __VA_ARGS__) /* ULX GT1.5 */ + +#define INTEL_KBL_GT1_IDS(MACRO__, ...) \ + INTEL_KBL_ULT_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_KBL_ULX_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x5902, ## __VA_ARGS__), /* DT GT1 */ \ + MACRO__(0x5908, ## __VA_ARGS__), /* Halo GT1 */ \ + MACRO__(0x590A, ## __VA_ARGS__), /* SRV GT1 */ \ + MACRO__(0x590B, ## __VA_ARGS__) /* Halo GT1 */ + +#define INTEL_KBL_ULT_GT2_IDS(MACRO__, ...) \ + MACRO__(0x5916, ## __VA_ARGS__), /* ULT GT2 */ \ + MACRO__(0x5921, ## __VA_ARGS__) /* ULT GT2F */ + +#define INTEL_KBL_ULX_GT2_IDS(MACRO__, ...) \ + MACRO__(0x591E, ## __VA_ARGS__) /* ULX GT2 */ + +#define INTEL_KBL_GT2_IDS(MACRO__, ...) \ + INTEL_KBL_ULT_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_KBL_ULX_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x5912, ## __VA_ARGS__), /* DT GT2 */ \ + MACRO__(0x5917, ## __VA_ARGS__), /* Mobile GT2 */ \ + MACRO__(0x591A, ## __VA_ARGS__), /* SRV GT2 */ \ + MACRO__(0x591B, ## __VA_ARGS__), /* Halo GT2 */ \ + MACRO__(0x591D, ## __VA_ARGS__) /* WKS GT2 */ + +#define INTEL_KBL_ULT_GT3_IDS(MACRO__, ...) \ + MACRO__(0x5926, ## __VA_ARGS__) /* ULT GT3 */ + +#define INTEL_KBL_GT3_IDS(MACRO__, ...) \ + INTEL_KBL_ULT_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x5923, ## __VA_ARGS__), /* ULT GT3 */ \ + MACRO__(0x5927, ## __VA_ARGS__) /* ULT GT3 */ + +#define INTEL_KBL_GT4_IDS(MACRO__, ...) \ + MACRO__(0x593B, ## __VA_ARGS__) /* Halo GT4 */ + +/* AML/KBL Y GT2 */ +#define INTEL_AML_KBL_GT2_IDS(MACRO__, ...) \ + MACRO__(0x591C, ## __VA_ARGS__), /* ULX GT2 */ \ + MACRO__(0x87C0, ## __VA_ARGS__) /* ULX GT2 */ + +/* AML/CFL Y GT2 */ +#define INTEL_AML_CFL_GT2_IDS(MACRO__, ...) \ + MACRO__(0x87CA, ## __VA_ARGS__) + +/* CML GT1 */ +#define INTEL_CML_GT1_IDS(MACRO__, ...) \ + MACRO__(0x9BA2, ## __VA_ARGS__), \ + MACRO__(0x9BA4, ## __VA_ARGS__), \ + MACRO__(0x9BA5, ## __VA_ARGS__), \ + MACRO__(0x9BA8, ## __VA_ARGS__) + +#define INTEL_CML_U_GT1_IDS(MACRO__, ...) \ + MACRO__(0x9B21, ## __VA_ARGS__), \ + MACRO__(0x9BAA, ## __VA_ARGS__), \ + MACRO__(0x9BAC, ## __VA_ARGS__) + +/* CML GT2 */ +#define INTEL_CML_GT2_IDS(MACRO__, ...) \ + MACRO__(0x9BC2, ## __VA_ARGS__), \ + MACRO__(0x9BC4, ## __VA_ARGS__), \ + MACRO__(0x9BC5, ## __VA_ARGS__), \ + MACRO__(0x9BC6, ## __VA_ARGS__), \ + MACRO__(0x9BC8, ## __VA_ARGS__), \ + MACRO__(0x9BE6, ## __VA_ARGS__), \ + MACRO__(0x9BF6, ## __VA_ARGS__) + +#define INTEL_CML_U_GT2_IDS(MACRO__, ...) \ + MACRO__(0x9B41, ## __VA_ARGS__), \ + MACRO__(0x9BCA, ## __VA_ARGS__), \ + MACRO__(0x9BCC, ## __VA_ARGS__) + +#define INTEL_CML_IDS(MACRO__, ...) \ + INTEL_CML_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CML_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CML_U_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CML_U_GT2_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_KBL_IDS(MACRO__, ...) \ + INTEL_KBL_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_KBL_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_KBL_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_KBL_GT4_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_AML_KBL_GT2_IDS(MACRO__, ## __VA_ARGS__) + +/* CFL S */ +#define INTEL_CFL_S_GT1_IDS(MACRO__, ...) \ + MACRO__(0x3E90, ## __VA_ARGS__), /* SRV GT1 */ \ + MACRO__(0x3E93, ## __VA_ARGS__), /* SRV GT1 */ \ + MACRO__(0x3E99, ## __VA_ARGS__) /* SRV GT1 */ + +#define INTEL_CFL_S_GT2_IDS(MACRO__, ...) \ + MACRO__(0x3E91, ## __VA_ARGS__), /* SRV GT2 */ \ + MACRO__(0x3E92, ## __VA_ARGS__), /* SRV GT2 */ \ + MACRO__(0x3E96, ## __VA_ARGS__), /* SRV GT2 */ \ + MACRO__(0x3E98, ## __VA_ARGS__), /* SRV GT2 */ \ + MACRO__(0x3E9A, ## __VA_ARGS__) /* SRV GT2 */ + +/* CFL H */ +#define INTEL_CFL_H_GT1_IDS(MACRO__, ...) \ + MACRO__(0x3E9C, ## __VA_ARGS__) + +#define INTEL_CFL_H_GT2_IDS(MACRO__, ...) \ + MACRO__(0x3E94, ## __VA_ARGS__), /* Halo GT2 */ \ + MACRO__(0x3E9B, ## __VA_ARGS__) /* Halo GT2 */ + +/* CFL U GT2 */ +#define INTEL_CFL_U_GT2_IDS(MACRO__, ...) \ + MACRO__(0x3EA9, ## __VA_ARGS__) + +/* CFL U GT3 */ +#define INTEL_CFL_U_GT3_IDS(MACRO__, ...) \ + MACRO__(0x3EA5, ## __VA_ARGS__), /* ULT GT3 */ \ + MACRO__(0x3EA6, ## __VA_ARGS__), /* ULT GT3 */ \ + MACRO__(0x3EA7, ## __VA_ARGS__), /* ULT GT3 */ \ + MACRO__(0x3EA8, ## __VA_ARGS__) /* ULT GT3 */ + +#define INTEL_CFL_IDS(MACRO__, ...) \ + INTEL_CFL_S_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CFL_S_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CFL_H_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CFL_H_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CFL_U_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_CFL_U_GT3_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_AML_CFL_GT2_IDS(MACRO__, ## __VA_ARGS__) + +/* WHL/CFL U GT1 */ +#define INTEL_WHL_U_GT1_IDS(MACRO__, ...) \ + MACRO__(0x3EA1, ## __VA_ARGS__), \ + MACRO__(0x3EA4, ## __VA_ARGS__) + +/* WHL/CFL U GT2 */ +#define INTEL_WHL_U_GT2_IDS(MACRO__, ...) \ + MACRO__(0x3EA0, ## __VA_ARGS__), \ + MACRO__(0x3EA3, ## __VA_ARGS__) + +/* WHL/CFL U GT3 */ +#define INTEL_WHL_U_GT3_IDS(MACRO__, ...) \ + MACRO__(0x3EA2, ## __VA_ARGS__) + +#define INTEL_WHL_IDS(MACRO__, ...) \ + INTEL_WHL_U_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_WHL_U_GT2_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_WHL_U_GT3_IDS(MACRO__, ## __VA_ARGS__) + +/* CNL */ +#define INTEL_CNL_PORT_F_IDS(MACRO__, ...) \ + MACRO__(0x5A44, ## __VA_ARGS__), \ + MACRO__(0x5A4C, ## __VA_ARGS__), \ + MACRO__(0x5A54, ## __VA_ARGS__), \ + MACRO__(0x5A5C, ## __VA_ARGS__) + +#define INTEL_CNL_IDS(MACRO__, ...) \ + INTEL_CNL_PORT_F_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x5A40, ## __VA_ARGS__), \ + MACRO__(0x5A41, ## __VA_ARGS__), \ + MACRO__(0x5A42, ## __VA_ARGS__), \ + MACRO__(0x5A49, ## __VA_ARGS__), \ + MACRO__(0x5A4A, ## __VA_ARGS__), \ + MACRO__(0x5A50, ## __VA_ARGS__), \ + MACRO__(0x5A51, ## __VA_ARGS__), \ + MACRO__(0x5A52, ## __VA_ARGS__), \ + MACRO__(0x5A59, ## __VA_ARGS__), \ + MACRO__(0x5A5A, ## __VA_ARGS__) + +/* ICL */ +#define INTEL_ICL_PORT_F_IDS(MACRO__, ...) \ + MACRO__(0x8A50, ## __VA_ARGS__), \ + MACRO__(0x8A52, ## __VA_ARGS__), \ + MACRO__(0x8A53, ## __VA_ARGS__), \ + MACRO__(0x8A54, ## __VA_ARGS__), \ + MACRO__(0x8A56, ## __VA_ARGS__), \ + MACRO__(0x8A57, ## __VA_ARGS__), \ + MACRO__(0x8A58, ## __VA_ARGS__), \ + MACRO__(0x8A59, ## __VA_ARGS__), \ + MACRO__(0x8A5A, ## __VA_ARGS__), \ + MACRO__(0x8A5B, ## __VA_ARGS__), \ + MACRO__(0x8A5C, ## __VA_ARGS__), \ + MACRO__(0x8A70, ## __VA_ARGS__), \ + MACRO__(0x8A71, ## __VA_ARGS__) + +#define INTEL_ICL_IDS(MACRO__, ...) \ + INTEL_ICL_PORT_F_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x8A51, ## __VA_ARGS__), \ + MACRO__(0x8A5D, ## __VA_ARGS__) + +/* EHL */ +#define INTEL_EHL_IDS(MACRO__, ...) \ + MACRO__(0x4541, ## __VA_ARGS__), \ + MACRO__(0x4551, ## __VA_ARGS__), \ + MACRO__(0x4555, ## __VA_ARGS__), \ + MACRO__(0x4557, ## __VA_ARGS__), \ + MACRO__(0x4570, ## __VA_ARGS__), \ + MACRO__(0x4571, ## __VA_ARGS__) + +/* JSL */ +#define INTEL_JSL_IDS(MACRO__, ...) \ + MACRO__(0x4E51, ## __VA_ARGS__), \ + MACRO__(0x4E55, ## __VA_ARGS__), \ + MACRO__(0x4E57, ## __VA_ARGS__), \ + MACRO__(0x4E61, ## __VA_ARGS__), \ + MACRO__(0x4E71, ## __VA_ARGS__) + +/* TGL */ +#define INTEL_TGL_GT1_IDS(MACRO__, ...) \ + MACRO__(0x9A60, ## __VA_ARGS__), \ + MACRO__(0x9A68, ## __VA_ARGS__), \ + MACRO__(0x9A70, ## __VA_ARGS__) + +#define INTEL_TGL_GT2_IDS(MACRO__, ...) \ + MACRO__(0x9A40, ## __VA_ARGS__), \ + MACRO__(0x9A49, ## __VA_ARGS__), \ + MACRO__(0x9A59, ## __VA_ARGS__), \ + MACRO__(0x9A78, ## __VA_ARGS__), \ + MACRO__(0x9AC0, ## __VA_ARGS__), \ + MACRO__(0x9AC9, ## __VA_ARGS__), \ + MACRO__(0x9AD9, ## __VA_ARGS__), \ + MACRO__(0x9AF8, ## __VA_ARGS__) + +#define INTEL_TGL_IDS(MACRO__, ...) \ + INTEL_TGL_GT1_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_TGL_GT2_IDS(MACRO__, ## __VA_ARGS__) + +/* RKL */ +#define INTEL_RKL_IDS(MACRO__, ...) \ + MACRO__(0x4C80, ## __VA_ARGS__), \ + MACRO__(0x4C8A, ## __VA_ARGS__), \ + MACRO__(0x4C8B, ## __VA_ARGS__), \ + MACRO__(0x4C8C, ## __VA_ARGS__), \ + MACRO__(0x4C90, ## __VA_ARGS__), \ + MACRO__(0x4C9A, ## __VA_ARGS__) + +/* DG1 */ +#define INTEL_DG1_IDS(MACRO__, ...) \ + MACRO__(0x4905, ## __VA_ARGS__), \ + MACRO__(0x4906, ## __VA_ARGS__), \ + MACRO__(0x4907, ## __VA_ARGS__), \ + MACRO__(0x4908, ## __VA_ARGS__), \ + MACRO__(0x4909, ## __VA_ARGS__) + +/* ADL-S */ +#define INTEL_ADLS_IDS(MACRO__, ...) \ + MACRO__(0x4680, ## __VA_ARGS__), \ + MACRO__(0x4682, ## __VA_ARGS__), \ + MACRO__(0x4688, ## __VA_ARGS__), \ + MACRO__(0x468A, ## __VA_ARGS__), \ + MACRO__(0x468B, ## __VA_ARGS__), \ + MACRO__(0x4690, ## __VA_ARGS__), \ + MACRO__(0x4692, ## __VA_ARGS__), \ + MACRO__(0x4693, ## __VA_ARGS__) + +/* ADL-P */ +#define INTEL_ADLP_IDS(MACRO__, ...) \ + MACRO__(0x46A0, ## __VA_ARGS__), \ + MACRO__(0x46A1, ## __VA_ARGS__), \ + MACRO__(0x46A2, ## __VA_ARGS__), \ + MACRO__(0x46A3, ## __VA_ARGS__), \ + MACRO__(0x46A6, ## __VA_ARGS__), \ + MACRO__(0x46A8, ## __VA_ARGS__), \ + MACRO__(0x46AA, ## __VA_ARGS__), \ + MACRO__(0x462A, ## __VA_ARGS__), \ + MACRO__(0x4626, ## __VA_ARGS__), \ + MACRO__(0x4628, ## __VA_ARGS__), \ + MACRO__(0x46B0, ## __VA_ARGS__), \ + MACRO__(0x46B1, ## __VA_ARGS__), \ + MACRO__(0x46B2, ## __VA_ARGS__), \ + MACRO__(0x46B3, ## __VA_ARGS__), \ + MACRO__(0x46C0, ## __VA_ARGS__), \ + MACRO__(0x46C1, ## __VA_ARGS__), \ + MACRO__(0x46C2, ## __VA_ARGS__), \ + MACRO__(0x46C3, ## __VA_ARGS__) + +/* ADL-N */ +#define INTEL_ADLN_IDS(MACRO__, ...) \ + MACRO__(0x46D0, ## __VA_ARGS__), \ + MACRO__(0x46D1, ## __VA_ARGS__), \ + MACRO__(0x46D2, ## __VA_ARGS__), \ + MACRO__(0x46D3, ## __VA_ARGS__), \ + MACRO__(0x46D4, ## __VA_ARGS__) + +/* RPL-S */ +#define INTEL_RPLS_IDS(MACRO__, ...) \ + MACRO__(0xA780, ## __VA_ARGS__), \ + MACRO__(0xA781, ## __VA_ARGS__), \ + MACRO__(0xA782, ## __VA_ARGS__), \ + MACRO__(0xA783, ## __VA_ARGS__), \ + MACRO__(0xA788, ## __VA_ARGS__), \ + MACRO__(0xA789, ## __VA_ARGS__), \ + MACRO__(0xA78A, ## __VA_ARGS__), \ + MACRO__(0xA78B, ## __VA_ARGS__) + +/* RPL-U */ +#define INTEL_RPLU_IDS(MACRO__, ...) \ + MACRO__(0xA721, ## __VA_ARGS__), \ + MACRO__(0xA7A1, ## __VA_ARGS__), \ + MACRO__(0xA7A9, ## __VA_ARGS__), \ + MACRO__(0xA7AC, ## __VA_ARGS__), \ + MACRO__(0xA7AD, ## __VA_ARGS__) + +/* RPL-P */ +#define INTEL_RPLP_IDS(MACRO__, ...) \ + MACRO__(0xA720, ## __VA_ARGS__), \ + MACRO__(0xA7A0, ## __VA_ARGS__), \ + MACRO__(0xA7A8, ## __VA_ARGS__), \ + MACRO__(0xA7AA, ## __VA_ARGS__), \ + MACRO__(0xA7AB, ## __VA_ARGS__) + +/* DG2 */ +#define INTEL_DG2_G10_D_IDS(MACRO__, ...) \ + MACRO__(0x56A0, ## __VA_ARGS__), \ + MACRO__(0x56A1, ## __VA_ARGS__), \ + MACRO__(0x56A2, ## __VA_ARGS__) + +#define INTEL_DG2_G10_E_IDS(MACRO__, ...) \ + MACRO__(0x56BE, ## __VA_ARGS__), \ + MACRO__(0x56BF, ## __VA_ARGS__) + +#define INTEL_DG2_G10_M_IDS(MACRO__, ...) \ + MACRO__(0x5690, ## __VA_ARGS__), \ + MACRO__(0x5691, ## __VA_ARGS__), \ + MACRO__(0x5692, ## __VA_ARGS__) + +#define INTEL_DG2_G10_IDS(MACRO__, ...) \ + INTEL_DG2_G10_D_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G10_E_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G10_M_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_DG2_G11_D_IDS(MACRO__, ...) \ + MACRO__(0x56A5, ## __VA_ARGS__), \ + MACRO__(0x56A6, ## __VA_ARGS__), \ + MACRO__(0x56B0, ## __VA_ARGS__), \ + MACRO__(0x56B1, ## __VA_ARGS__) + +#define INTEL_DG2_G11_E_IDS(MACRO__, ...) \ + MACRO__(0x56BA, ## __VA_ARGS__), \ + MACRO__(0x56BB, ## __VA_ARGS__), \ + MACRO__(0x56BC, ## __VA_ARGS__), \ + MACRO__(0x56BD, ## __VA_ARGS__) + +#define INTEL_DG2_G11_M_IDS(MACRO__, ...) \ + MACRO__(0x5693, ## __VA_ARGS__), \ + MACRO__(0x5694, ## __VA_ARGS__), \ + MACRO__(0x5695, ## __VA_ARGS__) + +#define INTEL_DG2_G11_IDS(MACRO__, ...) \ + INTEL_DG2_G11_D_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G11_E_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G11_M_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_DG2_G12_D_IDS(MACRO__, ...) \ + MACRO__(0x56A3, ## __VA_ARGS__), \ + MACRO__(0x56A4, ## __VA_ARGS__), \ + MACRO__(0x56B2, ## __VA_ARGS__), \ + MACRO__(0x56B3, ## __VA_ARGS__) + +#define INTEL_DG2_G12_M_IDS(MACRO__, ...) \ + MACRO__(0x5696, ## __VA_ARGS__), \ + MACRO__(0x5697, ## __VA_ARGS__) + +#define INTEL_DG2_G12_IDS(MACRO__, ...) \ + INTEL_DG2_G12_D_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G12_M_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_DG2_D_IDS(MACRO__, ...) \ + INTEL_DG2_G10_D_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G11_D_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G12_D_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_DG2_IDS(MACRO__, ...) \ + INTEL_DG2_G10_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G11_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_DG2_G12_IDS(MACRO__, ## __VA_ARGS__) + +#define INTEL_ATS_M150_IDS(MACRO__, ...) \ + MACRO__(0x56C0, ## __VA_ARGS__), \ + MACRO__(0x56C2, ## __VA_ARGS__) + +#define INTEL_ATS_M75_IDS(MACRO__, ...) \ + MACRO__(0x56C1, ## __VA_ARGS__) + +#define INTEL_ATS_M_IDS(MACRO__, ...) \ + INTEL_ATS_M150_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_ATS_M75_IDS(MACRO__, ## __VA_ARGS__) + +/* ARL */ +#define INTEL_ARL_H_IDS(MACRO__, ...) \ + MACRO__(0x7D51, ## __VA_ARGS__), \ + MACRO__(0x7DD1, ## __VA_ARGS__) + +#define INTEL_ARL_U_IDS(MACRO__, ...) \ + MACRO__(0x7D41, ## __VA_ARGS__) \ + +#define INTEL_ARL_S_IDS(MACRO__, ...) \ + MACRO__(0x7D67, ## __VA_ARGS__), \ + MACRO__(0xB640, ## __VA_ARGS__) + +#define INTEL_ARL_IDS(MACRO__, ...) \ + INTEL_ARL_H_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_ARL_U_IDS(MACRO__, ## __VA_ARGS__), \ + INTEL_ARL_S_IDS(MACRO__, ## __VA_ARGS__) + +/* MTL */ +#define INTEL_MTL_U_IDS(MACRO__, ...) \ + MACRO__(0x7D40, ## __VA_ARGS__), \ + MACRO__(0x7D45, ## __VA_ARGS__) + +#define INTEL_MTL_IDS(MACRO__, ...) \ + INTEL_MTL_U_IDS(MACRO__, ## __VA_ARGS__), \ + MACRO__(0x7D55, ## __VA_ARGS__), \ + MACRO__(0x7D60, ## __VA_ARGS__), \ + MACRO__(0x7DD5, ## __VA_ARGS__) + +/* PVC */ +#define INTEL_PVC_IDS(MACRO__, ...) \ + MACRO__(0x0B69, ## __VA_ARGS__), \ + MACRO__(0x0B6E, ## __VA_ARGS__), \ + MACRO__(0x0BD4, ## __VA_ARGS__), \ + MACRO__(0x0BD5, ## __VA_ARGS__), \ + MACRO__(0x0BD6, ## __VA_ARGS__), \ + MACRO__(0x0BD7, ## __VA_ARGS__), \ + MACRO__(0x0BD8, ## __VA_ARGS__), \ + MACRO__(0x0BD9, ## __VA_ARGS__), \ + MACRO__(0x0BDA, ## __VA_ARGS__), \ + MACRO__(0x0BDB, ## __VA_ARGS__), \ + MACRO__(0x0BE0, ## __VA_ARGS__), \ + MACRO__(0x0BE1, ## __VA_ARGS__), \ + MACRO__(0x0BE5, ## __VA_ARGS__) + +/* LNL */ +#define INTEL_LNL_IDS(MACRO__, ...) \ + MACRO__(0x6420, ## __VA_ARGS__), \ + MACRO__(0x64A0, ## __VA_ARGS__), \ + MACRO__(0x64B0, ## __VA_ARGS__) + +/* BMG */ +#define INTEL_BMG_IDS(MACRO__, ...) \ + MACRO__(0xE202, ## __VA_ARGS__), \ + MACRO__(0xE20B, ## __VA_ARGS__), \ + MACRO__(0xE20C, ## __VA_ARGS__), \ + MACRO__(0xE20D, ## __VA_ARGS__), \ + MACRO__(0xE210, ## __VA_ARGS__), \ + MACRO__(0xE211, ## __VA_ARGS__), \ + MACRO__(0xE212, ## __VA_ARGS__), \ + MACRO__(0xE215, ## __VA_ARGS__), \ + MACRO__(0xE216, ## __VA_ARGS__) + +/* PTL */ +#define INTEL_PTL_IDS(MACRO__, ...) \ + MACRO__(0xB080, ## __VA_ARGS__), \ + MACRO__(0xB081, ## __VA_ARGS__), \ + MACRO__(0xB082, ## __VA_ARGS__), \ + MACRO__(0xB083, ## __VA_ARGS__), \ + MACRO__(0xB084, ## __VA_ARGS__), \ + MACRO__(0xB085, ## __VA_ARGS__), \ + MACRO__(0xB086, ## __VA_ARGS__), \ + MACRO__(0xB087, ## __VA_ARGS__), \ + MACRO__(0xB08F, ## __VA_ARGS__), \ + MACRO__(0xB090, ## __VA_ARGS__), \ + MACRO__(0xB0A0, ## __VA_ARGS__), \ + MACRO__(0xB0B0, ## __VA_ARGS__) + +#endif /* __PCIIDS_H__ */ From nobody Tue Jun 24 08:50:14 2025 X-Original-To: dev-commits-src-main@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 4bRJYn6YWGz60VhV; Tue, 24 Jun 2025 08:50:21 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRJYn3lcpz3Q4y; Tue, 24 Jun 2025 08:50:21 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750755021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=bdWyOiSN1r3DLYRzt5zUzZ4te78v7ETFZvSiS8w9wuY=; b=wQ5kbb2PSwv8/cXZ/wjuRe/TrZs7weSkhA7jNJHZj1gDePgsCqWp3+tHnwFsfYsMXk9QqN 7USrbkl47wZfFcol3rRpdYvJ3ClnUxs4rOw690Rru536mWiv6FULyev9L8CPJHjpVbhV2v OFb7IkP6fQqdQWmsjol5Z+uEWe88veGaLjpNataJpVpEoVVVai0E2etC+gZfEiX5XgIXg0 XXWp+jIJic23Ogo5m9hZc4zWDFScLVwnPTU4hueyuuCUC8QfDg2VCg9SYZGu62ToBziTXo 6iD37/TXTYFrdfyMdZK5Pkr/tStDlQSTPhR4mboEIjqTUxYYCQEUd0ZesxRBIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750755021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=bdWyOiSN1r3DLYRzt5zUzZ4te78v7ETFZvSiS8w9wuY=; b=IeasFeABy66yXdnhPOPmbG6X03wICcy+nUF3fU2fp23dFwAbLjg8ozIGj50O4K+Ac8rDo1 cCfMAoFZbIokbTP3zBaKaVrD2DShWAUU0nl2uhnjR0C8waDp5sh1xSf+yrjjoercOOZKoC 3rSpMSe8vOOCqH0wn44RRjoXerOZPUubSryGJZCmsrfGch0/ZNbWYpmgVivjyZyEncYf3p T2xnqm5eaIw2sC/k6E38crdL1pgdW8XoFnHQS2WA390XBW6AFuSs4+j/OF54gAYK6UgSSV ttIuzbUC2aRuXgPYyKefL7xfLb+UPFGyGM/rMwPwS+dfs32GIxrkK0tNONk8Mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750755021; a=rsa-sha256; cv=none; b=PModw57a8ayOKSiwwb7YCc4sXJFetwf/z7f8rmMtYoPxS/RSiJNVurQMeNfJ+i7iYsX374 VCWHhlGFE0CQynij9D0ZI8GCceDEM8wax9sE0mm8TUBiT/Q1/u2D2EI8yPQ2hNWwuMG37v p2KHYMlpTQeu2jfT4Jg8WhrH1/obHo88sJVOJ5wJln9i7/7n9TK5n2em4JqkC0U71Z0jq/ UXDiv3ZhfzNbGCbmjTkJr+3h2yghKf1kb4QDMxQxb7Vd7ulpoMjwokGGOvS2daP7hRJzGd RRtt5wpXStO9r4AaDth2r1jNo4+26F+08PuQ3u3E2fM+7EC8vLqkhGNw3Q7jVQ== Received: from [10.80.0.22] (unknown [89.150.40.109]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bRJYj1JyBzMZB; Tue, 24 Jun 2025 08:50:17 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> Date: Tue, 24 Jun 2025 11:50:14 +0300 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> Content-Language: ru, en-GB From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <20250623093010.71b18c87@slippy> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------uaOisYYLFKc4kGOzu0a06enC" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------uaOisYYLFKc4kGOzu0a06enC Content-Type: multipart/mixed; boundary="------------EO03GQKirQDCRNsF2ev1b7aj"; protected-headers="v1" From: Dima Panov To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> In-Reply-To: <20250623093010.71b18c87@slippy> --------------EO03GQKirQDCRNsF2ev1b7aj Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCk9uIDIzLjA2LjIwMjUgMTk6MzAsIEN5IFNjaHViZXJ0IHdyb3RlOg0KPiBU aGFua3MgZm9yIHBvaW50aW5nIHRoaXMgb3V0LiBUaGlzIGhhcyBiZWVuIGFkZHJlc3NlZC4N Cg0KVGhhbmtzIQ0KQnV0IGxhdGVzdCB0b3VjaCBpbnRyb2R1Y2VkIGEgbmV3IGVycm9yIHdp dGggcGFja2FnZXM6DQoNCkNoZWNraW5nIGludGVncml0eS4uLiBkb25lICgxIGNvbmZsaWN0 aW5nKQ0KICAgLSBGcmVlQlNELWtyYjUtbGliLWRldi0xNS5zbmFwMjAyNTA2MjQwODI5NTMg W0ZyZWVCU0QtQmFzZV0gY29uZmxpY3RzIHdpdGggRnJlZUJTRC1rcmI1LWRldi0xNS5zbmFw MjAyNTA2MjQwODI5NTMgW2luc3RhbGxlZF0gb24gL3Vzci9pbmNsdWRlL2NvbV9lcnIuaA0K Q2hlY2tpbmcgaW50ZWdyaXR5Li4uIGRvbmUgKDAgY29uZmxpY3RpbmcpDQpUaGUgZm9sbG93 aW5nIDQgcGFja2FnZShzKSB3aWxsIGJlIGFmZmVjdGVkIChvZiAwIGNoZWNrZWQpOg0KDQpO ZXcgcGFja2FnZXMgdG8gYmUgSU5TVEFMTEVEOg0KICAgICAgICAgRnJlZUJTRC1rcmI1LWxp Yi1kZXY6IDE1LnNuYXAyMDI1MDYyNDA4Mjk1MyBbRnJlZUJTRC1CYXNlXQ0KICAgICAgICAg RnJlZUJTRC1rcmI1LWxpYi1kZXYtbGliMzI6IDE1LnNuYXAyMDI1MDYyNDA4Mjk1MyBbRnJl ZUJTRC1CYXNlXQ0KDQpJbnN0YWxsZWQgcGFja2FnZXMgdG8gYmUgUkVNT1ZFRDoNCiAgICAg ICAgIEZyZWVCU0Qta3JiNS1kZXY6IDE1LnNuYXAyMDI1MDYyNDA4Mjk1Mw0KICAgICAgICAg RnJlZUJTRC1rcmI1LWRldi1saWIzMjogMTUuc25hcDIwMjUwNjI0MDgyOTUzDQoNCk51bWJl ciBvZiBwYWNrYWdlcyB0byBiZSByZW1vdmVkOiAyDQpOdW1iZXIgb2YgcGFja2FnZXMgdG8g YmUgaW5zdGFsbGVkOiAyDQoNClRoZSBvcGVyYXRpb24gd2lsbCBmcmVlIDE2IE1pQi4NCg0K PiANCj4gV2Ugd2lsbCBmb3JlZ28gdGhlIHdhcm5pbmcgYXMgdXBzdHJlYW0gZG9lc24ndCBp bmNsdWRlIGEgd2FybmluZy4gSQ0KPiBwcmVmZXIgdG8gbGV0IHVwc3RyZWFtIGRlY2lkZSB3 aGV0aGVyIHRvIGRpc3BsYXkgYSB3YXJuaW5nLg0KPiANCj4gWW91ciB0ZXN0aW5nIGlzIG11 Y2hseSBhcHByZWNpYXRlZC4gSXMgdGhpcyB3b3JrIHBhcnQgb2YgcG9ydG1ncidzDQo+IGV4 cC1ydW4/DQo+IA0KDQpOb3BlLCBpdCdzIGEgcGVyc29uYWwgZWZmb3J0IGFuZCBteSBsb3Zl IHRvIEZyZWVCU0QgYW5kIGl0J3MgZnV0dXJlIDopDQoNCg0KQlRXLCBwb3J0cyBuZWVkIHNv bWUgbG92ZSB3aXRoIE1JVCBLUkI1IGluIHRoZSBiYXNlLCBzbyBJIGhhdmUgYSBkaXJ0eSBo YWNrIGZvciBNay9Vc2VzL2dzc2FwaS5tayBhbmQgYWxzbyBpbnRyb2R1Y2VkIGEgbmV3IHZh cmlhYmxlLCBLUkI1X0lNUEwsIHRvIHBhc3MgYXMgYXJndW1lbnQgZm9yIHBvcnRzIHRoYXQg cmVxdWlyZSBzb21ldGhpbmcgbGlrZSBgYGAtLXdpdGgtJHtLUkI1X0lNUEx9LWtyYjU9JHtH U1NBUElCQVNFRElSfWBgYCBmb3IgY29uZmlndXJlIHN0YWdlLg0KDQpodHRwczovL3Blb3Bs ZS5mcmVlYnNkLm9yZy9+Zmx1ZmZ5Ly1wYXRjaGVzL3dpdGhfbWl0a3JiNS5kaWZmDQoNCi0t IA0KU2luY2VyZWx5LA0KRGltYSAoZmx1ZmZ5QEZyZWVCU0Qub3JnLCBodHRwczovL3QubWUv Rmx1ZmZ5QlNELCBAZmx1ZmZ5Om1hdHJpeC1kZXYuZnJlZWJzZC5vcmcpDQooZGVza3RvcCwg a2RlLCB4MTEsIG9mZmljZSwgcG9ydHMtc2VjdGVhbSlARnJlZUJTRCB0ZWFtDQoNCg== --------------EO03GQKirQDCRNsF2ev1b7aj-- --------------uaOisYYLFKc4kGOzu0a06enC Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhaZsYFAwAAAAAACgkQ+4ugndU5jynI 0g/8DobnNKjjAmT4tZdx6Mh99unuGYQZrDsaCwI/SCBTainYXnN5PJFtqrMC3iAlfJ4J+VTWIdIs 4PxpOeQ0OGeIrL0h+1uoLgLn60Pxs5po759zbmO1NCkSjWg9Y+2igQWWZfE0I6Uulx3JYcbfVWSm 3itTLOC5bEJc1wchwVW7+dJEZFU6mjYbgwpZB15WfLaEMOuhdBDJYWxjzJDIXiDd4XvmJpAisLMU Y4TIJm6XaQPoRHEP/MbTN3xMgHZjXNVpRKU9J43VNCy/NpUwisxUxF7MOjTX8RKZPNjqcjnCXhkP qj7swTxsAgxp19a+BnP4RzBr/hCxh1iGy0ewK2k4+e0TMgP+rfnEnvebA6RIppX0OnckYNu2DlP5 GxC7732oZ4mu4cVrhl417moM3oLfWAuBdokKSGvxi+B7zGX4HNl9D9R88VwBU0IybKBitc/DxrFt vnA3UA02fAVR7lPBcIOZiWn0tvPQ/EGByAcbb2Sknt4LK56GnbAP7Br5qyyvsrDQAEF2RNM4EPVq DJNKa5L/5Sl16i5uH0kjVIXhVxPxTtdAKeYe556eHl95I1AGMeDb+gtKDYcrADNoq4bEvLml1KFO fbqRD4FLmKMJmq9aqD1kVdhZQTJK0NHEHoR5n2Ae175VpTCMDRYye+lRDBCsgEE5CqScrz3y5+jx oew= =mVyB -----END PGP SIGNATURE----- --------------uaOisYYLFKc4kGOzu0a06enC-- From nobody Tue Jun 24 08:56:03 2025 X-Original-To: dev-commits-src-main@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 4bRJhQ58hLz60WCd; Tue, 24 Jun 2025 08:56:06 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRJhQ4CmVz3RWj; Tue, 24 Jun 2025 08:56:06 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750755366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=E6jl3rtPOorsISs7i7rfTU3+y5xRuQeDYS+NddyTxcg=; b=bnPM3zm+4Xg5U1MVcfv1Ig+eOEaO6HAgkf3CszJt7BpLtdormctSnlhTaZmnwsmGqiwbQj fDIiJMe+iL1mT9JYCeXxLwdXw3e9oi6iaAP/mT0WfysCpG6cgoR/gaE2SsAkHqAqFgo3rc va0DmP4tjzDo9x0My47QT9MPVjQHlkY09XttUAq1IxeJtNM+1g2bBtKTJiSVYlmsbS1/JH +dZg4AenlRSyQPtbyYmoWcABkIN80DRa/iS89fzyiFdINDzlveOO6AyZtGn4XsLKSj5fGW zcMK1ODBpMY9xeAKcWant+BCoaZDQcP/QWI3eeUhKaDVmVQvR4ZLYBHlZ2VhIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750755366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=E6jl3rtPOorsISs7i7rfTU3+y5xRuQeDYS+NddyTxcg=; b=lp3PB2hB7wf72/HV3f2/QqexAUG9iHoJJ8btBungiettmnA0/zL9IXr28xJKr6LqxsJtsy uIEHUgK/sR2DoaV1McNHVJKxcIDLvWOjBB8ieKpwKO5s0d9uBE5Qf0uZ8CRmZoIlgNk+Op 1+pTXulGPaFGrAnvqByZHV6+NEUpbmf2Vggw38pXMlw5mh3miQZ1a93gUecKKViZl57y8M gr37Q3UWTAk0+363Ab02wXJmaWqLwIp+BKbB3/R6MzV4tWF2Wqhj0CZSlADmDokSNt+vO7 7zn1FzAEqK/RJJ09ggTNBLlweNPI6IbzeWYr4hYEAbHAkiFthd8Kgeu2Bib12Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750755366; a=rsa-sha256; cv=none; b=r3uqxgQdi5FK0F8P2Wwwn5YNYrOCY77Fe3r6JmvVb4XyOPZTKCJlNaVCiqOdNTywHWXl+x dIw3IL9ZT9sE5XnwHYTxxVdLj5hn9j8eVgYpk9VNdYmFZEdjax+U5wK1zVUH0mMlKdLAxw Lin04LVR9LpKK78GRvHqY28vXCBGzcJZrOFVnDRhgxIOkksP/9+NFKYX6x4piGADePnxZh guR9aPtZtu5NRJVt7sspRCpJg4TZiYbZI255cvwALBLf65qDk3IIQyG+pb3zt58lkB+qmy ywALc6uwcy9fJEZMS+0NRyknG4VVQhsmA2+5kAKPVAAN80oW4M/1XH/gdcMcmg== Received: from [10.80.0.22] (unknown [89.150.40.109]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bRJhP5QCvzMlZ; Tue, 24 Jun 2025 08:56:05 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <6001fc68-d500-4429-80f3-fddbdb78a1f6@FreeBSD.org> Date: Tue, 24 Jun 2025 11:56:03 +0300 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build From: Dima Panov To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> Content-Language: ru, en-GB Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------kVsufTswu63jdF9h5LiyyYQM" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------kVsufTswu63jdF9h5LiyyYQM Content-Type: multipart/mixed; boundary="------------N7Qv8J1fVRgG0VkXDxCXdgpN"; protected-headers="v1" From: Dima Panov To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <6001fc68-d500-4429-80f3-fddbdb78a1f6@FreeBSD.org> Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> In-Reply-To: <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> --------------N7Qv8J1fVRgG0VkXDxCXdgpN Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQoNCk9uIDI0LjA2LjIwMjUgMTE6NTAsIERpbWEgUGFub3Ygd3JvdGU6DQo+IEhlbGxvIQ0K PiANCj4gT24gMjMuMDYuMjAyNSAxOTozMCwgQ3kgU2NodWJlcnQgd3JvdGU6DQo+PiBUaGFu a3MgZm9yIHBvaW50aW5nIHRoaXMgb3V0LiBUaGlzIGhhcyBiZWVuIGFkZHJlc3NlZC4NCj4g DQo+IFRoYW5rcyENCj4gQnV0IGxhdGVzdCB0b3VjaCBpbnRyb2R1Y2VkIGEgbmV3IGVycm9y IHdpdGggcGFja2FnZXM6DQo+IA0KPg0KDQpBbmQgbW9yZSBtaXNzZWQgaW5jbHVkZXM6DQoN CkluIGZpbGUgaW5jbHVkZWQgZnJvbSAvdXNyL2luY2x1ZGUva2FkbTUvYWRtaW4uaDo0NToN CkluIGZpbGUgaW5jbHVkZWQgZnJvbSAvdXNyL2luY2x1ZGUvZ3NzcnBjL3JwYy5oOjQyOg0K L3Vzci9pbmNsdWRlL2dzc3JwYy90eXBlcy5oOjEyODoxMDogZmF0YWwgZXJyb3I6ICdnc3Ny cGMvcmVuYW1lLmgnIGZpbGUgbm90IGZvdW5kDQogICAxMjggfCAjaW5jbHVkZSA8Z3NzcnBj L3JlbmFtZS5oPg0KICAgICAgIHwgICAgICAgICAgXn5+fn5+fn5+fn5+fn5+fn4NCjEgZXJy b3IgZ2VuZXJhdGVkLg0KDQoNCi0tIA0KU2luY2VyZWx5LA0KRGltYSAoZmx1ZmZ5QEZyZWVC U0Qub3JnLCBodHRwczovL3QubWUvRmx1ZmZ5QlNELCBAZmx1ZmZ5Om1hdHJpeC1kZXYuZnJl ZWJzZC5vcmcpDQooZGVza3RvcCwga2RlLCB4MTEsIG9mZmljZSwgcG9ydHMtc2VjdGVhbSlA RnJlZUJTRCB0ZWFtDQoNCg== --------------N7Qv8J1fVRgG0VkXDxCXdgpN-- --------------kVsufTswu63jdF9h5LiyyYQM Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhaaCMFAwAAAAAACgkQ+4ugndU5jykf /w/+MwXKLDFZUhCl3Q7bhew77xOTSA9lv5fnJooqu5UbGW0rTJI5HhMGhzVTPAQV4Pmpjj5xRa69 Z8FtDflkTcpwCER4zvfoMwvqetoHrOO/96NtqhdWGfATwfYhcTbRDRmDl4+jNF+lZRVna7yW3wyh fgTM+zqKZRKo81zEPbGRNcZ47rlzRVs0aoSQxbbNrbcs2vXB9xzgQuE9TdXic/9dP2J0IKdvrqSm 2CJR34WKcmgCz3zuTCj/SwivMS+3pDFhYnPAqvXH9eNoy2BTltml8daPGw3TQvw7DC5A5MNOvXJK FSXwGPbJVw4rRlY/ZZOh/orYbElkALsVS1JumnZ6vJ2g0L7wmqXBYmiSuUA8JtXMfH9YM5XtmE9U E3Lk6qLNgjyVZMObHJAoimpHuLhbkoYgnj/0P8Z+uqi8A3GTjrzqQ84Kq1PKY2xI07iudQf+E7Pi Gkh65/VRFEYZ+rm5Qbz8yomGUnr7xI/Rx6ye97UcIpQ3bU2/f7TdSw+xsld9YP7c7yDcfLMDTiZN iutNwGEjhGcVLF1GFSKOUQ00W705Chpy85wt/KwRNjsmgfe7L8ILbSOgjpjmE9gAPuSHeYPp3+AB nBnV9UbP3McxMQNy/WlYerholqPXFSorII6ay4XdzxzWdBObHpVsjL5/4wao6SuWQuJz3lFTwdWT QpU= =8Wnc -----END PGP SIGNATURE----- --------------kVsufTswu63jdF9h5LiyyYQM-- From nobody Tue Jun 24 10:01:58 2025 X-Original-To: dev-commits-src-main@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 4bRL8Q5HhBz5yZwx; Tue, 24 Jun 2025 10:01: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 4bRL8Q4QW7z3qRY; Tue, 24 Jun 2025 10:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750759318; 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=mAMyXCkwsB+HQ9uedslW75IGXNo2hyQed0WNdDt9Sgo=; b=Aj5Vt/kJwxkxaS5HlLuuiwZQ5wpLutvJfjcwhRh38ek8JbLglkx2vWBzHX5ZS0q70uj8rT LBhEm0izYuqM0Ao/jVB0TRX0yfGimgnVhPz+er2g3HAxW5JRunVjITNoKrE3w4gHom1GEj jupCMuLBZxRAbcEtoX4+DuMlIZXs/dnCa+QjVgwi+porBLZvc7lH7qL6nMJxgVNNaJRcq2 0TKeZLmJwPjIO3ZS0ievRn76fmXP7T1IHC/4cAxc0JqnWujn4EAwv5mQEsqPiaBVNJL1td 7Fz4yt/3cqV5+XSbkiwk8Z74uCZwukfVtqoEQBSsSizuJ8tGWMKv6j5xEIhQfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750759318; 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=mAMyXCkwsB+HQ9uedslW75IGXNo2hyQed0WNdDt9Sgo=; b=iGHhNXAEQZLvfBe/czk17Otssj/utYTkk4fJXQsJrzY9dpCynm1qi+MZ01sh+UcCpWUlYG YH/9M3EiC9w5pTwyXI0lZEduZiZbv1fXVicOHyOWxQammbU/JssAZlknRBaKg+SPEcDo3g iy0mA7TmHkOQWfOQQcsdLRLnqMLgMAHpUPVFBXJqc9P2UXcTxmqVF9gq3biq/8+1FV5DSI ruPd13MxQMRyab9+HAvO0i1OmqJhwSCa17n/I6glA6iQyPqKjumGQ3J+Ms2cgxrgcKBNjN 6IM1n39ycxZc4/ahvtSTKnE0kAT2nda836Gep7UsW0OtlgbSp0qj0XZAjbwdOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750759318; a=rsa-sha256; cv=none; b=NCZPz8gToP2Aw7CZgzCl38F3JGa6ci+Kx4T99g/Ve5jcO5cLn+iTXAlTCeWp4ScegfytxG E35ojliZWMJK0xKCWijs8PEMX5DP53OZ1OErQLyRjr3PQ2PjTWfX/ZXQX06SEC0jS35xAY sbxY7zckbdXuon3FraMe/z8st6u55FeCSrFmsPGz7Tqto1lc6C0xT/EU5c23CpV7VXWzZa Wo/IA6KqsWMNLISBNuJqSjItIuce1zPW16a5duwLzoxE+CM5j6Kjmv7/gM+o6NMJI4Nxej cF5HsI2S2ijIm32ptVkXNUs3qOK5zh8ajFOMToSwNgyMaa8L3oWRBcB5IH97NQ== 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 4bRL8Q3jVtzk65; Tue, 24 Jun 2025 10:01: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 55OA1wvt042178; Tue, 24 Jun 2025 10:01:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OA1wms042175; Tue, 24 Jun 2025 10:01:58 GMT (envelope-from git) Date: Tue, 24 Jun 2025 10:01:58 GMT Message-Id: <202506241001.55OA1wms042175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 0b4c4833ee3e - main - ifnet: Eliminate unnecessary synchronization of the interface index in the link layer address List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b4c4833ee3eab0ce46b3bdbf054bca4b6bb7429 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0b4c4833ee3eab0ce46b3bdbf054bca4b6bb7429 commit 0b4c4833ee3eab0ce46b3bdbf054bca4b6bb7429 Author: Zhenlei Huang AuthorDate: 2025-06-24 10:01:18 +0000 Commit: Zhenlei Huang CommitDate: 2025-06-24 10:01:18 +0000 ifnet: Eliminate unnecessary synchronization of the interface index in the link layer address Change 80e60e236d85 made the if_index global, and for the whole lifecycle of an interface its index never changes, then there is no need to synchronize the interface index in the link layer address when moving interfaces from one vnet to another. No functional change intended. Reviewed by: glebius Fixes: 80e60e236d85 ifnet: make if_index global MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50975 --- sys/net/if.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 2363c48a24da..9048fcb0a16a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -930,21 +930,6 @@ if_attach_internal(struct ifnet *ifp, bool vmove) } #endif } -#ifdef VIMAGE - else { - /* - * Update the interface index in the link layer address - * of the interface. - */ - for (ifa = ifp->if_addr; ifa != NULL; - ifa = CK_STAILQ_NEXT(ifa, ifa_link)) { - if (ifa->ifa_addr->sa_family == AF_LINK) { - sdl = (struct sockaddr_dl *)ifa->ifa_addr; - sdl->sdl_index = ifp->if_index; - } - } - } -#endif if (domain_init_status >= 2) if_attachdomain1(ifp); From nobody Tue Jun 24 14:36:35 2025 X-Original-To: dev-commits-src-main@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 4bRSFJ19cKz5ysb0; Tue, 24 Jun 2025 14:36: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 4bRSFJ0Y22z3HQq; Tue, 24 Jun 2025 14:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750775796; 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=3zH2RG4CbFcecgfEOHotNO7rjXPjBRjMs2Q+Y1AHMv4=; b=sUFz2S1XCKlWSqvwJlB8lAezjMVAmdVIkVX/23A98HYoefDrnR1PS6zRoFCwi0CP0zlTBR voBKr+9qRl6EnEPJ1urbou2ljCopu43ZO62ZUiEe2UymSusYIHe/YcSxT8q4N/igD1Nosl 9mL7OuTX8MFsvkGoVMx9wRYHVit1M69jhn4KH731y1TUAvhFXnGtDzqz3O9gPRI22t31PR uEJbN42z7BJVIr/JUz/+30qLnsmveZFenAdU5oKVj/2UANZ3I3Mgk2bUo22y2pXOpz6J6x +NLMOTMNHpJZeSAJwUiqSVyzyDRiyanU7pspGiDy7uIGoTC35I6QSpRLhzPNTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750775796; 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=3zH2RG4CbFcecgfEOHotNO7rjXPjBRjMs2Q+Y1AHMv4=; b=qvAW3v/WNWDiUjCkVcUUGDTcRaiLmDhVGgqnVioTe44g2EzJ04AfRZ8BvLC6Pk6xtM3e93 nODbzs48MnG/jdkqgiSYKJbq+NIykFiahmT0nZxmw1Ba+XFo19bArclWpEnYIY9MO5zYtu nuLs2AGWPxFDgSUe7aXDPtUMFnXQVJFtrkHDUes9sLCp7ZoKItE71YxL7rzG7OfZTQs2/A sFEW6OwDQZfVy0mmf2EVTDp9xL0Io4op/KTodVlh3aBE7S11IWYtWQSed6QTyZqs3WDwqL 4Ctggb47w2GI5WMt8lKQT3936nQOlQqr4+79okCIZdfLJCa6XeRZLyu1qiCo+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750775796; a=rsa-sha256; cv=none; b=LxEq+dChqlVYBWPMvOtY3IGGdRwmIRGzOfxKSBKBqL7XHsHnFTtj0WzQ0dx/TJP5nc03jM vBFo+qq7q8t9TVkEKAC/54Zc3FybRrSOuzU/FD7IYTuWGj5AbsWvYP3FZCCX9wPVDcMHQL 3jODipmX6PHLiU24l4dencMpgQ47L7gadZNi1lpXocjp/wvC4ZIgW1EGZet3k6T2ZHcIGc 6mbv2vk4GHOAB434o3iodOuvwrEGlSIE3odnfjjMvt1L+N9ClBhwNQdHQY1g8NZWjQVusk /dW1Fyu6GjpxbQhRyhEXhCAiEpwx387cJHXDo16I3ADRP8Hhgc8Nao5OdHcFCw== 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 4bRSFJ04Lqzs5d; Tue, 24 Jun 2025 14:36: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 55OEaZ0a053947; Tue, 24 Jun 2025 14:36:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OEaZJD053944; Tue, 24 Jun 2025 14:36:35 GMT (envelope-from git) Date: Tue, 24 Jun 2025 14:36:35 GMT Message-Id: <202506241436.55OEaZJD053944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0d1496f0f1e7 - main - krb5/include: Add missing file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0d1496f0f1e7f1e98b6a7364e571d9400bc6ed8a Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0d1496f0f1e7f1e98b6a7364e571d9400bc6ed8a commit 0d1496f0f1e7f1e98b6a7364e571d9400bc6ed8a Author: Cy Schubert AuthorDate: 2025-06-24 13:20:51 +0000 Commit: Cy Schubert CommitDate: 2025-06-24 14:36:00 +0000 krb5/include: Add missing file A file was missed when generating a list of gssrpc files to be installed. Reported by: fluffy Fixes: ee3960cba106 --- krb5/include/gssrpc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/krb5/include/gssrpc/Makefile b/krb5/include/gssrpc/Makefile index 14f246867701..929c9eaacdc9 100644 --- a/krb5/include/gssrpc/Makefile +++ b/krb5/include/gssrpc/Makefile @@ -23,6 +23,7 @@ INCS= \ pmap_clnt.h \ pmap_prot.h \ pmap_rmt.h \ + rename.h \ rpc_msg.h \ rpc.h \ svc_auth.h \ From nobody Tue Jun 24 14:38:31 2025 X-Original-To: dev-commits-src-main@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 4bRSHb0FN3z5ysYd; Tue, 24 Jun 2025 14:38:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRSHZ4vt3z3JQ9; Tue, 24 Jun 2025 14:38:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id U1yBuUo4o5MqyU4nCuFKYY; Tue, 24 Jun 2025 14:38:34 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id U4nAul0ybWbOaU4nBucS5b; Tue, 24 Jun 2025 14:38:34 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Q5lx4J2a c=1 sm=1 tr=0 ts=685ab86a a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=oIbk6HYF3OhtEG9hQtYA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id D7F4965D; Tue, 24 Jun 2025 07:38:31 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (Postfix) with ESMTP id C49C21CC; Tue, 24 Jun 2025 07:38:31 -0700 (PDT) Date: Tue, 24 Jun 2025 07:38:31 -0700 From: Cy Schubert To: Dima Panov Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: <20250624073831.28469b70@slippy> In-Reply-To: <6001fc68-d500-4429-80f3-fddbdb78a1f6@FreeBSD.org> References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> <6001fc68-d500-4429-80f3-fddbdb78a1f6@FreeBSD.org> Organization: KOMQUATS X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfHv3jS5Xs+P3Ocv7dwwH1oLea0WKFVsBnckyF5N7e0F6biXJZbcX88RpdMgmO47oWc8ebhSeQjNU1BlHnytjBFO0lMF6ScSEoq9dyq5D5A5BQHtYfEmN EyIJQjBEzads4DlUzK7+Cs7Ia/pYe2lIwZZN5rh/Io2w+z42qRHGZO/P+TMuy4nk+eaW4O/Zm4ex41YUm5rPxn9KrZ3ct4tLJJofAr7nh3r7khm79unccjpn /cujVccjiIMVpYsxdDFU925F3GV1LzHb6gYD5N2umyriee8E0OmCov6dtljO3fXpn1YSWPQWEQW5JSPhNH5mQ5M1Bujf/4JndqysEgjtFOwjg8ASbdRBmMY5 pA9inP0t X-Rspamd-Queue-Id: 4bRSHZ4vt3z3JQ9 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] On Tue, 24 Jun 2025 11:56:03 +0300 Dima Panov wrote: > On 24.06.2025 11:50, Dima Panov wrote: > > Hello! > > > > On 23.06.2025 19:30, Cy Schubert wrote: > >> Thanks for pointing this out. This has been addressed. > > > > Thanks! > > But latest touch introduced a new error with packages: > > > > > > And more missed includes: > > In file included from /usr/include/kadm5/admin.h:45: > In file included from /usr/include/gssrpc/rpc.h:42: > /usr/include/gssrpc/types.h:128:10: fatal error: 'gssrpc/rename.h' file not found > 128 | #include > | ^~~~~~~~~~~~~~~~~ > 1 error generated. > > This has now been fixed. The file was missed when generating a list of INCS. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Tue Jun 24 14:49:38 2025 X-Original-To: dev-commits-src-main@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 4bRSXM18sfz5ysdP; Tue, 24 Jun 2025 14:49: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 4bRSXL5YWhz3MYC; Tue, 24 Jun 2025 14:49:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750776578; 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=MXNN01by3cqRsuYX9TxTx8NpI/TkZIlITSrB+z5S52A=; b=qruMo3zxVa4vnPmu8CVkFspxSd42dOnxeNW6u29AhFglaXNtGb2Nk56mi+8COEpieUK9XT o2rmaTZLeUoDN/mi+Da1rRYeGMJ5AbtiW+n95OcjOgR1NZ3uptSmOGRQuSOlpih9E/50sH 4HyGyAbCHekkCWnnKJWugvEYNWu+/5pMPhF/jirnMdFBW90kElE5L4v+U3yVUiaZ/DqURK FPQG1xdbTZ60b72p+1ReekSPERguXNU/L/m+DUDzswavKD12DmibStqUFD4beR1Xj5lM8W 6cCFY6l8NOdymHURpf79sX8QBAm+SOgDuBCFiVSmrrRyE7XRfvenpvWaSSJQvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750776578; 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=MXNN01by3cqRsuYX9TxTx8NpI/TkZIlITSrB+z5S52A=; b=ZEzLS0vWTmIU8HZ77ycIsH5+PEvsfRgKf97v8/2He6IckNH7wzgoqWx3Wwrr0FzA4npjtN 8ARJKFBGGutWpQGFLHgNX7zpyAqZqLgZ3hNnMWlCBHrxxWf+S6mNjAiTcRrMCaCifXm5lX slXBDtdZdzWpH65wzqdZr0x8dp95lb5XAfJsmqz5FVB2OYdfan6PcS5OmhAr6bmVYt1WkB PSsZRJkqSHC0iXKFbIeA8SqKoRPE6DbUWfnW67brpoRzId4ssoGEZ6ePvt7Q2VSd+mzyYo SQYsxj9lYsg0StrPUQLQlWBxtn96YvUY+gXyj3SUyuVFP3/29YRYYhz+KRbcnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750776578; a=rsa-sha256; cv=none; b=Vi3v6feq/3qFc/f4KIKUskEKGSC1OwtEJG83JXicWRocwTtFliq+4Ulyzzlefv8DcqnBRf AuSgdg4nEGEi3v5tPD8wqGg3FrC0d2bdqlSQQRj331Wmh/67LOAM0hMfTRkw7BcW6vhc75 JtRV68xaGTAsiED7/lDfbY8GJlluJ3+aHBsg/GtXTHRC8Zhw5XOlWia7RS9EDU5sQSmCXD C/k9w9pjjvrA/hKhalW/EJEFNXCtPt9oH2Q4cF/WrQZxw9a1OFNMvp/mq+OnToNv0ftfUZ VEtPeQYh6qFgfNsby1/I+0jmYYponR7LgGjc2hRjhnjdpirNZL4P3dd5iJ5XUw== 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 4bRSXL58ffzsf8; Tue, 24 Jun 2025 14:49: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 55OEncTM073016; Tue, 24 Jun 2025 14:49:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OEncL3073013; Tue, 24 Jun 2025 14:49:38 GMT (envelope-from git) Date: Tue, 24 Jun 2025 14:49:38 GMT Message-Id: <202506241449.55OEncL3073013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 88a2d48d39d9 - main - pkill: better document ancestor-hiding List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88a2d48d39d9845e36c8e95a9204001b11e7257e Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=88a2d48d39d9845e36c8e95a9204001b11e7257e commit 88a2d48d39d9845e36c8e95a9204001b11e7257e Author: Kyle Evans AuthorDate: 2025-06-24 14:49:31 +0000 Commit: Kyle Evans CommitDate: 2025-06-24 14:49:31 +0000 pkill: better document ancestor-hiding More prominently note that we'll hide ancestors in the first two paragraphs that provide an overview of pkill/pgrep. It also seems worth noting in the description of -a that we won't ever unhide the pgrep/pkill command itself, as mypid is skipped in all process iteration by way of PSKIP(). Reviewed by: allanjude, des Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51009 --- bin/pkill/pkill.1 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/pkill/pkill.1 b/bin/pkill/pkill.1 index f06b448b5df8..40abbba96362 100644 --- a/bin/pkill/pkill.1 +++ b/bin/pkill/pkill.1 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 5, 2020 +.Dd June 24, 2025 .Dt PKILL 1 .Os .Sh NAME @@ -71,12 +71,17 @@ The .Nm pgrep command searches the process table on the running system and prints the process IDs of all processes that match the criteria given on the command -line. +line, excluding itself and all direct ancestors unless the +.Fl a +option is specified. .Pp The .Nm pkill command searches the process table on the running system and signals all -processes that match the criteria given on the command line. +processes that match the criteria given on the command line, excluding itself +and all direct ancestors unless the +.Fl a +option is specified. .Pp The following options are available: .Bl -tag -width ".Fl F Ar pidfile" @@ -130,6 +135,16 @@ or process and all of its ancestors are excluded (unless .Fl v is used). +Note that the +.Fl a +option will not +.Dq unhide +the +.Nm pgrep +or +.Nm pkill +process itself, even with +.Fl v . .It Fl c Ar class Restrict matches to processes running with specified login class .Ar class . From nobody Tue Jun 24 15:06:13 2025 X-Original-To: dev-commits-src-main@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 4bRSvT2glJz5yv3t; Tue, 24 Jun 2025 15:06:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRSvT1yqgz3S1X; Tue, 24 Jun 2025 15:06:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750777573; 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=47wNrZwBFx5qd1/K/jfXYzG0ZoN+pQgfgcloqSzbg4k=; b=pHexJxg2BxIjoX31BKSTWKH5sH6zXODAgv751eD+GthQOInddTO9d31F5yErkpfGt9/yo1 PirgNES97x5WPEjmwneah9joA4GrT9Fl5jXV7nZB7krLh3VUWgpyDsFRv7zFeIlAkEfeZ/ 6QPOQGAWzIdqhCYpH3DYfCFsk+lrImZvX4j8thcjDDrq+Wz5WSkY+9tBaGFRfrVeXCVhij OVGgFXNamFYPeOIOW11sPV71RM+mJivyurpn1fO9Cwy4nQBaZGNv/5j+G894xLGNPUYH2c jhoncoyd153y/Bnbd7s0NWMwO0AO2VTNlH77+s95+J/rNOE2Xz0TkIpeY6FEyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750777573; 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=47wNrZwBFx5qd1/K/jfXYzG0ZoN+pQgfgcloqSzbg4k=; b=JgysIpJg+6n+eqpy2HH8MQIXZwmiDzdcqTQIqyGGgtL5WnigbIgUkh05AyiqK9CjZj4QqO cmYkbObGKdsVGckILcVsX9xFAYLitwAQVU3Oph2PHSBzn90kH6GfaaQJLurw/dcg9/MHti vOYW2s8RBs7Zjjd7LsxoDcxUE9TjCr8hukazwy+CNGPbOolzqeVjN3oE+ONpIKDJaFFCLQ kIws2vvGgo/fbV4VD3n4sfwFmqBmA8DO0d2S37QQiV+wBwE5WRySpLgdlozfsdLjBlsnwP 04NmeQNI237nTKTReVKNPBVOa3wMu6t3bNHpvO3QbatfUhAc1lmYFis1I+H7Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750777573; a=rsa-sha256; cv=none; b=glQfruzfGCUMBVymBeKthUFxnLkIBqYcq1Emt+eqTh/FOP5alFdaDSNaKMvKrJ5zHQ2mvN N5vScl7Wp2pY0EQGFA7jFn5mStCsPWuyjX7IzxRoJGErmcyfFqX/6MJRvuso406kAzom+v UfN4+28lubNMGyVd7wNSMte0RyXdyF92oQfUtrOjwMY3oWfMZT5h4D3ksAltN2WugPZjAu 7lZVSqsTqEiEPlOvHEEmrYzbEDhF97ifkxGbvMaa2tCF5KKyimCyLy5lDfRORw2GsXrWz1 2mMSm9PVvLejyl1ybgFBLmNdXK2m9vXaan1c59BKpn+LytwnqB+NrOLIfKqlfQ== 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 4bRSvT1Lp5zsmk; Tue, 24 Jun 2025 15:06:13 +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 55OF6Dl5009980; Tue, 24 Jun 2025 15:06:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OF6DSj009977; Tue, 24 Jun 2025 15:06:13 GMT (envelope-from git) Date: Tue, 24 Jun 2025 15:06:13 GMT Message-Id: <202506241506.55OF6DSj009977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: cbb6e747af98 - main - krb5/include: com_err.h and verto.h installed by krb5/util List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: cbb6e747af982206e4646fc1b1685c4f3b29f378 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=cbb6e747af982206e4646fc1b1685c4f3b29f378 commit cbb6e747af982206e4646fc1b1685c4f3b29f378 Author: Cy Schubert AuthorDate: 2025-06-24 14:47:52 +0000 Commit: Cy Schubert CommitDate: 2025-06-24 15:06:00 +0000 krb5/include: com_err.h and verto.h installed by krb5/util krb5/util/et and krb5/util/verto install com_err.h and verto.h respectively. Do not install them again. This causes pkgbase conflicts. Reported by: fluffy Fixes: ee3960cba106 --- krb5/include/Makefile | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/krb5/include/Makefile b/krb5/include/Makefile index fb919434bf93..0a2ceaebb689 100644 --- a/krb5/include/Makefile +++ b/krb5/include/Makefile @@ -17,7 +17,7 @@ SUBDIR= krb5_private krb5 gssrpc gssapi SUBDIR_PARALLEL= -INCSGROUPS= INCS COM_ERR VERTO GSSAPI_KRB5 +INCSGROUPS= INCS GSSAPI_KRB5 INCSDIR= ${INCLUDEDIR} @@ -47,25 +47,11 @@ SDESTDIR?= ${SYSROOT:U${DESTDIR}} .PHONY: force rebuild-error-tables osconf.h -.PATH: ${KRB5_DIR}/util/et -COM_ERRDIR= ${INCLUDEDIR} -COM_ERR= com_err.h - -.PATH: ${KRB5_DIR}/util/verto -VERTODIR= ${INCLUDEDIR} -VERTO= verto-module.h \ - verto.h - .PATH: ${KRB5_DIR}/include/krb5 copies: .PHONY .META cd ${KRB5_DIR}/include; \ ${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m444 ${INCS} ${SDESTDIR}${INCLUDEDIR} - cd ${KRB5_DIR}/util/et; \ - ${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m444 ${COM_ERR} ${SDESTDIR}${INCLUDEDIR} - cd ${KRB5_DIR}/util/verto; \ - ${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m444 ${VERTO} ${SDESTDIR}${INCLUDEDIR} - .include From nobody Tue Jun 24 15:12:55 2025 X-Original-To: dev-commits-src-main@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 4bRT3C62Ndz5yvBP; Tue, 24 Jun 2025 15:12: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 4bRT3C41xGz3Tvc; Tue, 24 Jun 2025 15:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750777975; 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=qnqM0jO7OAlPiyGWZJHU2bRpFbeoEhdgsIKff5H6jgg=; b=hY2HwhMTABSuJWmjz6R5klwLWHVrlj+ho4M9rVbgxc1vr11gL+zQU96CBH2Ls43Oj9jPtC Go57alPsdzgGUD2Ylmqh5tLUy0WF4VeUka8X3VAlxtI47sOwpve5kdIfLnxIALJ+84O5/Z 4OVeGe9xOThzsIVCjtK7w3Gfhq4PP/N43L9Uej5tMs9Pyawn9b0/i1TSsuLR1To5aowcgE 7aNBZxzsJX/MDTWil6KT6F9T82m6rYyZRhNphg5I5HVf2j5F8rpmrLUm9eOGeIJnd9rzoH x4GxGA+8Ak4U444e53cgZ4gs/wIyo+Ma/5vIfUzx8Hsp4xr9wVH/HMcyP+nT4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750777975; 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=qnqM0jO7OAlPiyGWZJHU2bRpFbeoEhdgsIKff5H6jgg=; b=FKpPRizItwcR8vUjGdgUlREQ1ZQT51Fe30VUIaZ/JJXvr3/C71oJKzgOIj/syvdKwk9ocz TcWt/njyOq6EcI/C/VNuFaSbF/jdUlW8lD5svJE77+fhpw+3fhGub/b7VPx++B385x2EQW 8+TSJoVxP5976c4eJ22Sdc4AqI9K3pCDGLJukoJF621RZkH+SEh21K2sFhUNI0OtmB/3th OUVvkyjlsslAnrbWaXm+ejDiUOC4F5yKXpWqmxTnA+CcU4EDDYCSDC4U6uK2QocD3Kbgjt G9gqOhb8qUb249W53VUSEs/Fgzqwxu+uOWn1iL/pPsAFPYofE+leWECxklimVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750777975; a=rsa-sha256; cv=none; b=Jd5j7oAfPznYPlEfSgQf2Ld116wHsafk+t6G5/5AUPJuXBY8BIQdFYeZhP6f53qZH2Q/oL qd24koUkY19ZyPvyAPrFCjm5oTu5rQ1PdklNjODRUKt177/lgZeoDKBeGbDiFAMjw8BRFH Pk8BG6hdKHnjQVxeD80iUC0d0rkUdAJIxN8ccQoKeK38srNkvb462ObJnSKjhwj5Z1ExAn +0vKAe+8dURPhieqMa4gQThPsx+9+M8n5UkCgK2rNC+aAg6ie2odNO+UuvA2Ww0++kaNbR 5W0bd2x44vgEe85DpuT/6/inX7yjFb+23ZvW/fQpznVrW20PURNSOWcw4Gja0A== 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 4bRT3C3PfYzsnH; Tue, 24 Jun 2025 15:12: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 55OFCtYQ028572; Tue, 24 Jun 2025 15:12:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OFCtv0028569; Tue, 24 Jun 2025 15:12:55 GMT (envelope-from git) Date: Tue, 24 Jun 2025 15:12:55 GMT Message-Id: <202506241512.55OFCtv0028569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: ac7a19d41ee5 - main - lualoader: Add distinct brand for installer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac7a19d41ee5eb1271c46fbc620b2f98dffa2230 Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=ac7a19d41ee5eb1271c46fbc620b2f98dffa2230 commit ac7a19d41ee5eb1271c46fbc620b2f98dffa2230 Author: Joseph Mingrone AuthorDate: 2025-06-23 20:47:20 +0000 Commit: Joseph Mingrone CommitDate: 2025-06-24 15:11:15 +0000 lualoader: Add distinct brand for installer Make it obvious to users that the system is booting into the installer. Reviewed by: kevans, manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51001 --- release/Makefile | 3 +++ stand/images/Makefile | 3 ++- stand/images/freebsd-install-brand-rev.png | Bin 0 -> 7724 bytes stand/lua/Makefile | 1 + stand/lua/gfx-install.lua | 24 ++++++++++++++++++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index 5875a22a5bfd..d7721cf4ccd8 100644 --- a/release/Makefile +++ b/release/Makefile @@ -245,6 +245,7 @@ disc1: ${PKGBASE_REPO} echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf + echo loader_brand=\"install\" >> ${.TARGET}/boot/loader.conf echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG @@ -284,6 +285,7 @@ bootonly: echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf + echo loader_brand=\"install\" >> ${.TARGET}/boot/loader.conf echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG @@ -338,6 +340,7 @@ dvd: ${PKGBASE_REPO} echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf + echo loader_brand=\"install\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc diff --git a/stand/images/Makefile b/stand/images/Makefile index d1e7d124dfa6..2f45b989e0a7 100644 --- a/stand/images/Makefile +++ b/stand/images/Makefile @@ -1,6 +1,7 @@ .include -FILES+= freebsd-brand-rev.png freebsd-brand.png freebsd-logo-rev.png +FILES+= freebsd-brand-rev.png freebsd-brand.png freebsd-install-brand-rev.png \ + freebsd-logo-rev.png FILESDIR= /boot/images diff --git a/stand/images/freebsd-install-brand-rev.png b/stand/images/freebsd-install-brand-rev.png new file mode 100644 index 000000000000..59d173d3f8b3 Binary files /dev/null and b/stand/images/freebsd-install-brand-rev.png differ diff --git a/stand/lua/Makefile b/stand/lua/Makefile index 3cec7ae3b050..d319261e18b2 100644 --- a/stand/lua/Makefile +++ b/stand/lua/Makefile @@ -24,6 +24,7 @@ FILES= cli.lua \ gfx-beastie.lua \ gfx-beastiebw.lua \ gfx-fbsdbw.lua \ + gfx-install.lua \ gfx-orb.lua \ gfx-orbbw.lua \ menu.lua \ diff --git a/stand/lua/gfx-install.lua b/stand/lua/gfx-install.lua new file mode 100644 index 000000000000..d4cd34e32e1e --- /dev/null +++ b/stand/lua/gfx-install.lua @@ -0,0 +1,24 @@ +-- +-- Copyright (c) 2025 Joseph Mingrone +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- + +return { + brand = { + ascii = { + image = { + " _____ ____ ____ ____ ___ _ _ _", + "| ___| __ ___ ___| __ ) ___|| _ \\ |_ _|_ __ ___| |_ __ _| | | ___ _ __", + "| |_ | '__/ _ \\/ _ \\ _ \\___ \\| | | | | || '_ \\/ __| __/ _` | | |/ _ \\ '__|", + "| _|| | | __/ __/ |_) |__) | |_| | | || | | \\__ \\ || (_| | | | __/ |", + "|_| |_| \\___|\\___|____/____/|____/ |___|_| |_|___/\\__\\__,_|_|_|\\___|_|", + }, + requires_color = false, + }, + fb = { + image = "/boot/images/freebsd-install-brand-rev.png", + width = 80, + }, + } +} From nobody Tue Jun 24 15:30:04 2025 X-Original-To: dev-commits-src-main@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 4bRTR34XtFz5ywVL; Tue, 24 Jun 2025 15:30:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRTR31WM0z3Y7v; Tue, 24 Jun 2025 15:30:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id U0ViuvILr9JM2U5b4uYSpl; Tue, 24 Jun 2025 15:30:06 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id U5b2uby0jWX70U5b3uAPTk; Tue, 24 Jun 2025 15:30:06 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=d71WygjE c=1 sm=1 tr=0 ts=685ac47e a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=pCfXl5vkbc7RvFvwq00A:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 609C170F; Tue, 24 Jun 2025 08:30:04 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (Postfix) with ESMTP id 4EEF01CF; Tue, 24 Jun 2025 08:30:04 -0700 (PDT) Date: Tue, 24 Jun 2025 08:30:04 -0700 From: Cy Schubert To: Dima Panov Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: <20250624083004.6de66e53@slippy> In-Reply-To: <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> Organization: KOMQUATS X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfCQ0S7L/VsHGEMO03fCmKrRT6FL6pb6vmoH4t/qsvCzBtr++TgJwUGtKK4a0uxgo71nHsKDImo3GhKFvrUVIeNFZN/28xmEsl4c2xnWhCVHKsazBRmBX HC3KRAycx+HyVvretHO5M3iBtBMGgzJDO/Yxl4U/Yqt55yFrJC7TAJuOHiirxsn7njyQQnBrd1QKRKuRWDEG/j5PExjVc/jooYHo0ICW5Lx1bdFa4Sxrq26i KXjnWaAk8yYJM2gZRqId3J/CSrFsVmWOdnOlNnYJN+j5v5bpBROCbohLQC86cBB7YjKjKNfk6l4zPBoaBEBCJo0QH+q+MlYSugxevEoaO2jd83kTGZp3Ab98 JhfA4GTr X-Rspamd-Queue-Id: 4bRTR31WM0z3Y7v X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] On Tue, 24 Jun 2025 11:50:14 +0300 Dima Panov wrote: > Hello! > > On 23.06.2025 19:30, Cy Schubert wrote: > > Thanks for pointing this out. This has been addressed. > > Thanks! > But latest touch introduced a new error with packages: > > Checking integrity... done (1 conflicting) > - FreeBSD-krb5-lib-dev-15.snap20250624082953 [FreeBSD-Base] conflicts with FreeBSD-krb5-dev-15.snap20250624082953 [installed] on /usr/include/com_err.h > Checking integrity... done (0 conflicting) > The following 4 package(s) will be affected (of 0 checked): > > New packages to be INSTALLED: > FreeBSD-krb5-lib-dev: 15.snap20250624082953 [FreeBSD-Base] > FreeBSD-krb5-lib-dev-lib32: 15.snap20250624082953 [FreeBSD-Base] > > Installed packages to be REMOVED: > FreeBSD-krb5-dev: 15.snap20250624082953 > FreeBSD-krb5-dev-lib32: 15.snap20250624082953 > > Number of packages to be removed: 2 > Number of packages to be installed: 2 > > The operation will free 16 MiB. I haven't played around with pkgbase yet. I'll need to look at this further. com_err.h was not touched by the last commit. But, it and /usr/include/verto* were being installed by krb5/include and their respective krb5/util libraries. I didn't verify the output of my generation script at the time and remove the duplicate entries. This has been fixed. > > > > > We will forego the warning as upstream doesn't include a warning. I > > prefer to let upstream decide whether to display a warning. > > > > Your testing is muchly appreciated. Is this work part of portmgr's > > exp-run? > > > > Nope, it's a personal effort and my love to FreeBSD and it's future :) This is still on my todo list. Since people can enable WITH_MITKRB5 we will need a make.conf knob which will default based on a test of __FreeBSD_version. There will be another __FreeBSD_version bump when WITH_MITKRB5=yes is default. > > > BTW, ports need some love with MIT KRB5 in the base, so I have a dirty hack for Mk/Uses/gssapi.mk and also introduced a new variable, KRB5_IMPL, to pass as argument for ports that require something like ```--with-${KRB5_IMPL}-krb5=${GSSAPIBASEDIR}``` for configure stage. > > https://people.freebsd.org/~fluffy/-patches/with_mitkrb5.diff > I'll take a look at this and maybe reach out to you offline to plan the necessary ports changes. I have some gssapi.mk patches to implement an optional port split as requested by some in a PR who want more of a Red Hat style of package split. I'd like to bounce those ideas off someone too before any formal review is put forward. Though, the port split is probably moot now but may still be relevant for older versions of FreeBSD. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Tue Jun 24 15:58:59 2025 X-Original-To: dev-commits-src-main@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 4bRV4N1SKzz5yy4B; Tue, 24 Jun 2025 15:59:00 +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 4bRV4N0hc9z3jD4; Tue, 24 Jun 2025 15:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750780740; 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=DFqzOWUcleZ5GkOKoT0tgl1vHiWWFwOYAiddxGu6BvU=; b=ZUmMU16P8UaIv98o8scKcPCOVjoSg9ueT+AJxMoVNQvztg5f5juInUaiKfKdJKolRvXwHy i6xs4GtIJ8/nxaRtrfYJEOCjwLeP2HDPQ2yQtOplwJkBHt5lHqzH6wXpRBXLxMLr+kdurL yk43PdaQjdoYZC6LyxkzSl+gRzK+YFx6JpdADZgpaBbn/onIqf01pRliLvdrGqdY3uKuNA n/k45HdCbbtK0GXyMyLDWqFEYcEYoGQbiyHqxWUh3Z6RALAd/2bEipuiOh724g8tJFo+bh 6lNImki7tZP7eX2ZuQn0KASgSV4JguFy0VOCzBrpANazi6CSTxmg/dQwEX8rJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750780740; 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=DFqzOWUcleZ5GkOKoT0tgl1vHiWWFwOYAiddxGu6BvU=; b=wnFbbwqi65qfIAlWgT/jakmOgdUbCrsOM6h4dAUlTPyJ4fneLq9PE/UczT0W4TlWHjbVg3 FmWHgsVC167Et4dNp6H4nSEcl8vAlRO5yfBUeepPkUs3dNXPcmcCv0QOYzObxLppwLhG13 PYsh+B5rj01JRUtY8QSI4Wu3Ggg9v77gpY5qQEnZkEiIE16wujC8bt+a4X9hsF2LxtzXcr Q3IlG3w17rvGLSgfQcQGDDjx72DrFwo0UyKG6yUTgrgXXBVOCT9ntsVb6PBEZSrQml/ojR 0RieDh4hNz5DZXPOzMHaaFXIq30eKWAWdEaMcD6e7ecU2gXBbDzI+FKe/l0Vrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750780740; a=rsa-sha256; cv=none; b=Re98yJX7BwgexBXuMdaSu5X4QgB7GQCGWddl2jKTHlFNc3rF/HGAybWDT/cSS/6beLJ/V7 2MrxTD/AroqbieXAwnzFSQ+BwvwrbcsYpG6ujGCFMILL5+5wmdG8uY06YxtCpi8lVPKTvM LHSoUGwiYaNcV/9KPyCynm/GeCQAng6uEjc4HBtYRAeQWoRKdN5g9LX8bhkUT7+gR2nd/b Iu/ewFstp5t1Xg3EoL8ucXBjcLuoED/MLVrjmByNHVMVPu9fOdZXSz/IH+9kh7tKJUVBWi 0M+u+50dzS2Uc+lqCctDya2oLowYc7t6sYeE0FFGf4QEMLdYii52M+OPFAOVig== 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 4bRV4M6yZMztYq; Tue, 24 Jun 2025 15:58:59 +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 55OFwxIk004761; Tue, 24 Jun 2025 15:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OFwx9X004758; Tue, 24 Jun 2025 15:58:59 GMT (envelope-from git) Date: Tue, 24 Jun 2025 15:58:59 GMT Message-Id: <202506241558.55OFwx9X004758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 614087c65e99 - main - sysctl net.inet.tcp.ktlslist: do not rely on global generation for ktls sessions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 614087c65e997fcdedcd60f368a035a4b09d106d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=614087c65e997fcdedcd60f368a035a4b09d106d commit 614087c65e997fcdedcd60f368a035a4b09d106d Author: Konstantin Belousov AuthorDate: 2025-06-24 02:51:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-24 15:58:53 +0000 sysctl net.inet.tcp.ktlslist: do not rely on global generation for ktls sessions Disallow parallel executions for the sysctl, which makes it possible to have the generation count for the sysctl requests itself instead of for the sessions. When the first pass over inpcbs is done, assign them the request' gen count. On the second pass, only externalize the inpcbs with ktls sessions which gen count is equal to the current request. This way, we can be sure that the second pass does not copy out more inpcbs than was counted for in the first pass, while eliminating the global atomic op during ktls session creation. Requested by: gallatin Reviewed by: gallatin, markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D51000 --- sys/kern/uipc_ktls.c | 10 ++-------- sys/netinet/tcp_subr.c | 41 +++++++++++++++++++++++++++++------------ sys/sys/ktls.h | 7 ------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 1cbaa7db2e84..ce09042abdac 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -595,8 +595,6 @@ start: return (error); } -uint64_t ktls_glob_gen = 1; - static int ktls_create_session(struct socket *so, struct tls_enable *en, struct ktls_session **tlsp, int direction) @@ -821,8 +819,7 @@ ktls_create_session(struct socket *so, struct tls_enable *en, arc4rand(tls->params.iv + 8, sizeof(uint64_t), 0); } - atomic_thread_fence_rel(); - tls->gen = atomic_fetchadd_64(&ktls_glob_gen, 1); + tls->gen = 0; *tlsp = tls; return (0); } @@ -865,8 +862,7 @@ ktls_clone_session(struct ktls_session *tls, int direction) memcpy(tls_new->params.cipher_key, tls->params.cipher_key, tls->params.cipher_key_len); - atomic_thread_fence_rel(); - tls_new->gen = atomic_fetchadd_64(&ktls_glob_gen, 1); + tls_new->gen = 0; return (tls_new); } @@ -1946,8 +1942,6 @@ ktls_destroy(struct ktls_session *tls) MPASS(tls->refcount == 0); - atomic_add_acq_64(&ktls_glob_gen, 1); - inp = tls->inp; if (tls->tx) { wlocked = INP_WLOCKED(inp); diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 7cd2168d262b..4542c5ccb8bb 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2669,8 +2669,13 @@ SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, #define SND_TAG_STATUS_MAXLEN 128 #ifdef KERN_TLS + +static struct sx ktlslist_lock; +SX_SYSINIT(ktlslistlock, &ktlslist_lock, "ktlslist"); +static uint64_t ktls_glob_gen = 1; + static int -tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) +tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) { struct xinpgen xig; struct inpcb *inp; @@ -2684,6 +2689,7 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) int error; bool ek, p; + sx_assert(&ktlslist_lock, SA_XLOCKED); if (req->newptr != NULL) return (EPERM); @@ -2692,7 +2698,7 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) ipi_gencnt = V_tcbinfo.ipi_gencnt; bzero(&xig, sizeof(xig)); xig.xig_len = sizeof(xig); - xig.xig_gen = atomic_load_acq_64(&ktls_glob_gen); + xig.xig_gen = ktls_glob_gen++; xig.xig_sogen = so_gencnt; struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, @@ -2708,7 +2714,8 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) ek = export_keys && cr_canexport_ktlskeys( req->td, inp); ksr = so->so_rcv.sb_tls_info; - if (ktls_session_genvis(ksr, xig.xig_gen)) { + if (ksr != NULL) { + ksr->gen = xig.xig_gen; p = true; if (ek) { sz = SIZE_T_MAX; @@ -2726,7 +2733,8 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) } } kss = so->so_snd.sb_tls_info; - if (ktls_session_genvis(kss, xig.xig_gen)) { + if (kss != NULL) { + kss->gen = xig.xig_gen; p = true; if (ek) { sz = SIZE_T_MAX; @@ -2783,11 +2791,11 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) ksr = so->so_rcv.sb_tls_info; kss = so->so_snd.sb_tls_info; xktls = (struct xktls_session *)buf; - if (ktls_session_genvis(ksr, xig.xig_gen)) { + if (ksr != NULL && ksr->gen == xig.xig_gen) { p = true; ktls_session_to_xktls_onedir(ksr, ek, &xktls->rcv); } - if (ktls_session_genvis(kss, xig.xig_gen)) { + if (kss != NULL && kss->gen == xig.xig_gen) { p = true; ktls_session_to_xktls_onedir(kss, ek, &xktls->snd); } @@ -2798,7 +2806,7 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) xktls->so_pcb = (kvaddr_t)inp; memcpy(&xktls->coninf, &inp->inp_inc, sizeof(xktls->coninf)); len = sizeof(*xktls); - if (ktls_session_genvis(ksr, xig.xig_gen)) { + if (ksr != NULL && ksr->gen == xig.xig_gen) { if (ek) { sz = buflen - len; ktls_session_copy_keys(ksr, buf + len, &sz); @@ -2815,7 +2823,7 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) len += sz; } } - if (ktls_session_genvis(kss, xig.xig_gen)) { + if (kss != NULL && kss->gen == xig.xig_gen) { if (ek) { sz = buflen - len; ktls_session_copy_keys(kss, buf + len, &sz); @@ -2845,8 +2853,6 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) } if (error == 0) { - atomic_thread_fence_rel(); - xig.xig_gen = atomic_load_64(&ktls_glob_gen); xig.xig_sogen = so_gencnt; xig.xig_count = cnt; error = SYSCTL_OUT(req, &xig, sizeof(xig)); @@ -2856,16 +2862,27 @@ tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) return (error); } +static int +tcp_ktlslist1(SYSCTL_HANDLER_ARGS, bool export_keys) +{ + int res; + + sx_xlock(&ktlslist_lock); + res = tcp_ktlslist_locked(oidp, arg1, arg2, req, export_keys); + sx_xunlock(&ktlslist_lock); + return (res); +} + static int tcp_ktlslist_nokeys(SYSCTL_HANDLER_ARGS) { - return (tcp_ktlslist(oidp, arg1, arg2, req, false)); + return (tcp_ktlslist1(oidp, arg1, arg2, req, false)); } static int tcp_ktlslist_wkeys(SYSCTL_HANDLER_ARGS) { - return (tcp_ktlslist(oidp, arg1, arg2, req, true)); + return (tcp_ktlslist1(oidp, arg1, arg2, req, true)); } SYSCTL_PROC(_net_inet_tcp, TCPCTL_KTLSLIST, ktlslist, diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 0f9e5c5ed87b..a940bcfaba25 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -233,7 +233,6 @@ struct ktls_session { } __aligned(CACHE_LINE_SIZE); extern unsigned int ktls_ifnet_max_rexmit_pct; -extern uint64_t ktls_glob_gen; typedef enum { KTLS_MBUF_CRYPTO_ST_MIXED = 0, @@ -283,12 +282,6 @@ ktls_free(struct ktls_session *tls) ktls_destroy(tls); } -static inline bool -ktls_session_genvis(const struct ktls_session *ks, uint64_t gen) -{ - return (ks != NULL && ks->gen <= gen); -} - void ktls_session_to_xktls_onedir(const struct ktls_session *ks, bool export_keys, struct xktls_session_onedir *xktls_od); void ktls_session_copy_keys(const struct ktls_session *ktls, From nobody Tue Jun 24 16:28:49 2025 X-Original-To: dev-commits-src-main@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 4bRVkp1CYXz600KM; Tue, 24 Jun 2025 16:28:50 +0000 (UTC) (envelope-from ivy@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRVkp07G5z3qh9; Tue, 24 Jun 2025 16:28:50 +0000 (UTC) (envelope-from ivy@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750782530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xf1J1qkdADNjfZGY/fwWoQKtlnXrq6AJxiRR1QXtZ1M=; b=H+k/3TmtZfyBICjitqSLR+/bBVLuEMPFcyQGG8qroWVnGYnjlgjPqny6X+pt2Iybi2qK54 X9+6PUGt9xknPiYt/vPpO+njb8d07Bj/bnlV32r8grHN7Gyc8SNTgn+8AK15Pn35/cFzLh q+EerOk8qYnEdIq1yjPwFdQkYsZmQ5Lsns/dgYTAVq4gEWVO+IPqlNYdseuQn0kv8k+HBP tcDzn/7Fg0cIETO20OMq+XQjsHCOXIRIHOQki8/G/ZjnkgJL0u7kielR+oE+BJ3DXHQWY7 e52EzVM4Fo67Go5HrTjK4E0+xANJwmgUJvzuSMPZnFohl37oy1Nxu5/eb8Bdag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750782530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xf1J1qkdADNjfZGY/fwWoQKtlnXrq6AJxiRR1QXtZ1M=; b=M67TQwVgDuwQ7VxlDW/hx0MoRX8oTFqq58D9uz2l6MNNX9RHB2Fdko9b7yuLJpZiul/1E9 29IYEgsblDRPlXBbUcWkozRX7k4lDso0IDoIYg3tSj9VWLb5vm3MRWCuGRsJPmuemgTTbm UGHbcMNarDiZKLZ4SoEn/P81EIQQWDBVQ/NPk8/GUtlWn+b6WerTC7PTrQ7l+qX8WeUHZc nG2zP2/NMXcOwmvR+RVR6bIiYFouDDIDKcwmKaGkqV5HeNCisGpJpvXY18Az1INFxncxRs pwhPfFEfBl9Bj3znwnJv2LzDhcrYokgjV6aM0R6Gyo35n1QWoEBQRLwABtM3lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750782530; a=rsa-sha256; cv=none; b=naSxLn1hBXqSejKyB4fN5c62ck5tW+6uGkOMSfD/is6BGV8RroO7abLMfIS6MvttWW12/f ccFUvOfulTEcKfypXYT56DeIYOV4gMvzzjFNxDf2OvGlLamcMgZr5vDSlyLD7re116NCku E9I22mKEYB3jMHmBZWtNj2XdnD6qtyI46U2njtbkjkFTU+TC9ZlGTGJTpN57UqovA+6tUP 0lgEbvhYwNEcJkQgnFh+MzXaWbqy1jBqfJI/ZpLbg6oebqhunsjv43SO4YsQARenfiEUKd RSwR/+2vQR8tuWmM2SPKA7zJVXWHWZLGVDZY/Id+/GPWwK6GNYpUSF2El3wa1Q== Received: by freefall.freebsd.org (Postfix, from userid 1532) id DA85D2AA5; Tue, 24 Jun 2025 16:28:49 +0000 (UTC) Date: Tue, 24 Jun 2025 17:28:49 +0100 From: Lexi Winter To: Cy Schubert Cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: Mail-Followup-To: Cy Schubert , Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> <20250624083004.6de66e53@slippy> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dqKOQqea6XkA3NXh" Content-Disposition: inline In-Reply-To: <20250624083004.6de66e53@slippy> --dqKOQqea6XkA3NXh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cy Schubert: > I'll take a look at this and maybe reach out to you offline to plan > the necessary ports changes. I have some gssapi.mk patches to > implement an optional port split as requested by some in a PR who want > more of a Red Hat style of package split. i think you're referring to my PR. after some more testing, i realised this can't work, because even if you split the port into krb5-libs and krb5-server, krb5-libs still has to be compiled with LDAP support because the support libraries include LDAP code. using an LDAP-enabled kdc with a non-LDAP-enabled libs causes the kdc to crash at startup. so my original intention of making krb5-libs not depend on OpenLDAP isn't possible with that solution. i didn't get around to updating the PR yet, sorry. i'm hoping with MIT krb5 in base, we might be able to find a better solution to this, but i haven't had a chance to actually try it. it may be we have to go with a glib-style "bootstrap port" solution. --dqKOQqea6XkA3NXh Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaFrSPgAKCRD1nT63mIK/ YJ8JAQDL0mU57x9fkrMSpnnxyLMYb+a2Hlhv8iTMWm2dkY6C/gEAwdwswU6TuSHH iX5aD0VSLvIczG70cDi73uo4spaIigs= =pgbN -----END PGP SIGNATURE----- --dqKOQqea6XkA3NXh-- From nobody Tue Jun 24 16:54:02 2025 X-Original-To: dev-commits-src-main@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 4bRWHz01Spz601mV; Tue, 24 Jun 2025 16:54:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRWHx4pkTz3wt5; Tue, 24 Jun 2025 16:54:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.32 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id U0ViuvILs9JM2U6uKubO03; Tue, 24 Jun 2025 16:54:04 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id U6uJucGxIWX70U6uJuAaov; Tue, 24 Jun 2025 16:54:04 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=d71WygjE c=1 sm=1 tr=0 ts=685ad82c a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=J4qffjmMAn0AfVaZbhYA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 9383A11E; Tue, 24 Jun 2025 09:54:02 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 5B759112; Tue, 24 Jun 2025 09:54:02 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert , Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build In-reply-to: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> <20250624083004.6de66e53@slippy> Comments: In-reply-to Lexi Winter message dated "Tue, 24 Jun 2025 17:28:49 +0100." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 24 Jun 2025 09:54:02 -0700 Message-Id: <20250624165402.5B759112@slippy.cwsent.com> X-CMAE-Envelope: MS4xfGRdzz0XDkZJ4hUDbyyH9W2yEQflJsauRHBQPfLvZRun9UTMknMcIuKkMzNPdxvMBWNUTqN5fGwvB8yAsZKotks8RvncAed3thCU6khD8xBxyQ4+hTku rbAb6ccA6q7IN0wFholak3fAjujU6jcCyp91LIgjltgZg+ljUfOZ8E8R18n8luI/17yrkSWBVCJO4ZIoreHrOBqs8PqwYfXn92ImFFBXHHyo0rD46fCgQhFG 3+vK/AF/E/F8oxIL+cR7iYz+UlHYdUIehmPFlthEi/fNOwSONv40eI1l8oTUe9cFLj5DWKdA1yf+yzESJJ3hdBJTQsnXQpCXgmkwpbFPOn3wE/wmJgGyiDR0 lnpBJ91V X-Spamd-Result: default: False [2.75 / 15.00]; NEURAL_SPAM_MEDIUM(0.99)[0.991]; NEURAL_SPAM_SHORT(0.92)[0.918]; NEURAL_SPAM_LONG(0.74)[0.736]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.32:from]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_THREE(0.00)[4]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4bRWHx4pkTz3wt5 X-Spamd-Bar: ++ In message , Lexi Winter writes: > > > --dqKOQqea6XkA3NXh > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > > Cy Schubert: > > I'll take a look at this and maybe reach out to you offline to plan > > the necessary ports changes. I have some gssapi.mk patches to > > implement an optional port split as requested by some in a PR who want > > more of a Red Hat style of package split. > > i think you're referring to my PR. after some more testing, i realised > this can't work, because even if you split the port into krb5-libs and > krb5-server, krb5-libs still has to be compiled with LDAP support > because the support libraries include LDAP code. using an LDAP-enabled > kdc with a non-LDAP-enabled libs causes the kdc to crash at startup. That is correct and it is what I was expressing in the PR. You have a circular reference regardless. Your LDAP server requires Kerberos for authentication while Kerberos stores its KDB in LDAP. You will need to build one without Kerberos support, build the other, then build the first with. The reason the circular dependency isn't readily apparent to most people is that LDAP uses cyrus-sasl-gssapi for authentication which depends on Kerberos. Kerberos in base will not fix this because it uses a BDB KDB database (there is no LDAP in base) and the LDAP configuration uses an LDAP KDB. > > so my original intention of making krb5-libs not depend on OpenLDAP > isn't possible with that solution. i didn't get around to updating the > PR yet, sorry. It's a circular impossibility. But if people wanted it I'd have implemented it and let them figure out whether the chicken or the egg came first. Again, because the circular dependency isn't in people's face, they don't see it. People think splitting the ports will fix the problem. It won't. Splitting the ports will reduce the number of prerequisites installed but I don't think that's worth all the effort. Even though I have a git branch that already implements the change it's not worth the maintenance headache as pkg-plist generation will consume more developer (my) time every upgrade. > > i'm hoping with MIT krb5 in base, we might be able to find a better > solution to this, but i haven't had a chance to actually try it. > it may be we have to go with a glib-style "bootstrap port" solution. It may help bootstrap but you can't rely on it to supply your KDC needs as it doesn't and will never use LDAP, unless we import OpenLDAP into base, and that's another matter of discussion. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 Regarding OpenLDAP in base, should we remove NIS we should consider importing OpenLDAP to replace it. I used to use NIS (still configured) but have migrated my NIS to LDAP. With PAM and nsswitch it's easy to have it reference LDAP before NIS during conversion. Then comment out NIS from nsswitch.conf. This requires a bit of planning to allow both to coexist so that users can convert during a conversion period. From nobody Tue Jun 24 17:06:53 2025 X-Original-To: dev-commits-src-main@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 4bRWZj6TDcz602j7; Tue, 24 Jun 2025 17:06:53 +0000 (UTC) (envelope-from ivy@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRWZj5s2wz436m; Tue, 24 Jun 2025 17:06:53 +0000 (UTC) (envelope-from ivy@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750784813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FcJQWf+25PtPGRMMMwkhK5WrRhBSs4JKwyuR5GlA/jM=; b=nxyUdEjoU52BtVDFmiOTfYSraNqXhEk0VYb5H+1qhUD5iMvvfkLNMzLafUrGnY1WbI2aGx 3zC6VVXpUstHFpKnBpVHRMUS5QArsUPoCV0EMYkb+69xHa0u4hgobvrjNwl9tsNTh2j1MD zG4tEsHafuI2u9cwofQr+i0OJte3QdDmRlPJyhKq+gFH98gchO5JN9PaM6MI+R8GneAJpB elMzyH90yOUGLrZFgA6QFyfc1SkiWL99zogIVf77oamZKtZQAwOz+ff8o0ZMUZXSEFNW/z bNmQVbIVH4U60aJW0xeCWmfmtYvXVlhja3LE+tDb/rllED/4/aRL11kUo5WDvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750784813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FcJQWf+25PtPGRMMMwkhK5WrRhBSs4JKwyuR5GlA/jM=; b=V2Lan3yiY+g02vVSoBEd9rf28B+VhbzFhz47qOMk/rqqKW56ygb2evNobMZGoVE8ZX1OZA FfTKriFdOSPYk484pn8KVouuVBG0x8zUeNZRgRkUr7ouf+L/rzWZALV7xfKgkXOgA/KqFw G4Toha1vBBFg5SIxAjpNfpRjCX79Fd5zDc5q2toD0hw0kGIpoBfZiMIWHf8wi9mVbQ+o3K Qn1f29IYfBjzc0szw1BE78xndV2HOrgIbvB32/tc/5W9EtBj51qXZM4hy/h1+tfbcbDO3K Qd0dcJQRLDNg8HPYcz3FsTyInenRyiSsA/V9rLhWZJfYGNhEhBfMZC3VRDz6yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750784813; a=rsa-sha256; cv=none; b=jbFi1TXDnOZ1wOosJAbz2MBpTS0CuI/HE4vlnxWd6sH9zQZMYDWhoxXiyLz15IRexEW8ri C0v7d5mlocvbSdJyGrUYNHBFv7s3Wq1FIHQyY2oagqIMhdeFTzAsz908NOotZrwRbvkLoU XmPtZTtCHSJYZUmEMdkvmoLFp8A5XdRvcVgdKDu004bWmUkyssE2G3c9jAHNYvnbM6XNr0 8OjE0c84Pnqe5URxxrCXfq0o4ptvosZ4WJZFUkKZk3/9fG3DEcuoUM3XzjFj/vNMk5BEnB ZlfcjN/WrA+cNnJbC+DQHjuBEwrvFMaPeykydn/9pnRt+bQpPB4frcn0xw9j5A== Received: by freefall.freebsd.org (Postfix, from userid 1532) id C20B368C1; Tue, 24 Jun 2025 17:06:53 +0000 (UTC) Date: Tue, 24 Jun 2025 18:06:53 +0100 From: Lexi Winter To: Cy Schubert Cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: Mail-Followup-To: Cy Schubert , Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> <20250624083004.6de66e53@slippy> <20250624165402.5B759112@slippy.cwsent.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wl1wY8zqm+zZ4JUH" Content-Disposition: inline In-Reply-To: <20250624165402.5B759112@slippy.cwsent.com> --wl1wY8zqm+zZ4JUH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Cy Schubert: > In message , Lexi Winter writes: > > i'm hoping with MIT krb5 in base, we might be able to find a better > > solution to this, but i haven't had a chance to actually try it. > > it may be we have to go with a glib-style "bootstrap port" solution. =20 > It may help bootstrap but you can't rely on it to supply your KDC needs a= s=20 > it doesn't and will never use LDAP, unless we import OpenLDAP into base,= =20 > and that's another matter of discussion. i am thinking purely in terms of ports here, e.g.: - krb5-ldap requires openldap26@bootstrap - openldap26@bootstrap builds OpenLDAP without Kerberos support - after building krb5-ldap you then build openldap26 with Kerberos support which is a drop-in replacement for openldap26@bootstrap. then you install krb5-ldap and openldap26-server and the openldap26@bootstrap port is never used after the package build is done. the exact details of how this works might be more complicated but my understanding is that this is how devel/glib20 and devel/gobject-introspection manage to depend on each other. i was hoping MIT krb5 in base would avoid the need for this, but i don't think it does: if ports openldap links to base krb5, and ports krb5 links to ports openldap, you'd end up with the KDC binary linking to both base and ports krb5. so in practice, you'd still need to ignore base Kerberos entirely (other than for NFS) and build everything against ports krb5, like we do now. --wl1wY8zqm+zZ4JUH Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaFrbKgAKCRD1nT63mIK/ YAjqAQDBz63Fwkodgt/MFpL4U5Mb9dCJ3K5C47HRpIRgu8J8HgEAjRz+VpMHS9JN eKv2NarpPZReSXTeFCRfRCVjY+EhPgQ= =PHx+ -----END PGP SIGNATURE----- --wl1wY8zqm+zZ4JUH-- From nobody Tue Jun 24 17:34:42 2025 X-Original-To: dev-commits-src-main@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 4bRXBt411Lz6041r; Tue, 24 Jun 2025 17:34:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRXBs2m9lz4FWR; Tue, 24 Jun 2025 17:34:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id U0QluUl8D5MqyU7XguLXic; Tue, 24 Jun 2025 17:34:44 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id U7XfuoPlcJhBPU7Xguz2Nh; Tue, 24 Jun 2025 17:34:44 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=685ae1b4 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=Qx23DKg_b-MCP-Ps7AQA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id B3FBD158; Tue, 24 Jun 2025 10:34:42 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id ADC1ACA; Tue, 24 Jun 2025 10:34:42 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert , Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build In-reply-to: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> <20250624083004.6de66e53@slippy> <20250624165402.5B759112@slippy.cwsent.com> Comments: In-reply-to Lexi Winter message dated "Tue, 24 Jun 2025 18:06:53 +0100." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 24 Jun 2025 10:34:42 -0700 Message-Id: <20250624173442.ADC1ACA@slippy.cwsent.com> X-CMAE-Envelope: MS4xfHrQgM05cl43xC0pCuu237xNjHD9d7urxd0gAK+kK3dORgOqk4o2KD0Wyku6O95DqLZSXC3keiiVmxIZtTrzYBb6OQgV7PkOuR5Jl6POoa6uE7j8mw0n xaxoL0Vi5phL8wU3UF9QdlaFoDdKhCb4tnq5+CRvs3rNsbX9DrxUm3qLV6V7SJdKvpPo2d4QNXBDP1Qv8MwJTycX8E1e+prnedwgGyeCr3KMbKDnsmspQcOv DiJy766QkW1FbXp/vctbNztS2jEOUlblvZe1w5Gnvb38/G7GKsXeulXh2A09wEGp8jFc66FNg5/Pzc+3h6LZ45R7F4X7GImRIu2pR/z4ZWet7TLRQrfXd3vG Yc+eHjR+ X-Spamd-Result: default: False [2.71 / 15.00]; NEURAL_SPAM_MEDIUM(0.98)[0.980]; NEURAL_SPAM_SHORT(0.96)[0.955]; NEURAL_SPAM_LONG(0.68)[0.676]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_FIVE(0.00)[6] X-Rspamd-Queue-Id: 4bRXBs2m9lz4FWR X-Spamd-Bar: ++ In message , Lexi Winter writes: > > Cy Schubert: > > In message , Lexi Winter writes: > > > i'm hoping with MIT krb5 in base, we might be able to find a better > > > solution to this, but i haven't had a chance to actually try it. > > > it may be we have to go with a glib-style "bootstrap port" solution. > =20 > > It may help bootstrap but you can't rely on it to supply your KDC needs a= > s=20 > > it doesn't and will never use LDAP, unless we import OpenLDAP into base,= > =20 > > and that's another matter of discussion. > > i am thinking purely in terms of ports here, e.g.: > > - krb5-ldap requires openldap26@bootstrap > - openldap26@bootstrap builds OpenLDAP without Kerberos support > - after building krb5-ldap you then build openldap26 with Kerberos > support which is a drop-in replacement for openldap26@bootstrap. > > then you install krb5-ldap and openldap26-server and the > openldap26@bootstrap port is never used after the package build is done. > > the exact details of how this works might be more complicated but my > understanding is that this is how devel/glib20 and > devel/gobject-introspection manage to depend on each other. > > i was hoping MIT krb5 in base would avoid the need for this, but i don't > think it does: if ports openldap links to base krb5, and ports krb5 > links to ports openldap, you'd end up with the KDC binary linking to > both base and ports krb5. so in practice, you'd still need to ignore > base Kerberos entirely (other than for NFS) and build everything against > ports krb5, like we do now. This is the same problem we have with Heimdal currently. This is why gssapi.mk was created in the first place. Considering the alternative it does a fairly good job of insulating ports from whatever kerberos is in base. gssapi.mk should determine its default based on what it finds, whether it be Heimdal in base or ports or MIT in base or ports. The changes made to the kdc rc script detect the kerberos. We should be able to do the same in gssapi.mk. This avoids people having to muck around with make.conf. Currently with Heimdal 1.5.2 in 13 and 14, and in default in 15 (until the default changes), users will need to use some kind of modern kerberos from ports. And this will be the state of affairs until 14 is EOL. gssapi.mk will need to account for this and the best way would be to test 1) if the user has selected a default in make.conf, 2) test if one of the ports is installed and use that, and 3) use whatever is in base (in 13, 14, or 15). Testing for the kdc or krb5kdc binary in ${LOCALBASE} first, next in /usr/libexec will tell gssapi.mk which version is installed. Regardless, LDAP requires one of the ports be prebuilt. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Tue Jun 24 17:41:09 2025 X-Original-To: dev-commits-src-main@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 4bRXLJ5k3pz604Mx; Tue, 24 Jun 2025 17:41:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRXLJ1nLVz4JYr; Tue, 24 Jun 2025 17:41:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id TzcyuUjqK5MqyU7dvuLlFb; Tue, 24 Jun 2025 17:41:11 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id U7dtulflAWbOaU7duucp80; Tue, 24 Jun 2025 17:41:11 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Q5lx4J2a c=1 sm=1 tr=0 ts=685ae337 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=YxBL1-UpAAAA:8 a=VrJqQQMgC7OOvynP3w4A:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 8916616B; Tue, 24 Jun 2025 10:41:09 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 7EC672E; Tue, 24 Jun 2025 10:41:09 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Lexi Winter cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build In-reply-to: <20250624173442.ADC1ACA@slippy.cwsent.com> References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <3742e37c-bca9-4778-881a-94c09aefdb32@FreeBSD.org> <20250623093010.71b18c87@slippy> <5fa53b5b-6c66-4195-8c89-1fc9d7b165bd@FreeBSD.org> <20250624083004.6de66e53@slippy> <20250624165402.5B759112@slippy.cwsent.com> <20250624173442.ADC1ACA@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Tue, 24 Jun 2025 10:34:42 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 24 Jun 2025 10:41:09 -0700 Message-Id: <20250624174109.7EC672E@slippy.cwsent.com> X-CMAE-Envelope: MS4xfKDzuax5Kx2xnL7YJ9p5LwdF10m2ZC3mqQIHrSUVkWSv7Lu7wo19hS9iT7qB2UCUFpNKmifocwDXIVgoon/zOn5myyuZaH+pN8OKDmJsX5jrDl0ydwVt pc41Md6ka8R2JllLCnF9Frp8tg2dFnrDG4qs0TKHFqOE6ozU8pIYbZdoudMCK+/eC3xyMnvkdi8lK8UGSmBGFpj/oiBRWL1sK94zZO/TJYdJgK0CeUzU1H8W 88AygajzisyUd5nWbDW4oj7d4C827ZLxOCKuG3mo3sRfZxTEmksHSS98MtsJGDjJiW20k6+fyLtNoNwWPFAWgGTEv8Ykxk/Ux/rSg1tnFpmCqRKkAVLnbGb4 xg5VY9baUkiAI6ZCZ0R8ryJ7v64PcA== X-Spamd-Result: default: False [2.75 / 15.00]; NEURAL_SPAM_SHORT(0.99)[0.986]; NEURAL_SPAM_MEDIUM(0.98)[0.981]; NEURAL_SPAM_LONG(0.69)[0.686]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_FIVE(0.00)[6] X-Rspamd-Queue-Id: 4bRXLJ1nLVz4JYr X-Spamd-Bar: ++ In message <20250624173442.ADC1ACA@slippy.cwsent.com>, Cy Schubert writes: > In message , Lexi Winter writes: > > > > Cy Schubert: > > > In message , Lexi Winter writes: > > > > i'm hoping with MIT krb5 in base, we might be able to find a better > > > > solution to this, but i haven't had a chance to actually try it. > > > > it may be we have to go with a glib-style "bootstrap port" solution. > > =20 > > > It may help bootstrap but you can't rely on it to supply your KDC needs a > = > > s=20 > > > it doesn't and will never use LDAP, unless we import OpenLDAP into base,= > > =20 > > > and that's another matter of discussion. > > > > i am thinking purely in terms of ports here, e.g.: > > > > - krb5-ldap requires openldap26@bootstrap > > - openldap26@bootstrap builds OpenLDAP without Kerberos support > > - after building krb5-ldap you then build openldap26 with Kerberos > > support which is a drop-in replacement for openldap26@bootstrap. > > > > then you install krb5-ldap and openldap26-server and the > > openldap26@bootstrap port is never used after the package build is done. > > > > the exact details of how this works might be more complicated but my > > understanding is that this is how devel/glib20 and > > devel/gobject-introspection manage to depend on each other. > > > > i was hoping MIT krb5 in base would avoid the need for this, but i don't > > think it does: if ports openldap links to base krb5, and ports krb5 > > links to ports openldap, you'd end up with the KDC binary linking to > > both base and ports krb5. so in practice, you'd still need to ignore > > base Kerberos entirely (other than for NFS) and build everything against > > ports krb5, like we do now. > > This is the same problem we have with Heimdal currently. This is why > gssapi.mk was created in the first place. Considering the alternative it > does a fairly good job of insulating ports from whatever kerberos is in > base. > > gssapi.mk should determine its default based on what it finds, whether it > be Heimdal in base or ports or MIT in base or ports. The changes made to > the kdc rc script detect the kerberos. We should be able to do the same in > gssapi.mk. This avoids people having to muck around with make.conf. > > Currently with Heimdal 1.5.2 in 13 and 14, and in default in 15 (until the > default changes), users will need to use some kind of modern kerberos from > ports. And this will be the state of affairs until 14 is EOL. gssapi.mk > will need to account for this and the best way would be to test 1) if the > user has selected a default in make.conf, 2) test if one of the ports is > installed and use that, and 3) use whatever is in base (in 13, 14, or 15). > > Testing for the kdc or krb5kdc binary in ${LOCALBASE} first, next in > /usr/libexec will tell gssapi.mk which version is installed. > > Regardless, LDAP requires one of the ports be prebuilt. Something we should start thinking about is bringing FreeIPA into ports. FreeIPA allows building a trust relationship between it and Microsoft Active Directory. I don't know what the requirements are but it's been on my radar for a while. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Tue Jun 24 19:34:09 2025 X-Original-To: dev-commits-src-main@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 4bRZrd4zvfz60B6G; Tue, 24 Jun 2025 19:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRZrd38H9z42KL; Tue, 24 Jun 2025 19:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750793649; 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=ruKk0n+zL3DIYac+JqSF+yrgzFh/+P4IOUF0iYwhVqA=; b=FgU7W3/GET1Dh2ED9NT7r+8/HeXZpv0NogPSm7nR7k5diUXTj3urMTZGYT2yEAKqPJeClU wUbEiIrGxtF8rjB9KGFsvoahwkJfu0QH/XMNf6KRAXyoQNpA6wllI5F8r8hOKzt3ePeNVL DLBKR+DS6TfPvTgMoxrr11NdtRawJ7pZ5FcpO3kcY9cAf5kkihgB72wMkXdOowrdlLFeGt uGMTTFzXBZJTE53IDfkutsCuoa2vPXXAqfykZcUvGCiaOdG+We54WAl9kgBvxWddraNmTl TpVJTRPyWZYND4u2DVwRRxeT8HPB2PMH3368OyAwf1lvMvQ1Z8yHTVIdYmObYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750793649; 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=ruKk0n+zL3DIYac+JqSF+yrgzFh/+P4IOUF0iYwhVqA=; b=Zz3lEHXl2MMqTs0XP4IPhOSikxuNf3x3WGOCdknQ2knvjMg/ODe1g1iexAodpKk3+UJVg8 CqJs8QJG/EAnf3Y8jnVS/aaacuAK2BXGGXSHl9r5d/ovFmeft7LzPauSxmTF7gK8mEW5Vb Bxxoj9ya1qMGgjuq5HNLD5OtbV2qLj+lYBNcy6+s+J5bAniVRJae+ep6/NPOjhnQMNwQ/1 fSCQUguO3wTen4o36hgCgQM4p60VW+VRoFtUQqwIJ4zHs6llN/9l+4GvuYuJyV/A61vXQ4 wZfI8MV8uuALDr2k1uGccksW5pPBKY7PR1HqlP1GSk3qOWaIRscP9iardd/6Ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750793649; a=rsa-sha256; cv=none; b=DqPdd58EAqozF7BI4UPrHCOodM5JcHRvjFSQ1kR1YKfcLSupchq3+pr7tmJR/372Kqg581 2twEzO1nC0FII0uaTMKCjpDNJXtw+VW6Nhv1jLUX9fGrP69nxTiE5iIow/djbBS7828tdq p1lFnj+Z71W1JIF61x88nET6d2I/aKNGoKnqbQ912VdbqIJy3vJVqp2E/oTao3pcSIQqVL 9adyE9htE70ab3ZBNb3rbm6Ii0/FrqHIq2kxOfEybYFNOiPiWOeRAMaeVxLUlfyq5w4GO8 S/MLzpCkZJTk9SjJZUp4eFVBQ7+ahnV3szcbkz6Ef9we/2ZitZz4/qwNTTz3JA== 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 4bRZrd2Smkz11qw; Tue, 24 Jun 2025 19:34:09 +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 55OJY9tE015142; Tue, 24 Jun 2025 19:34:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OJY9lH015139; Tue, 24 Jun 2025 19:34:09 GMT (envelope-from git) Date: Tue, 24 Jun 2025 19:34:09 GMT Message-Id: <202506241934.55OJY9lH015139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1b0b13915aae - main - bsdinstall: Report error from installing firmware List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b0b13915aaea80007e4ff86f2bb4f622e10d780 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1b0b13915aaea80007e4ff86f2bb4f622e10d780 commit 1b0b13915aaea80007e4ff86f2bb4f622e10d780 Author: Ed Maste AuthorDate: 2025-06-19 16:00:30 +0000 Commit: Ed Maste CommitDate: 2025-06-24 19:13:39 +0000 bsdinstall: Report error from installing firmware We should improve error reporting from commands invoked by binstall more generally, but this is a small improvement for an observed failure case. PR: 287654 Reviewed by: allanjude Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50941 --- usr.sbin/bsdinstall/scripts/firmware | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/usr.sbin/bsdinstall/scripts/firmware b/usr.sbin/bsdinstall/scripts/firmware index a563f0e578e4..0fc66f0a0261 100644 --- a/usr.sbin/bsdinstall/scripts/firmware +++ b/usr.sbin/bsdinstall/scripts/firmware @@ -115,11 +115,23 @@ f_quietly cp -f $BSDINSTALL_TMPETC/resolv.conf $BSDINSTALL_CHROOT/etc/ ${DIALOG} --title "$DIALOG_TITLE" --backtitle "$DIALOG_BACKTITLE" \ --infobox "Installing firmware. This may take a moment." 0 0 +pkg_install_fail= # Install each of the selected firmware packages for fw in ${selected}; do # We install one at a time in case one is not avail. # pkg-install.8 needs an option to skip unavail. ASSUME_ALWAYS_YES=YES chroot $BSDINSTALL_CHROOT pkg install -qy ${fw} + if [ $? -ne 0 ]; then + pkg_install_fail="$pkg_install_fail $fw" + fi done +if [ -n "$pkg_install_fail" ]; then + # Error(s) were likely spammed to the console; give the user a moment + # to read them. + sleep 5 + bsddialog --backtitle "$OSNAME Installer" --title "Error" \ + --msgbox "Error fetching firmware file(s)$pkg_install_fail" 0 0 + exit 1 +fi # end From nobody Tue Jun 24 21:04:34 2025 X-Original-To: dev-commits-src-main@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 4bRcry30XQz60H9J; Tue, 24 Jun 2025 21:04:34 +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 4bRcry2VHgz3xVn; Tue, 24 Jun 2025 21:04:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750799074; 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=YtX/GtBsko+5BfEQwxFbNIrHnwli2LbKX55ZK9NDOew=; b=HMmDtRyoxIl5oXiZ1WTK/7DxTSAfn7QM7e7LPb7sUXhr6uuUiB/U+BTpmihIemw8HZjju0 7trYAo66XCcCZJ2icp9U5WwdLa04ZHB7+7TcvU1sA/luJcqZ94U3aBgH6OseyOuzFbaraG +bVb3TYJV+avUyXP16EpMROeY+pLiJQmZBgvTuJSKVXgUZK1OuGZLcoU1tC1Wf60afL9Ec wLC/4xD487vDQCAaaRNjRbOzWSKLfKGsUSwlGuYqaarpVS7rLnEuxJ1gN2i3h/ywp8+LlM aA6mxtqPPDt/erst/hj6gOtJSdbPWYFS6xo2HlbYoWw+A+4vjtTmLiV7v68B/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750799074; 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=YtX/GtBsko+5BfEQwxFbNIrHnwli2LbKX55ZK9NDOew=; b=JwON7Z/2oxlvA/0w/QMynLP8mbYqlyYDm76bROrG4eoTMTE8ps1BR7dwL+1VxE0f2RXLnD 4huKUT5vUt4sTxoU55SPlhZX2AJYwj3HwSIh7L62OejHoEfkYAviP0pwUALFgOEgnV0Bvt HiTApy9Hy7ymPaR+YFa1e3YOUS99wLYNimfDsBmwgaxGdQIlhwN5KAAoswnBDMxQNWVjy4 +kGYtARavi2Kpsw6T3XZn1/vifz2DZnRcbioxE+Rd3rIjXhjLjbsxaEi2S0pycM5QynukG R4e/j6mz857/yJ1I/FRXWK5nNgk/4MU9I8/4FA3Z8+68oaw9qmgcaF9rMj5eYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750799074; a=rsa-sha256; cv=none; b=juw1bmGy1V1EXGpBhK5nuUDS6Qovp11gRxbvXSdywvnB77fJGvttcYruTddrQHQXLEpM4a YCVMk35zzpRSO0PwTa0VbylZ6/j3Yblj7b3Q5w7Y6njkowgq+pECOYcTnTtDhGG1ONEguB axtTqLulOaRZV8oA+7DTeD2sD9hw2OZwaIvt4fMAAGt7W7brAGcm3nle5djyfXtgNMEXmc rHTD3EbhMniAq8o6j7r1wCixJNnLVtyo1T6ofx2n71r7uCfniPwlv8jNKEwbBJLcw/Bbdj Q6PkBS7h4+JPaFuc2eqpERCQupoJvvyktD1PlfSzk1aipzaKijQug8xcZiyeZw== 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 4bRcry24w8z146L; Tue, 24 Jun 2025 21:04:34 +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 55OL4YTx085208; Tue, 24 Jun 2025 21:04:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OL4YbN085205; Tue, 24 Jun 2025 21:04:34 GMT (envelope-from git) Date: Tue, 24 Jun 2025 21:04:34 GMT Message-Id: <202506242104.55OL4YbN085205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f35525ff2053 - main - file: Add a fd flag with O_RESOLVE_BENEATH semantics List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: f35525ff2053e026a423e852136d73ed93c95803 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f35525ff2053e026a423e852136d73ed93c95803 commit f35525ff2053e026a423e852136d73ed93c95803 Author: Mark Johnston AuthorDate: 2025-06-24 20:17:07 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 21:04:18 +0000 file: Add a fd flag with O_RESOLVE_BENEATH semantics The O_RESOLVE_BENEATH openat(2) flag restricts name lookups such that they remain under the directory referenced by the dirfd. This commit introduces an implicit version of the flag, FD_RESOLVE_BENEATH, stored in the file descriptor entry. When the flag is set, any lookup relative to that fd automatically has O_RESOLVE_BENEATH semantics. Furthermore, the flag is sticky, meaning that it cannot be cleared, and it is copied by dup() and openat(). File descriptors with FD_RESOLVE_BENEATH set may not be passed to fchdir(2) or fchroot(2). Various fd lookup routines are modified to return fd flags to the caller. This flag will be used to address a case where jails with different root directories and the ability to pass SCM_RIGHTS messages across the jail boundary can transfer directory fds in such as way as to allow a filesystem escape. PR: 262180 Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D50371 --- lib/libsys/fcntl.2 | 63 +++++++++++++++++++---------- sys/fs/fdescfs/fdesc_vnops.c | 4 +- sys/kern/kern_descrip.c | 95 ++++++++++++++++++++++++++++++++------------ sys/kern/uipc_syscalls.c | 2 +- sys/kern/vfs_acl.c | 4 +- sys/kern/vfs_cache.c | 14 +++++-- sys/kern/vfs_extattr.c | 8 ++-- sys/kern/vfs_syscalls.c | 28 +++++++++---- sys/sys/fcntl.h | 2 + sys/sys/file.h | 2 +- sys/sys/filedesc.h | 8 +++- sys/sys/namei.h | 1 + 12 files changed, 162 insertions(+), 69 deletions(-) diff --git a/lib/libsys/fcntl.2 b/lib/libsys/fcntl.2 index b5d4abe35aeb..604de43e5e8c 100644 --- a/lib/libsys/fcntl.2 +++ b/lib/libsys/fcntl.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 7, 2021 +.Dd June 5, 2025 .Dt FCNTL 2 .Os .Sh NAME @@ -80,6 +80,11 @@ associated with the new file descriptor is cleared, so the file descriptor is to remain open across .Xr execve 2 system calls. +.It +The +.Dv FD_RESOLVE_BENEATH +flag, described below, will be set if it was set on the original +descriptor. .El .It Dv F_DUPFD_CLOEXEC Like @@ -113,29 +118,47 @@ Use instead of .Dv F_DUP2FD . .It Dv F_GETFD -Get the close-on-exec flag associated with the file descriptor -.Fa fd -as -.Dv FD_CLOEXEC . -If the returned value ANDed with -.Dv FD_CLOEXEC -is 0, -the file will remain open across -.Fn exec , -otherwise the file will be closed upon execution of +Get the flags associated with the file descriptor +.Fa fd . +The following flags are defined: +.Bl -tag -width FD_RESOLVE_BENEATH +.It Dv FD_CLOEXEC +The file will be closed upon execution of .Fn exec .Fa ( arg is ignored). +Otherwise, the file descriptor will remain open. +.It Dv FD_RESOLVE_BENEATH +All path name lookups relative to that file descriptor +will behave as if the lookup had +.Dv O_RESOLVE_BENEATH +or +.Dv AT_RESOLVE_BENEATH +semantics. +It is not permitted to call +.Xr fchdir 2 +or +.Xr fchroot 2 +on such a file descriptor. +The +.Dv FD_RESOLVE_BENEATH +flag is sticky, meaning that it is preserved by +.Xr dup 2 +and similar operations, and opening a directory with +.Xr openat 2 +where the directory descriptor has the flag set causes the new directory +descriptor to also have the flag set. +.El .It Dv F_SETFD -Set the close-on-exec flag associated with -.Fa fd -to -.Fa arg , -where -.Fa arg -is either 0 or -.Dv FD_CLOEXEC , -as described above. +Set flags associated with +.Fa fd . +The available flags are +.Dv FD_CLOEXEC +and +.Dv FD_RESOLVE_BENEATH . +The +.Dv FD_RESOLVE_BENEATH +flag cannot be cleared once set. .It Dv F_GETFL Get descriptor status flags, as described below .Fa ( arg diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 9ec80794e795..676ea5de12b8 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -502,7 +502,7 @@ fdesc_setattr(struct vop_setattr_args *ap) cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); } else { error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_SET), NULL, &fp); } if (error) { /* @@ -639,7 +639,7 @@ fdesc_readlink(struct vop_readlink_args *va) VOP_UNLOCK(vn); td = curthread; - error = fget_cap(td, fd_fd, &cap_no_rights, &fp, NULL); + error = fget_cap(td, fd_fd, &cap_no_rights, NULL, &fp, NULL); if (error != 0) goto out; diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index e70f2d248365..bbd6d530f478 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -109,8 +109,8 @@ static void fdgrowtable_exp(struct filedesc *fdp, int nfd); static void fdunused(struct filedesc *fdp, int fd); static void fdused(struct filedesc *fdp, int fd); static int fget_unlocked_seq(struct thread *td, int fd, - const cap_rights_t *needrightsp, struct file **fpp, - seqc_t *seqp); + const cap_rights_t *needrightsp, uint8_t *flagsp, + struct file **fpp, seqc_t *seqp); static int getmaxfd(struct thread *td); static u_long *filecaps_copy_prep(const struct filecaps *src); static void filecaps_copy_finish(const struct filecaps *src, @@ -527,7 +527,9 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) fde = fdeget_noref(fdp, fd); if (fde != NULL) { td->td_retval[0] = - (fde->fde_flags & UF_EXCLOSE) ? FD_CLOEXEC : 0; + ((fde->fde_flags & UF_EXCLOSE) ? FD_CLOEXEC : 0) | + ((fde->fde_flags & UF_RESOLVE_BENEATH) ? + FD_RESOLVE_BENEATH : 0); error = 0; } FILEDESC_SUNLOCK(fdp); @@ -538,8 +540,13 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) FILEDESC_XLOCK(fdp); fde = fdeget_noref(fdp, fd); if (fde != NULL) { + /* + * UF_RESOLVE_BENEATH is sticky and cannot be cleared. + */ fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) | - (arg & FD_CLOEXEC ? UF_EXCLOSE : 0); + ((arg & FD_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | + ((arg & FD_RESOLVE_BENEATH) != 0 ? + UF_RESOLVE_BENEATH : 0); error = 0; } FILEDESC_XUNLOCK(fdp); @@ -2164,7 +2171,8 @@ _finstall(struct filedesc *fdp, struct file *fp, int fd, int flags, seqc_write_begin(&fde->fde_seqc); #endif fde->fde_file = fp; - fde->fde_flags = (flags & O_CLOEXEC) != 0 ? UF_EXCLOSE : 0; + fde->fde_flags = ((flags & O_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | + ((flags & O_RESOLVE_BENEATH) != 0 ? UF_RESOLVE_BENEATH : 0); if (fcaps != NULL) filecaps_move(fcaps, &fde->fde_caps); else @@ -2912,7 +2920,7 @@ out: #ifdef CAPABILITIES int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, struct filecaps *havecapsp) + uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp) { struct filedesc *fdp = td->td_proc->p_fd; int error; @@ -2921,7 +2929,8 @@ fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, *fpp = NULL; for (;;) { - error = fget_unlocked_seq(td, fd, needrightsp, &fp, &seq); + error = fget_unlocked_seq(td, fd, needrightsp, flagsp, &fp, + &seq); if (error != 0) return (error); @@ -2952,10 +2961,10 @@ get_locked: #else int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, struct filecaps *havecapsp) + uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp) { int error; - error = fget_unlocked(td, fd, needrightsp, fpp); + error = fget_unlocked(td, fd, needrightsp, flagsp, fpp); if (havecapsp != NULL && error == 0) filecaps_fill(havecapsp); @@ -3038,7 +3047,7 @@ out: #ifdef CAPABILITIES int -fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp) { const struct filedescent *fde; const struct fdescenttbl *fdt; @@ -3048,7 +3057,7 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) const cap_rights_t *haverights; cap_rights_t rights; seqc_t seq; - int fd; + int fd, flags; VFS_SMR_ASSERT_ENTERED(); @@ -3068,7 +3077,9 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) return (EAGAIN); if (__predict_false(cap_check_inline_transient(haverights, &rights))) return (EAGAIN); - *fsearch = ((fp->f_flag & FSEARCH) != 0); + flags = fp->f_flag & FSEARCH; + flags |= (fde->fde_flags & UF_RESOLVE_BENEATH) != 0 ? + O_RESOLVE_BENEATH : 0; vp = fp->f_vnode; if (__predict_false(vp == NULL)) { return (EAGAIN); @@ -3102,17 +3113,19 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) #endif } *vpp = vp; + *flagsp = flags; return (0); } #else int -fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp) { + const struct filedescent *fde; const struct fdescenttbl *fdt; struct filedesc *fdp; struct file *fp; struct vnode *vp; - int fd; + int fd, flags; VFS_SMR_ASSERT_ENTERED(); @@ -3121,9 +3134,13 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) fdt = fdp->fd_files; if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) return (EBADF); - fp = fdt->fdt_ofiles[fd].fde_file; + fde = &fdt->fdt_ofiles[fd]; + fp = fde->fde_file; if (__predict_false(fp == NULL)) return (EAGAIN); + flags = fp->f_flag & FSEARCH; + flags |= (fde->fde_flags & UF_RESOLVE_BENEATH) != 0 ? + O_RESOLVE_BENEATH : 0; *fsearch = ((fp->f_flag & FSEARCH) != 0); vp = fp->f_vnode; if (__predict_false(vp == NULL || vp->v_type != VDIR)) { @@ -3139,6 +3156,7 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) return (EAGAIN); filecaps_fill(&ndp->ni_filecaps); *vpp = vp; + *flagsp = flags; return (0); } #endif @@ -3152,13 +3170,15 @@ fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp) struct componentname *cnp; cap_rights_t rights; int error; + uint8_t flags; td = curthread; rights = *ndp->ni_rightsneeded; cap_rights_set_one(&rights, CAP_LOOKUP); cnp = &ndp->ni_cnd; - error = fget_cap(td, ndp->ni_dirfd, &rights, &fp, &ndp->ni_filecaps); + error = fget_cap(td, ndp->ni_dirfd, &rights, &flags, &fp, + &ndp->ni_filecaps); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_ops == &badfileops)) { @@ -3176,6 +3196,10 @@ fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp) */ if ((fp->f_flag & FSEARCH) != 0) cnp->cn_flags |= NOEXECCHECK; + if ((flags & UF_RESOLVE_BENEATH) != 0) { + cnp->cn_flags |= RBENEATH; + ndp->ni_resflags |= NIRES_BENEATH; + } fdrop(fp, td); #ifdef CAPABILITIES @@ -3223,7 +3247,7 @@ out_free: #ifdef CAPABILITIES static int fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, seqc_t *seqp) + uint8_t *flagsp, struct file **fpp, seqc_t *seqp) { struct filedesc *fdp; const struct filedescent *fde; @@ -3232,6 +3256,7 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, seqc_t seq; cap_rights_t haverights; int error; + uint8_t flags; fdp = td->td_proc->p_fd; fdt = fdp->fd_files; @@ -3243,6 +3268,7 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde_inline(fde); fp = fde->fde_file; + flags = fde->fde_flags; if (__predict_false(fp == NULL)) { if (seqc_consistent(fd_seqc(fdt, fd), seq)) return (EBADF); @@ -3271,19 +3297,21 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, fdrop(fp, td); } *fpp = fp; - if (seqp != NULL) { + if (flagsp != NULL) + *flagsp = flags; + if (seqp != NULL) *seqp = seq; - } return (0); } #else static int fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, seqc_t *seqp __unused) + uint8_t *flagsp, struct file **fpp, seqc_t *seqp __unused) { struct filedesc *fdp; const struct fdescenttbl *fdt; struct file *fp; + uint8_t flags; fdp = td->td_proc->p_fd; fdt = fdp->fd_files; @@ -3292,6 +3320,7 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, for (;;) { fp = fdt->fdt_ofiles[fd].fde_file; + flags = fdt->fdt_ofiles[fd].fde_flags; if (__predict_false(fp == NULL)) return (EBADF); if (__predict_false(!refcount_acquire_if_not_zero(&fp->f_count))) { @@ -3308,6 +3337,8 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, break; fdrop(fp, td); } + if (flagsp != NULL) + *flagsp = flags; *fpp = fp; return (0); } @@ -3321,8 +3352,8 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, * racing with itself. */ int -fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp) +fget_unlocked_flags(struct thread *td, int fd, const cap_rights_t *needrightsp, + uint8_t *flagsp, struct file **fpp) { struct filedesc *fdp; #ifdef CAPABILITIES @@ -3334,6 +3365,7 @@ fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, seqc_t seq; const cap_rights_t *haverights; #endif + uint8_t flags; fdp = td->td_proc->p_fd; fdt = fdp->fd_files; @@ -3346,8 +3378,10 @@ fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, fde = &fdt->fdt_ofiles[fd]; haverights = cap_rights_fde_inline(fde); fp = fde->fde_file; + flags = fde->fde_flags; #else fp = fdt->fdt_ofiles[fd].fde_file; + flags = fdt->fdt_ofiles[fd].fde_flags; #endif if (__predict_false(fp == NULL)) goto out_fallback; @@ -3371,12 +3405,21 @@ fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, #endif goto out_fdrop; *fpp = fp; + if (flagsp != NULL) + *flagsp = flags; return (0); out_fdrop: fdrop(fp, td); out_fallback: *fpp = NULL; - return (fget_unlocked_seq(td, fd, needrightsp, fpp, NULL)); + return (fget_unlocked_seq(td, fd, needrightsp, flagsp, fpp, NULL)); +} + +int +fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, + struct file **fpp) +{ + return (fget_unlocked_flags(td, fd, needrightsp, NULL, fpp)); } /* @@ -3528,7 +3571,7 @@ fget_mmap(struct thread *td, int fd, const cap_rights_t *rightsp, fdp = td->td_proc->p_fd; MPASS(cap_rights_is_set(rightsp, CAP_MMAP)); for (;;) { - error = fget_unlocked_seq(td, fd, rightsp, &fp, &seq); + error = fget_unlocked_seq(td, fd, rightsp, NULL, &fp, &seq); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_ops == &badfileops)) { @@ -3583,7 +3626,7 @@ fget_fcntl(struct thread *td, int fd, const cap_rights_t *rightsp, *fpp = NULL; MPASS(cap_rights_is_set(rightsp, CAP_FCNTL)); for (;;) { - error = fget_unlocked_seq(td, fd, rightsp, &fp, &seq); + error = fget_unlocked_seq(td, fd, rightsp, NULL, &fp, &seq); if (error != 0) return (error); error = cap_fcntl_check(fdp, fd, needfcntl); @@ -3645,7 +3688,7 @@ fgetvp_rights(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file *fp; int error; - error = fget_cap(td, fd, needrightsp, &fp, &caps); + error = fget_cap(td, fd, needrightsp, NULL, &fp, &caps); if (error != 0) return (error); if (fp->f_ops == &badfileops) { diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 0bbf13936bf9..ad8485028987 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -91,7 +91,7 @@ getsock_cap(struct thread *td, int fd, const cap_rights_t *rightsp, struct file *fp; int error; - error = fget_cap(td, fd, rightsp, &fp, havecapsp); + error = fget_cap(td, fd, rightsp, NULL, &fp, havecapsp); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_type != DTYPE_SOCKET)) { diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 3106218abce6..6076a5f7bdf8 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -434,7 +434,7 @@ sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) AUDIT_ARG_FD(uap->filedes); error = getvnode_path(td, uap->filedes, - cap_rights_init_one(&rights, CAP_ACL_GET), &fp); + cap_rights_init_one(&rights, CAP_ACL_GET), NULL, &fp); if (error == 0) { error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); @@ -569,7 +569,7 @@ sys___acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) AUDIT_ARG_FD(uap->filedes); error = getvnode_path(td, uap->filedes, - cap_rights_init_one(&rights, CAP_ACL_CHECK), &fp); + cap_rights_init_one(&rights, CAP_ACL_CHECK), NULL, &fp); if (error == 0) { error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 4ab00698b311..883beaf6d1da 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4528,17 +4528,23 @@ cache_fplookup_dirfd(struct cache_fpl *fpl, struct vnode **vpp) { struct nameidata *ndp; struct componentname *cnp; - int error; - bool fsearch; + int error, flags; ndp = fpl->ndp; cnp = fpl->cnp; - error = fgetvp_lookup_smr(ndp, vpp, &fsearch); + error = fgetvp_lookup_smr(ndp, vpp, &flags); if (__predict_false(error != 0)) { return (cache_fpl_aborted(fpl)); } - fpl->fsearch = fsearch; + if (__predict_false((flags & O_RESOLVE_BENEATH) != 0)) { + _Static_assert((CACHE_FPL_SUPPORTED_CN_FLAGS & RBENEATH) == 0, + "RBENEATH supported by fplookup"); + cache_fpl_smr_exit(fpl); + cache_fpl_aborted(fpl); + return (EOPNOTSUPP); + } + fpl->fsearch = (flags & FSEARCH) != 0; if ((*vpp)->v_type != VDIR) { if (!((cnp->cn_flags & EMPTYPATH) != 0 && cnp->cn_pnbuf[0] == '\0')) { cache_fpl_smr_exit(fpl); diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 8debf487cc54..1fe7494f3998 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -253,7 +253,7 @@ kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_TEXT(attrname); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_SET), NULL, &fp); if (error) return (error); @@ -441,7 +441,7 @@ kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_TEXT(attrname); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_GET), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_GET), NULL, &fp); if (error) return (error); @@ -597,7 +597,7 @@ kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_TEXT(attrname); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_DELETE), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_DELETE), NULL, &fp); if (error) return (error); @@ -764,7 +764,7 @@ kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_FD(fd); AUDIT_ARG_VALUE(attrnamespace); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_LIST), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_LIST), NULL, &fp); if (error) return (error); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 0e4847e1c634..c236f241bf20 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -370,7 +370,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) int error; AUDIT_ARG_FD(fd); - error = getvnode_path(td, fd, &cap_fstatfs_rights, &fp); + error = getvnode_path(td, fd, &cap_fstatfs_rights, NULL, &fp); if (error != 0) return (error); vp = fp->f_vnode; @@ -893,12 +893,17 @@ sys_fchdir(struct thread *td, struct fchdir_args *uap) struct mount *mp; struct file *fp; int error; + uint8_t fdflags; AUDIT_ARG_FD(uap->fd); - error = getvnode_path(td, uap->fd, &cap_fchdir_rights, + error = getvnode_path(td, uap->fd, &cap_fchdir_rights, &fdflags, &fp); if (error != 0) return (error); + if ((fdflags & UF_RESOLVE_BENEATH) != 0) { + fdrop(fp, td); + return (ENOTCAPABLE); + } vp = fp->f_vnode; vrefact(vp); fdrop(fp, td); @@ -1041,10 +1046,15 @@ sys_fchroot(struct thread *td, struct fchroot_args *uap) struct vnode *vp; struct file *fp; int error; + uint8_t fdflags; - error = getvnode_path(td, uap->fd, &cap_fchroot_rights, &fp); + error = getvnode_path(td, uap->fd, &cap_fchroot_rights, &fdflags, &fp); if (error != 0) return (error); + if ((fdflags & UF_RESOLVE_BENEATH) != 0) { + fdrop(fp, td); + return (ENOTCAPABLE); + } vp = fp->f_vnode; vrefact(vp); fdrop(fp, td); @@ -1309,6 +1319,10 @@ success: else #endif fcaps = NULL; + if ((nd.ni_resflags & NIRES_BENEATH) != 0) + flags |= O_RESOLVE_BENEATH; + else + flags &= ~O_RESOLVE_BENEATH; error = finstall_refed(td, fp, &indx, flags, fcaps); /* On success finstall_refed() consumes fcaps. */ if (error != 0) { @@ -2013,7 +2027,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, fp = NULL; if (fd != FD_NONE) { - error = getvnode_path(td, fd, &cap_no_rights, &fp); + error = getvnode_path(td, fd, &cap_no_rights, NULL, &fp); if (error != 0) return (error); } @@ -4409,12 +4423,12 @@ out: */ int getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp, - struct file **fpp) + uint8_t *flagsp, struct file **fpp) { struct file *fp; int error; - error = fget_unlocked(td, fd, rightsp, &fp); + error = fget_unlocked_flags(td, fd, rightsp, flagsp, &fp); if (error != 0) return (error); @@ -4451,7 +4465,7 @@ getvnode(struct thread *td, int fd, const cap_rights_t *rightsp, { int error; - error = getvnode_path(td, fd, rightsp, fpp); + error = getvnode_path(td, fd, rightsp, NULL, fpp); if (__predict_false(error != 0)) return (error); diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index c23c7eba0544..9329ecc29c47 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -289,6 +289,8 @@ typedef __pid_t pid_t; /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ +#define FD_RESOLVE_BENEATH 2 /* all lookups relative to fd have + O_RESOLVE_BENEATH semantics */ /* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */ #define F_RDLCK 1 /* shared or read lock */ diff --git a/sys/sys/file.h b/sys/sys/file.h index c79759a3f966..284d523147b6 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -301,7 +301,7 @@ int fgetvp_read(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); int fgetvp_write(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); -int fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch); +int fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp); int fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp); static __inline __result_use_check bool diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 602d236ff853..55969b2ff4b3 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -148,6 +148,7 @@ struct filedesc_to_leader { * Per-process open flags. */ #define UF_EXCLOSE 0x01 /* auto-close on exec */ +#define UF_RESOLVE_BENEATH 0x02 /* lookups must be beneath this dir */ #ifdef _KERNEL @@ -278,17 +279,20 @@ struct filedesc_to_leader * int getvnode(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp); int getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp, - struct file **fpp); + uint8_t *flagsp, struct file **fpp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); int fget_cap_noref(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp, struct file **fpp, struct filecaps *havecapsp); int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, struct filecaps *havecapsp); + uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp); /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp); +int fget_unlocked_flags(struct thread *td, int fd, + const cap_rights_t *needrightsp, uint8_t *flagsp, + struct file **fpp); /* Return a file pointer without a ref. FILEDESC_IS_ONLY_USER must be true. */ int fget_only_user(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp, struct file **fpp); diff --git a/sys/sys/namei.h b/sys/sys/namei.h index eda3cc9b6f24..5c245235ace5 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -196,6 +196,7 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, #define NIRES_ABS 0x00000001 /* Path was absolute */ #define NIRES_STRICTREL 0x00000002 /* Restricted lookup result */ #define NIRES_EMPTYPATH 0x00000004 /* EMPTYPATH used */ +#define NIRES_BENEATH 0x00000008 /* O_RESOLVE_BENEATH is to be inherited */ /* * Flags in ni_lcf, valid for the duration of the namei call. From nobody Tue Jun 24 21:04:35 2025 X-Original-To: dev-commits-src-main@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 4bRcrz55Fvz60Gwh; Tue, 24 Jun 2025 21:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRcrz3Dynz3xVq; Tue, 24 Jun 2025 21:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750799075; 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=n+r6YpqyjFhB0eKLgNSmYH16rwlfUR94j71/j3JLkF4=; b=MF/NrWF8b+iNqdj9kVf7wpWuqun0fLGkXuPG6Z8ZTIQsEek4rbPdzLjYi0C9GdWOx6gcUp 2FcwjbWkRfjoUHyE9n+cIS+ouHLzTonVaopnMRh6dgcCGDYv0JaQbAdIY8yxCkRqIV0a7e n9Fq+lPYR1X16R3ffz4yf4yB/pjeddqueoJZXkAV3zEXQ1vZTXT+AVYoo/j6QCWcaiBzIO tuq/jmm4VQw7IGAIMO5kmopcBZdY4mocUWuYEIC2El3NmXY1D66wCoTzME6NJhuU2lFwN2 fKWa6S46bGBMM2o7HgwjjKysBJpk/h/pj4t+oKc8QotCK10cAaE0W8o9qTkJ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750799075; 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=n+r6YpqyjFhB0eKLgNSmYH16rwlfUR94j71/j3JLkF4=; b=R6KIVjoBOn5dZ9mr969lxD3jsHmfJuzk/69S7/dIhag8zTBhhpQskIsdcFY7oYKU83qGrF j62D+jTkMX9d2w16HQzq0Zx0JE3JoPskB4mbnTkZ3HcQZ33Y2+anqQc1MBPyzbNp013o6T oOvWF4zuDVLKLwR31QNlh2JVUBwRbGaTP8L2g2KZn7S+V+bmT+Wwtk0cSug/R+2H6fDzc2 iFNmBKHMvQMY2CHKbLL6O6mxEGc4k5krH/D6sg3MBHi0C/mU4ABXif03ndYnMS8G0qHgwZ Uj5z61DC+4KXTa8f9+sxurMNvj2Z4g7FrKyKCwlV4L+oTesY+pCe5nV4h7XIrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750799075; a=rsa-sha256; cv=none; b=JF0NtFX5mjoV+BfzHbvPvHMaYboN4YWkTlyLAfVn+qobWPFFd95wDMTweraf9e2DEVz28k hjgC4DiEmnIQ9xCoN7LCJzEL3tYwxHtynVq4yAsFjrqfCbTPRhuTBGDKWP01ozThZBeg07 iEuN8MYP70YuJHNNX3v0emrxmEjcfTfo2B9InyM6fl95xQIwxAZC9JtlIeevaEC2HA9ELT Gjjbw7jSRMgYo/TNHtwXRJkZMy6Cpnkbygr7TipnQLLb3sSgGasFlnbEyOImglPQ74mg6l f/D8utDjX4KVLiN5tSa9Ia/mba2HJuPdvN4xryRb/Rhg1cBfDiaiGfXUhOFq3Q== 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 4bRcrz2dfYz146M; Tue, 24 Jun 2025 21:04: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 55OL4Z7X085242; Tue, 24 Jun 2025 21:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OL4ZxO085239; Tue, 24 Jun 2025 21:04:35 GMT (envelope-from git) Date: Tue, 24 Jun 2025 21:04:35 GMT Message-Id: <202506242104.55OL4ZxO085239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 350ba9672a7f - main - unix: Set O_RESOLVE_BENEATH on fds transferred between jails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 350ba9672a7f4f16e30534a603df577dfd083b3f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=350ba9672a7f4f16e30534a603df577dfd083b3f commit 350ba9672a7f4f16e30534a603df577dfd083b3f Author: Mark Johnston AuthorDate: 2025-06-24 20:05:37 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 21:04:24 +0000 unix: Set O_RESOLVE_BENEATH on fds transferred between jails If a pair of jails with different filesystem roots is able to exchange SCM_RIGHTS messages (e.g., using a unix socket in a shared nullfs mount), a process in one jail can open a directory outside of the root of the second jail and then pass the fd to that second jail, allowing the receiving process to escape the jail chroot. Address this using the new FD_RESOLVE_BENEATH flag. When externalizing an SCM_RIGHTS message into the receiving process, automatically set this flag on all new fds where a jail boundary is crossed. This ensures that the receiver cannot do more than access files underneath the directory; in particular, the received fd cannot be used to access vnodes not accessible by the sender. PR: 262179 Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D50371 --- sys/amd64/conf/SYZKALLER | 5 +++++ sys/kern/uipc_usrreq.c | 31 +++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER new file mode 100644 index 000000000000..965841313616 --- /dev/null +++ b/sys/amd64/conf/SYZKALLER @@ -0,0 +1,5 @@ +include GENERIC-KASAN +ident SYZKALLER + +options COVERAGE +options KCOV diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 3f6535567e9d..72bd0246db11 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -56,7 +56,6 @@ * need a proper out-of-band */ -#include #include "opt_ddb.h" #include @@ -66,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -3437,22 +3437,34 @@ unp_freerights(struct filedescent **fdep, int fdcount) free(fdep[0], M_FILECAPS); } +static bool +restrict_rights(struct file *fp, struct thread *td) +{ + struct prison *prison1, *prison2; + + prison1 = fp->f_cred->cr_prison; + prison2 = td->td_ucred->cr_prison; + return (prison1 != prison2 && prison1->pr_root != prison2->pr_root && + prison2 != &prison0); +} + static int unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) { struct thread *td = curthread; /* XXX */ struct cmsghdr *cm = mtod(control, struct cmsghdr *); - int i; int *fdp; struct filedesc *fdesc = td->td_proc->p_fd; struct filedescent **fdep; void *data; socklen_t clen = control->m_len, datalen; - int error, newfds; + int error, fdflags, newfds; u_int newlen; UNP_LINK_UNLOCK_ASSERT(); + fdflags = (flags & MSG_CMSG_CLOEXEC) ? O_CLOEXEC : 0; + error = 0; if (controlp != NULL) /* controlp == NULL => free control messages */ *controlp = NULL; @@ -3494,11 +3506,14 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) *controlp = NULL; goto next; } - for (i = 0; i < newfds; i++, fdp++) { - _finstall(fdesc, fdep[i]->fde_file, *fdp, - (flags & MSG_CMSG_CLOEXEC) != 0 ? O_CLOEXEC : 0, - &fdep[i]->fde_caps); - unp_externalize_fp(fdep[i]->fde_file); + for (int i = 0; i < newfds; i++, fdp++) { + struct file *fp; + + fp = fdep[i]->fde_file; + _finstall(fdesc, fp, *fdp, fdflags | + (restrict_rights(fp, td) ? + O_RESOLVE_BENEATH : 0), &fdep[i]->fde_caps); + unp_externalize_fp(fp); } /* From nobody Tue Jun 24 21:04:36 2025 X-Original-To: dev-commits-src-main@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 4bRcs11SnBz60H9K; Tue, 24 Jun 2025 21:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRcs04TXrz3xdd; Tue, 24 Jun 2025 21:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750799076; 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=Md9q0v3U64GIv/BPpo5JIF6/lHRF7xvYZSXrRsj29fs=; b=cmVn8dskf9tfvMCTRuz/KGYUTDM1ejTXNw0RBgiJ+R63fpp2viV7gZvL+LPsBi4Hhb5LoL bVoFCBrhsU12UWir1QGEB7QJXIVhPBCiXdgmm5yJe5trlC06LOluyRMkYJ9g0t46oGRLVA uBHcTDVf83hrKmiAUqFopZKyi2kRQ2+7VjJhGIuGygjXcQkJa/7G6D+Yo356LqitHfjHA5 TxDs9BngRFYo3stcYsEMPpK0prQIYCmfdG8AkoRDDxo+iaydSKIClVMy1SL8q8vIuzOhmu J7LTFEYPI9JewvBGabl6Be5qu3fYmWUsbAxoXUCJXLpimEKTD/R7BCDOYqubeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750799076; 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=Md9q0v3U64GIv/BPpo5JIF6/lHRF7xvYZSXrRsj29fs=; b=vIp5dBX/YQmN9XGhgykeb4atTMUg/ROapUuZDMfC/TeI/KWKOsfxlTtElHuQrK122oPk+B v7p7/oIncu6WHJe+tt0kcYq9lMEz7KqnRDzvJ5WQlJm6Dc93sQCYwpkIr8NzE6zFAlVNUt c14YwnO38KbLBpx5zXpDaCy1jrqf1t6OcZ8kbgDxdhvbSrnd0+xJNzxwe3goyEZdqfSqb0 JrB/ru45NfHFu5anH1qB/k9fqeU9j2objCN7AfZL0WtrSxJny98fDEgpcLfP12EP9jJ/Rh n7YP/3kerLhiRJoLrmjtQwtgTVxNEkeXSyPBUe9cyB3hzg8Y1HYmjJ1F3JXx7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750799076; a=rsa-sha256; cv=none; b=lKOb/1063Gn/j4mlHyfs9wV6oDgpCji+/eOToHt5ZmQ7RB5FpOehu2Poxo5lpqCPUxeCsH ooeragtveAoUODW20Kx+cPpLd35JTrwHdRhtOvweMhxHW2KRYp6+8L1JnHnSPDWeLlPYkn axwQtW8WzdsVfD7sGM+LbVeM/1Cq65Ip6Kqx1LgVwAp8McAK2Q+EozVHX/EHQs+jrSDI1E KiRuGfcGEEm/Cw4HTA+JvrGiCpdZv5i2PrTWPW08oIaxJOxSmcrts+FZGiagP5pu4aBZXl +tg3mE3fwqvnLFCE/X+t02atVpRs1YieWkd3Oh+3gamGoEMlm0jKEdog13lm+A== 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 4bRcs03YCZz13bG; Tue, 24 Jun 2025 21:04: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 55OL4aRw085285; Tue, 24 Jun 2025 21:04:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OL4aUN085282; Tue, 24 Jun 2025 21:04:36 GMT (envelope-from git) Date: Tue, 24 Jun 2025 21:04:36 GMT Message-Id: <202506242104.55OL4aUN085282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5843b8ee02e9 - main - unix/tests: Add a regression test for fd transfer across jails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5843b8ee02e99527c28f579acfc1f48e10033529 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5843b8ee02e99527c28f579acfc1f48e10033529 commit 5843b8ee02e99527c28f579acfc1f48e10033529 Author: Mark Johnston AuthorDate: 2025-06-24 20:08:22 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 21:04:24 +0000 unix/tests: Add a regression test for fd transfer across jails MFC after: 3 weeks --- tests/sys/kern/Makefile | 2 + tests/sys/kern/unix_passfd_test.c | 134 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 94a75048a31a..8cc7beade3f3 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -96,6 +96,8 @@ LIBADD.sendfile_helper+= pthread LIBADD.fdgrowtable_test+= util pthread kvm procstat LIBADD.sigwait+= rt LIBADD.ktrace_test+= sysdecode +LIBADD.unix_passfd_dgram+= jail +LIBADD.unix_passfd_stream+= jail LIBADD.unix_stream+= pthread NETBSD_ATF_TESTS_C+= lockf_test diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c index 8c6a976a0e12..95271c04a16b 100644 --- a/tests/sys/kern/unix_passfd_test.c +++ b/tests/sys/kern/unix_passfd_test.c @@ -27,15 +27,19 @@ */ #include +#include #include #include #include #include #include #include +#include +#include #include #include +#include #include #include #include @@ -1032,6 +1036,135 @@ ATF_TC_BODY(control_creates_records, tc) closesocketpair(fd); } +ATF_TC_WITH_CLEANUP(cross_jail_dirfd); +ATF_TC_HEAD(cross_jail_dirfd, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(cross_jail_dirfd, tc) +{ + int error, sock[2], jid1, jid2, status; + pid_t pid1, pid2; + + domainsocketpair(sock); + + error = mkdir("./a", 0755); + ATF_REQUIRE(error == 0); + error = mkdir("./b", 0755); + ATF_REQUIRE(error == 0); + error = mkdir("./c", 0755); + ATF_REQUIRE(error == 0); + error = mkdir("./a/c", 0755); + ATF_REQUIRE(error == 0); + + jid1 = jail_setv(JAIL_CREATE, + "name", "passfd_test_cross_jail_dirfd1", + "path", "./a", + "persist", NULL, + NULL); + ATF_REQUIRE_MSG(jid1 >= 0, "jail_setv: %s", jail_errmsg); + + jid2 = jail_setv(JAIL_CREATE, + "name", "passfd_test_cross_jail_dirfd2", + "path", "./b", + "persist", NULL, + NULL); + ATF_REQUIRE_MSG(jid2 >= 0, "jail_setv: %s", jail_errmsg); + + pid1 = fork(); + ATF_REQUIRE(pid1 >= 0); + if (pid1 == 0) { + ssize_t len; + int dfd, error; + char ch; + + error = jail_attach(jid1); + if (error != 0) + err(1, "jail_attach"); + + dfd = open(".", O_RDONLY | O_DIRECTORY); + if (dfd < 0) + err(1, "open(\".\") in jail %d", jid1); + + ch = 0; + len = sendfd_payload(sock[0], dfd, &ch, sizeof(ch)); + if (len == -1) + err(1, "sendmsg"); + + _exit(0); + } + + pid2 = fork(); + ATF_REQUIRE(pid2 >= 0); + if (pid2 == 0) { + ssize_t len; + int dfd, dfd2, error, fd; + char ch; + + error = jail_attach(jid2); + if (error != 0) + err(1, "jail_attach"); + + /* Get a directory from outside the jail root. */ + len = recvfd_payload(sock[1], &dfd, &ch, sizeof(ch), + CMSG_SPACE(sizeof(int)), 0); + if (len == -1) + err(1, "recvmsg"); + + if ((fcntl(dfd, F_GETFD) & FD_RESOLVE_BENEATH) == 0) + errx(1, "dfd does not have FD_RESOLVE_BENEATH set"); + + /* Make sure we can't chdir. */ + error = fchdir(dfd); + if (error == 0) + errx(1, "fchdir succeeded"); + if (errno != ENOTCAPABLE) + err(1, "fchdir"); + + /* Make sure a dotdot access fails. */ + fd = openat(dfd, "../c", O_RDONLY | O_DIRECTORY); + if (fd >= 0) + errx(1, "openat(\"../c\") succeeded"); + if (errno != ENOTCAPABLE) + err(1, "openat"); + + /* Accesses within the sender's jail root are ok. */ + fd = openat(dfd, "c", O_RDONLY | O_DIRECTORY); + if (fd < 0) + err(1, "openat(\"c\")"); + + dfd2 = openat(dfd, "", O_EMPTY_PATH | O_RDONLY | O_DIRECTORY); + if (dfd2 < 0) + err(1, "openat(\"\")"); + if ((fcntl(dfd2, F_GETFD) & FD_RESOLVE_BENEATH) == 0) + errx(1, "dfd2 does not have FD_RESOLVE_BENEATH set"); + + _exit(0); + } + + error = waitpid(pid1, &status, 0); + ATF_REQUIRE(error != -1); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + error = waitpid(pid2, &status, 0); + ATF_REQUIRE(error != -1); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + closesocketpair(sock); +} +ATF_TC_CLEANUP(cross_jail_dirfd, tc) +{ + int jid; + + jid = jail_getid("passfd_test_cross_jail_dirfd1"); + if (jid >= 0 && jail_remove(jid) != 0) + err(1, "jail_remove"); + jid = jail_getid("passfd_test_cross_jail_dirfd2"); + if (jid >= 0 && jail_remove(jid) != 0) + err(1, "jail_remove"); +} + ATF_TP_ADD_TCS(tp) { @@ -1052,6 +1185,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, copyout_rights_error); ATF_TP_ADD_TC(tp, empty_rights_message); ATF_TP_ADD_TC(tp, control_creates_records); + ATF_TP_ADD_TC(tp, cross_jail_dirfd); return (atf_no_error()); } From nobody Tue Jun 24 22:25:05 2025 X-Original-To: dev-commits-src-main@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 4bRfds4x9rz60M8G; Tue, 24 Jun 2025 22:25: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 4bRfds3BM4z41GG; Tue, 24 Jun 2025 22:25:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750803905; 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=poOjSgQJUzcln6WP4pz34W3nbSWq7lAZAMyPiDYg3+g=; b=IMhltv4JS2egXCODYujAMrGOdczX0k7/dycRz9+po32yO12wibDd3VCJtObfT9bg0qAajJ I5WmtentxBSXDhC6N6rW+lBLyKFax8Bgdm39lV6apbrdU9gIXhaoxf0AUpw5VWgfMbtS22 +iA4bj1fUu9jCoVb4/oCPYeYErcSSXuPMt2xY4HOKr8vHiXylkkMuIpvLVpCqqmM0s07Pf Asz6HH1WjFTzijIWBAe7UmpDAtMEfV01aSuOdrlc3SXsicSao8T4RarWgTcFtKjulH7GWi 1u58tHuxqMs47ebkEBckVDnegUBjkuRT2N5nOjtwLBeHqxm+o39viSnVSFr8og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750803905; 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=poOjSgQJUzcln6WP4pz34W3nbSWq7lAZAMyPiDYg3+g=; b=Yos7zhO1aWACoj1aLkdBQ+/R4VoMABo2nZRQpe+OTYAUie8Bh5G8WVDLGPPg7S8513Y1UO 7YZJwp3m+LUGPBi2CclPPcc++3+dV0BCLkZzxFNVU+P4/vQ/qKueTPX5I9sWrifwD8ruOE cY65IrmeL8kI/iE7iNnZ5FOsr0Dtl1+WaRdUKnaPM9cis/XunLof1xRvGTYaLv3lfyLSsI fDrcVzH632Q5kZ8IxXZXFIOvXppmofGRZmvEXsvsasRLsoMOjgC4lznsSUVfIsJlp7C7jI ShSSGOwXtOj3D9OFbcSDjrZRCKWPfvCV9yJrl8WQ6b/ugpXMEtPY8KhFHiEr2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750803905; a=rsa-sha256; cv=none; b=i/4ymd+1W7kABQw6+dt7nIm2TfbTVir2KQHmuSLfASGHppShm4x+IcnLo96YxpecI9/ovA 6NKiVNAmKVA/Duf1GtRnVgqoB+GQEVDTAg/HGCUNbAxXN9RpbV/ysFrSj5Vr4i8qDRxwmo eT/LuseJ4OMNmQuQrp+z7JAK3kkTs4VNm4y45PC1IcBgI2liyLwTvJpMViXF95DDGA/wkF HycXHYYQvhvdMtRDnVRxS0RtYeNefyBn/qyiv4L+Oke3hBKVwGbVsFjTv5wi4SPFKrsKhT 0I8uPPetMUDc0hfUhjUYGYfygFZYQs1zh/3H5ClxWgflj5X8RMpuCewBiY8p3A== 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 4bRfds2P0tz15jT; Tue, 24 Jun 2025 22:25:05 +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 55OMP5X3036054; Tue, 24 Jun 2025 22:25:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OMP5tw036051; Tue, 24 Jun 2025 22:25:05 GMT (envelope-from git) Date: Tue, 24 Jun 2025 22:25:05 GMT Message-Id: <202506242225.55OMP5tw036051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 01addd846c64 - main - gone_in: make it __printflike() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01addd846c64fc2c8be610d83bfdc84ddb57f2ec Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=01addd846c64fc2c8be610d83bfdc84ddb57f2ec commit 01addd846c64fc2c8be610d83bfdc84ddb57f2ec Author: Gleb Smirnoff AuthorDate: 2025-06-24 22:23:47 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-24 22:23:47 +0000 gone_in: make it __printflike() Provide flexibility to use format strings for gone_in(). As a side effect, this removes hardcoded string "Obsolete code will be removed soon:" from the message, so now it is obligation of the deprecated code to provide a meaningful message. This required a small adoption of the existing users: midi, drm2 and le(4). Note that gone_in() is not a public KPI as it has no sense to use it outside of the FreeBSD tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50783 --- sys/dev/drm2/drm_os_freebsd.h | 13 +++---------- sys/dev/le/lance.c | 3 ++- sys/dev/sound/midi/sequencer.c | 6 ++++-- sys/kern/subr_bus.c | 40 +++++++++++++++++++++++----------------- sys/sys/systm.h | 13 ++++++++----- 5 files changed, 40 insertions(+), 35 deletions(-) diff --git a/sys/dev/drm2/drm_os_freebsd.h b/sys/dev/drm2/drm_os_freebsd.h index 71a9637ddd9f..ec1042f8f0d4 100644 --- a/sys/dev/drm2/drm_os_freebsd.h +++ b/sys/dev/drm2/drm_os_freebsd.h @@ -154,18 +154,11 @@ typedef void irqreturn_t; #if !defined(__arm__) #if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) -#define DRM_MSG "This code is deprecated. Install the graphics/drm-kmod pkg\n" +#define DRM_MSG "WARNING! drm2 module is deprecated. Install the graphics/drm-kmod pkg\n" #else -#define DRM_MSG "This code is deprecated." +#define DRM_MSG "WARNING! drm2 module is deprecated.\n" #endif - -#define DRM_OBSOLETE(dev) \ - do { \ - device_printf(dev, "=======================================================\n"); \ - device_printf(dev, DRM_MSG); \ - device_printf(dev, "=======================================================\n"); \ - gone_in_dev(dev, 13, "drm2 drivers"); \ - } while (0) +#define DRM_OBSOLETE(dev) gone_in_dev(dev, 13, DRM_MSG) #endif /* __arm__ */ /* DRM_READMEMORYBARRIER() prevents reordering of reads. diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index 6eef8b5da052..f5e41e82bb42 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -193,7 +193,8 @@ lance_attach(struct lance_softc *sc) if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); if_setcapenablebit(ifp, IFCAP_VLAN_MTU, 0); - gone_in(15, "le: 10/100 NIC no longer needed for Qemu/MIPS"); + gone_in(15, "Warning! le(4) to be removed: no longer needed for " + "Qemu/MIPS\n"); } void diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index db49aa1ef259..03b71688175c 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -519,7 +519,8 @@ seq_addunit(void) int ret; u_char *buf; - gone_in(15, "MIDI sequencer: no longer needed or used"); + gone_in(15, "Warning! MIDI sequencer to be removed soon: no longer " + "needed or used\n"); /* Allocate the softc. */ ret = ENOMEM; @@ -738,7 +739,8 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) struct seq_softc *scp = i_dev->si_drv1; int i; - gone_in(15, "MIDI sequencer: no longer needed or used"); + gone_in(15, "Warning! MIDI sequencer to be removed soon: no longer " + "needed or used\n"); if (scp == NULL) return ENXIO; diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 4de1df0c248f..e7e8896fc100 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -6258,8 +6258,10 @@ SYSCTL_INT(_debug, OID_AUTO, obsolete_panic, CTLFLAG_RWTUN, &obsolete_panic, 0, "2 = if deprecated)"); static void -gone_panic(int major, int running, const char *msg) +gone_panic(int major, int running, const char *msg, ...) { + va_list ap; + switch (obsolete_panic) { case 0: @@ -6269,32 +6271,36 @@ gone_panic(int major, int running, const char *msg) return; /* FALLTHROUGH */ default: - panic("%s", msg); + va_start(ap, msg); + vpanic(msg, ap); } } void -_gone_in(int major, const char *msg) +_gone_in(int major, const char *msg, ...) { - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg); - if (P_OSREL_MAJOR(__FreeBSD_version) >= major) - printf("Obsolete code will be removed soon: %s\n", msg); - else - printf("Deprecated code (to be removed in FreeBSD %d): %s\n", - major, msg); + va_list ap; + + gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg, ap); + va_start(ap, msg); + vprintf(msg, ap); + va_end(ap); + if (P_OSREL_MAJOR(__FreeBSD_version) < major) + printf("To be removed in FreeBSD %d\n", major); } void -_gone_in_dev(device_t dev, int major, const char *msg) +_gone_in_dev(device_t dev, int major, const char *msg, ...) { - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg); - if (P_OSREL_MAJOR(__FreeBSD_version) >= major) - device_printf(dev, - "Obsolete code will be removed soon: %s\n", msg); - else + va_list ap; + + gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg, ap); + va_start(ap, msg); + device_printf(dev, msg, ap); + va_end(ap); + if (P_OSREL_MAJOR(__FreeBSD_version) < major) device_printf(dev, - "Deprecated code (to be removed in FreeBSD %d): %s\n", - major, msg); + "to be removed in FreeBSD %d\n", major); } #ifdef DDB diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 7cc02c77bea4..7a6edaef2cb8 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -566,17 +566,20 @@ void counted_warning(unsigned *counter, const char *msg); /* * APIs to manage deprecation and obsolescence. */ -void _gone_in(int major, const char *msg); -void _gone_in_dev(device_t dev, int major, const char *msg); +void _gone_in(int major, const char *msg, ...) __printflike(2, 3); +void _gone_in_dev(device_t dev, int major, const char *msg, ...) + __printflike(3, 4); #ifdef NO_OBSOLETE_CODE #define __gone_ok(m, msg) \ _Static_assert(m < P_OSREL_MAJOR(__FreeBSD_version)), \ - "Obsolete code: " msg); + "Obsolete code: " msg) #else #define __gone_ok(m, msg) #endif -#define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) -#define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg) +#define gone_in(major, msg, ...) __gone_ok(major, msg) \ + _gone_in(major, msg __VA_OPT__(,) __VA_ARGS__) +#define gone_in_dev(dev, major, msg, ...) __gone_ok(major, msg) \ + _gone_in_dev(dev, major, msg __VA_OPT__(,) __VA_ARGS__) #ifdef INVARIANTS #define __diagused From nobody Tue Jun 24 22:25:06 2025 X-Original-To: dev-commits-src-main@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 4bRfdt5JfRz60LsR; Tue, 24 Jun 2025 22:25: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 4bRfdt2ysCz41JN; Tue, 24 Jun 2025 22:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750803906; 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=PgcToHRJ8PzJzIytGV6qvjDd1+H/1RsQGvRsBwi4r7M=; b=N+0lEDrZVo1GRVUsmTm22JZaPKqujUUrrxmaALkzxIREUjhTG+GNSLA5gDLj1hER3g76Mg 1NDkCuQQnwtnBpo0qTyKygzOHpkwnAWN+pvwgW2gSZNB4/GIIb8ehYdkdMlM3Wid6Bjya9 wkwUW3EvDaNxJLN4bgGsrFFwTZQySXfwn2Vl7ppZKHorNxGQQVv6mxhl26fbzgrRohaop+ uO0aIyy7EAChXHuSr6qyCKUwyP+yqOGG/CI7x/L98znbOUqCUtEVne3b+BYJwlsghSpqqF dcmX5Za0Pu1jtPNg84h6bhLlxL1fRp3rH0s/c2TVf78QlCvSFdTySgUdHyBBbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750803906; 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=PgcToHRJ8PzJzIytGV6qvjDd1+H/1RsQGvRsBwi4r7M=; b=Ot3Lk3idZSSoCh7se52Velk0Tf0g6EFFPF2UjR48+R/pG3LeiLwvhqsSkYqSihan7S8UT2 tqifKwL3ft18WtTuM6Kq90Jw9MtzAksX72ingwRiRp4lQRFX2DRmzBAZwg/ryYsgnjdbRD mxQTbPRVMzQZIf5oGWG25EfLsnj90AZgW3OdSysyBMl7ceYvvniIS4CU/w4Vkw5lUpR4/p 2c83qyEAyzPHx4xk7QP+41hC+njYwZkXdm/3tDNqifJfoFPOwKr2URZbj5F7F/UM4BOs1O ty/7sZvZ31T4KPTfxA6EQDCtjGoseG7WKt2pPJwixRBlj/zbD0Ke97F0MUlXJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750803906; a=rsa-sha256; cv=none; b=sbT9jLGuluS11F3nEJBKJhv8Pv1QXovep0LvdnNHq1hSTrFr8J/Kwgc9fKgKYFJu/0XVSS EhhjajQLf+9KaPYOyz3WD7u/znArWRnrzQUpyvnKB1aBzW8rIqHhvhLThy+XMCrWn23uuA zJBIK50TSexBOwdy+H6W+213AlsLqeqbxdbfynICM/Rf6Oq7KiZ3nfQdcqaNH9bYx1XJQ2 /5yQTbX6tnWPVvQoAtd7SHg7SRf17SpR8pOztOJYAXRgnMndK6SfFu+mPkUihqezrxnNoy 2c8Gs7ntjTb3j3X97JTMai/5C/FeKvfFoyaFeMlbGCAkfLb3kKIheQmXFXd99Q== 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 4bRfdt2ZZLz15nb; Tue, 24 Jun 2025 22:25: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 55OMP6jE036089; Tue, 24 Jun 2025 22:25:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OMP6G3036086; Tue, 24 Jun 2025 22:25:06 GMT (envelope-from git) Date: Tue, 24 Jun 2025 22:25:06 GMT Message-Id: <202506242225.55OMP6G3036086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: eabb9f600001 - main - gone_in: enforce printing only once List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eabb9f600001cc19943965b84d492936a5c59ebd Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=eabb9f600001cc19943965b84d492936a5c59ebd commit eabb9f600001cc19943965b84d492936a5c59ebd Author: Gleb Smirnoff AuthorDate: 2025-06-24 22:23:53 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-24 22:23:53 +0000 gone_in: enforce printing only once This allows to use this KPI not only in device attach methods, but also for syscalls and code that can be called multiple times at machine runtime. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50784 --- sys/sys/systm.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 7a6edaef2cb8..c4e0aafac452 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -576,10 +576,22 @@ void _gone_in_dev(device_t dev, int major, const char *msg, ...) #else #define __gone_ok(m, msg) #endif -#define gone_in(major, msg, ...) __gone_ok(major, msg) \ - _gone_in(major, msg __VA_OPT__(,) __VA_ARGS__) -#define gone_in_dev(dev, major, msg, ...) __gone_ok(major, msg) \ - _gone_in_dev(dev, major, msg __VA_OPT__(,) __VA_ARGS__) +#define gone_in(major, msg, ...) do { \ + static bool __read_mostly __gone_in_ ## __LINE__ = true; \ + __gone_ok(major, msg); \ + if (__predict_false(__gone_in_ ## __LINE__)) { \ + __gone_in_ ## __LINE__ = false; \ + _gone_in(major, msg __VA_OPT__(,) __VA_ARGS__); \ + } \ +} while (0) +#define gone_in_dev(dev, major, msg, ...) do { \ + static bool __read_mostly __gone_in_ ## __LINE__ = true; \ + __gone_ok(major, msg); \ + if (__predict_false(__gone_in_ ## __LINE__)) { \ + __gone_in_ ## __LINE__ = false; \ + _gone_in_dev(dev, major, msg __VA_OPT__(,) __VA_ARGS__);\ + } \ +} while (0) #ifdef INVARIANTS #define __diagused From nobody Tue Jun 24 22:25:07 2025 X-Original-To: dev-commits-src-main@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 4bRfdw0pwYz60LpK; Tue, 24 Jun 2025 22:25: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 4bRfdv5664z41LY; Tue, 24 Jun 2025 22:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750803907; 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=FE/hQoHBc74uxCZqlpLYY/YE23Uf3MNcwMUumLlb8zg=; b=AftjM1V+mmjSonGXFADyJCwDNk86OfzzDXY5fq7+t18qinls2V+kJbRnqfwjSMZtMFlwS1 YmYFdIPLELuoCZoMv0bHOXZpTJ4hX8wY7QaE5SPd4XKRkBdT+/OPfKc49/Na/JgH4tncJZ k+6asRmXp9w8KD6aCRYSowrW9A3fXowps+KZh8MAwKGodbb8NGQD5yeg2PJlI+cBbiP8ho MyXnZzHVEx09BBzIt1ak3wDqld3YL/iucuS7aAeAbzHQVyDfetl4UlcU5FBpY+BK+ntmuc B/HLTL2V0RrMd+jAIxs2szTwfPZP+oF+F3GYLDDLm3kcPl5PbAe44rUx8QGvuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750803907; 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=FE/hQoHBc74uxCZqlpLYY/YE23Uf3MNcwMUumLlb8zg=; b=B2pqeYrehHX2OwiZs3CwcSTP526WNAaiUg5nAtuVdV5LGUGNgpctq+2Zk1UgeGS3xvv4OS ajMYrro4OkLPwYCIU1zwLyIibwSo1YVMAVFK4i48t8xH3ymuXVNU82R/Zfe6k5zw4NHbkb +bZQBbRGBKFuLykoVCz/k4tU685tBfe7DJdAB7WYofAD6QD2X1rBnoZIzbkTMqgImxet+Z WXM5dx4X+kzneeYhw91a/53Pw0YidhTcEd0apiNorTbkUKxGldwUmSUW+gXBQnxa7mmVAp VSmtj/tASMWx/2h6hR0x4Btzhpho5oIbskR9tTFTHbvT/1t8KynzENBg4/WmqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750803907; a=rsa-sha256; cv=none; b=QAZvLsdJsQJgPJuMBdOGsbaAQqk0XdmhrfPwNzFIiqHLk4xsOE8jzLYP6+dbrPeGbfcRSk UXH24p5f6AUGpDTImYrWgR/hvMv4RthgJiVQ5f5oC7Dm2GPmjIDdQ2teF5AsuQIlFwp+Mq H2zEOlsVndoHdFx3LHb6j4jMo++jA34m4jyilC3wqA2nleGFI0bEkleXxa6M45IcfDV6Cc xwj46tHx1wnhgDiYYhxK/tFknByrVwV1jyznSmL6sGA68XhuQb8X+yxNQWfwxD2pC+HjCc pQ2MWBftpgZiC7zcZ7GmLM6tFkoijIrwV3TpQLBXtiEn6K5Y668ELJm3Ma7iIg== 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 4bRfdv3WMbz15YC; Tue, 24 Jun 2025 22:25: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 55OMP75n036124; Tue, 24 Jun 2025 22:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OMP7I5036121; Tue, 24 Jun 2025 22:25:07 GMT (envelope-from git) Date: Tue, 24 Jun 2025 22:25:07 GMT Message-Id: <202506242225.55OMP7I5036121@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d17cbe46983c - main - sendfile: retire SF_SYNC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d17cbe46983c08ba0567b0ffd71434abd35aa205 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d17cbe46983c08ba0567b0ffd71434abd35aa205 commit d17cbe46983c08ba0567b0ffd71434abd35aa205 Author: Gleb Smirnoff AuthorDate: 2025-06-24 21:26:10 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-24 22:24:04 +0000 sendfile: retire SF_SYNC The flag was added in b75a1171d8ba4 for the sake of Varnish. However, that idea didn't work. Quoting email from Poul-Henning: "We had to give up sendfile(), the overhead of keeping track of everything between the network stack and VM system made ate any gain we saw. ... I dont think we ever shipped a version where sendfile was enabled by default." PR: 287348 --- lib/libsys/sendfile.2 | 8 +------- sys/kern/kern_sendfile.c | 6 +++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/libsys/sendfile.2 b/lib/libsys/sendfile.2 index 07a563d5ef82..6000e3e9828f 100644 --- a/lib/libsys/sendfile.2 +++ b/lib/libsys/sendfile.2 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 30, 2020 +.Dd June 24, 2025 .Dt SENDFILE 2 .Os .Sh NAME @@ -147,12 +147,6 @@ in a different context. .It Dv SF_NOCACHE The data sent to socket will not be cached by the virtual memory system, and will be freed directly to the pool of free pages. -.It Dv SF_SYNC -.Nm -sleeps until the network stack no longer references the VM pages -of the file, making subsequent modifications to it safe. -Please note that this is not a guarantee that the data has actually -been sent. .It Dv SF_USER_READAHEAD .Nm has some internal heuristics to do readahead when sending data. diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 25c1f357dfd4..17b53208157a 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -798,7 +798,11 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, SFSTAT_INC(sf_syscalls); SFSTAT_ADD(sf_rhpages_requested, SF_READAHEAD(flags)); - if (flags & SF_SYNC) { + if (__predict_false(flags & SF_SYNC)) { + gone_in(16, "Warning! %s[%u] uses SF_SYNC sendfile(2) flag. " + "Please follow up to https://bugs.freebsd.org/" + "bugzilla/show_bug.cgi?id=287348. ", + td->td_proc->p_comm, td->td_proc->p_pid); sfs = malloc(sizeof(*sfs), M_SENDFILE, M_WAITOK | M_ZERO); mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); From nobody Tue Jun 24 22:30:30 2025 X-Original-To: dev-commits-src-main@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 4bRfm805FCz60M9W; Tue, 24 Jun 2025 22:30: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 4bRfm73f3Wz44D1; Tue, 24 Jun 2025 22:30:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750804231; 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=w8QqXhmvc/Kw0ViEQjtbQBkTDrVw4CoG9YopoWPp9Xc=; b=US9wXj7wFbH2SfT+0f7bKywZTcPyQSnuwlq9l2RcNgorNvp18Fu8hIbzADxf1QjWuikDej KpOG6dGJ8xt35fAY3FKJUae5/S5CUGSceoVhue/pcdWAzZyM9JSc4vqsi2tWZ+E8/ClX9L DKxLm/0Z+DLb6p1ajvHa5/P32CA1MBCWHTbk+a1fPF/dqk1nWVtj6kqKWkBLqZAZfn1MNc 69GI0vaZmkIuxtRjPiuCQK1FjiIApno5C9/woUF78C+E58Yihz8Ky97VOWdOQVNoyjx3YZ coUZ+zWmyNRke7wZDntvsLkqUsZa3QnepxQfJb4OKSoOf6ecy6wwPTcYnW1xvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750804231; 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=w8QqXhmvc/Kw0ViEQjtbQBkTDrVw4CoG9YopoWPp9Xc=; b=QIYNOkQtCYOAtWiYMQGWodoraOEqcCp0y2fMrkFz0GhN+b4Cjw6/nDxGwSbz+JpsjXgLIy aHMlGGB3l9cWoZsreKyN07MR899YwIZJkXxrw8E1rLXuOpy5VNW1tEeB7VxEz1kEvL9H6x rq2AJ/8nh1jFZWPSeKjkwISUeRJIyZRWFCd2NAG+RbB2Bvz5SJmvAo0s7LbDgFSuxjSj/O xNWlZJp34kzqbpoDWTM9gWLoXm4oqURM+1uVVtO1XumDX7MdfJkye/pDD5jAGgNS0Vhb7p qq6Fddteuy5RQ9kq73rS5Q+8RKp0zJEAQhNyAFH96NXNMLTGDzeKUSm+slZD+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750804231; a=rsa-sha256; cv=none; b=pBoO5f4VUjM+mbZl9FGWXksLWWLctLZEffXl/1O7Pt+waHwry8fPNJ51OzGS8bNpmwnZX0 R/kYqoPs6hBie7LSMG0osL/4cF2ZdJKV6aWl8IgmSkoYlz3zAzc1TpHTLkIvxD/qm7J9Vw 3w9ZbOaj9O19mlkPfsPEhXoG/0sXKVXUcAS4PYH1xaHXxhT+GITQWxRdJCyoH1O5NXbTpD SYgdQL5O0plm9Q8q3/sMviEIoyB3UOFhf2YbsRTXtXhu7LhB2cIe7MiuuIRmDkCywBdfHG dsHgoF2nwroJsvEGXmgjJwps0ek/FHXzC5M7Gh6o1K+xYz8iiddnPEEfH+D5Ng== 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 4bRfm71BCWz15JX; Tue, 24 Jun 2025 22:30: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 55OMUU6U046642; Tue, 24 Jun 2025 22:30:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OMUUtM046639; Tue, 24 Jun 2025 22:30:30 GMT (envelope-from git) Date: Tue, 24 Jun 2025 22:30:30 GMT Message-Id: <202506242230.55OMUUtM046639@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 994bec47ee7f - main - tests/kqueue: repair flaky test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 994bec47ee7f38bd20366b812313b2ea0714ef19 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=994bec47ee7f38bd20366b812313b2ea0714ef19 commit 994bec47ee7f38bd20366b812313b2ea0714ef19 Author: Gleb Smirnoff AuthorDate: 2025-06-24 22:28:07 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-24 22:29:03 +0000 tests/kqueue: repair flaky test The test arms timer for 500 msec and then sleeps 1 second and expects that the timer would always fire exactly 2 times. However, it has a chance to legitimately fire only once. This makes the test flaky. Fix the test reducing sleep time down to 495 msec. The problem started to show up recently, and I attribute that to 626ea75ed2e9. Before this revision sleep(3) was almost always sleeping over 1000 msec, now it can sleep exactly 1000 msec. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50996 --- tests/sys/kqueue/libkqueue/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/kqueue/libkqueue/timer.c b/tests/sys/kqueue/libkqueue/timer.c index 523dedc7c800..5116aea98b83 100644 --- a/tests/sys/kqueue/libkqueue/timer.c +++ b/tests/sys/kqueue/libkqueue/timer.c @@ -199,7 +199,7 @@ test_periodic_modify(void) kevent_cmp(&kev, kevent_get(kqfd)); /* Check if the event occurs again */ - EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, 500, NULL); + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, 495, NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); From nobody Tue Jun 24 22:42:50 2025 X-Original-To: dev-commits-src-main@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 4bRg2L5z0xz60N9g; Tue, 24 Jun 2025 22:42: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 4bRg2L5RcLz3GZp; Tue, 24 Jun 2025 22:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750804970; 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=2wtkASBR8m/Le4kBvgABtBGvEUXr1xNKc46A4YKiBm0=; b=Iu+6UBlIsQ6jXAAvLrd9fNbK9Mc2uubeuRxBnLQyjke+mRq33qNUeuO+6F0jyLxg0r3bqm KmljQUN7RSnI/oV8EoGtkbJRijJ6cWBgM5wJtQlQpDvwu8Vj8tx3e0zeidbrN9rGO+iWol 0840YO+09N96+H75svkEnY+EQ3CrPzABYF5Bv3yFAsajdEklMH/O9jKAtQ0YuEyr0zmVoU Wt0IgsiduDaXkSTKC8z5qJn7bNhZ0IETxHc3pyukIV28BtWNtwIGcd1mZPTKbONSVjP3Ql MB2z3Fxfh5XEeZqP3ImPdOuHEK25avhcDyoSStRHHujUVq66oifKhhGOaPCgcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750804970; 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=2wtkASBR8m/Le4kBvgABtBGvEUXr1xNKc46A4YKiBm0=; b=t+Ca5iK+s0hJ6uRaWbFMdHAnjDfvGqla/Dp3Igy6wT2VuO3RQMpU5SZMMVaiekZUaqoeJU M3ca2px83RL9E8kLDlmZ2kB3IP60ULpzL792+x+iwI6h9l0TdlONosB76xvQnk/GwpkrWz 3mT2TnkUcayc1l1TvGLaBVhTlsiZN7oyUfrDkYfyozjRAlI+HEINv2M3th5kllIhjuvBQ/ ljG3l6oyKam5uX/KeUcwLX8ZM9JWYKXJiE9dwe1CagbDsh5tQHXyz6YFEwszo1QgRK5eWR vLReN3XvZjPpiktNn7K/JOAHNaTpd5JfvesJLDtUQIQKdre4LlMk/eiJmhTLMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750804970; a=rsa-sha256; cv=none; b=uubdrveRcn90dBVhKo+hosfB6L+1mIjSUJhlFA8JKybQx8iHLpGs1rGIVNxxdqzpUMOTmD ptWZahHKaOlYJYlNnqYUKq/BaskUNT7yOaDajUSxjZl9FyleoPTzp7n5Gs3LijZnmfQW5t NmDC6amg6/3BR0HVWR5JJyV+9wXQNd8zsBJ5ZphYSi0AHRbuZSysoJuP1ZnkWkejQG68Bz Eq3ipikKlZC7+DWlSUDRD55IBrneECHb4tUPFfQMVhRUDuhQgYPhSmV+0KVgh0s71nF2NO uSXbw6v0jdXPq9SfzS0aUa6gNRVBZZCcGWC9ltYdF/Ey7GHLUgM/FTIo6bWLxA== 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 4bRg2L4wzbz16KM; Tue, 24 Jun 2025 22:42: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 55OMgoiA072756; Tue, 24 Jun 2025 22:42:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55OMgowk072753; Tue, 24 Jun 2025 22:42:50 GMT (envelope-from git) Date: Tue, 24 Jun 2025 22:42:50 GMT Message-Id: <202506242242.55OMgowk072753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: cdbff1b29996 - main - linuxkpi: Remove incorrect + 1 from HWEIGHT* macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cdbff1b2999660b31b2de076d04670722a555ed2 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cdbff1b2999660b31b2de076d04670722a555ed2 commit cdbff1b2999660b31b2de076d04670722a555ed2 Author: Ed Maste AuthorDate: 2025-06-24 13:36:54 +0000 Commit: Ed Maste CommitDate: 2025-06-24 22:42:16 +0000 linuxkpi: Remove incorrect + 1 from HWEIGHT* macros Fixes: 4cc8a9da491d ("LinuxKPI: add HWEIGHT32()") Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51010 --- sys/compat/linuxkpi/common/include/linux/bitops.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index 23aabb546cb2..bc776a0db9c4 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -62,10 +62,10 @@ #define hweight64(x) bitcount64(x) #define hweight_long(x) bitcountl(x) -#define HWEIGHT8(x) (bitcount8((uint8_t)(x)) + 1) -#define HWEIGHT16(x) (bitcount16(x) + 1) -#define HWEIGHT32(x) (bitcount32(x) + 1) -#define HWEIGHT64(x) (bitcount64(x) + 1) +#define HWEIGHT8(x) (bitcount8((uint8_t)(x))) +#define HWEIGHT16(x) (bitcount16(x)) +#define HWEIGHT32(x) (bitcount32(x)) +#define HWEIGHT64(x) (bitcount64(x)) static inline int __ffs(int mask) From nobody Wed Jun 25 01:14:35 2025 X-Original-To: dev-commits-src-main@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 4bRkPR2THtz60WY2; Wed, 25 Jun 2025 01:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRkPR1Dtlz3jtN; Wed, 25 Jun 2025 01:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750814075; 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=gZfMNtLB/jmxS7q8cMook/cv7+I7G5W5r4fsY4LpB6Y=; b=p20O9AjGgUdPEjcOqNKapRcd3kWUVN35oc+outd811idPlDVjoMW50CxSYrtZLTrPm+g6s RbcxwXdR5lBfRUgNaLkCPbd7TjTJwvt511Z4Ek+MAbqGHkjwGIgx166tsxhlhWYtihfCdz y0uiP+M66HeDKLjBPvajYs6aBDioLQD+U439GY36zJxF4xQ4rlWfDlMmsQ686jEAHUKX7c NcBTLPEL2Bf6gxep+gtLwe+mk9s/jut5vLaka3r4CjuyXRKoS2eCyy3AkRMtI9/dXzQQYt 9bzwMKiQBTxuTpOe4xraeEoxzMNcAs4EIFyRM0rssn0tXc2XTQ/LTWVQnYlWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750814075; 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=gZfMNtLB/jmxS7q8cMook/cv7+I7G5W5r4fsY4LpB6Y=; b=TDqhXwTvN8vFXdkTg49sCWewdwaReDMhg2zjfJQ95rWnvqVYdLYmZ+aKyT6IgrV+Uf/CNQ n2SnnTIQvp4AfJPd1cwSAe+q3CGx/10TXXWmpV0Vg28Hj9IVDXKzZOrSFN6z4V9+pCOP1/ TCGy96vXI2UGpNc79y1OpT7L1AcQa30fKAhcYGn2soyg3trD2ojts03USLH0gOQFV8yTib EFT34tj6TPMh+ERK/VCjvY2RjbgSDj6WlqwVTNTuoKeJ3kAQp9kb0EGWkvhPdJAoSRV2jt uDTvWuhyhAUuFC2zHQ0AOrSCjUwWfQH3LiMzRyFyKjGj3uo0lECcyVgbqhJCRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750814075; a=rsa-sha256; cv=none; b=yVST2LJGuA2B6NhsmAyOq1oYSA0PtsgrStwruoldpeNA0I5dV/FKwJtZ4RmAYWd8IwVhRW c5SOJT5LgxTSYrzeFuZJuZT8HIAcPdiDPOpGKkGi/Og1IBL78wBqf3Yc8nJlClWwzqW5S6 BS0oQov7v8OyFvzC4lh49tqLDbbwT7Tn3u5oBqf3jxJThrd1a5hHk4D2uJBPGTH/rXF3Dc RSW1I3Icf0JETdIJWefmHzeX2Wb3MF3VOwvEbXRdiehnbNbmTCwB/2trnp8LstdNn39iZg cA/011MfVNl1QchHhQKSdsKPPE6SBrW4xNMyDMv6mA0scSaR66x9u2wdDeq7uA== 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 4bRkPR0dBLz1B5Y; Wed, 25 Jun 2025 01:14: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 55P1EZ3w056005; Wed, 25 Jun 2025 01:14:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P1EZr2056002; Wed, 25 Jun 2025 01:14:35 GMT (envelope-from git) Date: Wed, 25 Jun 2025 01:14:35 GMT Message-Id: <202506250114.55P1EZr2056002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 96a241a35905 - main - bsddialog: in textbox mode differentiate between Exit and Extra buttons List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96a241a35905078bdc5d20bf25943cdb67758dea Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=96a241a35905078bdc5d20bf25943cdb67758dea commit 96a241a35905078bdc5d20bf25943cdb67758dea Author: Maksim Yevmenkin AuthorDate: 2025-06-25 01:13:38 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-25 01:13:38 +0000 bsddialog: in textbox mode differentiate between Exit and Extra buttons If run --extra-button --textbox dialog will have two buttons, but either of them would return 0 exit status. We definitely want the Extra to report its value. Reviewed by: jlduran, asiciliano Differential Revision: https://reviews.freebsd.org/D48668 --- contrib/bsddialog/lib/textbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsddialog/lib/textbox.c b/contrib/bsddialog/lib/textbox.c index 597dc6c8187b..ca3eb69fff52 100644 --- a/contrib/bsddialog/lib/textbox.c +++ b/contrib/bsddialog/lib/textbox.c @@ -200,7 +200,7 @@ bsddialog_textbox(struct bsddialog_conf *conf, const char *file, int rows, switch(input) { case KEY_ENTER: case 10: /* Enter */ - retval = BSDDIALOG_OK; + retval = BUTTONVALUE(d.bs); loop = false; break; case 27: /* Esc */ From nobody Wed Jun 25 01:16:54 2025 X-Original-To: dev-commits-src-main@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 4bRkS65Mvtz60WFC; Wed, 25 Jun 2025 01:16: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 4bRkS63M6lz3lKV; Wed, 25 Jun 2025 01:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750814214; 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=nM2SlKi4yFYea9ewVynp/AWYoe3N2JRSCW3dDbgvrQs=; b=uoaMuqcn/vaGpSVymnlENYaE6qi/2ZDiLlr+KAuGrPW/bZZrTJ0DsWX8FEShqi6P9Eld/w v1obt0BhH/FT2dr2BaeZmNPHSTsbPbAoFmjeucC+HHdcMzyH8X+3LS1Gb3P9vUbJOMV0+e 2hTolZzvEeZQGrJIXnCjG/ork2hlV9ZLdGwYVC3A0PjcZlZfLKq0pFOf2ZIDAeJoVmCNkz vhOL0/i+E2YlirH9YyTUr6bTSh+9mbj1tKiBlywT9tyI+CFM4v4+XvwLBYWuElKosrhAKL 5OZajKB9XqTly/rZvI/rn9g0P6Sx1JnWtojjUb2PxmTlheEhZk0tY7LMJiRbeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750814214; 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=nM2SlKi4yFYea9ewVynp/AWYoe3N2JRSCW3dDbgvrQs=; b=VaT9Y25E5FQHKP3FUaoF03CtUIqPBWe45OgmYUPGmtJNY2frRnBEcQFB7DGTzaTMq8OFnP aqD4ikHteLBunKCDRGNNg+kik41uDJ1eC2k0Z6RyHyeZHK8NDdwxYcY0UPEoehzoszR3Da WXLDIHR+ki30yeYor8/Bizi5Wp6SJPs9+59894zyouVmdn1yVUTUbLfNnQffLKwYWHOmdQ OhjRiFnhzyH43uqxn8FyDGKAksUnaZEeWKxD9NYDnLKMBSAmHnbew7H7F6kq34dwYbnv15 OdpS/PwDcI9gtASQivyiI5t55XzCmqOovsSEKRz3q5n8SRNCQpzOpD4ApU4cww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750814214; a=rsa-sha256; cv=none; b=fDfGLWlgFNP4K8oRtWMqFXGeiIoTWcsdvvaSlSzlp/ar3ZaKVurQVawxb/FnadBOGxEWwM +BEbdTDa3+YVjRe3v8g77hGZYNKDYH07eRCrXCe15/il51uFHm/XuYY+tG26eQaF4txcb0 9F6RluIC1x3E9jkx8WPSBH01EFug03f8QYNG88707tRsp8/TUHvfNm8aClHwjVL0F2JjNy PNwdipCdSrAR7NbszfLWQk5am1pVh8pCQcODfnkrTrGH5gVTTZtDAK3ho/5Fsp+IPmIRKO R/3UD6iN0zo7aqTYKrCQrWlgfDe+wMmQhdvncNS2Hz0zhAzn/0jVPq64+lEePg== 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 4bRkS62RY1z1BJX; Wed, 25 Jun 2025 01:16: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 55P1GswY056662; Wed, 25 Jun 2025 01:16:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P1GsCG056659; Wed, 25 Jun 2025 01:16:54 GMT (envelope-from git) Date: Wed, 25 Jun 2025 01:16:54 GMT Message-Id: <202506250116.55P1GsCG056659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 06ec77a42d9f - main - gone_in: initialize va before passing it to gone_panic() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06ec77a42d9f28c2e8fb67df55d1effe2a152be4 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=06ec77a42d9f28c2e8fb67df55d1effe2a152be4 commit 06ec77a42d9f28c2e8fb67df55d1effe2a152be4 Author: Gleb Smirnoff AuthorDate: 2025-06-25 01:16:16 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-25 01:16:16 +0000 gone_in: initialize va before passing it to gone_panic() Fixes: 01addd846c64fc2c8be610d83bfdc84ddb57f2ec --- sys/kern/subr_bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index e7e8896fc100..62a3da964c37 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -6281,8 +6281,8 @@ _gone_in(int major, const char *msg, ...) { va_list ap; - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg, ap); va_start(ap, msg); + gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg, ap); vprintf(msg, ap); va_end(ap); if (P_OSREL_MAJOR(__FreeBSD_version) < major) @@ -6294,8 +6294,8 @@ _gone_in_dev(device_t dev, int major, const char *msg, ...) { va_list ap; - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg, ap); va_start(ap, msg); + gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg, ap); device_printf(dev, msg, ap); va_end(ap); if (P_OSREL_MAJOR(__FreeBSD_version) < major) From nobody Wed Jun 25 01:36:36 2025 X-Original-To: dev-commits-src-main@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 4bRktr5573z60XSB; Wed, 25 Jun 2025 01:36: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 4bRktr2dtZz3y59; Wed, 25 Jun 2025 01:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750815396; 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=WsCsLB8m8z0AA2vhaQKI+/+7S/Ce/DheDSXLlD4v3D0=; b=voMiSr2O0ELmOcLs28n5zHQiXLcbfivJjh8uQiDhZS2TO9uphwOhmnm1xQO4eYJ2wtd4jZ VhiiKniKmSO+MQaU1Tvhuqp04/V+Y+40V+11VkogIKZ7njt9v5zd4wU4Pf7sLC6N6IJpVs rJGXKOQrTZa9gWhCratWqq1+MaSDanxiD1Lrr4TyfJB3/Ij5Xw4yTT5Iqlgz/6i4P7T78j k16HsRIqzGBr+JZWXwrbSbYQA66pmcVzVLb802otmJ4TAGYI1/t1TXorqcwFvnIrse5C+T Pl11m5StAdJkW2o3HtKdfQXH5li0JfFIp5cMDBM2VlseVnLwjdUIGzLzWUEFkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750815396; 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=WsCsLB8m8z0AA2vhaQKI+/+7S/Ce/DheDSXLlD4v3D0=; b=dbmlecjJ9I0UokgY7+6A9XdaMnvsQk5k/fk+bd9GahtONi207mCfeBIt9xMXetlPMQSTIS 5LPSDyHnOxPLqOXFfcpl1ZXg9hIG7NhsasjDHdsyYjuV9uTp7JXA7ovaTxHK9rqTr6LQrX LQ0ftVhupJndlFzSOBy4zejKxycvYbkfdHEpdd11U2yieBPJFKJ8rxdVc1Pxf+/H089xlt qoejK1LARkyHiRctlkiAOso04HpgDTb+o2g85ug+3Y7YYofB2OmDgZjv7yt2dAcoxwbX1g ocvMAvSbdTpqvXP7K9/CLCqmUyQKecDr46+TF9/HUTCtWjP32rqzj662n8xxUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750815396; a=rsa-sha256; cv=none; b=h4LKDBPRCcJq3UmI1mqpXlWFxk91EYdzKF47ebqCfrxkTNd90U82QwQlga/PzjBnm4Jn23 3JbwWotc9u6WCdebtvqfaM0XfcyYwonlw34o2XzW3L53/8S6RmVELQHTTuG0nUM8qQP5Pc QUpbrB+ei7ci4rJVXlXU6Q/+E6HhqYtCVYgHXspgstxBGGydrhWGAAY+GzCWJTm8z+3Igu fnzyhbwjXJDLWdpLS89BEKAGYQQpzIOxPl44T0e6+U1/g6w/HPM+sLwQoQNrY+tBhCFTav fFHLRYxaJmNscfCQ/S/wc0vl12KNKaDKak5R+inl4he16AvdjTiXPzmLFkQDzg== 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 4bRktr2Dccz1BJ4; Wed, 25 Jun 2025 01:36: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 55P1aaMG094337; Wed, 25 Jun 2025 01:36:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P1aag8094334; Wed, 25 Jun 2025 01:36:36 GMT (envelope-from git) Date: Wed, 25 Jun 2025 01:36:36 GMT Message-Id: <202506250136.55P1aag8094334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Lo Subject: git: 1395712cab8e - main - uchcom: add support for CH9102 and CH343 uarts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1395712cab8e95808064ba68c5a792b7cd0fe35f Auto-Submitted: auto-generated The branch main has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=1395712cab8e95808064ba68c5a792b7cd0fe35f commit 1395712cab8e95808064ba68c5a792b7cd0fe35f Author: Kevin Lo AuthorDate: 2025-06-25 01:33:35 +0000 Commit: Kevin Lo CommitDate: 2025-06-25 01:33:35 +0000 uchcom: add support for CH9102 and CH343 uarts The CH343 devices support any baud rate up to 6 Mbps. PR: 272803 Reviewed by: imp Tested by: joerg, Tomasz "CeDeROM" CEDRO Differential Revision: https://reviews.freebsd.org/D46290 --- share/man/man4/uchcom.4 | 27 +--- sys/dev/usb/serial/uchcom.c | 353 +++++++++++++++++++++++++------------------- sys/dev/usb/usbdevs | 4 +- 3 files changed, 208 insertions(+), 176 deletions(-) diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 index d5efe83286ba..4d395573589f 100644 --- a/share/man/man4/uchcom.4 +++ b/share/man/man4/uchcom.4 @@ -27,12 +27,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2017 +.Dd August 19, 2024 .Dt UCHCOM 4 .Os .Sh NAME .Nm uchcom -.Nd WinChipHead CH341/CH340 serial adapter driver +.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,22 +52,12 @@ uchcom_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the WinChipHead CH341/CH340 USB-to-RS-232 -Bridge chip. +driver provides support for the WinChipHead CH9102/CH343/CH341/CH340 +USB-to-RS-232 Bridge chip. .Pp -The device is accessed through the -.Xr ucom 4 -driver which makes it behave like a -.Xr tty 4 . -.Sh HARDWARE -The -.Nm -driver supports the following adapters: -.Pp -.Bl -bullet -compact -.It -HL USB-RS232 -.El +The datasheets for the CH340/CH341 list the maximum +supported baud rate as 2,000,000. +CH9102/CH343 devices support any baud rate up to 6 Mbps. .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* @@ -95,6 +85,3 @@ The first .Fx release to include it was .Fx 8.0 . -.Sh BUGS -Actually, this chip seems unable to drive other than 8 data bits and -1 stop bit line. diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c index a886b25c89d7..fdc5515fa722 100644 --- a/sys/dev/usb/serial/uchcom.c +++ b/sys/dev/usb/serial/uchcom.c @@ -58,8 +58,7 @@ */ /* - * Driver for WinChipHead CH341/340, the worst USB-serial chip in the - * world. + * Driver for WinChipHead CH9102/343/341/340. */ #include @@ -101,17 +100,19 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, &uchcom_debug, 0, "uchcom debug level"); #endif -#define UCHCOM_IFACE_INDEX 0 -#define UCHCOM_CONFIG_INDEX 0 +#define UCHCOM_IFACE_INDEX 0 +#define UCHCOM_CONFIG_INDEX 0 +#define UCHCOM_SECOND_IFACE_INDEX 1 #define UCHCOM_REV_CH340 0x0250 #define UCHCOM_INPUT_BUF_SIZE 8 -#define UCHCOM_REQ_GET_VERSION 0x5F -#define UCHCOM_REQ_READ_REG 0x95 -#define UCHCOM_REQ_WRITE_REG 0x9A -#define UCHCOM_REQ_RESET 0xA1 -#define UCHCOM_REQ_SET_DTRRTS 0xA4 +#define UCHCOM_REQ_GET_VERSION 0x5F +#define UCHCOM_REQ_READ_REG 0x95 +#define UCHCOM_REQ_WRITE_REG 0x9A +#define UCHCOM_REQ_RESET 0xA1 +#define UCHCOM_REQ_SET_DTRRTS 0xA4 +#define UCHCOM_REQ_CH343_WRITE_REG 0xA8 #define UCHCOM_REG_STAT1 0x06 #define UCHCOM_REG_STAT2 0x07 @@ -134,13 +135,21 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define UCHCOM_RTS_MASK 0x40 #define UCHCOM_BRK_MASK 0x01 +#define UCHCOM_ABRK_MASK 0x10 +#define UCHCOM_CH343_BRK_MASK 0x80 #define UCHCOM_LCR1_MASK 0xAF #define UCHCOM_LCR2_MASK 0x07 #define UCHCOM_LCR1_RX 0x80 #define UCHCOM_LCR1_TX 0x40 #define UCHCOM_LCR1_PARENB 0x08 +#define UCHCOM_LCR1_CS5 0x00 +#define UCHCOM_LCR1_CS6 0x01 +#define UCHCOM_LCR1_CS7 0x02 #define UCHCOM_LCR1_CS8 0x03 +#define UCHCOM_LCR1_STOPB 0x04 +#define UCHCOM_LCR1_PARODD 0x00 +#define UCHCOM_LCR1_PAREVEN 0x10 #define UCHCOM_LCR2_PAREVEN 0x07 #define UCHCOM_LCR2_PARODD 0x06 #define UCHCOM_LCR2_PARMARK 0x05 @@ -150,12 +159,18 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define UCHCOM_INTR_STAT2 0x03 #define UCHCOM_INTR_LEAST 4 -#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ +#define UCHCOM_T 0x08 +#define UCHCOM_CL 0x04 +#define UCHCOM_CH343_CT 0x80 +#define UCHCOM_CT 0x90 + +#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ + +#define TYPE_CH343 1 enum { UCHCOM_BULK_DT_WR, UCHCOM_BULK_DT_RD, - UCHCOM_INTR_DT_RD, UCHCOM_N_TRANSFER, }; @@ -164,6 +179,7 @@ struct uchcom_softc { struct ucom_softc sc_ucom; struct usb_xfer *sc_xfer[UCHCOM_N_TRANSFER]; + struct usb_xfer *sc_intr_xfer; /* Interrupt endpoint */ struct usb_device *sc_udev; struct mtx sc_mtx; @@ -171,39 +187,19 @@ struct uchcom_softc { uint8_t sc_rts; /* local copy */ uint8_t sc_version; uint8_t sc_msr; - uint8_t sc_lsr; /* local status register */ -}; - -struct uchcom_divider { - uint8_t dv_prescaler; - uint8_t dv_div; - uint8_t dv_mod; -}; - -struct uchcom_divider_record { - uint32_t dvr_high; - uint32_t dvr_low; - uint32_t dvr_base_clock; - struct uchcom_divider dvr_divider; -}; - -static const struct uchcom_divider_record dividers[] = -{ - {307200, 307200, UCHCOM_BASE_UNKNOWN, {7, 0xD9, 0}}, - {921600, 921600, UCHCOM_BASE_UNKNOWN, {7, 0xF3, 0}}, - {2999999, 23530, 6000000, {3, 0, 0}}, - {23529, 2942, 750000, {2, 0, 0}}, - {2941, 368, 93750, {1, 0, 0}}, - {367, 1, 11719, {0, 0, 0}}, + uint8_t sc_lsr; /* local status register */ + uint8_t sc_chiptype; /* type of chip */ + uint8_t sc_ctrl_iface_no; + uint8_t sc_iface_index; }; -#define NUM_DIVIDERS nitems(dividers) - static const STRUCT_USB_HOST_ID uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_3, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH343SER, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH9102SER, 0)}, }; /* protypes */ @@ -225,8 +221,9 @@ static void uchcom_update_version(struct uchcom_softc *); static void uchcom_convert_status(struct uchcom_softc *, uint8_t); static void uchcom_update_status(struct uchcom_softc *); static void uchcom_set_dtr_rts(struct uchcom_softc *); -static int uchcom_calc_divider_settings(struct uchcom_divider *, uint32_t); -static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t); +static void uchcom_calc_baudrate(struct uchcom_softc *, uint32_t, uint8_t *, + uint8_t *); +static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t, uint16_t); static void uchcom_poll(struct ucom_softc *ucom); static device_probe_t uchcom_probe; @@ -244,7 +241,7 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UCHCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = {.pipe_bof = 1,}, .callback = &uchcom_write_callback, }, @@ -256,8 +253,10 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = &uchcom_read_callback, }, +}; - [UCHCOM_INTR_DT_RD] = { +static const struct usb_config uchcom_intr_config_data[1] = { + [0] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -311,8 +310,9 @@ uchcom_attach(device_t dev) { struct uchcom_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); + struct usb_interface *iface; + struct usb_interface_descriptor *id; int error; - uint8_t iface_index; DPRINTFN(11, "\n"); @@ -330,20 +330,49 @@ uchcom_attach(device_t dev) case USB_PRODUCT_WCH2_CH341SER_3: device_printf(dev, "CH341 detected\n"); break; + case USB_PRODUCT_WCH2_CH343SER: + device_printf(dev, "CH343 detected\n"); + break; + case USB_PRODUCT_WCH2_CH9102SER: + device_printf(dev, "CH9102 detected\n"); + break; default: - device_printf(dev, "New CH340/CH341 product 0x%04x detected\n", - uaa->info.idProduct); + device_printf(dev, "New CH340/CH341/CH343/CH9102 product " + "0x%04x detected\n", uaa->info.idProduct); break; } - iface_index = UCHCOM_IFACE_INDEX; - error = usbd_transfer_setup(uaa->device, - &iface_index, sc->sc_xfer, uchcom_config_data, - UCHCOM_N_TRANSFER, sc, &sc->sc_mtx); + /* CH343/CH9102 has two interfaces. */ + sc->sc_ctrl_iface_no = uaa->info.bIfaceNum; + iface = usbd_get_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX); + if (iface) { + id = usbd_get_interface_descriptor(iface); + if (id == NULL) { + device_printf(dev, "no interface descriptor\n"); + goto detach; + } + sc->sc_iface_index = UCHCOM_SECOND_IFACE_INDEX; + usbd_set_parent_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX, + uaa->info.bIfaceIndex); + sc->sc_chiptype = TYPE_CH343; + } else { + sc->sc_iface_index = UCHCOM_IFACE_INDEX; + } + + /* Setup all transfers. */ + error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index, + sc->sc_xfer, uchcom_config_data, UCHCOM_N_TRANSFER, sc, + &sc->sc_mtx); + if (error) { + device_printf(dev, "could not allocate all pipes\n"); + goto detach; + } + error = usbd_transfer_setup(uaa->device, &sc->sc_ctrl_iface_no, + &sc->sc_intr_xfer, uchcom_intr_config_data, 1, sc, &sc->sc_mtx); if (error) { - DPRINTF("one or more missing USB endpoints, " - "error=%s\n", usbd_errstr(error)); + device_printf(dev, "allocating USB transfers failed for " + "interrupt\n"); goto detach; } @@ -449,7 +478,9 @@ uchcom_write_reg(struct uchcom_softc *sc, (unsigned)reg1, (unsigned)val1, (unsigned)reg2, (unsigned)val2); uchcom_ctrl_write( - sc, UCHCOM_REQ_WRITE_REG, + sc, + (sc->sc_chiptype != TYPE_CH343) ? + UCHCOM_REQ_WRITE_REG : UCHCOM_REQ_CH343_WRITE_REG, reg1 | ((uint16_t)reg2 << 8), val1 | ((uint16_t)val2 << 8)); } @@ -516,9 +547,6 @@ uchcom_update_version(struct uchcom_softc *sc) static void uchcom_convert_status(struct uchcom_softc *sc, uint8_t cur) { - sc->sc_dtr = !(cur & UCHCOM_DTR_MASK); - sc->sc_rts = !(cur & UCHCOM_RTS_MASK); - cur = ~cur & 0x0F; sc->sc_msr = (cur << 4) | ((sc->sc_msr >> 4) ^ cur); } @@ -555,78 +583,69 @@ uchcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff) uint8_t brk1; uint8_t brk2; - uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, &brk2); - if (onoff) { - /* on - clear bits */ - brk1 &= ~UCHCOM_BRK_MASK; - brk2 &= ~UCHCOM_LCR1_TX; + if (sc->sc_chiptype == TYPE_CH343) { + brk1 = UCHCOM_CH343_BRK_MASK; + if (!onoff) + brk1 |= UCHCOM_ABRK_MASK; + uchcom_write_reg(sc, brk1, 0, 0, 0); } else { - /* off - set bits */ - brk1 |= UCHCOM_BRK_MASK; - brk2 |= UCHCOM_LCR1_TX; + uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, + &brk2); + if (onoff) { + /* on - clear bits */ + brk1 &= ~UCHCOM_BRK_MASK; + brk2 &= ~UCHCOM_LCR1_TX; + } else { + /* off - set bits */ + brk1 |= UCHCOM_BRK_MASK; + brk2 |= UCHCOM_LCR1_TX; + } + uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, + brk2); } - uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, brk2); } -static int -uchcom_calc_divider_settings(struct uchcom_divider *dp, uint32_t rate) -{ - const struct uchcom_divider_record *rp; - uint32_t div; - uint32_t rem; - uint32_t mod; - uint8_t i; - - /* find record */ - for (i = 0; i != NUM_DIVIDERS; i++) { - if (dividers[i].dvr_high >= rate && - dividers[i].dvr_low <= rate) { - rp = ÷rs[i]; - goto found; - } - } - return (-1); - -found: - dp->dv_prescaler = rp->dvr_divider.dv_prescaler; - if (rp->dvr_base_clock == UCHCOM_BASE_UNKNOWN) - dp->dv_div = rp->dvr_divider.dv_div; - else { - div = rp->dvr_base_clock / rate; - rem = rp->dvr_base_clock % rate; - if (div == 0 || div >= 0xFF) - return (-1); - if ((rem << 1) >= rate) - div += 1; - dp->dv_div = (uint8_t)-div; +static void +uchcom_calc_baudrate(struct uchcom_softc *sc, uint32_t rate, uint8_t *divisor, + uint8_t *factor) +{ + uint32_t clk = 12000000; + + if (rate >= 256000 && sc->sc_chiptype == TYPE_CH343) + *divisor = 7; + else if (rate > 23529) { + clk /= 2; + *divisor = 3; + } else if (rate > 2941) { + clk /= 16; + *divisor = 2; + } else if (rate > 367) { + clk /= 128; + *divisor = 1; + } else { + clk = 11719; + *divisor = 0; } - mod = (UCHCOM_BPS_MOD_BASE / rate) + UCHCOM_BPS_MOD_BASE_OFS; - mod = mod + (mod / 2); + *factor = 256 - clk / rate; - dp->dv_mod = (mod + 0xFF) / 0x100; - - return (0); + if (rate == 921600 && sc->sc_chiptype != TYPE_CH343) { + *divisor = 7; + *factor = 243; + } } static void -uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate) +uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate, uint16_t lcr) { - struct uchcom_divider dv; + uint16_t idx; + uint8_t factor, div; - if (uchcom_calc_divider_settings(&dv, rate)) - return; + uchcom_calc_baudrate(sc, rate, &div, &factor); + div |= (sc->sc_chiptype != TYPE_CH343) ? 0x80 : 0x00; + idx = (factor << 8) | div; - /* - * According to linux code we need to set bit 7 of UCHCOM_REG_BPS_PRE, - * otherwise the chip will buffer data. - */ - uchcom_write_reg(sc, - UCHCOM_REG_BPS_PRE, dv.dv_prescaler | 0x80, - UCHCOM_REG_BPS_DIV, dv.dv_div); - uchcom_write_reg(sc, - UCHCOM_REG_BPS_MOD, dv.dv_mod, - UCHCOM_REG_BPS_PAD, 0); + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, lcr, idx); } /* ---------------------------------------------------------------------- @@ -673,6 +692,14 @@ uchcom_cfg_open(struct ucom_softc *ucom) DPRINTF("\n"); + if (sc->sc_chiptype != TYPE_CH343) { + /* Set default configuration. */ + uchcom_get_version(sc, NULL); + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); + uchcom_write_reg(sc, UCHCOM_REG_BPS_PRE, 0x82, + UCHCOM_REG_BPS_DIV, 0xd9); + uchcom_write_reg(sc, 0x2c, 0x07, UCHCOM_REG_BPS_PAD, 0); + } uchcom_update_version(sc); uchcom_update_status(sc); } @@ -680,53 +707,69 @@ uchcom_cfg_open(struct ucom_softc *ucom) static int uchcom_pre_param(struct ucom_softc *ucom, struct termios *t) { - struct uchcom_divider dv; + struct uchcom_softc *sc = ucom->sc_parent; - switch (t->c_cflag & CSIZE) { - case CS8: + /* + * Check requested baud rate. + * The CH340/CH341 can set any baud rate up to 2Mb. + * The CH9102/CH343 can set any baud rate up to 6Mb. + */ + switch (sc->sc_chiptype) { + case TYPE_CH343: + if (t->c_ospeed <= 6000000) + return (0); break; default: - return (EIO); + if (t->c_ospeed <= 2000000) + return (0); + break; } - if ((t->c_cflag & CSTOPB) != 0) - return (EIO); - if ((t->c_cflag & PARENB) != 0) - return (EIO); - if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) { - return (EIO); - } - return (0); /* success */ + return (EIO); } static void uchcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { struct uchcom_softc *sc = ucom->sc_parent; + uint8_t lcr; - uchcom_get_version(sc, NULL); - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); - uchcom_set_baudrate(sc, t->c_ospeed); - if (sc->sc_version < UCHCOM_VER_30) { - uchcom_read_reg(sc, UCHCOM_REG_LCR1, NULL, - UCHCOM_REG_LCR2, NULL); - uchcom_write_reg(sc, UCHCOM_REG_LCR1, 0x50, - UCHCOM_REG_LCR2, 0x00); - } else { - /* - * Set up line control: - * - enable transmit and receive - * - set 8n1 mode - * To do: support other sizes, parity, stop bits. - */ - uchcom_write_reg(sc, - UCHCOM_REG_LCR1, - UCHCOM_LCR1_RX | UCHCOM_LCR1_TX | UCHCOM_LCR1_CS8, - UCHCOM_REG_LCR2, 0x00); + lcr = UCHCOM_LCR1_RX | UCHCOM_LCR1_TX; + + if (t->c_cflag & CSTOPB) + lcr |= UCHCOM_LCR1_STOPB; + + if (t->c_cflag & PARENB) { + lcr |= UCHCOM_LCR1_PARENB; + if (t->c_cflag & PARODD) + lcr |= UCHCOM_LCR1_PARODD; + else + lcr |= UCHCOM_LCR1_PAREVEN; } - uchcom_update_status(sc); - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a); - uchcom_set_baudrate(sc, t->c_ospeed); + + switch (t->c_cflag & CSIZE) { + case CS5: + lcr |= UCHCOM_LCR1_CS5; + break; + case CS6: + lcr |= UCHCOM_LCR1_CS6; + break; + case CS7: + lcr |= UCHCOM_LCR1_CS7; + break; + case CS8: + default: + lcr |= UCHCOM_LCR1_CS8; + break; + } + + if (sc->sc_chiptype == TYPE_CH343) + uchcom_set_baudrate(sc, t->c_ospeed, + UCHCOM_T | UCHCOM_CL | UCHCOM_CH343_CT | lcr << 8); + else + uchcom_set_baudrate(sc, t->c_ospeed, + UCHCOM_T | UCHCOM_CL | UCHCOM_CT | lcr << 8); + uchcom_set_dtr_rts(sc); uchcom_update_status(sc); } @@ -737,7 +780,7 @@ uchcom_start_read(struct ucom_softc *ucom) struct uchcom_softc *sc = ucom->sc_parent; /* start interrupt endpoint */ - usbd_transfer_start(sc->sc_xfer[UCHCOM_INTR_DT_RD]); + usbd_transfer_start(sc->sc_intr_xfer); /* start read endpoint */ usbd_transfer_start(sc->sc_xfer[UCHCOM_BULK_DT_RD]); @@ -749,7 +792,7 @@ uchcom_stop_read(struct ucom_softc *ucom) struct uchcom_softc *sc = ucom->sc_parent; /* stop interrupt endpoint */ - usbd_transfer_stop(sc->sc_xfer[UCHCOM_INTR_DT_RD]); + usbd_transfer_stop(sc->sc_intr_xfer); /* stop read endpoint */ usbd_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_RD]); @@ -779,7 +822,8 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) { struct uchcom_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint8_t buf[UCHCOM_INTR_LEAST]; + uint32_t intrstat; + uint8_t buf[16]; int actlen; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -791,13 +835,12 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (actlen >= UCHCOM_INTR_LEAST) { pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_out(pc, 0, buf, UCHCOM_INTR_LEAST); + usbd_copy_out(pc, 0, buf, sizeof(buf)); - DPRINTF("data = 0x%02X 0x%02X 0x%02X 0x%02X\n", - (unsigned)buf[0], (unsigned)buf[1], - (unsigned)buf[2], (unsigned)buf[3]); + intrstat = (sc->sc_chiptype == TYPE_CH343) ? + actlen - 1 : UCHCOM_INTR_STAT1; - uchcom_convert_status(sc, buf[UCHCOM_INTR_STAT1]); + uchcom_convert_status(sc, buf[intrstat]); ucom_status_change(&sc->sc_ucom); } case USB_ST_SETUP: diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index f26edcebcb9c..2318e6bd0017 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4972,9 +4972,11 @@ product WAVESENSE JAZZ 0xaaaa Jazz blood glucose meter /* WCH products */ product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge product WCH2 CH341SER_2 0x5523 CH341/CH340 USB-Serial Bridge +product WCH2 CH343SER 0x55d3 CH343 USB Serial +product WCH2 CH9102SER 0x55d4 CH9102 USB Serial product WCH2 CH341SER_3 0x7522 CH341/CH340 USB-Serial Bridge product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge -product WCH2 U2M 0X752d CH345 USB2.0-MIDI +product WCH2 U2M 0x752d CH345 USB2.0-MIDI /* West Mountain Radio products */ product WESTMOUNTAIN RIGBLASTER_ADVANTAGE 0x0003 RIGblaster Advantage From nobody Wed Jun 25 05:08:58 2025 X-Original-To: dev-commits-src-main@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 4bRqbt6Qx6z60kXD; Wed, 25 Jun 2025 05:08: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 4bRqbt5nj4z4Dtp; Wed, 25 Jun 2025 05:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750828138; 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=OLV6mbGrjR262EnWrBoHZWSGivhIHRwQwdYpi1pneMQ=; b=iXwJFDI4OxDpzyJ0X0sKDA7U7wgEjps4Mh4rHj7pggEZzvYo/MRcqloC4KbraOqAZq6/Ng ubexIukBdci4RJa9ijayU4gPhRL6hMGhE3RbrW/zxrL5vQIXpDJeKr1tbKGNFxIGYK8uiQ IrVzPUabtX6rQ5pC+B8H1Nc85iyJwbK8metKNelXXusTbp5T1nNe+hIt0ONzHTW0I4pEl4 McOOYIjPiHDemEylZql8mzZzphmQEjY1Eto8xgURsika8d9+xt9DRZOcTTxWsZAkAn/WG/ axvoNBJM2pyTxHCgIseXHYNXHseUZ/AgD82vKaWamjgj8nwvVNRaFvIGNEgR3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750828138; 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=OLV6mbGrjR262EnWrBoHZWSGivhIHRwQwdYpi1pneMQ=; b=TITrg+mw3DMS5/BoM0dOOsEhQ7AoC7TKpHq7RtuuMU/9Z3Sbz4tJwUfI3Zl54Unmq8kuBH jdOd15VelhAvaaz3P6FSQQiamjberIdCJpzUzDAjsmntK5gf59KQg1fcARjDhZ9tj4rmDA v0kjQ+DJC1Lm8eF2lKiqmaJlgMfrNiY3EE/Ga/euVWUrMcgCVFnBi7MiKdOM5xicI1qFiZ JiYiIM3KR+Ctfs9W9GB2hgYMpBN7dgj2TE+X8QZ8QX175IQVrH5BBcu9S8BF7nIhHKITa3 YQGfDCWfTA6eDE457okwydW3FdXbzl6YmZ4B3GO2XzDbJFLvQqGREobutHKJlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750828138; a=rsa-sha256; cv=none; b=TjKO5yr0Ejv1/uDOzqvvzHqfcvaX6v9F5lXDTJu4rTtYk804Sc8bS43LcH5ZIF3H2+JeNZ Ku1AHbJODyr2ARJJvs5X1ZQzmAYSsbt7UsNmLWavL5OuDmV8J0qWl7wuCXkYZtA+UnsaZ6 Tfw53BPpbVyPO5gKVQ0Kpx/jHifhYD1eSYzJj50aLJg0Y3kQM9td925ixoHep/SPjcwCPI wWGOilvklroK2v2ajPoxj+AuNDxOcrNTHA2Ln/fejq0zvVrEDtbdI0CdUfJ+BvOL4ItWHr 3jINXOu9nLTF6phY0lFUjZ/sNh/eIRcQ77WMfVIzi12qbIt+Md5U8kmg2MVWDw== 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 4bRqbt5Nhjz1Hvk; Wed, 25 Jun 2025 05:08: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 55P58wEI091128; Wed, 25 Jun 2025 05:08:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P58wQe091124; Wed, 25 Jun 2025 05:08:58 GMT (envelope-from git) Date: Wed, 25 Jun 2025 05:08:58 GMT Message-Id: <202506250508.55P58wQe091124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: eab94b59a774 - main - ng_patch.4: Clarify relative_offset List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eab94b59a7743113c7f101846f498e539b2d094d Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=eab94b59a7743113c7f101846f498e539b2d094d commit eab94b59a7743113c7f101846f498e539b2d094d Author: Felix Johnson AuthorDate: 2025-06-25 04:49:51 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 05:05:48 +0000 ng_patch.4: Clarify relative_offset While here, fix an extra space typo. PR: 251833 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51033 --- share/man/man4/ng_patch.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_patch.4 b/share/man/man4/ng_patch.4 index 7a8543fd7dd8..9c0d7a8ee512 100644 --- a/share/man/man4/ng_patch.4 +++ b/share/man/man4/ng_patch.4 @@ -80,7 +80,7 @@ Sets the data link type on the .Va in hook (to help calculate relative offset). Currently, supported types are .Cm DLT_RAW -(raw IP datagrams , no offset applied, the default) and +(raw IP datagrams, no offset applied, the default) and .Cm DLT_EN10MB (Ethernet). DLT_ definitions can be found in .In net/bpf.h . @@ -135,6 +135,17 @@ corresponding checksum before transmitting packet on output interface. The .Nm node does not do any checksum correction by itself. +.Pp +The +.Va offset +value for the +.Vt ng_patch_op +structure is calculated from zero by default (the first byte of +packet headers). +If +.Va relative_offset +is enabled (set to 1) during configuration, the operation will have an +additional amount added to the offset based on the data link type. .It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig This control message returns the current set of modify operations, in the form of a From nobody Wed Jun 25 05:45:51 2025 X-Original-To: dev-commits-src-main@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 4bRrQc53bRz60m7N; Wed, 25 Jun 2025 05:46:00 +0000 (UTC) (envelope-from SRS0=CtnW=ZI=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int-backup.realworks.nl (smtp-relay-int-backup.realworks.nl [87.255.56.188]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bRrQc0T8cz3KGN; Wed, 25 Jun 2025 05:45:59 +0000 (UTC) (envelope-from SRS0=CtnW=ZI=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Received: from smtp-relay-int-backup.realworks.nl (crmpreview5.colo2.realworks.nl [10.2.52.35]) by mailrelayint2.colo2.realworks.nl (Postfix) with ESMTP id 4bRrQR53mrz1Hs; Wed, 25 Jun 2025 07:45:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1750830351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2UYdF30evm0x19SdcCBSRJUSCryEyHz+jcnDwibb3B8=; b=udS0YnJUFhIWP6+XR7lAF5m5/FzHT5G43QQDhrK4/USqw+tWmElYqZr08l9QC70rSahvrJ JiEjS+x2kmTc5tGia0CR8u+/F2PjGPEciivpVR0AuoHNiIGiTdiuvLyeg/tXy9fFXGdxo5 3CL+He8R7zgNWp45j7LTWn0lb7k7nv9i0aU0I+3HP+hIv3NwsZGzX38VycWV40JCCdz4ik 3AqDg2U847+Ca1IdLbBPow3KCA4mJV7SI3kklj+qZmebWdgdws9NYs6byjhiLMT45tZPHf G3GvsFgxQMF0DQRqaHKhUNfjA2/QnKi1vqoGk7OHIaYBW80tTf555HRFdN9a5A== Received: from crmpreview5.colo2.realworks.nl (localhost [127.0.0.1]) by crmpreview5.colo2.realworks.nl (Postfix) with ESMTP id A1416C04AA; Wed, 25 Jun 2025 07:45:51 +0200 (CEST) Date: Wed, 25 Jun 2025 07:45:51 +0200 (CEST) From: Ronald Klop To: Kevin Lo Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <727722724.560.1750830351345@localhost> In-Reply-To: <202506250136.55P1aag8094334@gitrepo.freebsd.org> References: <202506250136.55P1aag8094334@gitrepo.freebsd.org> Subject: Re: git: 1395712cab8e - main - uchcom: add support for CH9102 and CH343 uarts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_559_1619721974.1750830351251" X-Mailer: Realworks (753.38) X-Originating-Host: from (83-81-212-149.cable.dynamic.v4.ziggo.nl [83.81.212.149]) by crmpreview5.colo2.realworks.nl [10.2.52.35] with HTTP; Wed, 25 Jun 2025 07:45:51 +0200 Importance: Normal X-Priority: 3 (Normal) X-Originating-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:140.0) Gecko/20100101 Firefox/140.0 X-Rspamd-Queue-Id: 4bRrQc0T8cz3KGN X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:38930, ipnet:87.255.32.0/19, country:NL] ------=_Part_559_1619721974.1750830351251 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, nice work! Isn't the HARDWARE section in the man page used to generate a supported hardware list in the release notes of a new FreeBSD version? Regards, Ronald. Van: Kevin Lo Datum:woensdag, 25 juni 2025 03:36 Aan:src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp:git: 1395712cab8e - main - uchcom: add support for CH9102 and CH343 uarts > > The branch main has been updated by kevlo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1395712cab8e95808064ba68c5a792b7cd0fe35f > > commit 1395712cab8e95808064ba68c5a792b7cd0fe35f > Author: Kevin Lo > AuthorDate: 2025-06-25 01:33:35 +0000 > Commit: Kevin Lo > CommitDate: 2025-06-25 01:33:35 +0000 > > uchcom: add support for CH9102 and CH343 uarts > > The CH343 devices support any baud rate up to 6 Mbps. > PR: 272803 > Reviewed by: imp > Tested by: joerg, Tomasz "CeDeROM" CEDRO > Differential Revision: https://reviews.freebsd.org/D46290 > --- > share/man/man4/uchcom.4 | 27 +--- > sys/dev/usb/serial/uchcom.c | 353 +++++++++++++++++++++++++------------------- > sys/dev/usb/usbdevs | 4 +- > 3 files changed, 208 insertions(+), 176 deletions(-) > > diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 > index d5efe83286ba..4d395573589f 100644 > --- a/share/man/man4/uchcom.4 > +++ b/share/man/man4/uchcom.4 > @@ -27,12 +27,12 @@ > .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > .\" POSSIBILITY OF SUCH DAMAGE. > .\" > -.Dd April 26, 2017 > +.Dd August 19, 2024 > .Dt UCHCOM 4 > .Os > .Sh NAME > .Nm uchcom > -.Nd WinChipHead CH341/CH340 serial adapter driver > +.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver > .Sh SYNOPSIS > To compile this driver into the kernel, > place the following lines in your > @@ -52,22 +52,12 @@ uchcom_load="YES" > .Sh DESCRIPTION > The > .Nm > -driver provides support for the WinChipHead CH341/CH340 USB-to-RS-232 > -Bridge chip. > +driver provides support for the WinChipHead CH9102/CH343/CH341/CH340 > +USB-to-RS-232 Bridge chip. > .Pp > -The device is accessed through the > -.Xr ucom 4 > -driver which makes it behave like a > -.Xr tty 4 . > -.Sh HARDWARE > -The > -.Nm > -driver supports the following adapters: > -.Pp > -.Bl -bullet -compact > -.It > -HL USB-RS232 > -.El > +The datasheets for the CH340/CH341 list the maximum > +supported baud rate as 2,000,000. > +CH9102/CH343 devices support any baud rate up to 6 Mbps. > .Sh FILES > .Bl -tag -width "/dev/ttyU*.init" -compact > .It Pa /dev/ttyU* > @@ -95,6 +85,3 @@ The first > .Fx > release to include it was > .Fx 8.0 . > -.Sh BUGS > -Actually, this chip seems unable to drive other than 8 data bits and > -1 stop bit line. > diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c > index a886b25c89d7..fdc5515fa722 100644 > --- a/sys/dev/usb/serial/uchcom.c > +++ b/sys/dev/usb/serial/uchcom.c > @@ -58,8 +58,7 @@ > */ > > /* > - * Driver for WinChipHead CH341/340, the worst USB-serial chip in the > - * world. > + * Driver for WinChipHead CH9102/343/341/340. > */ > > #include > @@ -101,17 +100,19 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, > &uchcom_debug, 0, "uchcom debug level"); > #endif > > -#define UCHCOM_IFACE_INDEX 0 > -#define UCHCOM_CONFIG_INDEX 0 > +#define UCHCOM_IFACE_INDEX 0 > +#define UCHCOM_CONFIG_INDEX 0 > +#define UCHCOM_SECOND_IFACE_INDEX 1 > > #define UCHCOM_REV_CH340 0x0250 > #define UCHCOM_INPUT_BUF_SIZE 8 > > -#define UCHCOM_REQ_GET_VERSION 0x5F > -#define UCHCOM_REQ_READ_REG 0x95 > -#define UCHCOM_REQ_WRITE_REG 0x9A > -#define UCHCOM_REQ_RESET 0xA1 > -#define UCHCOM_REQ_SET_DTRRTS 0xA4 > +#define UCHCOM_REQ_GET_VERSION 0x5F > +#define UCHCOM_REQ_READ_REG 0x95 > +#define UCHCOM_REQ_WRITE_REG 0x9A > +#define UCHCOM_REQ_RESET 0xA1 > +#define UCHCOM_REQ_SET_DTRRTS 0xA4 > +#define UCHCOM_REQ_CH343_WRITE_REG 0xA8 > > #define UCHCOM_REG_STAT1 0x06 > #define UCHCOM_REG_STAT2 0x07 > @@ -134,13 +135,21 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, > #define UCHCOM_RTS_MASK 0x40 > > #define UCHCOM_BRK_MASK 0x01 > +#define UCHCOM_ABRK_MASK 0x10 > +#define UCHCOM_CH343_BRK_MASK 0x80 > > #define UCHCOM_LCR1_MASK 0xAF > #define UCHCOM_LCR2_MASK 0x07 > #define UCHCOM_LCR1_RX 0x80 > #define UCHCOM_LCR1_TX 0x40 > #define UCHCOM_LCR1_PARENB 0x08 > +#define UCHCOM_LCR1_CS5 0x00 > +#define UCHCOM_LCR1_CS6 0x01 > +#define UCHCOM_LCR1_CS7 0x02 > #define UCHCOM_LCR1_CS8 0x03 > +#define UCHCOM_LCR1_STOPB 0x04 > +#define UCHCOM_LCR1_PARODD 0x00 > +#define UCHCOM_LCR1_PAREVEN 0x10 > #define UCHCOM_LCR2_PAREVEN 0x07 > #define UCHCOM_LCR2_PARODD 0x06 > #define UCHCOM_LCR2_PARMARK 0x05 > @@ -150,12 +159,18 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, > #define UCHCOM_INTR_STAT2 0x03 > #define UCHCOM_INTR_LEAST 4 > > -#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ > +#define UCHCOM_T 0x08 > +#define UCHCOM_CL 0x04 > +#define UCHCOM_CH343_CT 0x80 > +#define UCHCOM_CT 0x90 > + > +#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ > + > +#define TYPE_CH343 1 > > enum { > UCHCOM_BULK_DT_WR, > UCHCOM_BULK_DT_RD, > - UCHCOM_INTR_DT_RD, > UCHCOM_N_TRANSFER, > }; > > @@ -164,6 +179,7 @@ struct uchcom_softc { > struct ucom_softc sc_ucom; > > struct usb_xfer *sc_xfer[UCHCOM_N_TRANSFER]; > + struct usb_xfer *sc_intr_xfer; /* Interrupt endpoint */ > struct usb_device *sc_udev; > struct mtx sc_mtx; > > @@ -171,39 +187,19 @@ struct uchcom_softc { > uint8_t sc_rts; /* local copy */ > uint8_t sc_version; > uint8_t sc_msr; > - uint8_t sc_lsr; /* local status register */ > -}; > - > -struct uchcom_divider { > - uint8_t dv_prescaler; > - uint8_t dv_div; > - uint8_t dv_mod; > -}; > - > -struct uchcom_divider_record { > - uint32_t dvr_high; > - uint32_t dvr_low; > - uint32_t dvr_base_clock; > - struct uchcom_divider dvr_divider; > -}; > - > -static const struct uchcom_divider_record dividers[] = > -{ > - {307200, 307200, UCHCOM_BASE_UNKNOWN, {7, 0xD9, 0}}, > - {921600, 921600, UCHCOM_BASE_UNKNOWN, {7, 0xF3, 0}}, > - {2999999, 23530, 6000000, {3, 0, 0}}, > - {23529, 2942, 750000, {2, 0, 0}}, > - {2941, 368, 93750, {1, 0, 0}}, > - {367, 1, 11719, {0, 0, 0}}, > + uint8_t sc_lsr; /* local status register */ > + uint8_t sc_chiptype; /* type of chip */ > + uint8_t sc_ctrl_iface_no; > + uint8_t sc_iface_index; > }; > > -#define NUM_DIVIDERS nitems(dividers) > - > static const STRUCT_USB_HOST_ID uchcom_devs[] = { > {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, > {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, > {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, > {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_3, 0)}, > + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH343SER, 0)}, > + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH9102SER, 0)}, > }; > > /* protypes */ > @@ -225,8 +221,9 @@ static void uchcom_update_version(struct uchcom_softc *); > static void uchcom_convert_status(struct uchcom_softc *, uint8_t); > static void uchcom_update_status(struct uchcom_softc *); > static void uchcom_set_dtr_rts(struct uchcom_softc *); > -static int uchcom_calc_divider_settings(struct uchcom_divider *, uint32_t); > -static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t); > +static void uchcom_calc_baudrate(struct uchcom_softc *, uint32_t, uint8_t *, > + uint8_t *); > +static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t, uint16_t); > static void uchcom_poll(struct ucom_softc *ucom); > > static device_probe_t uchcom_probe; > @@ -244,7 +241,7 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { > .endpoint = UE_ADDR_ANY, > .direction = UE_DIR_OUT, > .bufsize = UCHCOM_BULK_BUF_SIZE, > - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, > + .flags = {.pipe_bof = 1,}, > .callback = &uchcom_write_callback, > }, > > @@ -256,8 +253,10 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { > .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, > .callback = &uchcom_read_callback, > }, > +}; > > - [UCHCOM_INTR_DT_RD] = { > +static const struct usb_config uchcom_intr_config_data[1] = { > + [0] = { > .type = UE_INTERRUPT, > .endpoint = UE_ADDR_ANY, > .direction = UE_DIR_IN, > @@ -311,8 +310,9 @@ uchcom_attach(device_t dev) > { > struct uchcom_softc *sc = device_get_softc(dev); > struct usb_attach_arg *uaa = device_get_ivars(dev); > + struct usb_interface *iface; > + struct usb_interface_descriptor *id; > int error; > - uint8_t iface_index; > > DPRINTFN(11, "\n"); > > @@ -330,20 +330,49 @@ uchcom_attach(device_t dev) > case USB_PRODUCT_WCH2_CH341SER_3: > device_printf(dev, "CH341 detected\n"); > break; > + case USB_PRODUCT_WCH2_CH343SER: > + device_printf(dev, "CH343 detected\n"); > + break; > + case USB_PRODUCT_WCH2_CH9102SER: > + device_printf(dev, "CH9102 detected\n"); > + break; > default: > - device_printf(dev, "New CH340/CH341 product 0x%04x detected\n", > - uaa->info.idProduct); > + device_printf(dev, "New CH340/CH341/CH343/CH9102 product " > + "0x%04x detected\n", uaa->info.idProduct); > break; > } > > - iface_index = UCHCOM_IFACE_INDEX; > - error = usbd_transfer_setup(uaa->device, > - &iface_index, sc->sc_xfer, uchcom_config_data, > - UCHCOM_N_TRANSFER, sc, &sc->sc_mtx); > + /* CH343/CH9102 has two interfaces. */ > + sc->sc_ctrl_iface_no = uaa->info.bIfaceNum; > > + iface = usbd_get_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX); > + if (iface) { > + id = usbd_get_interface_descriptor(iface); > + if (id == NULL) { > + device_printf(dev, "no interface descriptor\n"); > + goto detach; > + } > + sc->sc_iface_index = UCHCOM_SECOND_IFACE_INDEX; > + usbd_set_parent_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX, > + uaa->info.bIfaceIndex); > + sc->sc_chiptype = TYPE_CH343; > + } else { > + sc->sc_iface_index = UCHCOM_IFACE_INDEX; > + } > + > + /* Setup all transfers. */ > + error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index, > + sc->sc_xfer, uchcom_config_data, UCHCOM_N_TRANSFER, sc, > + &sc->sc_mtx); > + if (error) { > + device_printf(dev, "could not allocate all pipes\n"); > + goto detach; > + } > + error = usbd_transfer_setup(uaa->device, &sc->sc_ctrl_iface_no, > + &sc->sc_intr_xfer, uchcom_intr_config_data, 1, sc, &sc->sc_mtx); > if (error) { > - DPRINTF("one or more missing USB endpoints, " > - "error=%s\n", usbd_errstr(error)); > + device_printf(dev, "allocating USB transfers failed for " > + "interrupt\n"); > goto detach; > } > > @@ -449,7 +478,9 @@ uchcom_write_reg(struct uchcom_softc *sc, > (unsigned)reg1, (unsigned)val1, > (unsigned)reg2, (unsigned)val2); > uchcom_ctrl_write( > - sc, UCHCOM_REQ_WRITE_REG, > + sc, > + (sc->sc_chiptype != TYPE_CH343) ? > + UCHCOM_REQ_WRITE_REG : UCHCOM_REQ_CH343_WRITE_REG, > reg1 | ((uint16_t)reg2 << 8), val1 | ((uint16_t)val2 << 8)); > } > > @@ -516,9 +547,6 @@ uchcom_update_version(struct uchcom_softc *sc) > static void > uchcom_convert_status(struct uchcom_softc *sc, uint8_t cur) > { > - sc->sc_dtr = !(cur & UCHCOM_DTR_MASK); > - sc->sc_rts = !(cur & UCHCOM_RTS_MASK); > - > cur = ~cur & 0x0F; > sc->sc_msr = (cur << 4) | ((sc->sc_msr >> 4) ^ cur); > } > @@ -555,78 +583,69 @@ uchcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff) > uint8_t brk1; > uint8_t brk2; > > - uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, &brk2); > - if (onoff) { > - /* on - clear bits */ > - brk1 &= ~UCHCOM_BRK_MASK; > - brk2 &= ~UCHCOM_LCR1_TX; > + if (sc->sc_chiptype == TYPE_CH343) { > + brk1 = UCHCOM_CH343_BRK_MASK; > + if (!onoff) > + brk1 |= UCHCOM_ABRK_MASK; > + uchcom_write_reg(sc, brk1, 0, 0, 0); > } else { > - /* off - set bits */ > - brk1 |= UCHCOM_BRK_MASK; > - brk2 |= UCHCOM_LCR1_TX; > + uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, > + &brk2); > + if (onoff) { > + /* on - clear bits */ > + brk1 &= ~UCHCOM_BRK_MASK; > + brk2 &= ~UCHCOM_LCR1_TX; > + } else { > + /* off - set bits */ > + brk1 |= UCHCOM_BRK_MASK; > + brk2 |= UCHCOM_LCR1_TX; > + } > + uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, > + brk2); > } > - uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, brk2); > } > > -static int > -uchcom_calc_divider_settings(struct uchcom_divider *dp, uint32_t rate) > -{ > - const struct uchcom_divider_record *rp; > - uint32_t div; > - uint32_t rem; > - uint32_t mod; > - uint8_t i; > - > - /* find record */ > - for (i = 0; i != NUM_DIVIDERS; i++) { > - if (dividers[i].dvr_high >= rate && > - dividers[i].dvr_low <= rate) { > - rp = ÷rs[i]; > - goto found; > - } > - } > - return (-1); > - > -found: > - dp->dv_prescaler = rp->dvr_divider.dv_prescaler; > - if (rp->dvr_base_clock == UCHCOM_BASE_UNKNOWN) > - dp->dv_div = rp->dvr_divider.dv_div; > - else { > - div = rp->dvr_base_clock / rate; > - rem = rp->dvr_base_clock % rate; > - if (div == 0 || div >= 0xFF) > - return (-1); > - if ((rem << 1) >= rate) > - div += 1; > - dp->dv_div = (uint8_t)-div; > +static void > +uchcom_calc_baudrate(struct uchcom_softc *sc, uint32_t rate, uint8_t *divisor, > + uint8_t *factor) > +{ > + uint32_t clk = 12000000; > + > + if (rate >= 256000 && sc->sc_chiptype == TYPE_CH343) > + *divisor = 7; > + else if (rate > 23529) { > + clk /= 2; > + *divisor = 3; > + } else if (rate > 2941) { > + clk /= 16; > + *divisor = 2; > + } else if (rate > 367) { > + clk /= 128; > + *divisor = 1; > + } else { > + clk = 11719; > + *divisor = 0; > } > > - mod = (UCHCOM_BPS_MOD_BASE / rate) + UCHCOM_BPS_MOD_BASE_OFS; > - mod = mod + (mod / 2); > + *factor = 256 - clk / rate; > > - dp->dv_mod = (mod + 0xFF) / 0x100; > - > - return (0); > + if (rate == 921600 && sc->sc_chiptype != TYPE_CH343) { > + *divisor = 7; > + *factor = 243; > + } > } > > static void > -uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate) > +uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate, uint16_t lcr) > { > - struct uchcom_divider dv; > + uint16_t idx; > + uint8_t factor, div; > > - if (uchcom_calc_divider_settings(&dv, rate)) > - return; > + uchcom_calc_baudrate(sc, rate, &div, &factor); > + div |= (sc->sc_chiptype != TYPE_CH343) ? 0x80 : 0x00; > + idx = (factor << 8) | div; > > - /* > - * According to linux code we need to set bit 7 of UCHCOM_REG_BPS_PRE, > - * otherwise the chip will buffer data. > - */ > - uchcom_write_reg(sc, > - UCHCOM_REG_BPS_PRE, dv.dv_prescaler | 0x80, > - UCHCOM_REG_BPS_DIV, dv.dv_div); > - uchcom_write_reg(sc, > - UCHCOM_REG_BPS_MOD, dv.dv_mod, > - UCHCOM_REG_BPS_PAD, 0); > + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, lcr, idx); > } > > /* ---------------------------------------------------------------------- > @@ -673,6 +692,14 @@ uchcom_cfg_open(struct ucom_softc *ucom) > > DPRINTF("\n"); > > + if (sc->sc_chiptype != TYPE_CH343) { > + /* Set default configuration. */ > + uchcom_get_version(sc, NULL); > + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); > + uchcom_write_reg(sc, UCHCOM_REG_BPS_PRE, 0x82, > + UCHCOM_REG_BPS_DIV, 0xd9); > + uchcom_write_reg(sc, 0x2c, 0x07, UCHCOM_REG_BPS_PAD, 0); > + } > uchcom_update_version(sc); > uchcom_update_status(sc); > } > @@ -680,53 +707,69 @@ uchcom_cfg_open(struct ucom_softc *ucom) > static int > uchcom_pre_param(struct ucom_softc *ucom, struct termios *t) > { > - struct uchcom_divider dv; > + struct uchcom_softc *sc = ucom->sc_parent; > > - switch (t->c_cflag & CSIZE) { > - case CS8: > + /* > + * Check requested baud rate. > + * The CH340/CH341 can set any baud rate up to 2Mb. > + * The CH9102/CH343 can set any baud rate up to 6Mb. > + */ > + switch (sc->sc_chiptype) { > + case TYPE_CH343: > + if (t->c_ospeed <= 6000000) > + return (0); > break; > default: > - return (EIO); > + if (t->c_ospeed <= 2000000) > + return (0); > + break; > } > - if ((t->c_cflag & CSTOPB) != 0) > - return (EIO); > - if ((t->c_cflag & PARENB) != 0) > - return (EIO); > > - if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) { > - return (EIO); > - } > - return (0); /* success */ > + return (EIO); > } > > static void > uchcom_cfg_param(struct ucom_softc *ucom, struct termios *t) > { > struct uchcom_softc *sc = ucom->sc_parent; > + uint8_t lcr; > > - uchcom_get_version(sc, NULL); > - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); > - uchcom_set_baudrate(sc, t->c_ospeed); > - if (sc->sc_version < UCHCOM_VER_30) { > - uchcom_read_reg(sc, UCHCOM_REG_LCR1, NULL, > - UCHCOM_REG_LCR2, NULL); > - uchcom_write_reg(sc, UCHCOM_REG_LCR1, 0x50, > - UCHCOM_REG_LCR2, 0x00); > - } else { > - /* > - * Set up line control: > - * - enable transmit and receive > - * - set 8n1 mode > - * To do: support other sizes, parity, stop bits. > - */ > - uchcom_write_reg(sc, > - UCHCOM_REG_LCR1, > - UCHCOM_LCR1_RX | UCHCOM_LCR1_TX | UCHCOM_LCR1_CS8, > - UCHCOM_REG_LCR2, 0x00); > + lcr = UCHCOM_LCR1_RX | UCHCOM_LCR1_TX; > + > + if (t->c_cflag & CSTOPB) > + lcr |= UCHCOM_LCR1_STOPB; > + > + if (t->c_cflag & PARENB) { > + lcr |= UCHCOM_LCR1_PARENB; > + if (t->c_cflag & PARODD) > + lcr |= UCHCOM_LCR1_PARODD; > + else > + lcr |= UCHCOM_LCR1_PAREVEN; > } > - uchcom_update_status(sc); > - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a); > - uchcom_set_baudrate(sc, t->c_ospeed); > + > + switch (t->c_cflag & CSIZE) { > + case CS5: > + lcr |= UCHCOM_LCR1_CS5; > + break; > + case CS6: > + lcr |= UCHCOM_LCR1_CS6; > + break; > + case CS7: > + lcr |= UCHCOM_LCR1_CS7; > + break; > + case CS8: > + default: > + lcr |= UCHCOM_LCR1_CS8; > + break; > + } > + > + if (sc->sc_chiptype == TYPE_CH343) > + uchcom_set_baudrate(sc, t->c_ospeed, > + UCHCOM_T | UCHCOM_CL | UCHCOM_CH343_CT | lcr << 8); > + else > + uchcom_set_baudrate(sc, t->c_ospeed, > + UCHCOM_T | UCHCOM_CL | UCHCOM_CT | lcr << 8); > + > uchcom_set_dtr_rts(sc); > uchcom_update_status(sc); > } > @@ -737,7 +780,7 @@ uchcom_start_read(struct ucom_softc *ucom) > struct uchcom_softc *sc = ucom->sc_parent; > > /* start interrupt endpoint */ > - usbd_transfer_start(sc->sc_xfer[UCHCOM_INTR_DT_RD]); > + usbd_transfer_start(sc->sc_intr_xfer); > > /* start read endpoint */ > usbd_transfer_start(sc->sc_xfer[UCHCOM_BULK_DT_RD]); > @@ -749,7 +792,7 @@ uchcom_stop_read(struct ucom_softc *ucom) > struct uchcom_softc *sc = ucom->sc_parent; > > /* stop interrupt endpoint */ > - usbd_transfer_stop(sc->sc_xfer[UCHCOM_INTR_DT_RD]); > + usbd_transfer_stop(sc->sc_intr_xfer); > > /* stop read endpoint */ > usbd_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_RD]); > @@ -779,7 +822,8 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) > { > struct uchcom_softc *sc = usbd_xfer_softc(xfer); > struct usb_page_cache *pc; > - uint8_t buf[UCHCOM_INTR_LEAST]; > + uint32_t intrstat; > + uint8_t buf[16]; > int actlen; > > usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); > @@ -791,13 +835,12 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) > > if (actlen >= UCHCOM_INTR_LEAST) { > pc = usbd_xfer_get_frame(xfer, 0); > - usbd_copy_out(pc, 0, buf, UCHCOM_INTR_LEAST); > + usbd_copy_out(pc, 0, buf, sizeof(buf)); > > - DPRINTF("data = 0x%02X 0x%02X 0x%02X 0x%02X\n", > - (unsigned)buf[0], (unsigned)buf[1], > - (unsigned)buf[2], (unsigned)buf[3]); > + intrstat = (sc->sc_chiptype == TYPE_CH343) ? > + actlen - 1 : UCHCOM_INTR_STAT1; > > - uchcom_convert_status(sc, buf[UCHCOM_INTR_STAT1]); > + uchcom_convert_status(sc, buf[intrstat]); > ucom_status_change(&sc->sc_ucom); > } > case USB_ST_SETUP: > diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs > index f26edcebcb9c..2318e6bd0017 100644 > --- a/sys/dev/usb/usbdevs > +++ b/sys/dev/usb/usbdevs > @@ -4972,9 +4972,11 @@ product WAVESENSE JAZZ 0xaaaa Jazz blood glucose meter > /* WCH products */ > product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge > product WCH2 CH341SER_2 0x5523 CH341/CH340 USB-Serial Bridge > +product WCH2 CH343SER 0x55d3 CH343 USB Serial > +product WCH2 CH9102SER 0x55d4 CH9102 USB Serial > product WCH2 CH341SER_3 0x7522 CH341/CH340 USB-Serial Bridge > product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge > -product WCH2 U2M 0X752d CH345 USB2.0-MIDI > +product WCH2 U2M 0x752d CH345 USB2.0-MIDI > > /* West Mountain Radio products */ > product WESTMOUNTAIN RIGBLASTER_ADVANTAGE 0x0003 RIGblaster Advantage > > > > ------=_Part_559_1619721974.1750830351251 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi,

nice work!

Isn't the HARDWARE section in the man page used to generate a supported hardware list in the release notes of a new FreeBSD version?

Regards,
Ronald.

 

Van: Kevin Lo <kevlo@FreeBSD.org>
Datum:woensdag, 25 juni 2025 03:36
Aan:src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp:git: 1395712cab8e - main - uchcom: add support for CH9102 and CH343 uarts

The branch main has been updated by kevlo:

URL: https://cgit.FreeBSD.org/src/commit/?id=1395712cab8e95808064ba68c5a792b7cd0fe35f

commit 1395712cab8e95808064ba68c5a792b7cd0fe35f
Author:     Kevin Lo <kevlo@FreeBSD.org>
AuthorDate: 2025-06-25 01:33:35 +0000
Commit:     Kevin Lo <kevlo@FreeBSD.org>
CommitDate: 2025-06-25 01:33:35 +0000

    uchcom: add support for CH9102 and CH343 uarts
    
    The CH343 devices support any baud rate up to 6 Mbps.
    PR:     272803
    Reviewed by:    imp
    Tested by:      joerg, Tomasz "CeDeROM" CEDRO <tomek_AT_cedro_DOT_info>
    Differential Revision:  https://reviews.freebsd.org/D46290
---
 share/man/man4/uchcom.4     |  27 +---
 sys/dev/usb/serial/uchcom.c | 353 +++++++++++++++++++++++++-------------------
 sys/dev/usb/usbdevs         |   4 +-
 3 files changed, 208 insertions(+), 176 deletions(-)

diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4
index d5efe83286ba..4d395573589f 100644
--- a/share/man/man4/uchcom.4
+++ b/share/man/man4/uchcom.4
@@ -27,12 +27,12 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 26, 2017
+.Dd August 19, 2024
 .Dt UCHCOM 4
 .Os
 .Sh NAME
 .Nm uchcom
-.Nd WinChipHead CH341/CH340 serial adapter driver
+.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following lines in your
@@ -52,22 +52,12 @@ uchcom_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for the WinChipHead CH341/CH340 USB-to-RS-232
-Bridge chip.
+driver provides support for the WinChipHead CH9102/CH343/CH341/CH340
+USB-to-RS-232 Bridge chip.
 .Pp
-The device is accessed through the
-.Xr ucom 4
-driver which makes it behave like a
-.Xr tty 4 .
-.Sh HARDWARE
-The
-.Nm
-driver supports the following adapters:
-.Pp
-.Bl -bullet -compact
-.It
-HL USB-RS232
-.El
+The datasheets for the CH340/CH341 list the maximum
+supported baud rate as 2,000,000.
+CH9102/CH343 devices support any baud rate up to 6 Mbps.
 .Sh FILES
 .Bl -tag -width "/dev/ttyU*.init" -compact
 .It Pa /dev/ttyU*
@@ -95,6 +85,3 @@ The first
 .Fx
 release to include it was
 .Fx 8.0 .
-.Sh BUGS
-Actually, this chip seems unable to drive other than 8 data bits and
-1 stop bit line.
diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c
index a886b25c89d7..fdc5515fa722 100644
--- a/sys/dev/usb/serial/uchcom.c
+++ b/sys/dev/usb/serial/uchcom.c
@@ -58,8 +58,7 @@
  */
 
 /*
- * Driver for WinChipHead CH341/340, the worst USB-serial chip in the
- * world.
+ * Driver for WinChipHead CH9102/343/341/340.
  */
 
 #include <sys/stdint.h>
@@ -101,17 +100,19 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN,
     &uchcom_debug, 0, "uchcom debug level");
 #endif
 
-#define    UCHCOM_IFACE_INDEX  0
-#define    UCHCOM_CONFIG_INDEX 0
+#define    UCHCOM_IFACE_INDEX      0
+#define    UCHCOM_CONFIG_INDEX     0
+#define    UCHCOM_SECOND_IFACE_INDEX   1
 
 #define    UCHCOM_REV_CH340    0x0250
 #define    UCHCOM_INPUT_BUF_SIZE   8
 
-#define    UCHCOM_REQ_GET_VERSION  0x5F
-#define    UCHCOM_REQ_READ_REG 0x95
-#define    UCHCOM_REQ_WRITE_REG    0x9A
-#define    UCHCOM_REQ_RESET    0xA1
-#define    UCHCOM_REQ_SET_DTRRTS   0xA4
+#define    UCHCOM_REQ_GET_VERSION      0x5F
+#define    UCHCOM_REQ_READ_REG     0x95
+#define    UCHCOM_REQ_WRITE_REG        0x9A
+#define    UCHCOM_REQ_RESET        0xA1
+#define    UCHCOM_REQ_SET_DTRRTS       0xA4
+#define UCHCOM_REQ_CH343_WRITE_REG 0xA8
 
 #define    UCHCOM_REG_STAT1    0x06
 #define    UCHCOM_REG_STAT2    0x07
@@ -134,13 +135,21 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN,
 #define    UCHCOM_RTS_MASK     0x40
 
 #define    UCHCOM_BRK_MASK     0x01
+#define    UCHCOM_ABRK_MASK    0x10
+#define    UCHCOM_CH343_BRK_MASK   0x80
 
 #define    UCHCOM_LCR1_MASK    0xAF
 #define    UCHCOM_LCR2_MASK    0x07
 #define    UCHCOM_LCR1_RX      0x80
 #define    UCHCOM_LCR1_TX      0x40
 #define    UCHCOM_LCR1_PARENB  0x08
+#define    UCHCOM_LCR1_CS5     0x00
+#define    UCHCOM_LCR1_CS6     0x01
+#define    UCHCOM_LCR1_CS7     0x02
 #define    UCHCOM_LCR1_CS8     0x03
+#define    UCHCOM_LCR1_STOPB   0x04
+#define    UCHCOM_LCR1_PARODD  0x00
+#define    UCHCOM_LCR1_PAREVEN 0x10
 #define    UCHCOM_LCR2_PAREVEN 0x07
 #define    UCHCOM_LCR2_PARODD  0x06
 #define    UCHCOM_LCR2_PARMARK 0x05
@@ -150,12 +159,18 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN,
 #define    UCHCOM_INTR_STAT2   0x03
 #define    UCHCOM_INTR_LEAST   4
 
-#define    UCHCOM_BULK_BUF_SIZE 1024   /* bytes */
+#define    UCHCOM_T        0x08
+#define    UCHCOM_CL       0x04
+#define    UCHCOM_CH343_CT     0x80
+#define    UCHCOM_CT       0x90
+
+#define    UCHCOM_BULK_BUF_SIZE    1024    /* bytes */
+
+#define    TYPE_CH343      1
 
 enum {
    UCHCOM_BULK_DT_WR,
    UCHCOM_BULK_DT_RD,
-   UCHCOM_INTR_DT_RD,
    UCHCOM_N_TRANSFER,
 };
 
@@ -164,6 +179,7 @@ struct uchcom_softc {
    struct ucom_softc sc_ucom;
 
    struct usb_xfer *sc_xfer[UCHCOM_N_TRANSFER];
+   struct usb_xfer *sc_intr_xfer;  /* Interrupt endpoint */
    struct usb_device *sc_udev;
    struct mtx sc_mtx;
 
@@ -171,39 +187,19 @@ struct uchcom_softc {
    uint8_t sc_rts;         /* local copy */
    uint8_t sc_version;
    uint8_t sc_msr;
-   uint8_t sc_lsr;         /* local status register */
-};
-
-struct uchcom_divider {
-   uint8_t dv_prescaler;
-   uint8_t dv_div;
-   uint8_t dv_mod;
-};
-
-struct uchcom_divider_record {
-   uint32_t dvr_high;
-   uint32_t dvr_low;
-   uint32_t dvr_base_clock;
-   struct uchcom_divider dvr_divider;
-};
-
-static const struct uchcom_divider_record dividers[] =
-{
-   {307200, 307200, UCHCOM_BASE_UNKNOWN, {7, 0xD9, 0}},
-   {921600, 921600, UCHCOM_BASE_UNKNOWN, {7, 0xF3, 0}},
-   {2999999, 23530, 6000000, {3, 0, 0}},
-   {23529, 2942, 750000, {2, 0, 0}},
-   {2941, 368, 93750, {1, 0, 0}},
-   {367, 1, 11719, {0, 0, 0}},
+   uint8_t sc_lsr;         /* local status register */
+   uint8_t sc_chiptype;        /* type of chip */
+   uint8_t sc_ctrl_iface_no;
+   uint8_t sc_iface_index;
 };
 
-#define    NUM_DIVIDERS    nitems(dividers)
-
 static const STRUCT_USB_HOST_ID uchcom_devs[] = {
    {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)},
    {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)},
    {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)},
    {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_3, 0)},
+   {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH343SER, 0)},
+   {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH9102SER, 0)},
 };
 
 /* protypes */
@@ -225,8 +221,9 @@ static void uchcom_update_version(struct uchcom_softc *);
 static void    uchcom_convert_status(struct uchcom_softc *, uint8_t);
 static void    uchcom_update_status(struct uchcom_softc *);
 static void    uchcom_set_dtr_rts(struct uchcom_softc *);
-static int uchcom_calc_divider_settings(struct uchcom_divider *, uint32_t);
-static void    uchcom_set_baudrate(struct uchcom_softc *, uint32_t);
+static void    uchcom_calc_baudrate(struct uchcom_softc *, uint32_t, uint8_t *,
+           uint8_t *);
+static void    uchcom_set_baudrate(struct uchcom_softc *, uint32_t, uint16_t);
 static void    uchcom_poll(struct ucom_softc *ucom);
 
 static device_probe_t uchcom_probe;
@@ -244,7 +241,7 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = {
        .endpoint = UE_ADDR_ANY,
        .direction = UE_DIR_OUT,
        .bufsize = UCHCOM_BULK_BUF_SIZE,
-       .flags = {.pipe_bof = 1,.force_short_xfer = 1,},
+       .flags = {.pipe_bof = 1,},
        .callback = &uchcom_write_callback,
    },
 
@@ -256,8 +253,10 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = {
        .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
        .callback = &uchcom_read_callback,
    },
+};
 
-   [UCHCOM_INTR_DT_RD] = {
+static const struct usb_config uchcom_intr_config_data[1] = {
+   [0] = {
        .type = UE_INTERRUPT,
        .endpoint = UE_ADDR_ANY,
        .direction = UE_DIR_IN,
@@ -311,8 +310,9 @@ uchcom_attach(device_t dev)
 {
    struct uchcom_softc *sc = device_get_softc(dev);
    struct usb_attach_arg *uaa = device_get_ivars(dev);
+   struct usb_interface *iface;
+   struct usb_interface_descriptor *id;
    int error;
-   uint8_t iface_index;
 
    DPRINTFN(11, "\n");
 
@@ -330,20 +330,49 @@ uchcom_attach(device_t dev)
    case USB_PRODUCT_WCH2_CH341SER_3:
        device_printf(dev, "CH341 detected\n");
        break;
+   case USB_PRODUCT_WCH2_CH343SER:
+       device_printf(dev, "CH343 detected\n");
+       break;
+   case USB_PRODUCT_WCH2_CH9102SER:
+       device_printf(dev, "CH9102 detected\n");
+       break;
    default:
-       device_printf(dev, "New CH340/CH341 product 0x%04x detected\n",
-           uaa->info.idProduct);
+       device_printf(dev, "New CH340/CH341/CH343/CH9102 product "
+           "0x%04x detected\n", uaa->info.idProduct);
        break;
    }
 
-   iface_index = UCHCOM_IFACE_INDEX;
-   error = usbd_transfer_setup(uaa->device,
-       &iface_index, sc->sc_xfer, uchcom_config_data,
-       UCHCOM_N_TRANSFER, sc, &sc->sc_mtx);
+   /* CH343/CH9102 has two interfaces. */
+   sc->sc_ctrl_iface_no = uaa->info.bIfaceNum;
 
+   iface = usbd_get_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX);
+   if (iface) {
+       id = usbd_get_interface_descriptor(iface);
+       if (id == NULL) {
+           device_printf(dev, "no interface descriptor\n");
+           goto detach;
+       }
+       sc->sc_iface_index = UCHCOM_SECOND_IFACE_INDEX;
+       usbd_set_parent_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX,
+           uaa->info.bIfaceIndex);
+       sc->sc_chiptype = TYPE_CH343;
+   } else {
+       sc->sc_iface_index = UCHCOM_IFACE_INDEX;
+   }
+
+   /* Setup all transfers. */
+   error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index,
+       sc->sc_xfer, uchcom_config_data, UCHCOM_N_TRANSFER, sc,
+       &sc->sc_mtx);
+   if (error) {
+       device_printf(dev, "could not allocate all pipes\n");
+       goto detach;
+   }
+   error = usbd_transfer_setup(uaa->device, &sc->sc_ctrl_iface_no,
+       &sc->sc_intr_xfer, uchcom_intr_config_data, 1, sc, &sc->sc_mtx);
    if (error) {
-       DPRINTF("one or more missing USB endpoints, "
-           "error=%s\n", usbd_errstr(error));
+       device_printf(dev, "allocating USB transfers failed for "
+           "interrupt\n");
        goto detach;
    }
 
@@ -449,7 +478,9 @@ uchcom_write_reg(struct uchcom_softc *sc,
        (unsigned)reg1, (unsigned)val1,
        (unsigned)reg2, (unsigned)val2);
    uchcom_ctrl_write(
-       sc, UCHCOM_REQ_WRITE_REG,
+       sc,
+       (sc->sc_chiptype != TYPE_CH343) ?
+       UCHCOM_REQ_WRITE_REG : UCHCOM_REQ_CH343_WRITE_REG,
        reg1 | ((uint16_t)reg2 << 8), val1 | ((uint16_t)val2 << 8));
 }
 
@@ -516,9 +547,6 @@ uchcom_update_version(struct uchcom_softc *sc)
 static void
 uchcom_convert_status(struct uchcom_softc *sc, uint8_t cur)
 {
-   sc->sc_dtr = !(cur & UCHCOM_DTR_MASK);
-   sc->sc_rts = !(cur & UCHCOM_RTS_MASK);
-
    cur = ~cur & 0x0F;
    sc->sc_msr = (cur << 4) | ((sc->sc_msr >> 4) ^ cur);
 }
@@ -555,78 +583,69 @@ uchcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
    uint8_t brk1;
    uint8_t brk2;
 
-   uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, &brk2);
-   if (onoff) {
-       /* on - clear bits */
-       brk1 &= ~UCHCOM_BRK_MASK;
-       brk2 &= ~UCHCOM_LCR1_TX;
+   if (sc->sc_chiptype == TYPE_CH343) {
+       brk1 = UCHCOM_CH343_BRK_MASK;
+       if (!onoff)
+           brk1 |= UCHCOM_ABRK_MASK;
+       uchcom_write_reg(sc, brk1, 0, 0, 0);
    } else {
-       /* off - set bits */
-       brk1 |= UCHCOM_BRK_MASK;
-       brk2 |= UCHCOM_LCR1_TX;
+       uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1,
+           &brk2);
+       if (onoff) {
+           /* on - clear bits */
+           brk1 &= ~UCHCOM_BRK_MASK;
+           brk2 &= ~UCHCOM_LCR1_TX;
+       } else {
+           /* off - set bits */
+           brk1 |= UCHCOM_BRK_MASK;
+           brk2 |= UCHCOM_LCR1_TX;
+       }
+       uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1,
+           brk2);
    }
-   uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, brk2);
 }
 
-static int
-uchcom_calc_divider_settings(struct uchcom_divider *dp, uint32_t rate)
-{
-   const struct uchcom_divider_record *rp;
-   uint32_t div;
-   uint32_t rem;
-   uint32_t mod;
-   uint8_t i;
-
-   /* find record */
-   for (i = 0; i != NUM_DIVIDERS; i++) {
-       if (dividers[i].dvr_high >= rate &&
-           dividers[i].dvr_low <= rate) {
-           rp = &dividers[i];
-           goto found;
-       }
-   }
-   return (-1);
-
-found:
-   dp->dv_prescaler = rp->dvr_divider.dv_prescaler;
-   if (rp->dvr_base_clock == UCHCOM_BASE_UNKNOWN)
-       dp->dv_div = rp->dvr_divider.dv_div;
-   else {
-       div = rp->dvr_base_clock / rate;
-       rem = rp->dvr_base_clock % rate;
-       if (div == 0 || div >= 0xFF)
-           return (-1);
-       if ((rem << 1) >= rate)
-           div += 1;
-       dp->dv_div = (uint8_t)-div;
+static void
+uchcom_calc_baudrate(struct uchcom_softc *sc, uint32_t rate, uint8_t *divisor,
+    uint8_t *factor)
+{
+   uint32_t clk = 12000000;
+
+   if (rate >= 256000 && sc->sc_chiptype == TYPE_CH343)
+       *divisor = 7;
+   else if (rate > 23529) {
+       clk /= 2;
+       *divisor = 3;
+   } else if (rate > 2941) {
+       clk /=  16;
+       *divisor = 2;
+   } else if (rate > 367) {
+       clk /= 128;
+       *divisor = 1;
+   } else {
+       clk = 11719;
+       *divisor = 0;
    }
 
-   mod = (UCHCOM_BPS_MOD_BASE / rate) + UCHCOM_BPS_MOD_BASE_OFS;
-   mod = mod + (mod / 2);
+   *factor = 256 - clk / rate;
 
-   dp->dv_mod = (mod + 0xFF) / 0x100;
-
-   return (0);
+   if (rate == 921600 && sc->sc_chiptype != TYPE_CH343) {
+       *divisor = 7;
+       *factor = 243;
+   }
 }
 
 static void
-uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate)
+uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate, uint16_t lcr)
 {
-   struct uchcom_divider dv;
+   uint16_t idx;
+   uint8_t factor, div;
 
-   if (uchcom_calc_divider_settings(&dv, rate))
-       return;
+   uchcom_calc_baudrate(sc, rate, &div, &factor);
+   div |= (sc->sc_chiptype != TYPE_CH343) ? 0x80 : 0x00;
+   idx = (factor << 8) | div;
 
-   /*
-    * According to linux code we need to set bit 7 of UCHCOM_REG_BPS_PRE,
-    * otherwise the chip will buffer data.
-    */
-   uchcom_write_reg(sc,
-       UCHCOM_REG_BPS_PRE, dv.dv_prescaler | 0x80,
-       UCHCOM_REG_BPS_DIV, dv.dv_div);
-   uchcom_write_reg(sc,
-       UCHCOM_REG_BPS_MOD, dv.dv_mod,
-       UCHCOM_REG_BPS_PAD, 0);
+   uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, lcr, idx);
 }
 
 /* ----------------------------------------------------------------------
@@ -673,6 +692,14 @@ uchcom_cfg_open(struct ucom_softc *ucom)
 
    DPRINTF("\n");
 
+   if (sc->sc_chiptype != TYPE_CH343) {
+       /* Set default configuration. */
+       uchcom_get_version(sc, NULL);
+       uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0);
+       uchcom_write_reg(sc, UCHCOM_REG_BPS_PRE, 0x82,
+           UCHCOM_REG_BPS_DIV, 0xd9);
+       uchcom_write_reg(sc, 0x2c, 0x07, UCHCOM_REG_BPS_PAD, 0);
+   }
    uchcom_update_version(sc);
    uchcom_update_status(sc);
 }
@@ -680,53 +707,69 @@ uchcom_cfg_open(struct ucom_softc *ucom)
 static int
 uchcom_pre_param(struct ucom_softc *ucom, struct termios *t)
 {
-   struct uchcom_divider dv;
+   struct uchcom_softc *sc = ucom->sc_parent;
 
-   switch (t->c_cflag & CSIZE) {
-   case CS8:
+   /*
+    * Check requested baud rate.
+    * The CH340/CH341 can set any baud rate up to 2Mb.
+    * The CH9102/CH343 can set any baud rate up to 6Mb.
+    */
+   switch (sc->sc_chiptype) {
+   case TYPE_CH343:
+       if (t->c_ospeed <= 6000000)
+           return (0);
        break;
    default:
-       return (EIO);
+       if (t->c_ospeed <= 2000000)
+           return (0);
+       break;
    }
-   if ((t->c_cflag & CSTOPB) != 0)
-       return (EIO);
-   if ((t->c_cflag & PARENB) != 0)
-       return (EIO);
 
-   if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) {
-       return (EIO);
-   }
-   return (0);         /* success */
+   return (EIO);
 }
 
 static void
 uchcom_cfg_param(struct ucom_softc *ucom, struct termios *t)
 {
    struct uchcom_softc *sc = ucom->sc_parent;
+   uint8_t lcr;
 
-   uchcom_get_version(sc, NULL);
-   uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0);
-   uchcom_set_baudrate(sc, t->c_ospeed);
-   if (sc->sc_version < UCHCOM_VER_30) {
-       uchcom_read_reg(sc, UCHCOM_REG_LCR1, NULL,
-           UCHCOM_REG_LCR2, NULL);
-       uchcom_write_reg(sc, UCHCOM_REG_LCR1, 0x50,
-           UCHCOM_REG_LCR2, 0x00);
-   } else {
-       /*
-        * Set up line control:
-        * - enable transmit and receive
-        * - set 8n1 mode
-        * To do: support other sizes, parity, stop bits.
-        */
-       uchcom_write_reg(sc,
-           UCHCOM_REG_LCR1,
-           UCHCOM_LCR1_RX | UCHCOM_LCR1_TX | UCHCOM_LCR1_CS8,
-           UCHCOM_REG_LCR2, 0x00);
+   lcr = UCHCOM_LCR1_RX | UCHCOM_LCR1_TX;
+
+   if (t->c_cflag & CSTOPB)
+       lcr |= UCHCOM_LCR1_STOPB;
+
+   if (t->c_cflag & PARENB) {
+       lcr |= UCHCOM_LCR1_PARENB;
+       if (t->c_cflag & PARODD)
+           lcr |= UCHCOM_LCR1_PARODD;
+       else
+           lcr |= UCHCOM_LCR1_PAREVEN;
    }
-   uchcom_update_status(sc);
-   uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a);
-   uchcom_set_baudrate(sc, t->c_ospeed);
+
+   switch (t->c_cflag & CSIZE) {
+   case CS5:
+       lcr |= UCHCOM_LCR1_CS5;
+       break;
+   case CS6:
+       lcr |= UCHCOM_LCR1_CS6;
+       break;
+   case CS7:
+       lcr |= UCHCOM_LCR1_CS7;
+       break;
+   case CS8:
+   default:
+       lcr |= UCHCOM_LCR1_CS8;
+       break;
+   }
+
+   if (sc->sc_chiptype == TYPE_CH343)
+       uchcom_set_baudrate(sc, t->c_ospeed,
+           UCHCOM_T | UCHCOM_CL | UCHCOM_CH343_CT | lcr << 8);
+   else
+       uchcom_set_baudrate(sc, t->c_ospeed,
+           UCHCOM_T | UCHCOM_CL | UCHCOM_CT | lcr << 8);
+
    uchcom_set_dtr_rts(sc);
    uchcom_update_status(sc);
 }
@@ -737,7 +780,7 @@ uchcom_start_read(struct ucom_softc *ucom)
    struct uchcom_softc *sc = ucom->sc_parent;
 
    /* start interrupt endpoint */
-   usbd_transfer_start(sc->sc_xfer[UCHCOM_INTR_DT_RD]);
+   usbd_transfer_start(sc->sc_intr_xfer);
 
    /* start read endpoint */
    usbd_transfer_start(sc->sc_xfer[UCHCOM_BULK_DT_RD]);
@@ -749,7 +792,7 @@ uchcom_stop_read(struct ucom_softc *ucom)
    struct uchcom_softc *sc = ucom->sc_parent;
 
    /* stop interrupt endpoint */
-   usbd_transfer_stop(sc->sc_xfer[UCHCOM_INTR_DT_RD]);
+   usbd_transfer_stop(sc->sc_intr_xfer);
 
    /* stop read endpoint */
    usbd_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_RD]);
@@ -779,7 +822,8 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error)
 {
    struct uchcom_softc *sc = usbd_xfer_softc(xfer);
    struct usb_page_cache *pc;
-   uint8_t buf[UCHCOM_INTR_LEAST];
+   uint32_t intrstat;
+   uint8_t buf[16];
    int actlen;
 
    usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
@@ -791,13 +835,12 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error)
 
        if (actlen >= UCHCOM_INTR_LEAST) {
            pc = usbd_xfer_get_frame(xfer, 0);
-           usbd_copy_out(pc, 0, buf, UCHCOM_INTR_LEAST);
+           usbd_copy_out(pc, 0, buf, sizeof(buf));
 
-           DPRINTF("data = 0x%02X 0x%02X 0x%02X 0x%02X\n",
-               (unsigned)buf[0], (unsigned)buf[1],
-               (unsigned)buf[2], (unsigned)buf[3]);
+           intrstat = (sc->sc_chiptype == TYPE_CH343) ?
+               actlen - 1 : UCHCOM_INTR_STAT1;
 
-           uchcom_convert_status(sc, buf[UCHCOM_INTR_STAT1]);
+           uchcom_convert_status(sc, buf[intrstat]);
            ucom_status_change(&sc->sc_ucom);
        }
    case USB_ST_SETUP:
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index f26edcebcb9c..2318e6bd0017 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -4972,9 +4972,11 @@ product WAVESENSE JAZZ       0xaaaa  Jazz blood glucose meter
 /* WCH products */
 product WCH CH341SER       0x5523  CH341/CH340 USB-Serial Bridge
 product WCH2 CH341SER_2        0x5523  CH341/CH340 USB-Serial Bridge
+product WCH2 CH343SER      0x55d3  CH343 USB Serial
+product WCH2 CH9102SER     0x55d4  CH9102 USB Serial
 product WCH2 CH341SER_3        0x7522  CH341/CH340 USB-Serial Bridge
 product WCH2 CH341SER      0x7523  CH341/CH340 USB-Serial Bridge
-product WCH2 U2M       0X752d  CH345 USB2.0-MIDI
+product WCH2 U2M       0x752d  CH345 USB2.0-MIDI
 
 /* West Mountain Radio products */
 product WESTMOUNTAIN RIGBLASTER_ADVANTAGE  0x0003  RIGblaster Advantage
 


  ------=_Part_559_1619721974.1750830351251-- From nobody Wed Jun 25 05:53:08 2025 X-Original-To: dev-commits-src-main@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 4bRrZy2nlqz60mfC for ; Wed, 25 Jun 2025 05:53:14 +0000 (UTC) (envelope-from 01000197a5a5aff1-ed598ba1-80f2-406b-b11d-fc36e727d9c7-000000@amazonses.com) Received: from a8-60.smtp-out.amazonses.com (a8-60.smtp-out.amazonses.com [54.240.8.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRrZy2BCKz3PsH for ; Wed, 25 Jun 2025 05:53:14 +0000 (UTC) (envelope-from 01000197a5a5aff1-ed598ba1-80f2-406b-b11d-fc36e727d9c7-000000@amazonses.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1750830788; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=QbIgY2n8tZ+66DbH7bc0W7+ogdqRBXRSa3CpUduqyEU=; b=bruogOvsFUA4mX0X6fCURWKNVhzuPkVZrB6/x++Xm0DmrVqFI9lpt8k6paqkE/y1 vcUMk/r9AFBlV11fUM3jbUx7ZgdH63jIV0izhEGEyHbHelm0SltwpvRiznsiqU/pZGv QD4lWXwjQUKrFvO85COmZAR9SaDJi9/MSqH+KnJ4= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1750830788; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=QbIgY2n8tZ+66DbH7bc0W7+ogdqRBXRSa3CpUduqyEU=; b=KhJ5r2FUYxtJT2hAr3llL2Xc+XmJUgfeaX0pdQayLgPjFRRY+Sd2SJi6PdfintXA LL3s7Pq/rUz1eeErINadSiR5PyTDXcPCFKg7Ol8FxiB02QlnHO2BfIHL0lpeVEczPJJ /5DoU35tLFTthN3iGVlacZdLE3YEclxZj//pEWQk= Message-ID: <01000197a5a5aff1-ed598ba1-80f2-406b-b11d-fc36e727d9c7-000000@email.amazonses.com> Date: Wed, 25 Jun 2025 05:53:08 +0000 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 1395712cab8e - main - uchcom: add support for CH9102 and CH343 uarts To: Ronald Klop , Kevin Lo Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506250136.55P1aag8094334@gitrepo.freebsd.org> <727722724.560.1750830351345@localhost> Content-Language: en-US From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSyYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT+i Yg/+PYyJNoFuygtV5t/skcjYmvEC93mnazEvh+x99vGYZnGKeJ8NDOF4QCUzeHquOWxDi8Zl reXyswKcrIquPxxX6+YyGe97VbvLnez3ksfzOYRj1F4qV0Rq8ZNK51+bvIrbcS3SfDaRioAk D7WWwFor8y/hSwxYkfsKbtP5PRcem20JUxuC085zqWLaKv5t5n2CBzAGMjwJaQ3tM3AXVwWJ uJaHA6ot/6fntJlmkfcyCYyyr0D6b0guRj3STbZ2hNn5o2AI+f6LJJ31s2sPFjl6rs7fORf3 hFSNOHDd2HxfVBXFdQy24ROkC4orBBz2xh9GScjxxT/hbXkfufkubFubw7n0HkvHzA3UF+Qq A8JiI3n+d7ocsP0/5BQ2sZdeqPGJgHx6RkAMuW1tJ29wSvCN1qMgFwhYkpQdfvHlociQrimU fvlRfSrBEe8o7tvIuEdpvwvCZSTJqQbVoMw8UHFE7nzyCXUSab5h6PbjakCqim13ekVO2KFF TTPcz5o5jEeUY75tzbIwcDfFbT5KqNjWy06TVdM9VEJDHSfOfxHR3kSEwZ+tT2aTvL3grsUn gFwSNcj4Cl4CRFfUw8zVZY+7O7RiMlhBqykikvUurrdGKc1Scwa0yuppdA6eVvylyTWSQGrQ +uLWtV1LUKN7ZqKJWBkLPt9nS4XZWGyBvxOHYqjOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: <727722724.560.1750830351345@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Feedback-ID: ::1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-SES-Outgoing: 2025.06.25-54.240.8.60 X-Rspamd-Queue-Id: 4bRrZy2BCKz3PsH X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US] Yes. Please keep the HARDWARE section in device driver man pages. The text from there goes directly into the "hardware notes" page on the website. Colin Percival On 6/24/25 22:45, Ronald Klop wrote: > Hi, > > nice work! > > Isn't the HARDWARE section in the man page used to generate a supported > hardware list in the release notes of a new FreeBSD version? > > Regards, > Ronald. > > *Van:* Kevin Lo > *Datum:*woensdag, 25 juni 2025 03:36 > *Aan:*src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev- > commits-src-main@FreeBSD.org > *Onderwerp:*git: 1395712cab8e - main - uchcom: add support for CH9102 and > CH343 uarts > > The branch main has been updated by kevlo: > > URL: https://cgit.FreeBSD.org/src/commit/? > id=1395712cab8e95808064ba68c5a792b7cd0fe35f commit/?id=1395712cab8e95808064ba68c5a792b7cd0fe35f> > > commit 1395712cab8e95808064ba68c5a792b7cd0fe35f > Author:     Kevin Lo > AuthorDate: 2025-06-25 01:33:35 +0000 > Commit:     Kevin Lo > CommitDate: 2025-06-25 01:33:35 +0000 > >     uchcom: add support for CH9102 and CH343 uarts > >     The CH343 devices support any baud rate up to 6 Mbps. >     PR:     272803 >     Reviewed by:    imp >     Tested by:      joerg, Tomasz "CeDeROM" CEDRO >     Differential Revision: https://reviews.freebsd.org/D46290 reviews.freebsd.org/D46290> > --- >  share/man/man4/uchcom.4     |  27 +--- >  sys/dev/usb/serial/uchcom.c | 353 ++++++++++++++++++++++++ > +------------------- >  sys/dev/usb/usbdevs         |   4 +- >  3 files changed, 208 insertions(+), 176 deletions(-) > > diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 > index d5efe83286ba..4d395573589f 100644 > --- a/share/man/man4/uchcom.4 > +++ b/share/man/man4/uchcom.4 > @@ -27,12 +27,12 @@ >  .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED > OF THE >  .\" POSSIBILITY OF SUCH DAMAGE. >  .\" > -.Dd April 26, 2017 > +.Dd August 19, 2024 >  .Dt UCHCOM 4 >  .Os >  .Sh NAME >  .Nm uchcom > -.Nd WinChipHead CH341/CH340 serial adapter driver > +.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver >  .Sh SYNOPSIS >  To compile this driver into the kernel, >  place the following lines in your > @@ -52,22 +52,12 @@ uchcom_load="YES" >  .Sh DESCRIPTION >  The >  .Nm > -driver provides support for the WinChipHead CH341/CH340 USB-to-RS-232 > -Bridge chip. > +driver provides support for the WinChipHead CH9102/CH343/CH341/CH340 > +USB-to-RS-232 Bridge chip. >  .Pp > -The device is accessed through the > -.Xr ucom 4 > -driver which makes it behave like a > -.Xr tty 4 . > -.Sh HARDWARE > -The > -.Nm > -driver supports the following adapters: > -.Pp > -.Bl -bullet -compact > -.It > -HL USB-RS232 > -.El > +The datasheets for the CH340/CH341 list the maximum > +supported baud rate as 2,000,000. > +CH9102/CH343 devices support any baud rate up to 6 Mbps. >  .Sh FILES >  .Bl -tag -width "/dev/ttyU*.init" -compact >  .It Pa /dev/ttyU* > @@ -95,6 +85,3 @@ The first >  .Fx >  release to include it was >  .Fx 8.0 . > -.Sh BUGS > -Actually, this chip seems unable to drive other than 8 data bits and > -1 stop bit line. > diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c > index a886b25c89d7..fdc5515fa722 100644 > --- a/sys/dev/usb/serial/uchcom.c > +++ b/sys/dev/usb/serial/uchcom.c > @@ -58,8 +58,7 @@ >   */ > >  /* > - * Driver for WinChipHead CH341/340, the worst USB-serial chip in the > - * world. > + * Driver for WinChipHead CH9102/343/341/340. >   */ > >  #include > @@ -101,17 +100,19 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, > CTLFLAG_RWTUN, >      &uchcom_debug, 0, "uchcom debug level"); >  #endif > > -#define    UCHCOM_IFACE_INDEX  0 > -#define    UCHCOM_CONFIG_INDEX 0 > +#define    UCHCOM_IFACE_INDEX      0 > +#define    UCHCOM_CONFIG_INDEX     0 > +#define    UCHCOM_SECOND_IFACE_INDEX   1 > >  #define    UCHCOM_REV_CH340    0x0250 >  #define    UCHCOM_INPUT_BUF_SIZE   8 > > -#define    UCHCOM_REQ_GET_VERSION  0x5F > -#define    UCHCOM_REQ_READ_REG 0x95 > -#define    UCHCOM_REQ_WRITE_REG    0x9A > -#define    UCHCOM_REQ_RESET    0xA1 > -#define    UCHCOM_REQ_SET_DTRRTS   0xA4 > +#define    UCHCOM_REQ_GET_VERSION      0x5F > +#define    UCHCOM_REQ_READ_REG     0x95 > +#define    UCHCOM_REQ_WRITE_REG        0x9A > +#define    UCHCOM_REQ_RESET        0xA1 > +#define    UCHCOM_REQ_SET_DTRRTS       0xA4 > +#define UCHCOM_REQ_CH343_WRITE_REG 0xA8 > >  #define    UCHCOM_REG_STAT1    0x06 >  #define    UCHCOM_REG_STAT2    0x07 > @@ -134,13 +135,21 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, > CTLFLAG_RWTUN, >  #define    UCHCOM_RTS_MASK     0x40 > >  #define    UCHCOM_BRK_MASK     0x01 > +#define    UCHCOM_ABRK_MASK    0x10 > +#define    UCHCOM_CH343_BRK_MASK   0x80 > >  #define    UCHCOM_LCR1_MASK    0xAF >  #define    UCHCOM_LCR2_MASK    0x07 >  #define    UCHCOM_LCR1_RX      0x80 >  #define    UCHCOM_LCR1_TX      0x40 >  #define    UCHCOM_LCR1_PARENB  0x08 > +#define    UCHCOM_LCR1_CS5     0x00 > +#define    UCHCOM_LCR1_CS6     0x01 > +#define    UCHCOM_LCR1_CS7     0x02 >  #define    UCHCOM_LCR1_CS8     0x03 > +#define    UCHCOM_LCR1_STOPB   0x04 > +#define    UCHCOM_LCR1_PARODD  0x00 > +#define    UCHCOM_LCR1_PAREVEN 0x10 >  #define    UCHCOM_LCR2_PAREVEN 0x07 >  #define    UCHCOM_LCR2_PARODD  0x06 >  #define    UCHCOM_LCR2_PARMARK 0x05 > @@ -150,12 +159,18 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, > CTLFLAG_RWTUN, >  #define    UCHCOM_INTR_STAT2   0x03 >  #define    UCHCOM_INTR_LEAST   4 > > -#define    UCHCOM_BULK_BUF_SIZE 1024   /* bytes */ > +#define    UCHCOM_T        0x08 > +#define    UCHCOM_CL       0x04 > +#define    UCHCOM_CH343_CT     0x80 > +#define    UCHCOM_CT       0x90 > + > +#define    UCHCOM_BULK_BUF_SIZE    1024    /* bytes */ > + > +#define    TYPE_CH343      1 > >  enum { >     UCHCOM_BULK_DT_WR, >     UCHCOM_BULK_DT_RD, > -   UCHCOM_INTR_DT_RD, >     UCHCOM_N_TRANSFER, >  }; > > @@ -164,6 +179,7 @@ struct uchcom_softc { >     struct ucom_softc sc_ucom; > >     struct usb_xfer *sc_xfer[UCHCOM_N_TRANSFER]; > +   struct usb_xfer *sc_intr_xfer;  /* Interrupt endpoint */ >     struct usb_device *sc_udev; >     struct mtx sc_mtx; > > @@ -171,39 +187,19 @@ struct uchcom_softc { >     uint8_t sc_rts;         /* local copy */ >     uint8_t sc_version; >     uint8_t sc_msr; > -   uint8_t sc_lsr;         /* local status register */ > -}; > - > -struct uchcom_divider { > -   uint8_t dv_prescaler; > -   uint8_t dv_div; > -   uint8_t dv_mod; > -}; > - > -struct uchcom_divider_record { > -   uint32_t dvr_high; > -   uint32_t dvr_low; > -   uint32_t dvr_base_clock; > -   struct uchcom_divider dvr_divider; > -}; > - > -static const struct uchcom_divider_record dividers[] = > -{ > -   {307200, 307200, UCHCOM_BASE_UNKNOWN, {7, 0xD9, 0}}, > -   {921600, 921600, UCHCOM_BASE_UNKNOWN, {7, 0xF3, 0}}, > -   {2999999, 23530, 6000000, {3, 0, 0}}, > -   {23529, 2942, 750000, {2, 0, 0}}, > -   {2941, 368, 93750, {1, 0, 0}}, > -   {367, 1, 11719, {0, 0, 0}}, > +   uint8_t sc_lsr;         /* local status register */ > +   uint8_t sc_chiptype;        /* type of chip */ > +   uint8_t sc_ctrl_iface_no; > +   uint8_t sc_iface_index; >  }; > > -#define    NUM_DIVIDERS    nitems(dividers) > - >  static const STRUCT_USB_HOST_ID uchcom_devs[] = { >     {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, >     {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, >     {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, >     {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_3, 0)}, > +   {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH343SER, 0)}, > +   {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH9102SER, 0)}, >  }; > >  /* protypes */ > @@ -225,8 +221,9 @@ static void uchcom_update_version(struct uchcom_softc *); >  static void    uchcom_convert_status(struct uchcom_softc *, uint8_t); >  static void    uchcom_update_status(struct uchcom_softc *); >  static void    uchcom_set_dtr_rts(struct uchcom_softc *); > -static int uchcom_calc_divider_settings(struct uchcom_divider *, uint32_t); > -static void    uchcom_set_baudrate(struct uchcom_softc *, uint32_t); > +static void    uchcom_calc_baudrate(struct uchcom_softc *, uint32_t, > uint8_t *, > +           uint8_t *); > +static void    uchcom_set_baudrate(struct uchcom_softc *, uint32_t, > uint16_t); >  static void    uchcom_poll(struct ucom_softc *ucom); > >  static device_probe_t uchcom_probe; > @@ -244,7 +241,7 @@ static const struct usb_config > uchcom_config_data[UCHCOM_N_TRANSFER] = { >         .endpoint = UE_ADDR_ANY, >         .direction = UE_DIR_OUT, >         .bufsize = UCHCOM_BULK_BUF_SIZE, > -       .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, > +       .flags = {.pipe_bof = 1,}, >         .callback = &uchcom_write_callback, >     }, > > @@ -256,8 +253,10 @@ static const struct usb_config > uchcom_config_data[UCHCOM_N_TRANSFER] = { >         .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, >         .callback = &uchcom_read_callback, >     }, > +}; > > -   [UCHCOM_INTR_DT_RD] = { > +static const struct usb_config uchcom_intr_config_data[1] = { > +   [0] = { >         .type = UE_INTERRUPT, >         .endpoint = UE_ADDR_ANY, >         .direction = UE_DIR_IN, > @@ -311,8 +310,9 @@ uchcom_attach(device_t dev) >  { >     struct uchcom_softc *sc = device_get_softc(dev); >     struct usb_attach_arg *uaa = device_get_ivars(dev); > +   struct usb_interface *iface; > +   struct usb_interface_descriptor *id; >     int error; > -   uint8_t iface_index; > >     DPRINTFN(11, "\n"); > > @@ -330,20 +330,49 @@ uchcom_attach(device_t dev) >     case USB_PRODUCT_WCH2_CH341SER_3: >         device_printf(dev, "CH341 detected\n"); >         break; > +   case USB_PRODUCT_WCH2_CH343SER: > +       device_printf(dev, "CH343 detected\n"); > +       break; > +   case USB_PRODUCT_WCH2_CH9102SER: > +       device_printf(dev, "CH9102 detected\n"); > +       break; >     default: > -       device_printf(dev, "New CH340/CH341 product 0x%04x detected\n", > -           uaa->info.idProduct); > +       device_printf(dev, "New CH340/CH341/CH343/CH9102 product " > +           "0x%04x detected\n", uaa->info.idProduct); >         break; >     } > > -   iface_index = UCHCOM_IFACE_INDEX; > -   error = usbd_transfer_setup(uaa->device, > -       &iface_index, sc->sc_xfer, uchcom_config_data, > -       UCHCOM_N_TRANSFER, sc, &sc->sc_mtx); > +   /* CH343/CH9102 has two interfaces. */ > +   sc->sc_ctrl_iface_no = uaa->info.bIfaceNum; > > +   iface = usbd_get_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX); > +   if (iface) { > +       id = usbd_get_interface_descriptor(iface); > +       if (id == NULL) { > +           device_printf(dev, "no interface descriptor\n"); > +           goto detach; > +       } > +       sc->sc_iface_index = UCHCOM_SECOND_IFACE_INDEX; > +       usbd_set_parent_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX, > +           uaa->info.bIfaceIndex); > +       sc->sc_chiptype = TYPE_CH343; > +   } else { > +       sc->sc_iface_index = UCHCOM_IFACE_INDEX; > +   } > + > +   /* Setup all transfers. */ > +   error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index, > +       sc->sc_xfer, uchcom_config_data, UCHCOM_N_TRANSFER, sc, > +       &sc->sc_mtx); > +   if (error) { > +       device_printf(dev, "could not allocate all pipes\n"); > +       goto detach; > +   } > +   error = usbd_transfer_setup(uaa->device, &sc->sc_ctrl_iface_no, > +       &sc->sc_intr_xfer, uchcom_intr_config_data, 1, sc, &sc->sc_mtx); >     if (error) { > -       DPRINTF("one or more missing USB endpoints, " > -           "error=%s\n", usbd_errstr(error)); > +       device_printf(dev, "allocating USB transfers failed for " > +           "interrupt\n"); >         goto detach; >     } > > @@ -449,7 +478,9 @@ uchcom_write_reg(struct uchcom_softc *sc, >         (unsigned)reg1, (unsigned)val1, >         (unsigned)reg2, (unsigned)val2); >     uchcom_ctrl_write( > -       sc, UCHCOM_REQ_WRITE_REG, > +       sc, > +       (sc->sc_chiptype != TYPE_CH343) ? > +       UCHCOM_REQ_WRITE_REG : UCHCOM_REQ_CH343_WRITE_REG, >         reg1 | ((uint16_t)reg2 << 8), val1 | ((uint16_t)val2 << 8)); >  } > > @@ -516,9 +547,6 @@ uchcom_update_version(struct uchcom_softc *sc) >  static void >  uchcom_convert_status(struct uchcom_softc *sc, uint8_t cur) >  { > -   sc->sc_dtr = !(cur & UCHCOM_DTR_MASK); > -   sc->sc_rts = !(cur & UCHCOM_RTS_MASK); > - >     cur = ~cur & 0x0F; >     sc->sc_msr = (cur << 4) | ((sc->sc_msr >> 4) ^ cur); >  } > @@ -555,78 +583,69 @@ uchcom_cfg_set_break(struct ucom_softc *ucom, > uint8_t onoff) >     uint8_t brk1; >     uint8_t brk2; > > -   uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, &brk2); > -   if (onoff) { > -       /* on - clear bits */ > -       brk1 &= ~UCHCOM_BRK_MASK; > -       brk2 &= ~UCHCOM_LCR1_TX; > +   if (sc->sc_chiptype == TYPE_CH343) { > +       brk1 = UCHCOM_CH343_BRK_MASK; > +       if (!onoff) > +           brk1 |= UCHCOM_ABRK_MASK; > +       uchcom_write_reg(sc, brk1, 0, 0, 0); >     } else { > -       /* off - set bits */ > -       brk1 |= UCHCOM_BRK_MASK; > -       brk2 |= UCHCOM_LCR1_TX; > +       uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, > +           &brk2); > +       if (onoff) { > +           /* on - clear bits */ > +           brk1 &= ~UCHCOM_BRK_MASK; > +           brk2 &= ~UCHCOM_LCR1_TX; > +       } else { > +           /* off - set bits */ > +           brk1 |= UCHCOM_BRK_MASK; > +           brk2 |= UCHCOM_LCR1_TX; > +       } > +       uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, > +           brk2); >     } > -   uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, brk2); >  } > > -static int > -uchcom_calc_divider_settings(struct uchcom_divider *dp, uint32_t rate) > -{ > -   const struct uchcom_divider_record *rp; > -   uint32_t div; > -   uint32_t rem; > -   uint32_t mod; > -   uint8_t i; > - > -   /* find record */ > -   for (i = 0; i != NUM_DIVIDERS; i++) { > -       if (dividers[i].dvr_high >= rate && > -           dividers[i].dvr_low <= rate) { > -           rp = ÷rs[i]; > -           goto found; > -       } > -   } > -   return (-1); > - > -found: > -   dp->dv_prescaler = rp->dvr_divider.dv_prescaler; > -   if (rp->dvr_base_clock == UCHCOM_BASE_UNKNOWN) > -       dp->dv_div = rp->dvr_divider.dv_div; > -   else { > -       div = rp->dvr_base_clock / rate; > -       rem = rp->dvr_base_clock % rate; > -       if (div == 0 || div >= 0xFF) > -           return (-1); > -       if ((rem << 1) >= rate) > -           div += 1; > -       dp->dv_div = (uint8_t)-div; > +static void > +uchcom_calc_baudrate(struct uchcom_softc *sc, uint32_t rate, uint8_t > *divisor, > +    uint8_t *factor) > +{ > +   uint32_t clk = 12000000; > + > +   if (rate >= 256000 && sc->sc_chiptype == TYPE_CH343) > +       *divisor = 7; > +   else if (rate > 23529) { > +       clk /= 2; > +       *divisor = 3; > +   } else if (rate > 2941) { > +       clk /=  16; > +       *divisor = 2; > +   } else if (rate > 367) { > +       clk /= 128; > +       *divisor = 1; > +   } else { > +       clk = 11719; > +       *divisor = 0; >     } > > -   mod = (UCHCOM_BPS_MOD_BASE / rate) + UCHCOM_BPS_MOD_BASE_OFS; > -   mod = mod + (mod / 2); > +   *factor = 256 - clk / rate; > > -   dp->dv_mod = (mod + 0xFF) / 0x100; > - > -   return (0); > +   if (rate == 921600 && sc->sc_chiptype != TYPE_CH343) { > +       *divisor = 7; > +       *factor = 243; > +   } >  } > >  static void > -uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate) > +uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate, uint16_t lcr) >  { > -   struct uchcom_divider dv; > +   uint16_t idx; > +   uint8_t factor, div; > > -   if (uchcom_calc_divider_settings(&dv, rate)) > -       return; > +   uchcom_calc_baudrate(sc, rate, &div, &factor); > +   div |= (sc->sc_chiptype != TYPE_CH343) ? 0x80 : 0x00; > +   idx = (factor << 8) | div; > > -   /* > -    * According to linux code we need to set bit 7 of UCHCOM_REG_BPS_PRE, > -    * otherwise the chip will buffer data. > -    */ > -   uchcom_write_reg(sc, > -       UCHCOM_REG_BPS_PRE, dv.dv_prescaler | 0x80, > -       UCHCOM_REG_BPS_DIV, dv.dv_div); > -   uchcom_write_reg(sc, > -       UCHCOM_REG_BPS_MOD, dv.dv_mod, > -       UCHCOM_REG_BPS_PAD, 0); > +   uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, lcr, idx); >  } > >  /* ---------------------------------------------------------------------- > @@ -673,6 +692,14 @@ uchcom_cfg_open(struct ucom_softc *ucom) > >     DPRINTF("\n"); > > +   if (sc->sc_chiptype != TYPE_CH343) { > +       /* Set default configuration. */ > +       uchcom_get_version(sc, NULL); > +       uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); > +       uchcom_write_reg(sc, UCHCOM_REG_BPS_PRE, 0x82, > +           UCHCOM_REG_BPS_DIV, 0xd9); > +       uchcom_write_reg(sc, 0x2c, 0x07, UCHCOM_REG_BPS_PAD, 0); > +   } >     uchcom_update_version(sc); >     uchcom_update_status(sc); >  } > @@ -680,53 +707,69 @@ uchcom_cfg_open(struct ucom_softc *ucom) >  static int >  uchcom_pre_param(struct ucom_softc *ucom, struct termios *t) >  { > -   struct uchcom_divider dv; > +   struct uchcom_softc *sc = ucom->sc_parent; > > -   switch (t->c_cflag & CSIZE) { > -   case CS8: > +   /* > +    * Check requested baud rate. > +    * The CH340/CH341 can set any baud rate up to 2Mb. > +    * The CH9102/CH343 can set any baud rate up to 6Mb. > +    */ > +   switch (sc->sc_chiptype) { > +   case TYPE_CH343: > +       if (t->c_ospeed <= 6000000) > +           return (0); >         break; >     default: > -       return (EIO); > +       if (t->c_ospeed <= 2000000) > +           return (0); > +       break; >     } > -   if ((t->c_cflag & CSTOPB) != 0) > -       return (EIO); > -   if ((t->c_cflag & PARENB) != 0) > -       return (EIO); > > -   if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) { > -       return (EIO); > -   } > -   return (0);         /* success */ > +   return (EIO); >  } > >  static void >  uchcom_cfg_param(struct ucom_softc *ucom, struct termios *t) >  { >     struct uchcom_softc *sc = ucom->sc_parent; > +   uint8_t lcr; > > -   uchcom_get_version(sc, NULL); > -   uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); > -   uchcom_set_baudrate(sc, t->c_ospeed); > -   if (sc->sc_version < UCHCOM_VER_30) { > -       uchcom_read_reg(sc, UCHCOM_REG_LCR1, NULL, > -           UCHCOM_REG_LCR2, NULL); > -       uchcom_write_reg(sc, UCHCOM_REG_LCR1, 0x50, > -           UCHCOM_REG_LCR2, 0x00); > -   } else { > -       /* > -        * Set up line control: > -        * - enable transmit and receive > -        * - set 8n1 mode > -        * To do: support other sizes, parity, stop bits. > -        */ > -       uchcom_write_reg(sc, > -           UCHCOM_REG_LCR1, > -           UCHCOM_LCR1_RX | UCHCOM_LCR1_TX | UCHCOM_LCR1_CS8, > -           UCHCOM_REG_LCR2, 0x00); > +   lcr = UCHCOM_LCR1_RX | UCHCOM_LCR1_TX; > + > +   if (t->c_cflag & CSTOPB) > +       lcr |= UCHCOM_LCR1_STOPB; > + > +   if (t->c_cflag & PARENB) { > +       lcr |= UCHCOM_LCR1_PARENB; > +       if (t->c_cflag & PARODD) > +           lcr |= UCHCOM_LCR1_PARODD; > +       else > +           lcr |= UCHCOM_LCR1_PAREVEN; >     } > -   uchcom_update_status(sc); > -   uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a); > -   uchcom_set_baudrate(sc, t->c_ospeed); > + > +   switch (t->c_cflag & CSIZE) { > +   case CS5: > +       lcr |= UCHCOM_LCR1_CS5; > +       break; > +   case CS6: > +       lcr |= UCHCOM_LCR1_CS6; > +       break; > +   case CS7: > +       lcr |= UCHCOM_LCR1_CS7; > +       break; > +   case CS8: > +   default: > +       lcr |= UCHCOM_LCR1_CS8; > +       break; > +   } > + > +   if (sc->sc_chiptype == TYPE_CH343) > +       uchcom_set_baudrate(sc, t->c_ospeed, > +           UCHCOM_T | UCHCOM_CL | UCHCOM_CH343_CT | lcr << 8); > +   else > +       uchcom_set_baudrate(sc, t->c_ospeed, > +           UCHCOM_T | UCHCOM_CL | UCHCOM_CT | lcr << 8); > + >     uchcom_set_dtr_rts(sc); >     uchcom_update_status(sc); >  } > @@ -737,7 +780,7 @@ uchcom_start_read(struct ucom_softc *ucom) >     struct uchcom_softc *sc = ucom->sc_parent; > >     /* start interrupt endpoint */ > -   usbd_transfer_start(sc->sc_xfer[UCHCOM_INTR_DT_RD]); > +   usbd_transfer_start(sc->sc_intr_xfer); > >     /* start read endpoint */ >     usbd_transfer_start(sc->sc_xfer[UCHCOM_BULK_DT_RD]); > @@ -749,7 +792,7 @@ uchcom_stop_read(struct ucom_softc *ucom) >     struct uchcom_softc *sc = ucom->sc_parent; > >     /* stop interrupt endpoint */ > -   usbd_transfer_stop(sc->sc_xfer[UCHCOM_INTR_DT_RD]); > +   usbd_transfer_stop(sc->sc_intr_xfer); > >     /* stop read endpoint */ >     usbd_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_RD]); > @@ -779,7 +822,8 @@ uchcom_intr_callback(struct usb_xfer *xfer, > usb_error_t error) >  { >     struct uchcom_softc *sc = usbd_xfer_softc(xfer); >     struct usb_page_cache *pc; > -   uint8_t buf[UCHCOM_INTR_LEAST]; > +   uint32_t intrstat; > +   uint8_t buf[16]; >     int actlen; > >     usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); > @@ -791,13 +835,12 @@ uchcom_intr_callback(struct usb_xfer *xfer, > usb_error_t error) > >         if (actlen >= UCHCOM_INTR_LEAST) { >             pc = usbd_xfer_get_frame(xfer, 0); > -           usbd_copy_out(pc, 0, buf, UCHCOM_INTR_LEAST); > +           usbd_copy_out(pc, 0, buf, sizeof(buf)); > > -           DPRINTF("data = 0x%02X 0x%02X 0x%02X 0x%02X\n", > -               (unsigned)buf[0], (unsigned)buf[1], > -               (unsigned)buf[2], (unsigned)buf[3]); > +           intrstat = (sc->sc_chiptype == TYPE_CH343) ? > +               actlen - 1 : UCHCOM_INTR_STAT1; > > -           uchcom_convert_status(sc, buf[UCHCOM_INTR_STAT1]); > +           uchcom_convert_status(sc, buf[intrstat]); >             ucom_status_change(&sc->sc_ucom); >         } >     case USB_ST_SETUP: > diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs > index f26edcebcb9c..2318e6bd0017 100644 > --- a/sys/dev/usb/usbdevs > +++ b/sys/dev/usb/usbdevs > @@ -4972,9 +4972,11 @@ product WAVESENSE JAZZ       0xaaaa  Jazz blood > glucose meter >  /* WCH products */ >  product WCH CH341SER       0x5523  CH341/CH340 USB-Serial Bridge >  product WCH2 CH341SER_2        0x5523  CH341/CH340 USB-Serial Bridge > +product WCH2 CH343SER      0x55d3  CH343 USB Serial > +product WCH2 CH9102SER     0x55d4  CH9102 USB Serial >  product WCH2 CH341SER_3        0x7522  CH341/CH340 USB-Serial Bridge >  product WCH2 CH341SER      0x7523  CH341/CH340 USB-Serial Bridge > -product WCH2 U2M       0X752d  CH345 USB2.0-MIDI > +product WCH2 U2M       0x752d  CH345 USB2.0-MIDI > >  /* West Mountain Radio products */ >  product WESTMOUNTAIN RIGBLASTER_ADVANTAGE  0x0003  RIGblaster Advantage > ------------------------------------------------------------------------------ > > -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Wed Jun 25 07:33:09 2025 X-Original-To: dev-commits-src-main@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 4bRtpM0Y2fz5ydxZ; Wed, 25 Jun 2025 07:33:15 +0000 (UTC) (envelope-from kevlo@freebsd.org) Received: from mail.kevlo.org (ns.kevlo.org [220.134.220.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRtpK6C9sz3pP0; Wed, 25 Jun 2025 07:33:13 +0000 (UTC) (envelope-from kevlo@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from localhost (ns.kevlo.org [local]) by ns.kevlo.org (OpenSMTPD) with ESMTPA id 3021bd70; Wed, 25 Jun 2025 15:33:09 +0800 (CST) Date: Wed, 25 Jun 2025 15:33:09 +0800 From: Kevin Lo To: Ronald Klop Cc: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1395712cab8e - main - uchcom: add support for CH9102 and CH343 uarts Message-ID: References: <202506250136.55P1aag8094334@gitrepo.freebsd.org> <727722724.560.1750830351345@localhost> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <727722724.560.1750830351345@localhost> X-Rspamd-Queue-Id: 4bRtpK6C9sz3pP0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3462, ipnet:220.134.0.0/16, country:TW] On Wed, Jun 25, 2025 at 07:45:51AM +0200, Ronald Klop wrote: > Hi, Hi Ronald, > nice work! > > Isn't the HARDWARE section in the man page used to generate a supported hardware list in the release notes of a new FreeBSD version? ziaee will update the man page https://reviews.freebsd.org/D51036 Thanks. > Regards, > Ronald. > > > Van: Kevin Lo > Datum:woensdag, 25 juni 2025 03:36 > Aan:src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org > Onderwerp:git: 1395712cab8e - main - uchcom: add support for CH9102 and CH343 uarts > > > > The branch main has been updated by kevlo: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1395712cab8e95808064ba68c5a792b7cd0fe35f > > > > commit 1395712cab8e95808064ba68c5a792b7cd0fe35f > > Author: Kevin Lo > > AuthorDate: 2025-06-25 01:33:35 +0000 > > Commit: Kevin Lo > > CommitDate: 2025-06-25 01:33:35 +0000 > > > > uchcom: add support for CH9102 and CH343 uarts > > The CH343 devices support any baud rate up to 6 Mbps. > > PR: 272803 > > Reviewed by: imp > > Tested by: joerg, Tomasz "CeDeROM" CEDRO > > Differential Revision: https://reviews.freebsd.org/D46290 > > --- > > share/man/man4/uchcom.4 | 27 +--- > > sys/dev/usb/serial/uchcom.c | 353 +++++++++++++++++++++++++------------------- > > sys/dev/usb/usbdevs | 4 +- > > 3 files changed, 208 insertions(+), 176 deletions(-) > > > > diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 > > index d5efe83286ba..4d395573589f 100644 > > --- a/share/man/man4/uchcom.4 > > +++ b/share/man/man4/uchcom.4 > > @@ -27,12 +27,12 @@ > > .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > > .\" POSSIBILITY OF SUCH DAMAGE. > > .\" > > -.Dd April 26, 2017 > > +.Dd August 19, 2024 > > .Dt UCHCOM 4 > > .Os > > .Sh NAME > > .Nm uchcom > > -.Nd WinChipHead CH341/CH340 serial adapter driver > > +.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver > > .Sh SYNOPSIS > > To compile this driver into the kernel, > > place the following lines in your > > @@ -52,22 +52,12 @@ uchcom_load="YES" > > .Sh DESCRIPTION > > The > > .Nm > > -driver provides support for the WinChipHead CH341/CH340 USB-to-RS-232 > > -Bridge chip. > > +driver provides support for the WinChipHead CH9102/CH343/CH341/CH340 > > +USB-to-RS-232 Bridge chip. > > .Pp > > -The device is accessed through the > > -.Xr ucom 4 > > -driver which makes it behave like a > > -.Xr tty 4 . > > -.Sh HARDWARE > > -The > > -.Nm > > -driver supports the following adapters: > > -.Pp > > -.Bl -bullet -compact > > -.It > > -HL USB-RS232 > > -.El > > +The datasheets for the CH340/CH341 list the maximum > > +supported baud rate as 2,000,000. > > +CH9102/CH343 devices support any baud rate up to 6 Mbps. > > .Sh FILES > > .Bl -tag -width "/dev/ttyU*.init" -compact > > .It Pa /dev/ttyU* > > @@ -95,6 +85,3 @@ The first > > .Fx > > release to include it was > > .Fx 8.0 . > > -.Sh BUGS > > -Actually, this chip seems unable to drive other than 8 data bits and > > -1 stop bit line. > > diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c > > index a886b25c89d7..fdc5515fa722 100644 > > --- a/sys/dev/usb/serial/uchcom.c > > +++ b/sys/dev/usb/serial/uchcom.c > > @@ -58,8 +58,7 @@ > > */ > > /* > > - * Driver for WinChipHead CH341/340, the worst USB-serial chip in the > > - * world. > > + * Driver for WinChipHead CH9102/343/341/340. > > */ > > #include > > @@ -101,17 +100,19 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, > > &uchcom_debug, 0, "uchcom debug level"); > > #endif > > -#define UCHCOM_IFACE_INDEX 0 > > -#define UCHCOM_CONFIG_INDEX 0 > > +#define UCHCOM_IFACE_INDEX 0 > > +#define UCHCOM_CONFIG_INDEX 0 > > +#define UCHCOM_SECOND_IFACE_INDEX 1 > > #define UCHCOM_REV_CH340 0x0250 > > #define UCHCOM_INPUT_BUF_SIZE 8 > > -#define UCHCOM_REQ_GET_VERSION 0x5F > > -#define UCHCOM_REQ_READ_REG 0x95 > > -#define UCHCOM_REQ_WRITE_REG 0x9A > > -#define UCHCOM_REQ_RESET 0xA1 > > -#define UCHCOM_REQ_SET_DTRRTS 0xA4 > > +#define UCHCOM_REQ_GET_VERSION 0x5F > > +#define UCHCOM_REQ_READ_REG 0x95 > > +#define UCHCOM_REQ_WRITE_REG 0x9A > > +#define UCHCOM_REQ_RESET 0xA1 > > +#define UCHCOM_REQ_SET_DTRRTS 0xA4 > > +#define UCHCOM_REQ_CH343_WRITE_REG 0xA8 > > #define UCHCOM_REG_STAT1 0x06 > > #define UCHCOM_REG_STAT2 0x07 > > @@ -134,13 +135,21 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, > > #define UCHCOM_RTS_MASK 0x40 > > #define UCHCOM_BRK_MASK 0x01 > > +#define UCHCOM_ABRK_MASK 0x10 > > +#define UCHCOM_CH343_BRK_MASK 0x80 > > #define UCHCOM_LCR1_MASK 0xAF > > #define UCHCOM_LCR2_MASK 0x07 > > #define UCHCOM_LCR1_RX 0x80 > > #define UCHCOM_LCR1_TX 0x40 > > #define UCHCOM_LCR1_PARENB 0x08 > > +#define UCHCOM_LCR1_CS5 0x00 > > +#define UCHCOM_LCR1_CS6 0x01 > > +#define UCHCOM_LCR1_CS7 0x02 > > #define UCHCOM_LCR1_CS8 0x03 > > +#define UCHCOM_LCR1_STOPB 0x04 > > +#define UCHCOM_LCR1_PARODD 0x00 > > +#define UCHCOM_LCR1_PAREVEN 0x10 > > #define UCHCOM_LCR2_PAREVEN 0x07 > > #define UCHCOM_LCR2_PARODD 0x06 > > #define UCHCOM_LCR2_PARMARK 0x05 > > @@ -150,12 +159,18 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, > > #define UCHCOM_INTR_STAT2 0x03 > > #define UCHCOM_INTR_LEAST 4 > > -#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ > > +#define UCHCOM_T 0x08 > > +#define UCHCOM_CL 0x04 > > +#define UCHCOM_CH343_CT 0x80 > > +#define UCHCOM_CT 0x90 > > + > > +#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ > > + > > +#define TYPE_CH343 1 > > enum { > > UCHCOM_BULK_DT_WR, > > UCHCOM_BULK_DT_RD, > > - UCHCOM_INTR_DT_RD, > > UCHCOM_N_TRANSFER, > > }; > > @@ -164,6 +179,7 @@ struct uchcom_softc { > > struct ucom_softc sc_ucom; > > struct usb_xfer *sc_xfer[UCHCOM_N_TRANSFER]; > > + struct usb_xfer *sc_intr_xfer; /* Interrupt endpoint */ > > struct usb_device *sc_udev; > > struct mtx sc_mtx; > > @@ -171,39 +187,19 @@ struct uchcom_softc { > > uint8_t sc_rts; /* local copy */ > > uint8_t sc_version; > > uint8_t sc_msr; > > - uint8_t sc_lsr; /* local status register */ > > -}; > > - > > -struct uchcom_divider { > > - uint8_t dv_prescaler; > > - uint8_t dv_div; > > - uint8_t dv_mod; > > -}; > > - > > -struct uchcom_divider_record { > > - uint32_t dvr_high; > > - uint32_t dvr_low; > > - uint32_t dvr_base_clock; > > - struct uchcom_divider dvr_divider; > > -}; > > - > > -static const struct uchcom_divider_record dividers[] = > > -{ > > - {307200, 307200, UCHCOM_BASE_UNKNOWN, {7, 0xD9, 0}}, > > - {921600, 921600, UCHCOM_BASE_UNKNOWN, {7, 0xF3, 0}}, > > - {2999999, 23530, 6000000, {3, 0, 0}}, > > - {23529, 2942, 750000, {2, 0, 0}}, > > - {2941, 368, 93750, {1, 0, 0}}, > > - {367, 1, 11719, {0, 0, 0}}, > > + uint8_t sc_lsr; /* local status register */ > > + uint8_t sc_chiptype; /* type of chip */ > > + uint8_t sc_ctrl_iface_no; > > + uint8_t sc_iface_index; > > }; > > -#define NUM_DIVIDERS nitems(dividers) > > - > > static const STRUCT_USB_HOST_ID uchcom_devs[] = { > > {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, > > {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, > > {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, > > {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_3, 0)}, > > + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH343SER, 0)}, > > + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH9102SER, 0)}, > > }; > > /* protypes */ > > @@ -225,8 +221,9 @@ static void uchcom_update_version(struct uchcom_softc *); > > static void uchcom_convert_status(struct uchcom_softc *, uint8_t); > > static void uchcom_update_status(struct uchcom_softc *); > > static void uchcom_set_dtr_rts(struct uchcom_softc *); > > -static int uchcom_calc_divider_settings(struct uchcom_divider *, uint32_t); > > -static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t); > > +static void uchcom_calc_baudrate(struct uchcom_softc *, uint32_t, uint8_t *, > > + uint8_t *); > > +static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t, uint16_t); > > static void uchcom_poll(struct ucom_softc *ucom); > > static device_probe_t uchcom_probe; > > @@ -244,7 +241,7 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { > > .endpoint = UE_ADDR_ANY, > > .direction = UE_DIR_OUT, > > .bufsize = UCHCOM_BULK_BUF_SIZE, > > - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, > > + .flags = {.pipe_bof = 1,}, > > .callback = &uchcom_write_callback, > > }, > > @@ -256,8 +253,10 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { > > .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, > > .callback = &uchcom_read_callback, > > }, > > +}; > > - [UCHCOM_INTR_DT_RD] = { > > +static const struct usb_config uchcom_intr_config_data[1] = { > > + [0] = { > > .type = UE_INTERRUPT, > > .endpoint = UE_ADDR_ANY, > > .direction = UE_DIR_IN, > > @@ -311,8 +310,9 @@ uchcom_attach(device_t dev) > > { > > struct uchcom_softc *sc = device_get_softc(dev); > > struct usb_attach_arg *uaa = device_get_ivars(dev); > > + struct usb_interface *iface; > > + struct usb_interface_descriptor *id; > > int error; > > - uint8_t iface_index; > > DPRINTFN(11, "\n"); > > @@ -330,20 +330,49 @@ uchcom_attach(device_t dev) > > case USB_PRODUCT_WCH2_CH341SER_3: > > device_printf(dev, "CH341 detected\n"); > > break; > > + case USB_PRODUCT_WCH2_CH343SER: > > + device_printf(dev, "CH343 detected\n"); > > + break; > > + case USB_PRODUCT_WCH2_CH9102SER: > > + device_printf(dev, "CH9102 detected\n"); > > + break; > > default: > > - device_printf(dev, "New CH340/CH341 product 0x%04x detected\n", > > - uaa->info.idProduct); > > + device_printf(dev, "New CH340/CH341/CH343/CH9102 product " > > + "0x%04x detected\n", uaa->info.idProduct); > > break; > > } > > - iface_index = UCHCOM_IFACE_INDEX; > > - error = usbd_transfer_setup(uaa->device, > > - &iface_index, sc->sc_xfer, uchcom_config_data, > > - UCHCOM_N_TRANSFER, sc, &sc->sc_mtx); > > + /* CH343/CH9102 has two interfaces. */ > > + sc->sc_ctrl_iface_no = uaa->info.bIfaceNum; > > + iface = usbd_get_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX); > > + if (iface) { > > + id = usbd_get_interface_descriptor(iface); > > + if (id == NULL) { > > + device_printf(dev, "no interface descriptor\n"); > > + goto detach; > > + } > > + sc->sc_iface_index = UCHCOM_SECOND_IFACE_INDEX; > > + usbd_set_parent_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX, > > + uaa->info.bIfaceIndex); > > + sc->sc_chiptype = TYPE_CH343; > > + } else { > > + sc->sc_iface_index = UCHCOM_IFACE_INDEX; > > + } > > + > > + /* Setup all transfers. */ > > + error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index, > > + sc->sc_xfer, uchcom_config_data, UCHCOM_N_TRANSFER, sc, > > + &sc->sc_mtx); > > + if (error) { > > + device_printf(dev, "could not allocate all pipes\n"); > > + goto detach; > > + } > > + error = usbd_transfer_setup(uaa->device, &sc->sc_ctrl_iface_no, > > + &sc->sc_intr_xfer, uchcom_intr_config_data, 1, sc, &sc->sc_mtx); > > if (error) { > > - DPRINTF("one or more missing USB endpoints, " > > - "error=%s\n", usbd_errstr(error)); > > + device_printf(dev, "allocating USB transfers failed for " > > + "interrupt\n"); > > goto detach; > > } > > @@ -449,7 +478,9 @@ uchcom_write_reg(struct uchcom_softc *sc, > > (unsigned)reg1, (unsigned)val1, > > (unsigned)reg2, (unsigned)val2); > > uchcom_ctrl_write( > > - sc, UCHCOM_REQ_WRITE_REG, > > + sc, > > + (sc->sc_chiptype != TYPE_CH343) ? > > + UCHCOM_REQ_WRITE_REG : UCHCOM_REQ_CH343_WRITE_REG, > > reg1 | ((uint16_t)reg2 << 8), val1 | ((uint16_t)val2 << 8)); > > } > > @@ -516,9 +547,6 @@ uchcom_update_version(struct uchcom_softc *sc) > > static void > > uchcom_convert_status(struct uchcom_softc *sc, uint8_t cur) > > { > > - sc->sc_dtr = !(cur & UCHCOM_DTR_MASK); > > - sc->sc_rts = !(cur & UCHCOM_RTS_MASK); > > - > > cur = ~cur & 0x0F; > > sc->sc_msr = (cur << 4) | ((sc->sc_msr >> 4) ^ cur); > > } > > @@ -555,78 +583,69 @@ uchcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff) > > uint8_t brk1; > > uint8_t brk2; > > - uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, &brk2); > > - if (onoff) { > > - /* on - clear bits */ > > - brk1 &= ~UCHCOM_BRK_MASK; > > - brk2 &= ~UCHCOM_LCR1_TX; > > + if (sc->sc_chiptype == TYPE_CH343) { > > + brk1 = UCHCOM_CH343_BRK_MASK; > > + if (!onoff) > > + brk1 |= UCHCOM_ABRK_MASK; > > + uchcom_write_reg(sc, brk1, 0, 0, 0); > > } else { > > - /* off - set bits */ > > - brk1 |= UCHCOM_BRK_MASK; > > - brk2 |= UCHCOM_LCR1_TX; > > + uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, > > + &brk2); > > + if (onoff) { > > + /* on - clear bits */ > > + brk1 &= ~UCHCOM_BRK_MASK; > > + brk2 &= ~UCHCOM_LCR1_TX; > > + } else { > > + /* off - set bits */ > > + brk1 |= UCHCOM_BRK_MASK; > > + brk2 |= UCHCOM_LCR1_TX; > > + } > > + uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, > > + brk2); > > } > > - uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, brk2); > > } > > -static int > > -uchcom_calc_divider_settings(struct uchcom_divider *dp, uint32_t rate) > > -{ > > - const struct uchcom_divider_record *rp; > > - uint32_t div; > > - uint32_t rem; > > - uint32_t mod; > > - uint8_t i; > > - > > - /* find record */ > > - for (i = 0; i != NUM_DIVIDERS; i++) { > > - if (dividers[i].dvr_high >= rate && > > - dividers[i].dvr_low <= rate) { > > - rp = ÷rs[i]; > > - goto found; > > - } > > - } > > - return (-1); > > - > > -found: > > - dp->dv_prescaler = rp->dvr_divider.dv_prescaler; > > - if (rp->dvr_base_clock == UCHCOM_BASE_UNKNOWN) > > - dp->dv_div = rp->dvr_divider.dv_div; > > - else { > > - div = rp->dvr_base_clock / rate; > > - rem = rp->dvr_base_clock % rate; > > - if (div == 0 || div >= 0xFF) > > - return (-1); > > - if ((rem << 1) >= rate) > > - div += 1; > > - dp->dv_div = (uint8_t)-div; > > +static void > > +uchcom_calc_baudrate(struct uchcom_softc *sc, uint32_t rate, uint8_t *divisor, > > + uint8_t *factor) > > +{ > > + uint32_t clk = 12000000; > > + > > + if (rate >= 256000 && sc->sc_chiptype == TYPE_CH343) > > + *divisor = 7; > > + else if (rate > 23529) { > > + clk /= 2; > > + *divisor = 3; > > + } else if (rate > 2941) { > > + clk /= 16; > > + *divisor = 2; > > + } else if (rate > 367) { > > + clk /= 128; > > + *divisor = 1; > > + } else { > > + clk = 11719; > > + *divisor = 0; > > } > > - mod = (UCHCOM_BPS_MOD_BASE / rate) + UCHCOM_BPS_MOD_BASE_OFS; > > - mod = mod + (mod / 2); > > + *factor = 256 - clk / rate; > > - dp->dv_mod = (mod + 0xFF) / 0x100; > > - > > - return (0); > > + if (rate == 921600 && sc->sc_chiptype != TYPE_CH343) { > > + *divisor = 7; > > + *factor = 243; > > + } > > } > > static void > > -uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate) > > +uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate, uint16_t lcr) > > { > > - struct uchcom_divider dv; > > + uint16_t idx; > > + uint8_t factor, div; > > - if (uchcom_calc_divider_settings(&dv, rate)) > > - return; > > + uchcom_calc_baudrate(sc, rate, &div, &factor); > > + div |= (sc->sc_chiptype != TYPE_CH343) ? 0x80 : 0x00; > > + idx = (factor << 8) | div; > > - /* > > - * According to linux code we need to set bit 7 of UCHCOM_REG_BPS_PRE, > > - * otherwise the chip will buffer data. > > - */ > > - uchcom_write_reg(sc, > > - UCHCOM_REG_BPS_PRE, dv.dv_prescaler | 0x80, > > - UCHCOM_REG_BPS_DIV, dv.dv_div); > > - uchcom_write_reg(sc, > > - UCHCOM_REG_BPS_MOD, dv.dv_mod, > > - UCHCOM_REG_BPS_PAD, 0); > > + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, lcr, idx); > > } > > /* ---------------------------------------------------------------------- > > @@ -673,6 +692,14 @@ uchcom_cfg_open(struct ucom_softc *ucom) > > DPRINTF("\n"); > > + if (sc->sc_chiptype != TYPE_CH343) { > > + /* Set default configuration. */ > > + uchcom_get_version(sc, NULL); > > + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); > > + uchcom_write_reg(sc, UCHCOM_REG_BPS_PRE, 0x82, > > + UCHCOM_REG_BPS_DIV, 0xd9); > > + uchcom_write_reg(sc, 0x2c, 0x07, UCHCOM_REG_BPS_PAD, 0); > > + } > > uchcom_update_version(sc); > > uchcom_update_status(sc); > > } > > @@ -680,53 +707,69 @@ uchcom_cfg_open(struct ucom_softc *ucom) > > static int > > uchcom_pre_param(struct ucom_softc *ucom, struct termios *t) > > { > > - struct uchcom_divider dv; > > + struct uchcom_softc *sc = ucom->sc_parent; > > - switch (t->c_cflag & CSIZE) { > > - case CS8: > > + /* > > + * Check requested baud rate. > > + * The CH340/CH341 can set any baud rate up to 2Mb. > > + * The CH9102/CH343 can set any baud rate up to 6Mb. > > + */ > > + switch (sc->sc_chiptype) { > > + case TYPE_CH343: > > + if (t->c_ospeed <= 6000000) > > + return (0); > > break; > > default: > > - return (EIO); > > + if (t->c_ospeed <= 2000000) > > + return (0); > > + break; > > } > > - if ((t->c_cflag & CSTOPB) != 0) > > - return (EIO); > > - if ((t->c_cflag & PARENB) != 0) > > - return (EIO); > > - if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) { > > - return (EIO); > > - } > > - return (0); /* success */ > > + return (EIO); > > } > > static void > > uchcom_cfg_param(struct ucom_softc *ucom, struct termios *t) > > { > > struct uchcom_softc *sc = ucom->sc_parent; > > + uint8_t lcr; > > - uchcom_get_version(sc, NULL); > > - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); > > - uchcom_set_baudrate(sc, t->c_ospeed); > > - if (sc->sc_version < UCHCOM_VER_30) { > > - uchcom_read_reg(sc, UCHCOM_REG_LCR1, NULL, > > - UCHCOM_REG_LCR2, NULL); > > - uchcom_write_reg(sc, UCHCOM_REG_LCR1, 0x50, > > - UCHCOM_REG_LCR2, 0x00); > > - } else { > > - /* > > - * Set up line control: > > - * - enable transmit and receive > > - * - set 8n1 mode > > - * To do: support other sizes, parity, stop bits. > > - */ > > - uchcom_write_reg(sc, > > - UCHCOM_REG_LCR1, > > - UCHCOM_LCR1_RX | UCHCOM_LCR1_TX | UCHCOM_LCR1_CS8, > > - UCHCOM_REG_LCR2, 0x00); > > + lcr = UCHCOM_LCR1_RX | UCHCOM_LCR1_TX; > > + > > + if (t->c_cflag & CSTOPB) > > + lcr |= UCHCOM_LCR1_STOPB; > > + > > + if (t->c_cflag & PARENB) { > > + lcr |= UCHCOM_LCR1_PARENB; > > + if (t->c_cflag & PARODD) > > + lcr |= UCHCOM_LCR1_PARODD; > > + else > > + lcr |= UCHCOM_LCR1_PAREVEN; > > } > > - uchcom_update_status(sc); > > - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a); > > - uchcom_set_baudrate(sc, t->c_ospeed); > > + > > + switch (t->c_cflag & CSIZE) { > > + case CS5: > > + lcr |= UCHCOM_LCR1_CS5; > > + break; > > + case CS6: > > + lcr |= UCHCOM_LCR1_CS6; > > + break; > > + case CS7: > > + lcr |= UCHCOM_LCR1_CS7; > > + break; > > + case CS8: > > + default: > > + lcr |= UCHCOM_LCR1_CS8; > > + break; > > + } > > + > > + if (sc->sc_chiptype == TYPE_CH343) > > + uchcom_set_baudrate(sc, t->c_ospeed, > > + UCHCOM_T | UCHCOM_CL | UCHCOM_CH343_CT | lcr << 8); > > + else > > + uchcom_set_baudrate(sc, t->c_ospeed, > > + UCHCOM_T | UCHCOM_CL | UCHCOM_CT | lcr << 8); > > + > > uchcom_set_dtr_rts(sc); > > uchcom_update_status(sc); > > } > > @@ -737,7 +780,7 @@ uchcom_start_read(struct ucom_softc *ucom) > > struct uchcom_softc *sc = ucom->sc_parent; > > /* start interrupt endpoint */ > > - usbd_transfer_start(sc->sc_xfer[UCHCOM_INTR_DT_RD]); > > + usbd_transfer_start(sc->sc_intr_xfer); > > /* start read endpoint */ > > usbd_transfer_start(sc->sc_xfer[UCHCOM_BULK_DT_RD]); > > @@ -749,7 +792,7 @@ uchcom_stop_read(struct ucom_softc *ucom) > > struct uchcom_softc *sc = ucom->sc_parent; > > /* stop interrupt endpoint */ > > - usbd_transfer_stop(sc->sc_xfer[UCHCOM_INTR_DT_RD]); > > + usbd_transfer_stop(sc->sc_intr_xfer); > > /* stop read endpoint */ > > usbd_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_RD]); > > @@ -779,7 +822,8 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) > > { > > struct uchcom_softc *sc = usbd_xfer_softc(xfer); > > struct usb_page_cache *pc; > > - uint8_t buf[UCHCOM_INTR_LEAST]; > > + uint32_t intrstat; > > + uint8_t buf[16]; > > int actlen; > > usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); > > @@ -791,13 +835,12 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) > > if (actlen >= UCHCOM_INTR_LEAST) { > > pc = usbd_xfer_get_frame(xfer, 0); > > - usbd_copy_out(pc, 0, buf, UCHCOM_INTR_LEAST); > > + usbd_copy_out(pc, 0, buf, sizeof(buf)); > > - DPRINTF("data = 0x%02X 0x%02X 0x%02X 0x%02X\n", > > - (unsigned)buf[0], (unsigned)buf[1], > > - (unsigned)buf[2], (unsigned)buf[3]); > > + intrstat = (sc->sc_chiptype == TYPE_CH343) ? > > + actlen - 1 : UCHCOM_INTR_STAT1; > > - uchcom_convert_status(sc, buf[UCHCOM_INTR_STAT1]); > > + uchcom_convert_status(sc, buf[intrstat]); > > ucom_status_change(&sc->sc_ucom); > > } > > case USB_ST_SETUP: > > diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs > > index f26edcebcb9c..2318e6bd0017 100644 > > --- a/sys/dev/usb/usbdevs > > +++ b/sys/dev/usb/usbdevs > > @@ -4972,9 +4972,11 @@ product WAVESENSE JAZZ 0xaaaa Jazz blood glucose meter > > /* WCH products */ > > product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge > > product WCH2 CH341SER_2 0x5523 CH341/CH340 USB-Serial Bridge > > +product WCH2 CH343SER 0x55d3 CH343 USB Serial > > +product WCH2 CH9102SER 0x55d4 CH9102 USB Serial > > product WCH2 CH341SER_3 0x7522 CH341/CH340 USB-Serial Bridge > > product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge > > -product WCH2 U2M 0X752d CH345 USB2.0-MIDI > > +product WCH2 U2M 0x752d CH345 USB2.0-MIDI > > /* West Mountain Radio products */ > > product WESTMOUNTAIN RIGBLASTER_ADVANTAGE 0x0003 RIGblaster Advantage > > > > > > > > From nobody Wed Jun 25 09:25:36 2025 X-Original-To: dev-commits-src-main@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 4bRxJ14Qq3z5ynF8; Wed, 25 Jun 2025 09:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRxJ11NPcz3Mpb; Wed, 25 Jun 2025 09:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843537; 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=3CcYAJBVhrZcZ976y572btDpXkrM2HnTpGp3sv24mN8=; b=T9NTSW48ca+PF+UzGQiEUCAyCuj7WalJv0AZalJKUyCY5JuRirx0SQ8aSWKoXugJiaZBCL pABfPh474nf9pocdJS8Nv6FjYsz0pI4a1BbG/fHwPOdGB38cOwB8wYlynTcMztGL+hFV6q wghN0fjwwS6S5MQGa44cjkm8QZKLfJ3eWI210hivrQOi0ghTzAW3V/UCwF6qKk0s7Navdi dFkfAJLO0Fzdb4iOIjgvbwCObZOa3yUf0rV9EhcG59BwcBoz9wkGPbf8VW2OJVX9M6ZJ9f QVBcvemOJuW4r3hH0pD4L91vcEaYaxHtbLQ/2istLAqt0Y0zJpYW9C+DNymhow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843537; 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=3CcYAJBVhrZcZ976y572btDpXkrM2HnTpGp3sv24mN8=; b=PDEbvdZbbH9UDGIxNdf+ZrSS4m5Ys35n0s9iX99/CqeO7a8rYewEEyKBS+kDHzpcutb66Q J0fPW2bEoyc3aldpeKmCpaB0FnEF8kOiaizYj5Xl/L4tv666Pz4wwZe31PdWfQC/Kdq4NT YuSzwKLPS0sev50Dun5GlMtP/vsum3fTPrR7O2OSr/v+X8ZqIegphDmi2lyyq+WrO0tzel FDWZz71XpBooYTvpEQ2u1AP+mMgeSMZoiP+kTKvECJwgWB6trSvlwadglKY2omvkQSmfEy muVA7X+sk3Od53HVEpK3TRFmDgRQeqeBpX+QgnfyKV+uh5A+Z6Yf4Rn81OfzvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750843537; a=rsa-sha256; cv=none; b=gVU0oabiDDPHRHnfNfWE/OHuPS7ZOQxuQtpmnHkvJ8bCbS7c2BiMH3lcE8crp/f+wDERx+ WuL0MWJbsqzLoK1XyRyK1VL1T6VbOHHUKqkDC1vsA6X6cMehFSEOu/+rfsJhjh++uQL/RV SRmbOYdyngvI4nX24/snXgLSBW0GPEFiVRhgSoi5GlsiHjXPGR8CykdYf6+vnskNoinSqx FHMjXOJwjWFCM1ssoU2QezKXxjA7aCooKYscA5+4RtZRB/NXjbnm2BEB9o+R2a/PkVuRRD FTHvRS9AH2KpXrKC/J84yEDClufNPs810CTJjIrHcCLlyqa1tAAq1yfQVJTIaQ== 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 4bRxJ06nPGz1QZQ; Wed, 25 Jun 2025 09:25: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 55P9Pa4o077148; Wed, 25 Jun 2025 09:25:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P9PaHm077145; Wed, 25 Jun 2025 09:25:36 GMT (envelope-from git) Date: Wed, 25 Jun 2025 09:25:36 GMT Message-Id: <202506250925.55P9PaHm077145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 85007872d122 - main - sys: Add AT_HWCAP3 and AT_HWCAP4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85007872d1227006adf2ce119fe30de856cbe12d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=85007872d1227006adf2ce119fe30de856cbe12d commit 85007872d1227006adf2ce119fe30de856cbe12d Author: Andrew Turner AuthorDate: 2025-06-24 14:56:46 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 16:26:40 +0000 sys: Add AT_HWCAP3 and AT_HWCAP4 It is likely we will need these on arm64. Add them in preparation for flags in these to be added at some point in the future. Reviewed by: brooks, imp, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51005 --- sys/amd64/linux/linux_sysvec.c | 2 ++ sys/amd64/linux32/linux32_sysvec.c | 2 ++ sys/arm/arm/elf_machdep.c | 2 ++ sys/arm64/arm64/elf32_machdep.c | 2 ++ sys/arm64/arm64/elf_machdep.c | 2 ++ sys/arm64/linux/linux_sysvec.c | 2 ++ sys/compat/linux/linux_misc.h | 4 +++- sys/i386/linux/linux_sysvec.c | 4 ++++ sys/kern/imgact_elf.c | 4 ++++ sys/powerpc/powerpc/elf32_machdep.c | 2 ++ sys/powerpc/powerpc/elf64_machdep.c | 4 ++++ sys/powerpc/powerpc/elf_common.c | 1 + sys/sys/elf_common.h | 4 +++- sys/sys/sysent.h | 2 ++ 14 files changed, 35 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 3760a5455a73..c8579c5da4ad 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -711,6 +711,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = linux_vsyscall, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index d7f87e2fdf34..8fac626f9053 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -811,6 +811,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c index e1003b71543a..ea6437f320ce 100644 --- a/sys/arm/arm/elf_machdep.c +++ b/sys/arm/arm/elf_machdep.c @@ -97,6 +97,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index fd2a2690b7a1..7cd5327b9f1b 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -134,6 +134,8 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf32_hwcap, .sv_hwcap2 = &elf32_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index d5b420a8b519..6ca8a711839f 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -101,6 +101,8 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_protect = arm64_exec_protect, .sv_onexit = exit_onexit, diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 185c4f3044b1..13c42e061094 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -458,6 +458,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = &linux_elf_hwcap, .sv_hwcap2 = &linux_elf_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index 445110c598cc..2d2b12ef0127 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -85,7 +85,9 @@ * differ from AT_PLATFORM. */ #define LINUX_AT_RANDOM 25 /* address of random bytes */ -#define LINUX_AT_HWCAP2 26 /* CPU capabilities, second part */ +#define LINUX_AT_HWCAP2 26 /* CPU capabilities */ +#define LINUX_AT_HWCAP3 29 /* CPU capabilities */ +#define LINUX_AT_HWCAP4 30 /* CPU capabilities */ #define LINUX_AT_EXECFN 31 /* filename of program */ #define LINUX_AT_SYSINFO 32 /* vsyscall */ #define LINUX_AT_SYSINFO_EHDR 33 /* vdso header */ diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index c68a0e17a8e4..85877bf40997 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -606,6 +606,8 @@ struct sysentvec linux_sysvec = { .sv_trap = NULL, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, @@ -650,6 +652,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 1a2c0e2ef93d..b7ffbe68b483 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1487,6 +1487,10 @@ __elfN(freebsd_copyout_auxargs)(struct image_params *imgp, uintptr_t base) AUXARGS_ENTRY(pos, AT_HWCAP, *imgp->sysent->sv_hwcap); if (imgp->sysent->sv_hwcap2 != NULL) AUXARGS_ENTRY(pos, AT_HWCAP2, *imgp->sysent->sv_hwcap2); + if (imgp->sysent->sv_hwcap3 != NULL) + AUXARGS_ENTRY(pos, AT_HWCAP3, *imgp->sysent->sv_hwcap3); + if (imgp->sysent->sv_hwcap4 != NULL) + AUXARGS_ENTRY(pos, AT_HWCAP4, *imgp->sysent->sv_hwcap4); bsdflags = 0; bsdflags |= __elfN(sigfastblock) ? ELF_BSDF_SIGFASTBLK : 0; oc = atomic_load_int(&vm_overcommit); diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c index af01043878db..e1118713bff0 100644 --- a/sys/powerpc/powerpc/elf32_machdep.c +++ b/sys/powerpc/powerpc/elf32_machdep.c @@ -134,6 +134,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c index 1035e35d286e..a999f742caeb 100644 --- a/sys/powerpc/powerpc/elf64_machdep.c +++ b/sys/powerpc/powerpc/elf64_machdep.c @@ -97,6 +97,8 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), @@ -139,6 +141,8 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/powerpc/powerpc/elf_common.c b/sys/powerpc/powerpc/elf_common.c index e7960feb2c10..01a7e9febd68 100644 --- a/sys/powerpc/powerpc/elf_common.c +++ b/sys/powerpc/powerpc/elf_common.c @@ -93,6 +93,7 @@ __elfN(powerpc_copyout_auxargs)(struct image_params *imgp, uintptr_t base) AUXARGS_ENTRY(pos, AT_OLD_HWCAP, *imgp->sysent->sv_hwcap); if (imgp->sysent->sv_hwcap2 != NULL) AUXARGS_ENTRY(pos, AT_OLD_HWCAP2, *imgp->sysent->sv_hwcap2); + if (imgp->sysent->sv_hwcap3 != NULL) AUXARGS_ENTRY(pos, AT_OLD_NULL, 0); free(imgp->auxargs, M_TEMP); diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index a5e605624e1e..87460aae2dd4 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1015,8 +1015,10 @@ typedef struct { #define AT_USRSTACKBASE 35 /* Top of user stack */ #define AT_USRSTACKLIM 36 /* Grow limit of user stack */ #define AT_CHERI_STATS 37 /* Reserved */ +#define AT_HWCAP3 38 /* CPU feature flags 3. */ +#define AT_HWCAP4 39 /* CPU feature flags 4. */ -#define AT_COUNT 38 /* Count of defined aux entry types. */ +#define AT_COUNT 40 /* Count of defined aux entry types. */ /* * Relocation types. diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index dffe77de91d0..6314b03142e7 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -145,6 +145,8 @@ struct sysentvec { int (*sv_trap)(struct thread *); u_long *sv_hwcap; /* Value passed in AT_HWCAP. */ u_long *sv_hwcap2; /* Value passed in AT_HWCAP2. */ + u_long *sv_hwcap3; /* Value passed in AT_HWCAP3. */ + u_long *sv_hwcap4; /* Value passed in AT_HWCAP4. */ const char *(*sv_machine_arch)(struct proc *); vm_offset_t sv_fxrng_gen_offset; void (*sv_onexec_old)(struct thread *td); From nobody Wed Jun 25 09:25:37 2025 X-Original-To: dev-commits-src-main@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 4bRxJ24kwsz5ynGJ; Wed, 25 Jun 2025 09:25: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 4bRxJ22xCNz3Mrx; Wed, 25 Jun 2025 09:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843538; 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=137bmARJN82JxK9eYHchwg7jY+kBl0Rogg81CcUTbmo=; b=wceymGYVa4+tz2YcCuqhnbizWPeNLyxIy7jktyEcjM1kioskwdwCdPl9KFVe1JVazUBvmN 1D8hlM2tfUoWjnkzsKDdNEb40TLCafA8kNSOxaqkR+xdaNbMl6FkZoNC+MvK0F8sMASIDZ 48+f1TOQKAIgUWos1YQK78gGTj2gFSMOgAdpYWe7q4bCTTwehnck/3MG9iIOC8jmKZ2PmV AWpHQmKl5cHsDqatseP3auVgFqS8zsIv5DKipYEILWINMcgNaQnWMCmGcVh2K+gz+CCsYe 7gV/k7/OHDbSbrbr4gFiQsK2UEMpDaA1Bbc0AvRyfx2VouFzJfNh8oP4n4SRIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843538; 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=137bmARJN82JxK9eYHchwg7jY+kBl0Rogg81CcUTbmo=; b=SYXK6iu03Br8L8TaO7j5YVzEX0WANM34UZLVQh0VX6BfUo+8FnNzVGW2knJE8d6g04bpHC vQ1gDOrFcnVjNLJMdijFI/BVHz9MYXClJbbQTDuMcU4DvhfnCnxgvwxo01sxZANofS/0Jv RoUgX5XG2JVGAGPpCS1PutI1dzxEg8nFoXbTgTUFZfB4vpHwRxfBIOQiUB3+9nsv+dYzvL 1eaAoFIZkt2JXhmaHH/BQ77KKzXVgOqp9SFPbaHa1MTnXgAR79mlxewzHe+2mm4U7JEuy/ KAV46wHeSb/LCNgVg2ULP2ouEQBp5m69K5Ioyn4Gk7ebTS+uwQjX5rzc8oMm4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750843538; a=rsa-sha256; cv=none; b=NffpGzFgjk8UVNDB7gt9AO3W5tu+l4TWEpc3pcaR6bNwncSqy1jfdiosJtHWdIb62a9g7N ZF3+jsEZZBveT4dpU1ZhMjZLxljYv0rij9agOBjQrLhyZXUpgasumhmjVxbzH87bf4cPhA cPvYaD90iiwXHjd+mW0+LdpXtnwnQycj2r/+0aqitw5KbPlTctRyoCoaPA9AmPB3JgJ0/D bJ0Uus7rLgcmy2Pml2muRQagdPpS/LqFOFjfhNfPzzaYqntLKtiHaHkONnfxKCv0WzMVpY w+MPE0bLn2GzjdtIcqjkAKFrwS3W6OMgm2VpqqCYI32/2mlr9JB9yhi6ZhG6mw== 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 4bRxJ20LZdz1QN5; Wed, 25 Jun 2025 09:25: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 55P9PbCH077182; Wed, 25 Jun 2025 09:25:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P9PbXe077179; Wed, 25 Jun 2025 09:25:37 GMT (envelope-from git) Date: Wed, 25 Jun 2025 09:25:37 GMT Message-Id: <202506250925.55P9PbXe077179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: fa1c23da01e0 - main - libsys: Add AT_HWCAP3 and AT_HWCAP4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa1c23da01e07f308aa30d3cf3625d014c55ba94 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fa1c23da01e07f308aa30d3cf3625d014c55ba94 commit fa1c23da01e07f308aa30d3cf3625d014c55ba94 Author: Andrew Turner AuthorDate: 2025-06-24 14:56:54 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 16:26:40 +0000 libsys: Add AT_HWCAP3 and AT_HWCAP4 This is needed to read these values. Reviewed by: brooks, imp, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51006 --- lib/libsys/auxv.3 | 8 +++++++- lib/libsys/auxv.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/lib/libsys/auxv.3 b/lib/libsys/auxv.3 index 10ec10e8755c..b3b741937ac7 100644 --- a/lib/libsys/auxv.3 +++ b/lib/libsys/auxv.3 @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 16, 2022 +.Dd June 24, 2025 .Dt ELF_AUX_INFO 3 .Os .Sh NAME @@ -59,6 +59,12 @@ CPU / hardware feature flags .It AT_HWCAP2 CPU / hardware feature flags .Dv (sizeof(u_long)). +.It AT_HWCAP3 +CPU / hardware feature flags +.Dv (sizeof(u_long)). +.It AT_HWCAP4 +CPU / hardware feature flags +.Dv (sizeof(u_long)). .It AT_NCPUS Number of CPUs .Dv (sizeof(int)). diff --git a/lib/libsys/auxv.c b/lib/libsys/auxv.c index 1a4fd352950e..80702c66ba22 100644 --- a/lib/libsys/auxv.c +++ b/lib/libsys/auxv.c @@ -69,10 +69,10 @@ __init_elf_aux_vector(void) static int aux_once; static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags; -static int hwcap_present, hwcap2_present; +static int hwcap_present, hwcap2_present, hwcap3_present, hwcap4_present; static char *canary, *pagesizes, *execpath; static void *ps_strings, *timekeep; -static u_long hwcap, hwcap2; +static u_long hwcap, hwcap2, hwcap3, hwcap4; static void *fxrng_seed_version; static u_long usrstackbase, usrstacklim; @@ -123,6 +123,16 @@ init_aux(void) hwcap2 = (u_long)(aux->a_un.a_val); break; + case AT_HWCAP3: + hwcap3_present = 1; + hwcap3 = (u_long)(aux->a_un.a_val); + break; + + case AT_HWCAP4: + hwcap4_present = 1; + hwcap4 = (u_long)(aux->a_un.a_val); + break; + case AT_PAGESIZES: pagesizes = (char *)(aux->a_un.a_ptr); break; @@ -318,6 +328,20 @@ _elf_aux_info(int aux, void *buf, int buflen) } else res = ENOENT; break; + case AT_HWCAP3: + if (hwcap3_present && buflen == sizeof(u_long)) { + *(u_long *)buf = hwcap3; + res = 0; + } else + res = ENOENT; + break; + case AT_HWCAP4: + if (hwcap4_present && buflen == sizeof(u_long)) { + *(u_long *)buf = hwcap4; + res = 0; + } else + res = ENOENT; + break; case AT_PAGESIZES: if (pagesizes != NULL && pagesizes_len >= buflen) { memcpy(buf, pagesizes, buflen); From nobody Wed Jun 25 09:25:39 2025 X-Original-To: dev-commits-src-main@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 4bRxJ33TJtz5ymwW; Wed, 25 Jun 2025 09:25: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 4bRxJ32DRMz3MmG; Wed, 25 Jun 2025 09:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843539; 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=g2lDaPnlN13/2GjI0TNZyGx4Pauh/+HfFwxahegNbhE=; b=XQR1FQg5tBgJX/ViN/LaEtC5c8qch1Z/pJNmpKMZSUMnyPDZZ0d+ot8k7PbukArL+hZqQZ 8g9AG6HpJFr9ZA/sttkQenFzJJPwiW1lRhkeWdoucpnD2NyIWiWcFWv7VIczI+VZixsbio gS3RfJ/FCBPVaaRRN4JaMkBsOgQ9i/TFW8jdMOUfNQAqpmRcMxR+GGmgi95Vi1Ymv3Bg7M y0H9oficR3s57Pov+Tsn1DXzP46OiJt905LcsgOE8+6ipt/ALGf96GBhyBkJ81GOJN6M8Z MlhLBhtOVdRBF3NhpN7E5zI9/pA2nSl7w64NnLU9ooCwz+cJkVei/MlhBciI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843539; 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=g2lDaPnlN13/2GjI0TNZyGx4Pauh/+HfFwxahegNbhE=; b=KU9CsMkNAtY96+3PJroXKYXJ9o3cOb3k81gl3oECaswtpwD3KsnogdKgd+wUGpDKiVt1Wl 5VjdY3wfcAvKRsXuklSe1SIZmDsS0b5vHPqfcblCHhrH5QqepvAQz/e5Ttte6VwWkqkTp7 4DLTSgzdHHstGdcJ6wE8I/fxcS87tg20KucFB2roE+hLVXr02UHtZITsFmqMvaWhGLt2hn m7Qxr1dWoeRJFNwkQ194FzLf2D2YFOCpHdtaOQpo6OGQMNQ0mIXtpxiZgSxLEsHCktTini v81QTmX476JgAaHZqng9iGp5UXWImfwNEVAE+9xDBTdlC0PFtvso01EYKHPeVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750843539; a=rsa-sha256; cv=none; b=l09ohgdFjwdMsQkzdTwXVGndGq2EGPBErBQRPf9bE/NV/LXOTWkgZ+BMwOiurbcWa0m85k LzROOMo/CtSFpBu9s5wWOG/H+/Vym1dYNxfKZHHB0C5xsGRqi/yFeBdEj47cS8YpgPVfEf 9BlvG4lH+ikW/XolrUnrtpgyyKQon5q8frV3aFeLtItkD1L6pWRdJafnYbb0eTK7KlfpJ5 lJmtXJ4wSWEmCKdLwFkqrNvWjVT86QQO5GEEAt5FUrZG+ydKPSXEkB6mMeYPGT+8lHpgjW 0N7vvPGbtjTilf0OicEOlurbAdJdLdJdcjmFCdLlxpKP78v3VqASQCHLYFJcUg== 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 4bRxJ31fSHz1QQ9; Wed, 25 Jun 2025 09:25: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 55P9Pdv9077222; Wed, 25 Jun 2025 09:25:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P9PdKf077219; Wed, 25 Jun 2025 09:25:39 GMT (envelope-from git) Date: Wed, 25 Jun 2025 09:25:39 GMT Message-Id: <202506250925.55P9PdKf077219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 28fd9bceba1d - main - rtld-elf: Add Add AT_HWCAP3 and AT_HWCAP4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28fd9bceba1d6dfd6c67f78878e6ff160f48d0b7 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=28fd9bceba1d6dfd6c67f78878e6ff160f48d0b7 commit 28fd9bceba1d6dfd6c67f78878e6ff160f48d0b7 Author: Andrew Turner AuthorDate: 2025-06-24 14:57:01 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 16:26:40 +0000 rtld-elf: Add Add AT_HWCAP3 and AT_HWCAP4 Add the AT_HWCAP3 and AT_HWCAP4 format strings to auxfmt. Reviewed by: brooks, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51007 --- libexec/rtld-elf/rtld.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 625e67941be3..1459b38f3720 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6485,6 +6485,10 @@ static const struct auxfmt { AUXFMT(AT_KPRELOAD, "%p"), AUXFMT(AT_USRSTACKBASE, "%#lx"), AUXFMT(AT_USRSTACKLIM, "%#lx"), + /* AT_CHERI_STATS */ + AUXFMT(AT_HWCAP3, "%#lx"), + AUXFMT(AT_HWCAP4, "%#lx"), + }; static bool From nobody Wed Jun 25 09:25:40 2025 X-Original-To: dev-commits-src-main@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 4bRxJ44m8Pz5yn9T; Wed, 25 Jun 2025 09:25: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 4bRxJ43CJPz3MYl; Wed, 25 Jun 2025 09:25:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843540; 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=h7K+ZeQmex+RBgD075gi6C7yUAajW35KAPH2MGEH4ew=; b=tglNJ3jDsggIWYnTfYOiFOi5S6YTVP9hJOwfJw1+Z+emfpN2InVV37zdq9XmGlE/Wbu8l6 +A99yOzIojRua5PHGZL3agHuBmHk5qHCPOTM+dDKxeWMvoaAAbu+jazgJ8p0698WDzh6Sr vgPZCZA3Br+nacL3TrkeK3GglhqG5JqYlLFVGZF92hEBe4mkIPrkx/M37rSbubkCguKvO/ 0M6R3gIENelJhNj4bPkbWkIyeWRS2pFcF+PKqhDwuzuNRdJckvi7KRsCG3uEd/VP9c/Muc Z5dQSiBKCA82WdrgOjqWrHob1l7TOhGIVqLoXrR6jCrIuife7frq/B34BtSwEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843540; 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=h7K+ZeQmex+RBgD075gi6C7yUAajW35KAPH2MGEH4ew=; b=TvS/il/e0EudLx0BwTn0b+4Yn5h1J7aZd2dfb23hzaYktA5EWw3A7WNBs06Ug+q3dhJvDk JX/gSz2VRevaHM0NKcxoyPie9bYjnOGxvdShzqsDs5DWL2EwcMThJxIDssLU7q6P9n0rEP 1ajc1Kb1JsqVZYPdFeQ730Wex+qeifBR8qbTSzXvIhQrRmsWxS3bw8HPd7wYA21fYluR/N 31B+VRvyysKwOJzD+O79TGB5ImY4dBl/EqhBEQhFP1S452sXroedXCI4dQ03LQrSK3KgUQ VFLllfJDmWr66nfia2kUz3vBa/c/1rsgbv9G4bwr0Dz3mzRjQPfOJeoPBluAxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750843540; a=rsa-sha256; cv=none; b=u0RF6ePAhD4tf8qqefbYlnjBGyI8jSEK+pioLYwNXk2AZD3RtXBQMGq6/Ik5dUQHc17L7E Z8euR7MBmujZXxyiAklHyRtiPy8BlP2e+JKrZ+rMeIKYEnOC3HV1BwNCb4izG5TRaJ++3S sSvfFOhoMV3KFXGfkmBrsojH+KYCCuyTR+676p/UJP70q7BMbxXwQUfmJ0Lbb66tcrEqt9 xkApITg+2YlsXNZfJtrNDq8Q6UMFwIkEieLhqr8EFe1m63xyOTRdq1TMZxmMdKwcOXDLjy u1GVRuBjJV5aotpXPilU12mxN8v3rkhbNFXgI7J1IpDZol/RYy4FBc3kwUskgA== 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 4bRxJ42X8xz1QBx; Wed, 25 Jun 2025 09:25: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 55P9PeRf077261; Wed, 25 Jun 2025 09:25:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P9PeMI077257; Wed, 25 Jun 2025 09:25:40 GMT (envelope-from git) Date: Wed, 25 Jun 2025 09:25:40 GMT Message-Id: <202506250925.55P9PeMI077257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: fc04d82226e5 - main - arm64: Add AT_HWCAP3 and AT_HWCAP4 support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc04d82226e5844fcf57d681b711e47e38b5f7c4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fc04d82226e5844fcf57d681b711e47e38b5f7c4 commit fc04d82226e5844fcf57d681b711e47e38b5f7c4 Author: Andrew Turner AuthorDate: 2025-06-24 14:57:08 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 16:26:40 +0000 arm64: Add AT_HWCAP3 and AT_HWCAP4 support The adds the parts needed to export the new AT_HWCAP3 and 4 from the kernel. Reviewed by: brooks, imp, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51008 --- sys/arm64/arm64/elf_machdep.c | 8 ++++++-- sys/arm64/include/md_var.h | 4 ++++ sys/arm64/linux/linux.h | 2 +- sys/arm64/linux/linux_sysvec.c | 6 ++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index 6ca8a711839f..970dba0ca7d9 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -57,9 +57,13 @@ u_long __read_frequently elf_hwcap; u_long __read_frequently elf_hwcap2; +u_long __read_frequently elf_hwcap3; +u_long __read_frequently elf_hwcap4; /* TODO: Move to a better location */ u_long __read_frequently linux_elf_hwcap; u_long __read_frequently linux_elf_hwcap2; +u_long __read_frequently linux_elf_hwcap3; +u_long __read_frequently linux_elf_hwcap4; struct arm64_addr_mask elf64_addr_mask; @@ -101,8 +105,8 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, - .sv_hwcap3 = NULL, - .sv_hwcap4 = NULL, + .sv_hwcap3 = &elf_hwcap3, + .sv_hwcap4 = &elf_hwcap4, .sv_onexec_old = exec_onexec_old, .sv_protect = arm64_exec_protect, .sv_onexit = exit_onexit, diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index f9aaaeba7306..da136ff091db 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -37,8 +37,12 @@ extern char sigcode[]; extern int szsigcode; extern u_long elf_hwcap; extern u_long elf_hwcap2; +extern u_long elf_hwcap3; +extern u_long elf_hwcap4; extern u_long linux_elf_hwcap; extern u_long linux_elf_hwcap2; +extern u_long linux_elf_hwcap3; +extern u_long linux_elf_hwcap4; #ifdef COMPAT_FREEBSD32 extern u_long elf32_hwcap; extern u_long elf32_hwcap2; diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index d612ba8e5d9e..00a70fabc54f 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -77,7 +77,7 @@ typedef struct { #define l_fd_set fd_set /* Miscellaneous */ -#define LINUX_AT_COUNT 21 /* Count of used aux entry types. +#define LINUX_AT_COUNT 23 /* Count of used aux entry types. * Keep this synchronized with * linux_copyout_auxargs() code. */ diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 13c42e061094..084b7a11b01f 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -156,6 +156,8 @@ linux64_arch_copyout_auxargs(struct image_params *imgp, Elf_Auxinfo **pos) AUXARGS_ENTRY((*pos), LINUX_AT_SYSINFO_EHDR, linux_vdso_base); AUXARGS_ENTRY((*pos), LINUX_AT_HWCAP, *imgp->sysent->sv_hwcap); AUXARGS_ENTRY((*pos), LINUX_AT_HWCAP2, *imgp->sysent->sv_hwcap2); + AUXARGS_ENTRY((*pos), LINUX_AT_HWCAP3, *imgp->sysent->sv_hwcap3); + AUXARGS_ENTRY((*pos), LINUX_AT_HWCAP4, *imgp->sysent->sv_hwcap4); AUXARGS_ENTRY((*pos), LINUX_AT_PLATFORM, PTROUT(linux_platform)); } @@ -458,8 +460,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = &linux_elf_hwcap, .sv_hwcap2 = &linux_elf_hwcap2, - .sv_hwcap3 = NULL, - .sv_hwcap4 = NULL, + .sv_hwcap3 = &linux_elf_hwcap3, + .sv_hwcap4 = &linux_elf_hwcap4, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, From nobody Wed Jun 25 09:57:02 2025 X-Original-To: dev-commits-src-main@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 4bRy0W74TWz5ypnT; Wed, 25 Jun 2025 09:57:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bRy0W3H8Sz3YLq; Wed, 25 Jun 2025 09:57:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 55P9v2PL042810; Wed, 25 Jun 2025 12:57:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55P9v2PL042810 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55P9v230042809; Wed, 25 Jun 2025 12:57:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jun 2025 12:57:02 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 350ba9672a7f - main - unix: Set O_RESOLVE_BENEATH on fds transferred between jails Message-ID: References: <202506242104.55OL4ZxO085239@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506242104.55OL4ZxO085239@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bRy0W3H8Sz3YLq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jun 24, 2025 at 09:04:35PM +0000, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=350ba9672a7f4f16e30534a603df577dfd083b3f > > commit 350ba9672a7f4f16e30534a603df577dfd083b3f > Author: Mark Johnston > AuthorDate: 2025-06-24 20:05:37 +0000 > Commit: Mark Johnston > CommitDate: 2025-06-24 21:04:24 +0000 > > unix: Set O_RESOLVE_BENEATH on fds transferred between jails > > If a pair of jails with different filesystem roots is able to exchange > SCM_RIGHTS messages (e.g., using a unix socket in a shared nullfs > mount), a process in one jail can open a directory outside of the root > of the second jail and then pass the fd to that second jail, allowing > the receiving process to escape the jail chroot. > > Address this using the new FD_RESOLVE_BENEATH flag. When externalizing > an SCM_RIGHTS message into the receiving process, automatically set this > flag on all new fds where a jail boundary is crossed. This ensures that > the receiver cannot do more than access files underneath the directory; > in particular, the received fd cannot be used to access vnodes not > accessible by the sender. > > PR: 262179 > Reviewed by: kib > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D50371 > --- > sys/amd64/conf/SYZKALLER | 5 +++++ > sys/kern/uipc_usrreq.c | 31 +++++++++++++++++++++++-------- > 2 files changed, 28 insertions(+), 8 deletions(-) > > diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER > new file mode 100644 > index 000000000000..965841313616 > --- /dev/null > +++ b/sys/amd64/conf/SYZKALLER > @@ -0,0 +1,5 @@ > +include GENERIC-KASAN > +ident SYZKALLER > + > +options COVERAGE > +options KCOV Was this config intended for the commit? From nobody Wed Jun 25 10:12:29 2025 X-Original-To: dev-commits-src-main@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 4bRyL60ZxKz5yqd1; Wed, 25 Jun 2025 10:12: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 4bRyL56xy4z3cmV; Wed, 25 Jun 2025 10:12:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750846350; 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=poZByz2sOkC/UUe53ZvPXEYKLZx60oSMS6JZlwFEzHQ=; b=DFhGWmkWOdAAQ+E0eHFzRoMmfIvFMDZDx7f36Hl0af16dDU7msh/XeULbDz5rbueYZusrx Z+5NiWaGfymKI0lu3ImBfceHlpPYM1UcBMUzJz0+0GIes7sdcnM15DW2bsAz8f3dsscO5/ cpy1WzjaaVY3cK+J06uvSLk2I3V1Ezu3gRuFV+50mDCOcdKJ1XLokcYB7tYTAZziCYEt9e K0lL249uFVlH87ogHKKmGLWnJNJD5I6G2Uj2sAoc1x6WWjw2+WJO7mlGF5BuMy9CJ7mRfP UnApwlEpRc98DxvQSG+5ohyh/POJbYnUR46OzJRPPZM40eymOJ6NNDhjOeAwjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750846350; 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=poZByz2sOkC/UUe53ZvPXEYKLZx60oSMS6JZlwFEzHQ=; b=w5JXSn2baTeAfI8ZksFcNq6nU9tevnUpNHsirw73NwwSaIH2mltGGNl1tiVyPZJ3JY2VlA chdfhY/RPINgcb0rdz+fdXU6PUQXqc+YAsY+RilUu+q2WTO5s7+hNJO/kmHcL1JljhioKN cN+LDHVzHhV1EzZ4+XsVJNvzpn5ypEgz0SI6d7k2MN+el4rB4RadOxZ3hbh77jN83hSsav bQDhDRwWbJyjN3NbfPicyhvT/u2bWwul9bwNR1OG2GojZMMr4AOhNxkRkmtPXQQ6pr96k8 c+KpWh1EAB0eKos64WTFqU2de8zt2eMkr8sGPJYMY8psFxHQ4QT+K/hdL+q0pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750846350; a=rsa-sha256; cv=none; b=UpuNY/DUxxcn72ZCIKZME5hBHlBcwbCeqn4T36R6cyJi4/X5VT+/OfpsENHI7YPkOZwaZa /z1iNOXcPqOTh6VWBmK3v3p1NfjdJ+Ny6FOVKKyrlnsysCb5HLldZs0mFCuZUPmOfP70iu OIEuGWolmyys5jyW30WcErVBoZvb2V63sZMrrhkcWzhx0sGwTrUss/J3Wtxvhij2jvg101 zbfsKEsaZh6zQ/lcw3mKe6TTYj3GloiMwSUXqSZA2rGgWd6zOo2x7ho+ElhVI2N6ViYyl0 KNBxYL56xf2m7hSxTSpExEEflO+Y/IvvvJ3GdjbxUx4LCF/T5g/Qyskcv81bWw== 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 4bRyL56Jzgz1RtF; Wed, 25 Jun 2025 10:12: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 55PACTWZ069989; Wed, 25 Jun 2025 10:12:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PACTxE069986; Wed, 25 Jun 2025 10:12:29 GMT (envelope-from git) Date: Wed, 25 Jun 2025 10:12:29 GMT Message-Id: <202506251012.55PACTxE069986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d86c5811cdb3 - main - ng_ksocket: Add tests for IPv6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: d86c5811cdb384b3ba565187f8dc7e7e51b6466e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d86c5811cdb384b3ba565187f8dc7e7e51b6466e commit d86c5811cdb384b3ba565187f8dc7e7e51b6466e Author: Seyed Pouria Mousavizadeh Tehrani AuthorDate: 2025-06-25 07:31:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-25 10:12:11 +0000 ng_ksocket: Add tests for IPv6 Add udp6_connect and udp6_bind for ng_ksocket Differential Revision: https://reviews.freebsd.org/D50111 --- tests/sys/netgraph/ksocket.c | 86 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 12 deletions(-) diff --git a/tests/sys/netgraph/ksocket.c b/tests/sys/netgraph/ksocket.c index d3ea5ca2876e..a60c17bd337f 100644 --- a/tests/sys/netgraph/ksocket.c +++ b/tests/sys/netgraph/ksocket.c @@ -50,23 +50,23 @@ hellocheck(int wr, int rd) ATF_TC_WITHOUT_HEAD(udp_connect); ATF_TC_BODY(udp_connect, tc) { + struct ngm_mkpeer mkp = { + .type = NG_KSOCKET_NODE_TYPE, + .ourhook = OURHOOK, + .peerhook = "inet/dgram/udp", + }; struct sockaddr_in sin = { .sin_family = AF_INET, .sin_addr.s_addr = htonl(INADDR_LOOPBACK), .sin_len = sizeof(sin), }; socklen_t slen = sizeof(sin); - int ds, cs, us; + int cs, ds, us; ATF_REQUIRE((us = socket(PF_INET, SOCK_DGRAM, 0)) > 0); ATF_REQUIRE(bind(us, (struct sockaddr *)&sin, sizeof(sin)) == 0); ATF_REQUIRE(getsockname(us, (struct sockaddr *)&sin, &slen) == 0); - struct ngm_mkpeer mkp = { - .type = NG_KSOCKET_NODE_TYPE, - .ourhook = OURHOOK, - .peerhook = "inet/dgram/udp", - }; ATF_REQUIRE(NgMkSockNode(NULL, &cs, &ds) == 0); ATF_REQUIRE(NgSendMsg(cs, ".", NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, sizeof(mkp)) >= 0); @@ -79,19 +79,19 @@ ATF_TC_BODY(udp_connect, tc) ATF_TC_WITHOUT_HEAD(udp_bind); ATF_TC_BODY(udp_bind, tc) { + struct ngm_mkpeer mkp = { + .type = NG_KSOCKET_NODE_TYPE, + .ourhook = OURHOOK, + .peerhook = "inet/dgram/udp", + }; struct sockaddr_in sin = { .sin_family = AF_INET, .sin_addr.s_addr = htonl(INADDR_LOOPBACK), .sin_len = sizeof(sin), }; struct ng_mesg *rep; - int ds, cs, us; + int cs, ds, us; - struct ngm_mkpeer mkp = { - .type = NG_KSOCKET_NODE_TYPE, - .ourhook = OURHOOK, - .peerhook = "inet/dgram/udp", - }; ATF_REQUIRE(NgMkSockNode(NULL, &cs, &ds) == 0); ATF_REQUIRE(NgSendMsg(cs, ".", NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, sizeof(mkp)) >= 0); @@ -109,10 +109,72 @@ ATF_TC_BODY(udp_bind, tc) hellocheck(us, ds); } +ATF_TC_WITHOUT_HEAD(udp6_connect); +ATF_TC_BODY(udp6_connect, tc) +{ + struct ngm_mkpeer mkp = { + .type = NG_KSOCKET_NODE_TYPE, + .ourhook = OURHOOK, + .peerhook = "inet6/dgram/udp6", + }; + struct sockaddr_in6 sin6 = { + .sin6_family = AF_INET6, + }; + socklen_t slen = sizeof(sin6); + int cs, ds, us; + + ATF_REQUIRE((us = socket(PF_INET6, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE(bind(us, (struct sockaddr *)&sin6, sizeof(sin6)) == 0); + ATF_REQUIRE(getsockname(us, (struct sockaddr *)&sin6, &slen) == 0); + + ATF_REQUIRE(NgMkSockNode(NULL, &cs, &ds) == 0); + ATF_REQUIRE(NgSendMsg(cs, ".", NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, + sizeof(mkp)) >= 0); + ATF_REQUIRE(NgSendMsg(cs, ".:" OURHOOK, NGM_KSOCKET_COOKIE, + NGM_KSOCKET_CONNECT, &sin6, sizeof(sin6)) >= 0); + + hellocheck(ds, us); +} + + +ATF_TC_WITHOUT_HEAD(udp6_bind); +ATF_TC_BODY(udp6_bind, tc) +{ + struct ngm_mkpeer mkp = { + .type = NG_KSOCKET_NODE_TYPE, + .ourhook = OURHOOK, + .peerhook = "inet6/dgram/udp6", + }; + struct sockaddr_in6 sin6 = { + .sin6_family = AF_INET6, + .sin6_len = sizeof(sin6), + }; + struct ng_mesg *rep; + int cs, ds, us; + + ATF_REQUIRE(NgMkSockNode(NULL, &cs, &ds) == 0); + ATF_REQUIRE(NgSendMsg(cs, ".", NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, + sizeof(mkp)) >= 0); + ATF_REQUIRE(NgSendMsg(cs, ".:" OURHOOK, NGM_KSOCKET_COOKIE, + NGM_KSOCKET_BIND, &sin6, sizeof(sin6)) >= 0); + ATF_REQUIRE(NgSendMsg(cs, ".:" OURHOOK, NGM_KSOCKET_COOKIE, + NGM_KSOCKET_GETNAME, NULL, 0) >= 0); + ATF_REQUIRE(NgAllocRecvMsg(cs, &rep, NULL) == sizeof(struct ng_mesg) + + sizeof(struct sockaddr_in6)); + + ATF_REQUIRE((us = socket(PF_INET6, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE(connect(us, (struct sockaddr *)rep->data, + sizeof(struct sockaddr_in6)) == 0); + + hellocheck(us, ds); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, udp_connect); ATF_TP_ADD_TC(tp, udp_bind); + ATF_TP_ADD_TC(tp, udp6_connect); + ATF_TP_ADD_TC(tp, udp6_bind); return (atf_no_error()); } From nobody Wed Jun 25 08:56:59 2025 X-Original-To: dev-commits-src-main@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 4bRzTR1ZHvz5ytQh; Wed, 25 Jun 2025 11:03:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRzTR0hF3z43dn; Wed, 25 Jun 2025 11:03:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750849435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=izMZZHuW5MSf9p3NNMii9IrVn3rnB+C2dQ12HO2dQH8=; b=RIN12ODR6SYyFHLbkfTFlCY3xt/nBi7uHEsV5avNONamCVXC2xTSeQ7pCYCYf02/L3GBkN HszV+LFRrZZQ509DMlTv6fWuT5MBnIMax3Pn2LpkqYibcjyqjwskdZ1XBj4dPp0eUL+qx4 isFKsfXDKjLp8NAlUVwZf0HJas1tSxTRKgtitFrecLZwD06dQCKMVECRJvmZdLw1eumIbs P1j0Qf29C5YRz+f6TTHyLWQgcsEebRH51Vpoe0nTRkuJ1KMuofdwYr4FhrY3FoJQX2JKl/ Ea2ncOmUMHyXSSpLakUIs7clEURmuwsauN90sPvxNZ6hm3/cjtf/8fzIh9l9lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750849435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=izMZZHuW5MSf9p3NNMii9IrVn3rnB+C2dQ12HO2dQH8=; b=nV3ZeRdDcygytx/hgXzVLFTvf4+M7IorWSKdh0Pb98nfIz1jxAkPQnf0Z4HXqdO6j5LhvU KW+lrDNyMcgm4aPWmQtZaUCVvA3Hl1bjx5+z7FGXU11nUuzEz17EP5F/yRYCfWsFDygete fw4GQibqcMu0QKzFOZ1leeWxjBuHWHfQAqRSPg8n9uzZLF8PwhOHMPQ0/jU/144BFvTcp8 iAexWFYABe8TXRgMyK8i1FwyW39cnyddUBY0zApuW/n6ZXngQ8lPqDdldZubD+AcS042cX N1RTvAoIHAEPD1pKzkEOiwXypiJ8KE33krdaXZ2I38yk6PepxyL7Z6lFNpGOuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750849435; a=rsa-sha256; cv=none; b=aHP0GbobSZEfp98txp30cHHNVDCg93Y0QQ2xuR5GBoJ6XWGSJzdpCM87aGG8w3PH2oJxrz zoxq72cT/n4YRCKAzy8F28XJzjKPnCa585qDVDye4R+CkjtK9XE4sXtKCGiRO7aWmI4XjL WEVeH1lM2kze3BING9lpJe4mEAAxpWGASunUYOdeCaWW/CvqrNVTevhixGx46RbvG36V7x HSU3hLdGeWZ6/eqaovTdBwE5yvS7Op7qy8QSqG/dK6QXAQZa6zSBhbuEwlTXh5AGU9c+jw LbyQ0d3wZH07V2Q2iuM6qpUQqb90k6r8G2/f6XBWuFJupJqS2w/bx73DRnsiRw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bRzTQ5tzWz1BdT; Wed, 25 Jun 2025 11:03:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id C489D50E94; Wed, 25 Jun 2025 10:57:01 +0200 (CEST) From: Kristof Provost To: Mark Johnston Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 350ba9672a7f - main - unix: Set O_RESOLVE_BENEATH on fds transferred between jails Date: Wed, 25 Jun 2025 10:56:59 +0200 X-Mailer: MailMate (2.0r6255) Message-ID: <814CBB43-4B0A-41A3-9F4D-84CA3E39A2DC@FreeBSD.org> In-Reply-To: <202506242104.55OL4ZxO085239@gitrepo.freebsd.org> References: <202506242104.55OL4ZxO085239@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_8BC08770-8A9C-4198-9262-DCD7D3FE3450_=" --=_MailMate_8BC08770-8A9C-4198-9262-DCD7D3FE3450_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 24 Jun 2025, at 23:04, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D350ba9672a7f4f16e30534a603df5= 77dfd083b3f > > commit 350ba9672a7f4f16e30534a603df577dfd083b3f > Author: Mark Johnston > AuthorDate: 2025-06-24 20:05:37 +0000 > Commit: Mark Johnston > CommitDate: 2025-06-24 21:04:24 +0000 > > unix: Set O_RESOLVE_BENEATH on fds transferred between jails > > If a pair of jails with different filesystem roots is able to = > exchange > SCM_RIGHTS messages (e.g., using a unix socket in a shared nullfs > mount), a process in one jail can open a directory outside of the = > root > of the second jail and then pass the fd to that second jail, = > allowing > the receiving process to escape the jail chroot. > > Address this using the new FD_RESOLVE_BENEATH flag. When = > externalizing > an SCM_RIGHTS message into the receiving process, automatically = > set this > flag on all new fds where a jail boundary is crossed. This = > ensures that > the receiver cannot do more than access files underneath the = > directory; > in particular, the received fd cannot be used to access vnodes not > accessible by the sender. > > PR: 262179 > Reviewed by: kib > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D50371 > --- > sys/amd64/conf/SYZKALLER | 5 +++++ > sys/kern/uipc_usrreq.c | 31 +++++++++++++++++++++++-------- > 2 files changed, 28 insertions(+), 8 deletions(-) > > diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER > new file mode 100644 > index 000000000000..965841313616 > --- /dev/null > +++ b/sys/amd64/conf/SYZKALLER > @@ -0,0 +1,5 @@ > +include GENERIC-KASAN > +ident SYZKALLER > + > +options COVERAGE > +options KCOV I think you didn=E2=80=99t intend to include this bit. (Although perhaps = it = should be committed in its own commit.) =E2=80=94 Kristof --=_MailMate_8BC08770-8A9C-4198-9262-DCD7D3FE3450_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 24 Jun 2025, at 23:04, Mark Johnston wrote:

The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3D350ba9672a7f4f16e30534a603df577dfd083b3f

commit 350ba9672a7f4f16e30534a603df577dfd083b3f
Author: Mark Johnston markj@Free= BSD.org
AuthorDate: 2025-06-24 20:05:37 +0000
Commit: Mark Johnston markj@Free= BSD.org
CommitDate: 2025-06-24 21:04:24 +0000

un=
ix: Set O_RESOLVE_BENEATH on fds transferred between jails

If a pair of jails with different filesystem roots is able to exchange
SCM_RIGHTS messages (e.g., using a unix socket in a shared nullfs
mount), a process in one jail can open a directory outside of the root
of the second jail and then pass the fd to that second jail, allowing
the receiving process to escape the jail chroot.

Address this using the new FD_RESOLVE_BENEATH flag.  When externalizing
an SCM_RIGHTS message into the receiving process, automatically set this
flag on all new fds where a jail boundary is crossed.  This ensures that
the receiver cannot do more than access files underneath the directory;
in particular, the received fd cannot be used to access vnodes not
accessible by the sender.

PR:             262179
Reviewed by:    kib
MFC after:      3 weeks
Differential Revision:  https://reviews.freebsd.org/D50371

sys/amd64/conf/SYZKALLER | 5 +++++
sys/kern/uipc_usrreq.c | 31 +++++++++++++++++++++++--------
2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SY= ZKALLER
new file mode 100644
index 000000000000..965841313616
--- /dev/null
+++ b/sys/amd64/conf/SYZKALLER
@@ -0,0 +1,5 @@
+include GENERIC-KASAN
+ident SYZKALLER
+
+options COVERAGE
+options KCOV

I think you didn=E2=80=99t intend to include this bit. (A= lthough perhaps it should be committed in its own commit.)

=E2=80=94
Kristof

--=_MailMate_8BC08770-8A9C-4198-9262-DCD7D3FE3450_=-- From nobody Wed Jun 25 11:22:50 2025 X-Original-To: dev-commits-src-main@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 4bRzvG4kFGz5yvXC; Wed, 25 Jun 2025 11:22: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 4bRzvG31fLz3DKX; Wed, 25 Jun 2025 11:22:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750850570; 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=C20MHsiXtPlR4g6YEUg0mDtfpwnYSKsLocP1qv0t3dc=; b=iKU5fU5R0Quz2E1XnDvDfcI0JR7SglyHsvnvfFoKqhxToVQhjE1+jl+DsBpUYq79M8k88o zafN7C4+UbO0WPandQvKHL5bnIgRzu/838aGVq4vqzwwUaMPVKRG6KkBrH0VNt2DM6FDZF fvq4ztMSU70YDSIHqd0aSJMS9dmP4OIGM2giPCdz3jp2nMKSq5h4JWV8pxeVEQcmA1aGhZ kRk9KAI7mEFGcaGvWx50hepmFI7ocQwOipICh/qFmSSlG6UlQo184Vz7G4LlghuWFTjCF7 JmWGY3zWcgNdKhegSFzNAtCrzmosktV9wCRi9gWcICPOn/oL89yEth1hCovoEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750850570; 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=C20MHsiXtPlR4g6YEUg0mDtfpwnYSKsLocP1qv0t3dc=; b=S57zn5+YYvyLy59glUSdZBUSq4Mu/YSBQy3MrVpiFCvbQ8QqM24fylb4aLEg7k+9WSNtzU xmleS88H/v4doQBeheszXUyB6ZxGar8VtQlO6yJ8O3w3RDdDUtlrYLpOfD4FZv4AXm4y6Y Vu5sCA2PLmxUCfZPN+1Ucj+3YQZcunsB1dJkodkUrs7LJXphiphmfqibNbTfj4frAZowYw pbiViX3/EA6ILKzCYZNkGCSECpMatXTQQEd7Ga5ZyCw11vdy0z/EqvBSaStojmLayBbjTn 2c0jm+pOpY+dEfX09CNswdIxpNuY6JY3t2pmAdYrwT7tu7V8+Z0COUDu9iQJhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750850570; a=rsa-sha256; cv=none; b=bisrZ+dnzruiAERCQJb6ftm1+pSmJgMNS62CzXhrkcSnbZCwfjx9VXUy8g406hUK2Po8NF FhH+Mg012a41S+c2/elgKblwzONeE1yOoYgbwkKz0j15r5/XqBYjNoUO4gm55BVCrs8eul nvK5Rvz1uwlIIN81Cjc0i1VL6skFIzcErGP+OHiDqK3IWm1z1xEI48KW3LXMscus3yd2hC Dq0oUpfeA+ymcOMZHUXiVzAKc8MZRSdROozx11IJNErdYRknA2Ab2sXwym64U1b+uE307z Y0qsY+H5iic+FPgLiPNDbsNSRidxUDiLAUDF3bjiEanT9avG09SO61W85tj3EA== 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 4bRzvG2ccfzsn; Wed, 25 Jun 2025 11:22: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 55PBMocn001270; Wed, 25 Jun 2025 11:22:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PBMoXw001267; Wed, 25 Jun 2025 11:22:50 GMT (envelope-from git) Date: Wed, 25 Jun 2025 11:22:50 GMT Message-Id: <202506251122.55PBMoXw001267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4e17c5fc501d - main - dev/psci: Use an SMCCC return value List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e17c5fc501d23a444f061fb1b07529ceed68790 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4e17c5fc501d23a444f061fb1b07529ceed68790 commit 4e17c5fc501d23a444f061fb1b07529ceed68790 Author: Andrew Turner AuthorDate: 2025-06-24 16:46:54 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 17:45:41 +0000 dev/psci: Use an SMCCC return value Switch to the SMCCC not supported macro in smccc_arch_features. This shouldn't be a functional change as the value is identical to the PSCI value it replaces. Reviewed by: bz, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50977 --- sys/dev/psci/smccc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/psci/smccc.c b/sys/dev/psci/smccc.c index 8e43401338e2..e40a60336d98 100644 --- a/sys/dev/psci/smccc.c +++ b/sys/dev/psci/smccc.c @@ -108,7 +108,7 @@ smccc_arch_features(uint32_t smccc_func_id) MPASS(smccc_version != 0); if (smccc_version == SMCCC_VERSION_1_0) - return (PSCI_RETVAL_NOT_SUPPORTED); + return (SMCCC_RET_NOT_SUPPORTED); return (arm_smccc_invoke(SMCCC_ARCH_FEATURES, smccc_func_id, NULL)); } From nobody Wed Jun 25 11:22:51 2025 X-Original-To: dev-commits-src-main@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 4bRzvJ4lTZz5yvF4; Wed, 25 Jun 2025 11:22: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 4bRzvH3VC7z3DKb; Wed, 25 Jun 2025 11:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750850571; 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=CpWv6fkpxMceEx37KZxVCd5d5pjb5rvgBUVg3FWlsJE=; b=Ve/zvjyaeZ+sdokUvI9MaQlU7lqIKvpLq/PxcqllaRL6Aa+djTbJFCACmJ9Ogbes1kIYkg mBiOzwxiQgcVFQOA4bR+BaI2WK+1/KK8syiSdIw090vRL9f+WINFIhntwCYvJaQvXI1O9o 9RI1bknUl4cKnNi64rZtKrDNhZcfRDQBrD5pw4gK59wjoM78JTzo/wrn62oH9H3C4YFLM7 ZqcC4Zb34V48NnVX9Sl1EXiQge/JoYB6T6a1UO8mmx0CreWj1g0q2S7Xt1zY3d8VYi0R21 0Yfp5Tti+P/2CNW+SE4HlU57t3ejSuMoGK6q7LYSJw9T6POC5okwALb4yPbm5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750850571; 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=CpWv6fkpxMceEx37KZxVCd5d5pjb5rvgBUVg3FWlsJE=; b=sC2Txq7y6Wy1t3DZDceMsKM6g8ldEDuoxccH894e0n87jqTiKaXS49l34U0/99sJV5Q63V 4LRUPbADinLUlZJiaMarVtaYfybNvAwQY9E35VWXk8vQrDZ4Vy6yGyu29JsUXE1f8wT8N1 2k5K9cPe76I3BWBtBaqQj1MSEQfdSMF5Y6dcTUBFy+LzMDvWPx+eca6oa/XCNndU7nLLeg rHXKCBbN+JUrtmi3PrASRrAAB2+g1kr2YyOCz3KEDsSFKy8Tk4knS+epBG19XLFQTMk1wF CH+BGUB/lURIO+kBYcxo0zTMZYvaTwxKpY08p8u68MShsgjLLpYIpc7KfeUqBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750850571; a=rsa-sha256; cv=none; b=YpTvH0rQ95y9AIByeaYubMX+e8juz6Ikq2Wc6hrtcrze3ve42RNw9MPDX/qQUi1yC1M1r6 hJSSNZAzKtuw4rwQC8FsiKCQeIMRk+K9IvGLKZoAEIW0QMJnsNxP4FYV7C6pb207zsAAEA rJ6+wQC5g8wN5aSzE+5Yfasg7MZ7ov/u90+jybAS4Gm7vjoLCjqq5RAet7DrVkNzrSZNad wM6eEjLuavju7kuuqYxcrGdUFZyRWAImWVfVCcqXXQRa8eQSih0CmveB5LveH+8ewBF3Gn Tl9V+QKonNyyblhCdkCT3AT2UTKdz4xdE9daWZ2dINM9R34WwuQqb95YtQd5Uw== 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 4bRzvH362pz16Q; Wed, 25 Jun 2025 11:22: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 55PBMpmw001309; Wed, 25 Jun 2025 11:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PBMpWP001305; Wed, 25 Jun 2025 11:22:51 GMT (envelope-from git) Date: Wed, 25 Jun 2025 11:22:51 GMT Message-Id: <202506251122.55PBMpWP001305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 288ba78edcfd - main - dev/psci: Check for functions before calling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 288ba78edcfd82b4b558a46fae78e4076acbe200 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=288ba78edcfd82b4b558a46fae78e4076acbe200 commit 288ba78edcfd82b4b558a46fae78e4076acbe200 Author: Andrew Turner AuthorDate: 2025-06-24 16:47:28 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 17:45:42 +0000 dev/psci: Check for functions before calling In the SMCCC TRNG and Errata ABI drivers check if the version functions are implemented before calling them. Without this the firmware may complain about an unimplemented function being called. Reported by: bz Reviewed by: bz Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50978 --- sys/dev/psci/smccc_errata.c | 3 ++- sys/dev/psci/smccc_trng.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/psci/smccc_errata.c b/sys/dev/psci/smccc_errata.c index 92f39c72c7f0..ebfc0f8b67ee 100644 --- a/sys/dev/psci/smccc_errata.c +++ b/sys/dev/psci/smccc_errata.c @@ -70,7 +70,8 @@ errata_identify(driver_t *driver, device_t parent) { int32_t version; - if (smccc_get_version() < SMCCC_MAKE_VERSION(1, 1)) + /* Check if Errata ABI is supported */ + if (smccc_arch_features(EM_VERSION) != SMCCC_RET_SUCCESS) return; /* Check we have Errata 1.0 or later */ diff --git a/sys/dev/psci/smccc_trng.c b/sys/dev/psci/smccc_trng.c index 5f54d8adc24a..bf8c95a81c83 100644 --- a/sys/dev/psci/smccc_trng.c +++ b/sys/dev/psci/smccc_trng.c @@ -69,8 +69,8 @@ trng_identify(driver_t *driver, device_t parent) { int32_t version; - /* TRNG depends on SMCCC 1.1 (per the spec) */ - if (smccc_get_version() < SMCCC_MAKE_VERSION(1, 1)) + /* Check if TRNG is supported */ + if (smccc_arch_features(TRNG_VERSION) != SMCCC_RET_SUCCESS) return; /* Check we have TRNG 1.0 or later */ From nobody Wed Jun 25 11:22:52 2025 X-Original-To: dev-commits-src-main@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 4bRzvK1bxpz5yvfG; Wed, 25 Jun 2025 11:22: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 4bRzvJ4KDJz3DQp; Wed, 25 Jun 2025 11:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750850572; 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=C5kf2xsjnUkKYG2FgVxH8Rwq+je+EVtdBe/gpX3f0ck=; b=dgnuTT654b4bFA3/tGIWit9PsJ1N+RD00pLXv/H5Wb1Q8U0BfnjHzXsNxHnqhkSkL6yRrM poOOQtk/fXSl/IJB+CRaYpidFkI5d6pqUO1mB1uUKeTHO8fttqxp0L5Vqbc3mv0UoPZCDm NtjT8IZu+iBUrWzPvxWrN4OG70qL99INPUted4w6wtTS+VdbRLtWq1iEoAbe5f1q18hO1a 7Eg3WKLQB1B8n5qMHx8O9jUuuVMC6BiNCKgQyQrpr+FqqlGZwFJceNi6/dpi4tXmlz8/Ni zfRBdXaQ3YS52EQnrUEulSRAO0rXw2tLtZ8Xmz8TF01v4G1bEpYddpmuaRI5+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750850572; 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=C5kf2xsjnUkKYG2FgVxH8Rwq+je+EVtdBe/gpX3f0ck=; b=ZstMzkZsHfKbOYNYoPHNhyv+1m7wYYLus193xp6cANSoxr+TSoqdsbr8xXOYuNl0U8MQj3 6sUK4gKzG9mAo/TSzG3Lazfx8T4j8ye776av+zTUtM5Yip3D6QQOLoVQqyY3nv3Ptv65+v zirBDmyHs8m8wUoLwfCH+H2LqhlOcsu/mNAdey5cTc/03Ezzh5I/y4ahcEuApNlUnF3SJF EneD0l9q9g/y1SlTlRhuijJfy2fJiLsP+k32Hav1VVbXYyxszMAg0fGtT5ENiARfgfy2ak NBH2+FbJpJdpdRwAMStQ7VuZxpirPAFE/25n+y9gxx/QkEnTEuWVd/nbCPZpSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750850572; a=rsa-sha256; cv=none; b=S3r/hkh/m199OMiI8WlScgm0ezFNE8YPb4q0VVKowH7WsEkMKsK/1u+Ma8VaiA8ApR3ZMi e+FJdk+hjSOP3y4EMHxSf/Gt16HdYvb4P9aW9xcmaeKcH4aZaNraTRQBEtu8g+A9qORRXS qb2cvKYR3ynSsqqORQb4Eh3M47FVqXYnKO6dWXVCkOPxY0Q1dtWlbYkjSV7zhN7drE1adH KPCyHjp2bfO+A3GbvsXa36kxmfKaVq9oXNJF7H91i1/gay3NmV3Ey7Ek3PlFYj05I9cWzH MJE/zN0r6Kkq4QSryrNHxP7LWwkx5XF7dqMehoaI1hkoAkTqQ+g3rR3N75+i1A== 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 4bRzvJ3nMvzsp; Wed, 25 Jun 2025 11:22: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 55PBMqx0001348; Wed, 25 Jun 2025 11:22:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PBMqa8001344; Wed, 25 Jun 2025 11:22:52 GMT (envelope-from git) Date: Wed, 25 Jun 2025 11:22:52 GMT Message-Id: <202506251122.55PBMqa8001344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5ec268d09a2e - main - dev/psci: Use the correct SMCCC TRNG field List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ec268d09a2e33736339bb43dac5062e64b6af45 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5ec268d09a2e33736339bb43dac5062e64b6af45 commit 5ec268d09a2e33736339bb43dac5062e64b6af45 Author: Andrew Turner AuthorDate: 2025-06-24 16:48:55 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 17:45:42 +0000 dev/psci: Use the correct SMCCC TRNG field The TRNG service will return random data in x3. Use the correct field when filling the buffer in trng_read. This driver has not been in any release, so no security advisory is needed. Reviewed by: bz Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50979 --- sys/dev/psci/smccc_trng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/psci/smccc_trng.c b/sys/dev/psci/smccc_trng.c index bf8c95a81c83..ab98837d3841 100644 --- a/sys/dev/psci/smccc_trng.c +++ b/sys/dev/psci/smccc_trng.c @@ -122,7 +122,7 @@ trng_read(void *buf, unsigned usz) if (ret < 0) return (0); - memcpy(buf, &res.a0, len); + memcpy(buf, &res.a3, len); return (len); } From nobody Wed Jun 25 12:38:20 2025 X-Original-To: dev-commits-src-main@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 4bS1ZN6XPDz600DL; Wed, 25 Jun 2025 12: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 4bS1ZN51vxz3nQQ; Wed, 25 Jun 2025 12: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=1750855100; 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=d7cA4so8E3QtHT7qy6qw3KOk7wPMtufqpUWooRiQXKI=; b=TxY5STFjvW27q3g34NOMdGNIpBGp7Zk2mNITC/RsxBGrDrFDMGk2pblZCjlmh0g3X0h7Pf l3KvtVwFGfUkc1NXOvf0Lf3eEX/Urbxov0AbFCiAHBYS8DYOLD8B7kGpF1iUUEHUk/I0Zd Rfdu9un9DTsFA/vZ1HQa7hiUepuGNGgy6Pq1WzgicQa70WU+JJNuWfuYX2RtAV9ttSNdqI 3S8kp13XEo2MtpbDi6oCbXNDmly+zn8IVJa/t/0SBvaUINHCb4uF9rrU19i5vtqC75yrTV +gh93nw5slRwAmjKElM+gBDn1ZjhagYqUL5C9dpvKBR+hdFIhe1pO5lEtPqZhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855100; 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=d7cA4so8E3QtHT7qy6qw3KOk7wPMtufqpUWooRiQXKI=; b=JirNh5r9przgLD9XGjxp/5Lf0bvVnJQDYT3uxfWNgC5JfDcxJkFgfxJtLXReFzJuoiI9CT sAiQbauUQ8WalbdpyBs6dyiC4BWDTyFS44i00n9Q3o8H0M106RsOL9oM13sBujNLs+rWZK GEQFA6CD+Jk1RAsYKdMBRUpAVpiTaf9ePUe7hH9vexR8EORuHSqgnh0nYwuVTfyJIchRIz b0/xrXtD+slM9VQh5sDwfOx8vI1p6VzGjtj8sg0tR1k190wQR/Ei7cqi8RGwZ3NW9D2UQf tvNfYwv8BXwK3QEwZm9lwAWpzZJw/43buhuvf5bHxoBHrzrAtwy8yOB0bzKADg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750855100; a=rsa-sha256; cv=none; b=HPrMwDquwOHetGAiWTYRqLChBzAGoojebmP9OhZKz8jtH2Q8wW9NZPVXhJxmHuX7B6EAtF GNECHGNaWSCZ9YW5aA9bGZgs4BVE8tK/os8ekaKHIgxDn498VX3+hXdVAtLP91ZHo+mf74 tEZnvgFTsf0aLrPcfVkFux2JydKH4MLWdz/1OrR+FMQ3bD9T7GFryH4+QsmQdxUhnv2wDy OyPHaaqdUldp4zHvZoJJxtTdsqTRAkuNgqJQe+j6lKLMm3b2B7iYvlZIeG3MnL+2kPg+1S lpkjzmET+9uiujuSB8AwRA3paxlVRT1hTi6C3OOixR0K8v7Y5q5Jf2qZcEp1yw== 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 4bS1ZN1rSjz2g1; Wed, 25 Jun 2025 12: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 55PCcKpA034055; Wed, 25 Jun 2025 12: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 55PCcK3h034052; Wed, 25 Jun 2025 12:38:20 GMT (envelope-from git) Date: Wed, 25 Jun 2025 12:38:20 GMT Message-Id: <202506251238.55PCcK3h034052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: f0ba0b99ef0a - main - uchcom.4: Add HARDWARE, makeover List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0ba0b99ef0a9cf9e7822278d7d2bc0a80911361 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=f0ba0b99ef0a9cf9e7822278d7d2bc0a80911361 commit f0ba0b99ef0a9cf9e7822278d7d2bc0a80911361 Author: Alexander Ziaee AuthorDate: 2025-06-25 04:37:37 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 12:35:11 +0000 uchcom.4: Add HARDWARE, makeover Tag spdx, improve document description for apropos, improve synopsis for clarity and consistency, improve description to explain usage, improve hardware for hardware release notes, mention the sysctl, xref the application to use this driver, improve history. MFC: no (unless change adding CH9102/CH343 mfcs) Fixes: 1395712cab8e9 (add support for CH9102 and CH343) Reviewed by: carlavilla, kevlo Differential Revision: https://reviews.freebsd.org/D51036 --- share/man/man4/uchcom.4 | 88 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 index 4d395573589f..6cee3d82c2ce 100644 --- a/share/man/man4/uchcom.4 +++ b/share/man/man4/uchcom.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" $NetBSD: uchcom.4,v 1.2 2008/04/30 13:10:54 martin Exp $ .\" .\" Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -27,37 +30,75 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 19, 2024 +.Dd June 25, 2025 .Dt UCHCOM 4 .Os .Sh NAME .Nm uchcom -.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver +.Nd WinChipHead CH9102/CH343/CH341/CH340 USB to serial UART driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device usb" .Cd "device ucom" .Cd "device uchcom" -.Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -uchcom_load="YES" -.Ed +In +.Xr rc.conf 5 : +.Cd kld_list="uchcom" +.Pp +In +.Xr sysctl.conf 5 : +.Cd hw.usb.uchcom.debug=1 .Sh DESCRIPTION The .Nm -driver provides support for the WinChipHead CH9102/CH343/CH341/CH340 -USB-to-RS-232 Bridge chip. +driver provides support for the WinChipHead USB to serial UART adapters. +If the appropriate hardware is detected, +the driver will be loaded automatically by +.Xr devmatch 8 . +To load the driver manually, add it to the +.Ic kld_list +in +.Xr rc.conf 5 , +or use +.Xr kldload 8 +at runtime. +The device is accessed through the +.Xr ucom 4 +driver, which makes it behave like a +.Xr tty 4 . +.Pp +Call out through this interface with applications like +.Xr cu 1 +or +.Xr tip 1 . +.Sh HARDWARE +The +.Nm +driver supports the following USB to serial UART controllers: .Pp -The datasheets for the CH340/CH341 list the maximum -supported baud rate as 2,000,000. -CH9102/CH343 devices support any baud rate up to 6 Mbps. +.Bl -bullet -compact +.It +WinChipHead CH9102 (max 6Mbps) +.It +WinChipHead CH343 (max 6Mbps) +.It +WinChipHead CH341 (max 2Mbps) +.It +WinChipHead CH340 (max 2Mbps) +.El +.Sh SYSCTL VARIABLES +These settings can be entered in the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width "hw.usb.uchcom.debug" +.It Va hw.usb.uchcom.debug +Enable debugging messages, default +.Ql 0 +.El .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* @@ -73,15 +114,14 @@ for callout ports corresponding callout initial-state and lock-state devices .El .Sh SEE ALSO +.Xr cu 1 , .Xr tty 4 , .Xr ucom 4 , .Xr usb 4 .Sh HISTORY The .Nm -driver first appeared in -.Nx . -The first -.Fx -release to include it was -.Fx 8.0 . +driver appeared in +.Fx 8.0 +from +.Nx 5.0 . From nobody Wed Jun 25 12:38:21 2025 X-Original-To: dev-commits-src-main@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 4bS1ZP5f5Wz600Rc; Wed, 25 Jun 2025 12:38: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 4bS1ZP3Rlfz3nFv; Wed, 25 Jun 2025 12:38:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855101; 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=vFtKyPCGDOwXN3k2Na5g1ihCbhMDEYdSUBZHLDipmIc=; b=EgJ0SMzQdTiibpTq9e5RR7wEA6M2j2OrtGcyU4+5zzAxrP2DO8++MY2IR0jyF+1zO8NoAW 7nNdfn7YLqOGGTl/AgwlZNebEPO/Bd1R46IfsOkJOblzwod+pVxtvcLfJ7q+Py3GLRz4s8 YYMnRHo7YppTVyxudwCnD4iIK/lxtfx/zCALc9IDec8j2qUe4mXgYZ8VoSDK1QELmw7xdF WZUApOUJb3n/uBBA13ndvA3WWJvMyfLp7ZrFEt6gvyDpONjpFboC/8GvVCTonMtQB6fPiU BBqv7PFIzbXOAfLLpJ+j8KnF2irYWMoRo6CEhZ0ukTpSG8niUpENxsu50Eb7vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855101; 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=vFtKyPCGDOwXN3k2Na5g1ihCbhMDEYdSUBZHLDipmIc=; b=qkcWw7Eefemu6MI7QjJL3maKMKrnlJunHIeKaNKnaVYkKTHLFpMgRTI8Ty8A5yqEZ+8EqB jh1HCqpD8QxzKL/7pfi5prL24z83crwDVT6ExrurKsUPC0Kj0ot1A8UPRz+t/3Cxl99047 kRps+uxG4WRC/xt0MKjqxETVIYPIds/XtH3SFjUMpQC8BXoRyZpD2QhHqQeFJixXYuaGDm 5apLZ3Xo0RoFDKixFb9YSvLA+MqdmSQMh9xhJEf83In5+GqMB0aR/cBWhZwVdXk3Q85pal 0ldZiA1IeERY0qz72k9vOcAjq9RoSyjqjisC6/FRnVrSRYXe9bRw2CyLdJeY7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750855101; a=rsa-sha256; cv=none; b=oDfXMRrItvJF0BioOofTbKsi4dtG7Y/pbhlWo/U9ksHm44VK9N4bkEam8AXj5+qVahfhmx 269l3rA1z4Mou9oPxAtxU5fWGi4L4/Q478nYipWRhJ7Lf6yEHrb7CVSH4QxA7sE7nUXR/3 Lc3dU2oTttpvhlDNbkZDjhqDH4/HxFOpL3PYj29XmDASFgQB6ER37//t1GzVad11b64rgr ZLpL5u5RP6S3uk0BlSAdcotepK7KTXG8z5IqTv5uLxR0pny9f+ODEKLMWUgLVUjUvKvuTm oIFjIhYsDmqCcVW1OQ57/7Lf8+PI/+9+KCmyIZqw1c8JaTWVtmoPojbQUNAVKQ== 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 4bS1ZP2MT1z2Sq; Wed, 25 Jun 2025 12:38: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 55PCcL2w034090; Wed, 25 Jun 2025 12:38:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PCcLGG034086; Wed, 25 Jun 2025 12:38:21 GMT (envelope-from git) Date: Wed, 25 Jun 2025 12:38:21 GMT Message-Id: <202506251238.55PCcLGG034086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 7176e1e3b547 - main - uftdi.4: Makeover! List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7176e1e3b5474a209f54cfd5d567a523bce3b9f6 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7176e1e3b5474a209f54cfd5d567a523bce3b9f6 commit 7176e1e3b5474a209f54cfd5d567a523bce3b9f6 Author: Alexander Ziaee AuthorDate: 2025-05-30 01:54:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 12:36:32 +0000 uftdi.4: Makeover! + tag SPDX + rewrite document description to one line in contemporary style + rewrite synopsis in vt/iwx/mtw/uart's style, adding all sysctls for brevity, in the future I will call this "possibilities style" + move ioctls into an ioctl section (we should use these more) + add a sysctl section listing all sysctls and their defaults + remove list of specific 20 year old usb serial adapters from hardware + move list of supported controllers to the hardware section + explain how the driver is loaded in description, and give usage hints MFC after: 3 days Thanks: cperciva (devd calls devmatch at runtime) Thanks: linimon (you dont need to be able to read *) Thanks: adrian (here, you can find things in the code) Reviewed by: adrian, ivy, mhorne (previous version) Differential Revision: https://reviews.freebsd.org/D50608 --- share/man/man4/uftdi.4 | 119 +++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 54 deletions(-) diff --git a/share/man/man4/uftdi.4 b/share/man/man4/uftdi.4 index 9bd3d4a4a293..b526143eaa25 100644 --- a/share/man/man4/uftdi.4 +++ b/share/man/man4/uftdi.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" $NetBSD: uftdi.4,v 1.5 2002/02/07 03:15:08 ross Exp $ .\" .\" Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -27,61 +30,90 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2017 +.Dd June 25, 2025 .Dt UFTDI 4 .Os .Sh NAME .Nm uftdi -.Nd USB support for serial adapters based on the FTDI family of USB -serial adapter chips. +.Nd Future Technology Devices International USB to serial UART driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device usb" .Cd "device ucom" .Cd "device uftdi" -.Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -uftdi_load="YES" -.Ed +In +.Xr rc.conf 5 : +.Cd kld_list="uftdi" +.Pp +In +.Xr sysctl.conf 5 : +.Cd hw.usb.uftdi.debug=1 +.Cd hw.usb.uftdi.skip_jtag_interfaces=0 .Sh DESCRIPTION The .Nm -driver provides support for various serial adapters based on the -following FTDI chips: +driver supports FTDI USB to serial UART devices. +If the appropriate hardware is detected, +the driver will be loaded automatically by +.Xr devmatch 8 . +To load the driver manually, add it to the +.Ic kld_list +in +.Xr rc.conf 5 , +or use +.Xr kldload 8 +at runtime. +The device is accessed through the +.Xr ucom 4 +driver which makes it behave like a +.Xr tty 4 . +.Pp +Call out through this interface with applications like +.Xr cu 1 +or +.Xr tip 1 . +.Sh HARDWARE +The +.Nm +driver supports the following USB to serial UART controllers: .Pp .Bl -bullet -compact .It -FT8U100AX +FTDI FT4232H .It -FT8U232AM +FTDI FT232R .It -FT8U232BM +FTDI FT230X .It -FT232R +FTDI FT2232H .It -FT2232C +FTDI FT2232D .It -FT2232D +FTDI FT2232C .It -FT2232H +FTDI FT8U232BM .It -FT4232H +FTDI FT8U232AM .It -FT230X +FTDI FT8U100AX .El -.Pp -The device is accessed through the -.Xr ucom 4 -driver which makes it behave like a -.Xr tty 4 . -.Pp +.Sh SYSCTL VARIABLES +These settings can be entered in the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width "hw.usb.uftdi.skip_jtag_interfaces" +.It Va hw.usb.uftdi.debug +Enable debugging messages, default +.Ql 0 +.It Va hw.usb.uftdi.skip_jtag_interfaces +Ignore JTAG interfaces, default +.Ql 1 +.El +.Sh IOCTLS Many of the supported chips provide additional functionality such as bitbang mode and the MPSSE engine for serial bus emulation. The @@ -219,27 +251,6 @@ ioctl, you must pass the special value .Dv UFTDI_CONFIRM_ERASE as the argument to this ioctl. .El -.Sh HARDWARE -The -.Nm -driver supports the following adapters: -.Pp -.Bl -bullet -compact -.It -B&B Electronics USB->RS422/485 adapter -.It -Elexol USB MOD1 and USB MOD3 -.It -HP USB-Serial adapter shipped with some HP laptops -.It -Inland UAS111 -.It -QVS USC-1000 -.It -Buffalo PC-OP-RS / Kurouto-shikou KURO-RS universal remote -.It -Prologix GPIB-USB Controller -.El .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* @@ -255,14 +266,14 @@ for callout ports corresponding callout initial-state and lock-state devices .El .Sh SEE ALSO +.Xr cu 1 , .Xr tty 4 , .Xr ucom 4 , .Xr usb 4 .Sh HISTORY The .Nm -driver -appeared in +driver appeared in .Fx 4.8 from .Nx 1.5 . From nobody Wed Jun 25 12:40:10 2025 X-Original-To: dev-commits-src-main@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 4bS1cW3150z600Rk; Wed, 25 Jun 2025 12:40:11 +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 4bS1cV6yfQz3pBc; Wed, 25 Jun 2025 12:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855211; 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=RlOoVJQhjDx+2YUIhcblGQNqlHh0scsVOEZS3SXpVzE=; b=DqS2xsyLySte8uqE97X3H1MQg6L82j4UeOxkDsW790DWVsIeZP5UnlhqjT3u9aTS0iZQiE d4HKHNGTgMKylXXLRJFRL0927C0DSzKTJ2SovDZaHaccRqoT9o5hHXUSQOHJUs6gL0MsXd xzbwIyzd7De5YHi54+VkHnOtsloGHoayRA4TSPj7CcPW1zYd/K3nI09M6ZVKDPPtnhjiQ4 pwyUsqWzJvC+pgHfz2SdXgsiR0pLJYFKxNVrA06wW/aNuG8FZQBnrNyN+TjhiXi+UObDCI qXSytXjjp16lKcPU6663TK5T7HxV/wLHovt67KDhe/MZgqkxndIE2GnE2A3k0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855211; 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=RlOoVJQhjDx+2YUIhcblGQNqlHh0scsVOEZS3SXpVzE=; b=wWMh3sR9FxRyE8zokBpKxQk9S4XUlfO7zfibkTjYw3wJ+91ezIyn2QFbQwsKfieHwUYVft QOkTZPmRPef5QaijdbkkpIE3Oir+admvKkAeiZJR/Tv3XZi2SFTjcgUgF5umTCCXLHoqJN 4JOZOlf3DWvz7lc7ULqET8Fcxas72sIX4ZBjBLO92nB93KHKSfxnGk8RTqPavuzf+WDbHs LsP9YIhr50e0P4EHt/ywwCbPMbYEma80PSx55xgLlT4+Bq7RSA/yiQDmGJgRbPQajrhTIe CLuM8jj0y1LW6NaVMvIG7ZWAg4XI9fSJ4+dS7nPI7XrpbQ1GNZzQxP0B7VWAeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750855211; a=rsa-sha256; cv=none; b=s/39oswd5RYNMM4SVNTbAdFrDb02QD9ffRz2ICoLF8k5xgv8+MwNqnkB5tmwtdWWhzGlUh 8Ng4IrVWBcqmcJA+Uk2j4VF5hXL+TgnUWT9sLZxd/35j9lLh8yYt7u0r/mnuUyq72tV9Yo EfvpIGdLdEPmxokmqtzTCfxtiFbx8MVMERTNV0Qp5x7YFWVdPnkU3pbLJHKDSZiCuSE9eT dFALSXCcVxn6OcfeBEWLOQeQUj3v+Q7r37wUuDrtaVojvcBiuAgESdOypUy3SqRFEwRTHV HaFM1kuInNf3QPW4x2Obbq9TMgZAVW5I7Sq5VUNmVX4s11iFg/iAVjIrq4zgrg== 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 4bS1cV62Zrz2tN; Wed, 25 Jun 2025 12:40:10 +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 55PCeAMD039285; Wed, 25 Jun 2025 12:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PCeAEC039276; Wed, 25 Jun 2025 12:40:10 GMT (envelope-from git) Date: Wed, 25 Jun 2025 12:40:10 GMT Message-Id: <202506251240.55PCeAEC039276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 4981b8968d19 - main - libusb: consider bad fd as a broken event List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4981b8968d19f009347ee8844770e84f9b83311e Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=4981b8968d19f009347ee8844770e84f9b83311e commit 4981b8968d19f009347ee8844770e84f9b83311e Author: SHENGYI HUNG AuthorDate: 2025-06-20 21:45:27 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-25 12:40:02 +0000 libusb: consider bad fd as a broken event Application can use libusb_get_pollfds to get pollfds from libusb then close the fd themselves. This cause the hotplug thread unable to leave because it will be consider as a invalid event then loop forever instead of a broken event that should be quit immediately. Reviewed by: bapt Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50959 --- lib/libusb/libusb10_hotplug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c index f148e4dd43f5..369539d4512e 100644 --- a/lib/libusb/libusb10_hotplug.c +++ b/lib/libusb/libusb10_hotplug.c @@ -140,6 +140,8 @@ verify_event_validity(libusb_context *ctx) return (valid_event); return (invalid_event); } + if (errno == EBADF) + return (broken_event); return (invalid_event); } else if (ctx->usb_event_mode == usb_event_devd) { char buf[DEVCTL_MAXBUF]; From nobody Wed Jun 25 12:52:34 2025 X-Original-To: dev-commits-src-main@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 4bS1tp60N6z601MW; Wed, 25 Jun 2025 12:52:34 +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 4bS1tp5DXXz3vRR; Wed, 25 Jun 2025 12:52:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855954; 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=75WGnm+Vcy2fj0xj3yeOFE9zLoHNbzHTe8pu78Qaw1Y=; b=M8NH0w7gz71lBI7HybN3UkMEpErljubEQpw+f5zL1ES7ctLuvX/1+1DfC1kF4C1ac18lJZ wYOCMOZhntIfm/j9cE2fnoEbYxsM/K7j86FsWIE5eUvsj/J8kozWwElaprMZJ32GznIzew UPIRVzc2qbVTqOeGiJCsd4siycI/BAXTft/HOt4NdZJTefN3LRokbCUm9cPSv3aKqORbHX HLc6PUt31SkmlXq185lwQuCTIayiRwqMAR10ZfH5uQ/oxnCmtRIhaWZklJcnt/D/dqLnER XUnlaAqdUBvv7sqPHBL85yjptlCZr3Zx3ql76NyW2KVO+/OEEJpf3oqLFEfy/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855954; 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=75WGnm+Vcy2fj0xj3yeOFE9zLoHNbzHTe8pu78Qaw1Y=; b=w5LuW8gAZKLSNAC/IJgwOONvmz69m2O9H7aE5Zferh81JXc5O7TAy7/bJeKTFDO5OicVZ6 5/PcV46RJUXyBetkmZlvV6L6IGN2bq2S7jMZPMW3k1pjxEkPtdfw6o2njTA98amhfx7QP/ RNbwFQyz+yx5ydkHqMffFKHZvV4PzvaOs7JuKh+z74UIys5mqtUDAG2rVhKw4Kcu+xRCD8 Y9XP4S0aDv/lirsASBXcgVovcchdIraNxsCBeUFkVrTS/WgQo9rjqHDnE8WkXcWDNT56FK z608hdj54xpGG1X4csNFlYhVN/rQIOOgtk7xcAYAVye+PmK/r9JcMfjs9L0x5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750855954; a=rsa-sha256; cv=none; b=KXnO6r4t9L6/+MBt2DUMnnkxRf0j7/vCbzqSST67t2rygieDDyOwSsBT8ayM6b1m/RpeBj /MSe0avli3YLkm6/FpmIdZF11s3UjyxDaWT7/VWz6+5Zq2jMOlUFNP9pGvg5iEqYrJlBOz XF9VT0TcoGIJfcNSAk80Ey6cDuCWmSBcEAbnFWvI+DJ5Nd5pgkkp1S3g1guvNiuDXONLhh Nx86OelMjbuSLrHYB3Imn36cR7RqJlQWRU4GRksla+gPSS/p3174tt9+/yc0hnZ/RAu8B+ bs8cgE3JUfDmAPHIXrOILNpCsJNrvt3aHUi4O2VtTKDuvL0bOr9/32x2WDkzIA== 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 4bS1tp4Sktz33k; Wed, 25 Jun 2025 12:52:34 +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 55PCqYBC070685; Wed, 25 Jun 2025 12:52:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PCqY6x070682; Wed, 25 Jun 2025 12:52:34 GMT (envelope-from git) Date: Wed, 25 Jun 2025 12:52:34 GMT Message-Id: <202506251252.55PCqY6x070682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3ef39f58e5d6 - main - amd64/conf: Remove a config committed by accident List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 3ef39f58e5d63a78fd1c37e6c62d599bc68d5e1e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3ef39f58e5d63a78fd1c37e6c62d599bc68d5e1e commit 3ef39f58e5d63a78fd1c37e6c62d599bc68d5e1e Author: Mark Johnston AuthorDate: 2025-06-25 12:50:50 +0000 Commit: Mark Johnston CommitDate: 2025-06-25 12:50:50 +0000 amd64/conf: Remove a config committed by accident Reported by: kib, kp Fixes: 350ba9672a7f ("unix: Set O_RESOLVE_BENEATH on fds transferred between jails") --- sys/amd64/conf/SYZKALLER | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER deleted file mode 100644 index 965841313616..000000000000 --- a/sys/amd64/conf/SYZKALLER +++ /dev/null @@ -1,5 +0,0 @@ -include GENERIC-KASAN -ident SYZKALLER - -options COVERAGE -options KCOV From nobody Wed Jun 25 13:39:29 2025 X-Original-To: dev-commits-src-main@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 4bS2wy0dFYz603qb; Wed, 25 Jun 2025 13: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 4bS2wx5WFGz49CN; Wed, 25 Jun 2025 13:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750858769; 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=4H2XEnZeDH7RaAM/f2I6ra83tz8lVFYf+YZSHXdgBgo=; b=icY+uOuwUxMOBxaFrI6We61s6ReddGSHgFwaBO6uViyHHVvhoaJiO5NZAW3IWOHzLVjGxq TwIBDC5PpLRj5HFfee+e6Gu54DsTI++hCJWJl2lV5eCbSC2xuF8Co+La5yZ8R8KrzLk5er GeoAZ7p8mcQ6mxI3u7xLO0q6fofT5wOeeXXzaaq2d8jwPgj/KY1rrYU3UP5+bMcucMgedA gmeIZNsOJGTGUGdrIIiNaNS955CwNbRQwcHxq86a5zo7O6Nb7PFobS2ZevzloH/7nLfCLt oQknWEmGIXueRzFIUAxADe0yazaaTYddPStGCcjw1dZv2whriDWVdjtzLii8DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750858769; 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=4H2XEnZeDH7RaAM/f2I6ra83tz8lVFYf+YZSHXdgBgo=; b=CsoE2r8MEmB3nHY3G8v4JXWig1YWNkON1AaTSjzhgYjXE7KmRVouKPYBKVvdkD+K4kq6zs qa6slM7ikgr+UGzL495RGzwPSf9FBEirXaAaXIKkw7PXKWFTsaImEldsfljLZ+Ys/VIGJm jGmNTJ3jjXFEC0lFdnvAqdPFg1t3HQTBq1e7/hV6wXzhFSs0mnejv/Bj08A3GDuB0qLm7U bWsJfl4CAWDaii72fYdVGuW/nWGcdK/F15ts2CKcMX00XmZ4KNqwL3Dh6Y/Lor2bo86AP2 S7Fat/9pcni8/7NMaiIB6cSBDz9qK3Y2gFC2aHnYc6Fkidb6u5i2O8F1tjOWmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750858769; a=rsa-sha256; cv=none; b=p5+7/TWCSAY0qVT+qDPYgRtl7oswGPksJjduCIUSvDJlvj7vzLebRD+gWmHE5r+gcctB9z aKywsWQVCya5QyRu4nSCq4Gt5Bd+JbgcjLaKpMKoWBC5bKNU7yHxGjMKjW1m7ueknExics wMl4lPs51PRJxTI6INe/hh2OrVS2mrfWDEjj9r8Kaujkq4CTjVfu60L9vORLx1hkSwm4gR MOnxCIU6hZxI66gKzZA8aTnK6NnSnoYF2tuMzsnl7AqpvlmTkaeqtTM8x7LNI2+v4EpDee ZkOvNP66xANbRvTkU2hzbFd/LhMhPkz+So86Jtp1V0iPaTyNLoy98TWAC/m34g== 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 4bS2wx56FBz47k; Wed, 25 Jun 2025 13: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 55PDdT30047918; Wed, 25 Jun 2025 13: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 55PDdTX1047916; Wed, 25 Jun 2025 13:39:29 GMT (envelope-from git) Date: Wed, 25 Jun 2025 13:39:29 GMT Message-Id: <202506251339.55PDdTX1047916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: 32f9c9699a5a - main - Reset kvo_laundry to prevent it being cumulative List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32f9c9699a5a56ef8ef1da8e2974a8b34e2b84f5 Auto-Submitted: auto-generated The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=32f9c9699a5a56ef8ef1da8e2974a8b34e2b84f5 commit 32f9c9699a5a56ef8ef1da8e2974a8b34e2b84f5 Author: Allan Jude AuthorDate: 2025-06-25 13:38:50 +0000 Commit: Allan Jude CommitDate: 2025-06-25 13:39:15 +0000 Reset kvo_laundry to prevent it being cumulative `sysctl vm.objects`, used by `vmstat -o` was not resetting the laundry counter to 0 inside the loop, causing it to show the sum of the laundry count for all previous objects instead of only the laundry count for the current object. Fixes: a86373bc93ee1c850943e8585d0d426479378145 Reviewed by: markj Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D50907 --- sys/vm/vm_object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index f0769102aca1..6d9ea8bf9d93 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2529,6 +2529,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) kvo->kvo_memattr = obj->memattr; kvo->kvo_active = 0; kvo->kvo_inactive = 0; + kvo->kvo_laundry = 0; kvo->kvo_flags = 0; if (!swap_only) { vm_page_iter_init(&pages, obj); From nobody Wed Jun 25 13:46:42 2025 X-Original-To: dev-commits-src-main@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 4bS35G5jsVz603JT; Wed, 25 Jun 2025 13:46: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 4bS35G4PlQz3FFZ; Wed, 25 Jun 2025 13:46:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750859202; 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=fOMFGWBlS1X26mr2ZU28KR/Vz2QQI7gUNpDc5qoERUg=; b=QZDAwMLVEGaiCGwx1pmNU4RqGWLjy7n0KcivEjm8k9uNunfkLeG/PSIj0tPVxF4sP8eISC WwLYYIXmSFwp/M+aeMra5LDpLYbbf4Y6BqRC7TzWfdqiKjUl1zyNL8r/4BkHm5ofxmOMlR MQl4fC5eCFSa/bDJnozFqtKhnONeSNu7kIr9VyU92Jvqsmk+Dzu7k0FQQU2XPG3C0K3osO 4LxAs89BRS3dx39PoR++IOxYlyMuXFnUIs60EFfWRteg9HualricGl13Lco0HBxuHhMd07 s8NMYJs6hWqAa2K6fFom7EKw05rH/1bfBGR7z5+o7IVWiweRuRd+24i3L0gUhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750859202; 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=fOMFGWBlS1X26mr2ZU28KR/Vz2QQI7gUNpDc5qoERUg=; b=WLKyKFGH0aKV1Z1EKXG+Swt0S8R2s+A3sTQN6MJvxMlvp7fT2oVZxAm4S4NygdIj2VsQze nWpE0KalFJOWYdy+h8gv1WPLZPQWRFM8rtdc/tNGS1B8YUL9bBadRONIfQN1RKoniSmvyw 4smPoZ0XyNPDVSwsjj4yvhuqIcdbMvndHVCPBqDOZyzkG3OpNaacLf4AOG/YXz/dJHhO/H 1TA/wNgJT53q8Ex/rUmztzmXFfd3KwE3+qf6hKWEyhk1ZIK5OfQC1L3LiFecwlIkTt64hC nCEwvddivccNgJ02QCoZJf0kQj78ofDp1QkKfPxKRnVCtHidi1gHSUTnqiC+EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750859202; a=rsa-sha256; cv=none; b=Uom7hhUXkqAgmCLjVqcM14tpTOVizDlg3kwaAv7+8misxXiN5ADjPABFRJdq20aAkeCjXq 5QuG/jQVbmwOUqaM8PpFm+ptOoboLEn0d1P7kwnyos7lVIE7RYZzIOdsCBPHoVdZr21rJC e5EMx/XRJnXDMKNSyPAybOju5BKHd2xOlyHcidheel8pl+SqfA+jpjP0TiPh2ITdLSR5t3 XyCZvxxD0LjLzosiM7/MZMlePoCgCmrNjghkv+9J7A2wjZuCKUf+4cOsd9KwZRyG1f2mcV O8v3ZO6lxOh+StltQintLIzWIkDeJrBLPaSw/2Gvsa5e+xlOhiaE2TFCVpmmJQ== 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 4bS35G3zN4z4jJ; Wed, 25 Jun 2025 13:46: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 55PDkgew065307; Wed, 25 Jun 2025 13:46:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PDkgQi065304; Wed, 25 Jun 2025 13:46:42 GMT (envelope-from git) Date: Wed, 25 Jun 2025 13:46:42 GMT Message-Id: <202506251346.55PDkgQi065304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: df84bd484cb8 - main - release: Sort keys in generate-ucl.lua List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: df84bd484cb813fc5ab76c81ac2c35fdd78c8235 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=df84bd484cb813fc5ab76c81ac2c35fdd78c8235 commit df84bd484cb813fc5ab76c81ac2c35fdd78c8235 Author: Mark Johnston AuthorDate: 2025-06-25 12:57:26 +0000 Commit: Mark Johnston CommitDate: 2025-06-25 13:46:31 +0000 release: Sort keys in generate-ucl.lua When writing out the UCL file containing a package's metadata, metadata values consisting of key-value pairs were not sorted. For instance, in the certctl package we could have either "deps": { "FreeBSD-openssl": { ... }, "FreeBSD-caroot": { ... }, } or "deps": { "FreeBSD-caroot": { ... }, "FreeBSD-openssl": { ... }, } This breaks reproducibility. Use the undocumented third parameter to libucl's to_format() to request recursive sorting of keys. Reviewed by: manu, bapt MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51021 --- release/packages/generate-ucl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/packages/generate-ucl.lua b/release/packages/generate-ucl.lua index de52802913f8..ae6ee58dd84a 100755 --- a/release/packages/generate-ucl.lua +++ b/release/packages/generate-ucl.lua @@ -31,5 +31,5 @@ if not f then os.exit(1) end local obj = parser:get_object() -f:write(ucl.to_format(obj, 'ucl')) +f:write(ucl.to_format(obj, 'ucl', true)) f:close() From nobody Wed Jun 25 15:30:14 2025 X-Original-To: dev-commits-src-main@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 4bS5Nk6Dvjz609TP; Wed, 25 Jun 2025 15:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bS5Nk5Shxz3xYq; Wed, 25 Jun 2025 15:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750865414; 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=bXqAZ0gjc4rh98o27VjPsW3WH5Id/6JlZMOCdhSlUQ4=; b=Dj5GX8PeofYJ2EbRktk5UxxCBh+fuw8YwCbrAhvicxsnOj0XQLs48KZy+bDBRn1Pg8YzwQ Ix5+yv+4EzTisybwjbtChs8V+BP89lnje9l3D5G9VKD65bT8xc5+qoomyBnyImOjJzPmxt DzGxwZyHMdtCVVfMVSjiwHNAqRCh2mwPHzkLIy7JaG+rPzd9VteaF9YyQuc/YNJRe8z9He dG/vG5aaWXf6AUyi/zbGNmIWah4vHCtRnMnwPv6LqSmv7XuRUlmzDVBsXJpkAhObeocdxs q6Pip67s8fKCaq1jLQpWNFRMlJR1RgfRG6ExbryBxZGo0qEU2vxaI+J9qCZd5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750865414; 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=bXqAZ0gjc4rh98o27VjPsW3WH5Id/6JlZMOCdhSlUQ4=; b=THT2phwlXrbrsEq7kW5g7//CkAHhK9CcLtFCmwPBkSSEk4qp+icFpf+/BEM4gWkNA2FN4n cGbVj2roAa9L3IZCUKXkBR4Hyyedw2lOqWntUqUqJAw+E+591OYrsFdF7F3pENmDM7Zd9L sgBhFzFsKt6kqyMBnJiuWfKkqh+m1kCzANA3fZHLcBgIMqTUcF7IFUDQKwQas5Pi9djCDX vc5p+4KfvypXeKtWhR1HF1cnjEDpHDkE/NNIj4mjn3UzOMfdeV72B9iaLj5mPTTzhwlIik kIaJ90QvLyuTDfSw1MfUAd3uiFEHS17V6+DlKeQUmlEwzEIwBoRoVDdpL1Uh0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750865414; a=rsa-sha256; cv=none; b=uQxNfM7frRtjHHc7DUKtzvaXVU59ELQf8QJzM0rZ9+hbAmpXrGkPoNc2EBAvBR/3yAWuGa byLEpgamxFVvkUNvDxyvexcSTuGtPmctW09UHt0M0y6Jq1AA5bxP/g4YJq/bu1uwYR9aNK zctJ9lCPiuRR8W3Kb/2hMcDAjMPFqvI9lAExRkBU+VwGz3+fqKXeCEAJLnm40Kv8hByp9m tatMaGCb85CHbYUh2mCOe+znrJFaSUGhr95o+ijAsSRpRBP8rwteM05zP/WcYxu14bwpv+ yPa8apZyVsfqrve5l5TkBLQuWGSKc/gz5J1IX2GM3qA9RPGde9eGdYxFjkkrVw== 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 4bS5Nk4XL3z7fW; Wed, 25 Jun 2025 15:30:14 +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 55PFUEIb060828; Wed, 25 Jun 2025 15:30:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PFUEkH060815; Wed, 25 Jun 2025 15:30:14 GMT (envelope-from git) Date: Wed, 25 Jun 2025 15:30:14 GMT Message-Id: <202506251530.55PFUEkH060815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 6a13b3d90612 - main - if_vlan: add a prototype for vlan_input_p List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a13b3d90612120c6e157ce7aaf7e2d1340e98ad Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=6a13b3d90612120c6e157ce7aaf7e2d1340e98ad commit 6a13b3d90612120c6e157ce7aaf7e2d1340e98ad Author: Lexi Winter AuthorDate: 2025-06-25 14:23:34 +0000 Commit: Lexi Winter CommitDate: 2025-06-25 15:29:54 +0000 if_vlan: add a prototype for vlan_input_p Move the definition of vlan_input_p to net/if.c and its prototype to if_vlan_var.h, to match the other functions exported from if_vlan. Remove the previous comment which is now outdated. This is required for if_bridge to use this function. Reviewed by: zlei, kp, des, kib Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50567 --- sys/net/if.c | 1 + sys/net/if_ethersubr.c | 2 -- sys/net/if_vlan.c | 9 --------- sys/net/if_vlan_var.h | 1 + 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 9048fcb0a16a..79c883fd4a0a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2089,6 +2089,7 @@ int (*vlan_tag_p)(struct ifnet *, uint16_t *); int (*vlan_pcp_p)(struct ifnet *, uint16_t *); int (*vlan_setcookie_p)(struct ifnet *, void *); void *(*vlan_cookie_p)(struct ifnet *); +void (*vlan_input_p)(struct ifnet *, struct mbuf *); /* * Handle a change in the interface link state. To avoid LORs diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index cec1c08c2614..66a4724a786c 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -106,8 +106,6 @@ int (*ng_ether_output_p)(struct ifnet *ifp, struct mbuf **mp); void (*ng_ether_attach_p)(struct ifnet *ifp); void (*ng_ether_detach_p)(struct ifnet *ifp); -void (*vlan_input_p)(struct ifnet *, struct mbuf *); - /* if_bridge(4) support */ void (*bridge_dn_p)(struct mbuf *, struct ifnet *); bool (*bridge_same_p)(const void *, const void *); diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index a37a9d41fc53..9561ae5c316c 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -888,15 +888,6 @@ vlan_devat(struct ifnet *ifp, uint16_t vid) return (ifp); } -/* - * VLAN support can be loaded as a module. The only place in the - * system that's intimately aware of this is ether_input. We hook - * into this code through vlan_input_p which is defined there and - * set here. No one else in the system should be aware of this so - * we use an explicit reference here. - */ -extern void (*vlan_input_p)(struct ifnet *, struct mbuf *); - /* For if_link_state_change() eyes only... */ extern void (*vlan_link_state_p)(struct ifnet *); diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h index 3a8e45dfab03..f0b09445d04b 100644 --- a/sys/net/if_vlan_var.h +++ b/sys/net/if_vlan_var.h @@ -168,6 +168,7 @@ extern int (*vlan_tag_p)(struct ifnet *, uint16_t *); extern int (*vlan_pcp_p)(struct ifnet *, uint16_t *); extern int (*vlan_setcookie_p)(struct ifnet *, void *); extern void *(*vlan_cookie_p)(struct ifnet *); +extern void (*vlan_input_p)(struct ifnet *, struct mbuf *); #include From nobody Wed Jun 25 17:13:38 2025 X-Original-To: dev-commits-src-main@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 4bS7h31F3yz60HGl; Wed, 25 Jun 2025 17:13: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 4bS7h30Zqwz3Q5x; Wed, 25 Jun 2025 17:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750871619; 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=IIcsoNGO41tDJRV2oPTGUe17DKYYza7cClxxnGNYkOI=; b=TZiyGdXyxBj4IpNU+3ZWVqu1G+VCbSM4x0QhwFVE2LIQxN1YpuugmDtJmDE2pDr3u2LO/4 dkYl59pocq99hy5HgAfgeV4JvICHl8FrHuqlplrj1tnqNN7D2su5qL9TxpPSs1uBeOqy9l zo6iESp0QN+tQ/hvtFUXKg+Iu+eIx/olG//3yg7G3zpicawbOqPC5LBL1jYdS4pwqYKtqF 4FAb6pjDV+7qqlH2TWcoRX7qCMHNn8j0AL0m9hZoAWt8N+Lw6mV2d6aw42itX/6b1pslXS ylyFNBLcnvyxa4dsnDmIbWIMWMiCj9eBM0eWu2C/69vZdzuW/ggyp1gvsUZ0lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750871619; 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=IIcsoNGO41tDJRV2oPTGUe17DKYYza7cClxxnGNYkOI=; b=ULfe+FGuyCnDqpLDX+oOFppaJjQ/nEPYe6NlbYorXe6kKIgP+vTLOTUAsB4RAB5BG78Ejn M8GSwI+YHlldgqFbHFjYiegLZNzzah0f4uRogZXRsoIFle0pX7HKiokH9Z9yAhCw/1kW+a TXzhOyevWqIhqD7/P+jnftN2UALQnt8aUmho1GPFQcwiTGzcGKqWfLLXPEIEi+HE793uAB crw+hj/9w1qw22CJmDTsZ0uYCJWAsOSst8HWsIJZaHTWXqHd8rI7UdVD3fjTd2GUk3YRkJ p8ep8vLXk33rvEES2I2V18gp1KFR+LBoDWjjtRlG6LuYB9inulXb7ly4V0n+7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750871619; a=rsa-sha256; cv=none; b=vTPgNG5lkMjBy/ktQhvS06TH/vPANgNfVdZimPp8GSvuDvPT7zzeTuTPKn3NoyMjjdyPsU HR/ril/ZwWNiVjIkMaSZCx8osQFcgbdcgQIX5cks4g8TIoyfUSdzMsZ0D/gxvNV9bvnVjF r8fhPqOCHYlz8PjSKU9YMu9FUkLYndwByK1lnCknJLzhU34UpD0oDDYc6isd3nZUszm7UO X206gVrNvsLhKmwIVn4FW5qu/tMDskgHGkoMmUn+H7Jd7GmJ6zVpD1b13o3MCk5cMaLvEz NbTogikYzYamCudlRgbvOELbgqgVmdolxa1haR8Ca5rvSGX17iKJsI6vsjIz4g== 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 4bS7h309MHz9kx; Wed, 25 Jun 2025 17:13: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 55PHDcUH059750; Wed, 25 Jun 2025 17:13:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PHDcRn059747; Wed, 25 Jun 2025 17:13:38 GMT (envelope-from git) Date: Wed, 25 Jun 2025 17:13:38 GMT Message-Id: <202506251713.55PHDcRn059747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 55dfaeae8e9a - main - contrib/llvm-project: fix clang crash compiling modules List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55dfaeae8e9aa95f0b724d90ad2423ca1b623142 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=55dfaeae8e9aa95f0b724d90ad2423ca1b623142 commit 55dfaeae8e9aa95f0b724d90ad2423ca1b623142 Author: Lexi Winter AuthorDate: 2025-06-25 17:12:02 +0000 Commit: Lexi Winter CommitDate: 2025-06-25 17:12:02 +0000 contrib/llvm-project: fix clang crash compiling modules clang++ may crash when compiling certain C++20 modules. Backport the fix from LLVM upstream. This fixes LLVM bug 102684: https://github.com/llvm/llvm-project/issues/102684. PR: 287803 MFC after: 3 days Obtained from: https://github.com/llvm/llvm-project/pull/102855 Reviewed by: kevans, dim Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D51041 --- .../include/clang/Frontend/MultiplexConsumer.h | 1 + .../Serialization/ASTDeserializationListener.h | 2 + .../clang/include/clang/Serialization/ASTReader.h | 3 + .../clang/include/clang/Serialization/ASTWriter.h | 1 + .../clang/lib/Frontend/MultiplexConsumer.cpp | 5 ++ .../clang/lib/Serialization/ASTReader.cpp | 91 +++++++++++++++++----- .../clang/lib/Serialization/ASTWriter.cpp | 6 ++ 7 files changed, 91 insertions(+), 18 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h b/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h index e49e3392d1f3..3a7670d7a51a 100644 --- a/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h +++ b/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h @@ -36,6 +36,7 @@ public: void MacroRead(serialization::MacroID ID, MacroInfo *MI) override; void TypeRead(serialization::TypeIdx Idx, QualType T) override; void DeclRead(GlobalDeclID ID, const Decl *D) override; + void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) override; void SelectorRead(serialization::SelectorID iD, Selector Sel) override; void MacroDefinitionRead(serialization::PreprocessedEntityID, MacroDefinitionRecord *MD) override; diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h index 1d81a9ae3fe2..ea96faa07c19 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h @@ -45,6 +45,8 @@ public: virtual void TypeRead(serialization::TypeIdx Idx, QualType T) { } /// A decl was deserialized from the AST file. virtual void DeclRead(GlobalDeclID ID, const Decl *D) {} + /// A predefined decl was built during the serialization. + virtual void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) {} /// A selector was read from the AST file. virtual void SelectorRead(serialization::SelectorID iD, Selector Sel) {} /// A macro definition was read from the AST file. diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h index 671520a3602b..82f32e843d63 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h @@ -1541,6 +1541,9 @@ private: std::pair translateTypeIDToIndex(serialization::TypeID ID) const; + /// Get a predefined Decl from ASTContext. + Decl *getPredefinedDecl(PredefinedDeclIDs ID); + public: /// Load the AST file and validate its contents against the given /// Preprocessor. diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h index 700f0ad00111..10a50b711043 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h @@ -869,6 +869,7 @@ private: void IdentifierRead(serialization::IdentifierID ID, IdentifierInfo *II) override; void MacroRead(serialization::MacroID ID, MacroInfo *MI) override; void TypeRead(serialization::TypeIdx Idx, QualType T) override; + void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) override; void SelectorRead(serialization::SelectorID ID, Selector Sel) override; void MacroDefinitionRead(serialization::PreprocessedEntityID ID, MacroDefinitionRecord *MD) override; diff --git a/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp b/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp index 651c55aeed54..2158d176d189 100644 --- a/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp @@ -58,6 +58,11 @@ void MultiplexASTDeserializationListener::DeclRead(GlobalDeclID ID, Listeners[i]->DeclRead(ID, D); } +void MultiplexASTDeserializationListener::PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) { + for (size_t i = 0, e = Listeners.size(); i != e; ++i) + Listeners[i]->PredefinedDeclBuilt(ID, D); +} + void MultiplexASTDeserializationListener::SelectorRead( serialization::SelectorID ID, Selector Sel) { for (size_t i = 0, e = Listeners.size(); i != e; ++i) diff --git a/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp b/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp index 29aec144aec1..2d8f5a801f0e 100644 --- a/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp +++ b/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp @@ -7741,7 +7741,10 @@ SourceLocation ASTReader::getSourceLocationForDeclID(GlobalDeclID ID) { return Loc; } -static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) { +Decl *ASTReader::getPredefinedDecl(PredefinedDeclIDs ID) { + assert(ContextObj && "reading predefined decl without AST context"); + ASTContext &Context = *ContextObj; + Decl *NewLoaded = nullptr; switch (ID) { case PREDEF_DECL_NULL_ID: return nullptr; @@ -7750,54 +7753,106 @@ static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) { return Context.getTranslationUnitDecl(); case PREDEF_DECL_OBJC_ID_ID: - return Context.getObjCIdDecl(); + if (Context.ObjCIdDecl) + return Context.ObjCIdDecl; + NewLoaded = Context.getObjCIdDecl(); + break; case PREDEF_DECL_OBJC_SEL_ID: - return Context.getObjCSelDecl(); + if (Context.ObjCSelDecl) + return Context.ObjCSelDecl; + NewLoaded = Context.getObjCSelDecl(); + break; case PREDEF_DECL_OBJC_CLASS_ID: - return Context.getObjCClassDecl(); + if (Context.ObjCClassDecl) + return Context.ObjCClassDecl; + NewLoaded = Context.getObjCClassDecl(); + break; case PREDEF_DECL_OBJC_PROTOCOL_ID: - return Context.getObjCProtocolDecl(); + if (Context.ObjCProtocolClassDecl) + return Context.ObjCProtocolClassDecl; + NewLoaded = Context.getObjCProtocolDecl(); + break; case PREDEF_DECL_INT_128_ID: - return Context.getInt128Decl(); + if (Context.Int128Decl) + return Context.Int128Decl; + NewLoaded = Context.getInt128Decl(); + break; case PREDEF_DECL_UNSIGNED_INT_128_ID: - return Context.getUInt128Decl(); + if (Context.UInt128Decl) + return Context.UInt128Decl; + NewLoaded = Context.getUInt128Decl(); + break; case PREDEF_DECL_OBJC_INSTANCETYPE_ID: - return Context.getObjCInstanceTypeDecl(); + if (Context.ObjCInstanceTypeDecl) + return Context.ObjCInstanceTypeDecl; + NewLoaded = Context.getObjCInstanceTypeDecl(); + break; case PREDEF_DECL_BUILTIN_VA_LIST_ID: - return Context.getBuiltinVaListDecl(); + if (Context.BuiltinVaListDecl) + return Context.BuiltinVaListDecl; + NewLoaded = Context.getBuiltinVaListDecl(); + break; case PREDEF_DECL_VA_LIST_TAG: - return Context.getVaListTagDecl(); + if (Context.VaListTagDecl) + return Context.VaListTagDecl; + NewLoaded = Context.getVaListTagDecl(); + break; case PREDEF_DECL_BUILTIN_MS_VA_LIST_ID: - return Context.getBuiltinMSVaListDecl(); + if (Context.BuiltinMSVaListDecl) + return Context.BuiltinMSVaListDecl; + NewLoaded = Context.getBuiltinMSVaListDecl(); + break; case PREDEF_DECL_BUILTIN_MS_GUID_ID: + // ASTContext::getMSGuidTagDecl won't create MSGuidTagDecl conditionally. return Context.getMSGuidTagDecl(); case PREDEF_DECL_EXTERN_C_CONTEXT_ID: - return Context.getExternCContextDecl(); + if (Context.ExternCContext) + return Context.ExternCContext; + NewLoaded = Context.getExternCContextDecl(); + break; case PREDEF_DECL_MAKE_INTEGER_SEQ_ID: - return Context.getMakeIntegerSeqDecl(); + if (Context.MakeIntegerSeqDecl) + return Context.MakeIntegerSeqDecl; + NewLoaded = Context.getMakeIntegerSeqDecl(); + break; case PREDEF_DECL_CF_CONSTANT_STRING_ID: - return Context.getCFConstantStringDecl(); + if (Context.CFConstantStringTypeDecl) + return Context.CFConstantStringTypeDecl; + NewLoaded = Context.getCFConstantStringDecl(); + break; case PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID: - return Context.getCFConstantStringTagDecl(); + if (Context.CFConstantStringTagDecl) + return Context.CFConstantStringTagDecl; + NewLoaded = Context.getCFConstantStringTagDecl(); + break; case PREDEF_DECL_TYPE_PACK_ELEMENT_ID: - return Context.getTypePackElementDecl(); + if (Context.TypePackElementDecl) + return Context.TypePackElementDecl; + NewLoaded = Context.getTypePackElementDecl(); + break; } - llvm_unreachable("PredefinedDeclIDs unknown enum value"); + + assert(NewLoaded && "Failed to load predefined decl?"); + + if (DeserializationListener) + DeserializationListener->PredefinedDeclBuilt(ID, NewLoaded); + + return NewLoaded; } unsigned ASTReader::translateGlobalDeclIDToIndex(GlobalDeclID GlobalID) const { @@ -7814,7 +7869,7 @@ Decl *ASTReader::GetExistingDecl(GlobalDeclID ID) { assert(ContextObj && "reading decl with no AST context"); if (ID < NUM_PREDEF_DECL_IDS) { - Decl *D = getPredefinedDecl(*ContextObj, (PredefinedDeclIDs)ID); + Decl *D = getPredefinedDecl((PredefinedDeclIDs)ID); if (D) { // Track that we have merged the declaration with ID \p ID into the // pre-existing predefined declaration \p D. diff --git a/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp b/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp index cb63dec92e33..e907ddb88949 100644 --- a/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp +++ b/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp @@ -6757,6 +6757,12 @@ void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { StoredIdx = Idx; } +void ASTWriter::PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) { + assert(D->isCanonicalDecl() && "predefined decl is not canonical"); + DeclIDs[D] = LocalDeclID(ID); + PredefinedDecls.insert(D); +} + void ASTWriter::SelectorRead(SelectorID ID, Selector S) { // Always keep the highest ID. See \p TypeRead() for more information. SelectorID &StoredID = SelectorIDs[S]; From nobody Wed Jun 25 17:17:37 2025 X-Original-To: dev-commits-src-main@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 4bS7mf157qz60HgX; Wed, 25 Jun 2025 17:17: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 4bS7md6W3wz3S8d; Wed, 25 Jun 2025 17:17:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750871857; 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=T8ukSQxhqZj2DKuIedgpGiZcVym6EA4cS0S8/DlmPUY=; b=d4CoFpReKXDYhGBOXMJ18V7L99zIYt43Sfut0RlGMY0Kz8kmoXC/n7wUZ4S28GyTH9jnPu 6WI5CLh4tjG4T9ljgB60b8dJcJ9ecZMXvO9ff7gg1QNjOE680z9rNg8b69e6vIqkWvxT2N +fGM24wn5Mci2wkfaIQGeiRCmmeTZ2ayyIQL7P1g6/YomP+tnIwXRRdWZ9kQA+X8Dx8zrp w3T02QG/gBnzFy+J6NauchJrsq+VoyAd1plsIHgWEPlrcYotD29kTOiPeofxCDiySis8ea 2269mDfgJPrpfjU96P4+ReOLGaW3x+uld5AnJjXhuxMSmHGf1yTt0VVvPxA+yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750871857; 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=T8ukSQxhqZj2DKuIedgpGiZcVym6EA4cS0S8/DlmPUY=; b=HsToxpklw0O+ztzuZQOYna695DWy0iOuDdFbg2WuyYDybQBSVk8IPb6Weo98RNlX4WNab3 9wOYOJmmNPV/bNUIM2MoNrn5/cEd1h0Lw5hlEcl4U1OdGcC3qNXZZqCI0NDQrjg36P/mmS HfOJZBZ3Rj8qiingimIySEa+0s9qJ5BhOWphc8i2iqbMGHeCIkudfEgP0HoVIiJq7Js0Ds 7rg8+Tlx0sMpAXLNaDu/5B7WNiRZQ256wTAW5PsLHIfOadEcT4uOVjKNjWLEF9oclzbk4P BYHPtkOGYjod1Oq9yJbDxKzenj6QjWKlbIj5l1uEyP9mWZ9+wZv/jHTZVNnHjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750871857; a=rsa-sha256; cv=none; b=W46RkpuYGqO1GAc0X4TlcbVT5URRrvGA6I8hvmsdzL4yr7oVuTLfxBl4+1pevmoi3W0MAQ 03dLX8ravU1glpJ0TsMhKFttUeKERsWV3dI17fqFD61/fnVItAiweS5re0osSncb+78U0e n515m191vTPYuRkLcaOjRjatwZUt2yrBTf+ZLKPUomFWYiKMoE6OATsq16sfwRYr91euYQ fOYvBJjhK1PumtiT6dhsyc4/MtIS6oeApSEq9JW9LW4ne7zL+PEfAYyB+qwaIuyZv6C0bm eqfINSsEscqfTfQXmL9b8mwHnbSKyjnmcR2JFKaeaoAHYUeBovFxzWA7PWdeow== 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 4bS7md64L6z9HD; Wed, 25 Jun 2025 17:17: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 55PHHb0p061114; Wed, 25 Jun 2025 17:17:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PHHbV1061111; Wed, 25 Jun 2025 17:17:37 GMT (envelope-from git) Date: Wed, 25 Jun 2025 17:17:37 GMT Message-Id: <202506251717.55PHHbV1061111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7b26124ae106 - main - libtpool/tests: Fix a flaky test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 7b26124ae106283952e1e61d07f0eecda5c361a0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7b26124ae106283952e1e61d07f0eecda5c361a0 commit 7b26124ae106283952e1e61d07f0eecda5c361a0 Author: Mark Johnston AuthorDate: 2025-06-25 14:19:27 +0000 Commit: Mark Johnston CommitDate: 2025-06-25 17:17:08 +0000 libtpool/tests: Fix a flaky test I occasionally see failures due to pthread_barrier_wait() not returning 0. There is another possible non-error return value, so allow that too. While here, check the result in tp_delay() as well. Fixes: 5c1ba994a8bc ("Add a regression test for a libtpool bug") Differential Revision: https://reviews.freebsd.org/D50967 --- cddl/lib/libtpool/tests/libtpool_test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cddl/lib/libtpool/tests/libtpool_test.c b/cddl/lib/libtpool/tests/libtpool_test.c index 42726a13420c..42bce269cb23 100644 --- a/cddl/lib/libtpool/tests/libtpool_test.c +++ b/cddl/lib/libtpool/tests/libtpool_test.c @@ -11,9 +11,12 @@ static void tp_delay(void *arg) { pthread_barrier_t *barrier = arg; + int r; /* Block this task until all thread pool workers have been created. */ - pthread_barrier_wait(barrier); + r = pthread_barrier_wait(barrier); + ATF_REQUIRE_MSG(r == 0 || r == PTHREAD_BARRIER_SERIAL_THREAD, + "pthread_barrier_wait failed: %s", strerror(r)); } /* @@ -38,7 +41,6 @@ ATF_TC_BODY(complete_exhaustion, tc) int nworkers; int r, i; - len = sizeof(max_threads_per_proc); r = sysctlbyname("kern.threads.max_threads_per_proc", &max_threads_per_proc, &len, NULL, 0); @@ -65,7 +67,9 @@ ATF_TC_BODY(complete_exhaustion, tc) ATF_REQUIRE_EQ(tpool_dispatch(tp1, tp_delay, NULL), -1); /* Cleanup */ - ATF_REQUIRE_EQ(pthread_barrier_wait(&barrier), 0); + r = pthread_barrier_wait(&barrier); + ATF_REQUIRE_MSG(r == 0 || r == PTHREAD_BARRIER_SERIAL_THREAD, + "pthread_barrier_wait failed: %s", strerror(r)); tpool_wait(tp1); tpool_wait(tp0); } From nobody Wed Jun 25 17:22:06 2025 X-Original-To: dev-commits-src-main@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 4bS7sp6frbz60J0h; Wed, 25 Jun 2025 17:22: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 4bS7sp44cWz3Tg0; Wed, 25 Jun 2025 17:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750872126; 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=uKtPaq7UxxjaIO66a/WtiB/kFvCctqyz+d7V/uVgud0=; b=Nj7hAZTtrS+I34MlF5QgZ/WHfUajXiQJYqiUGGTOWnETB4NAYNR16kZvTec5sOJH6d8jGI e+zBKCyV69nRKfcAV+91fDSeCbndN+HwGyEdZXchEIAyjRjXj3WNmSpSIBrk61fhhAeh4C E5AVqwKW/w5q1819a/a2RN0YSPc7b+EMU6/AuMCfBhVgo6Nk0/uP+MxdaVoLhbV60GnLKv VcdYgSZQV9t1lQv1ac6cPvXB3Tw9fwQgh+wAsuICN8TwH5WeNb3RmFV4hoS0+c5f2zZN8L 1cDLYa3v1LrOpWU61F1TEJvku3y23zzNyhHDVGK6Cl0gf1H1V4wddsXozvzMVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750872126; 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=uKtPaq7UxxjaIO66a/WtiB/kFvCctqyz+d7V/uVgud0=; b=OoccMozwkrqSFvl/4mx16WZyWQS4MZF3weB1z5fkkr1iKs5PDR0Akly93HZcVUMr8zhuY4 NHdh2zBuSnafbAwnWbCzn3nUvfxLSTL9c6kAoKDe+D2wt8stX0sa090tUDCk3pRHU1xqZy /25iEWW73HmmKWz2TIhys+NyLkZOeNHC9dy6lbHZJwKM5R5M5lxwOAaCF7g2DmWCwKCmbs qtdOlfk5OrxlMDma9+dy6Isd4znZzr2lQnkyf94D+LH+o/9SPgPs2akutrWrKzyfoaFag2 7tM9/AU7YthP+WOx3E7fk7abpBXFF91frfgxDXyxa/Vk0Dq+N4OhsEZ4rJbteQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750872126; a=rsa-sha256; cv=none; b=rY+zEzpU91AeS+85uZT58Er8FG5IuEVWz/I37B9iNg6pwxpfcCUKxcThWCzhnNgMPnZICe MCoh0GrId/TDtI+ABnmnZl+GQZE+jmwhIfhbkMstZslN48/LKmbqrDHhjeQRPzVHroy98a Dv/V3wEa2lVbeJcla1fvyCbEc2H8hJYcmo6CrIxBemOROP9W9092H/NuUNBzNmpF2Dy9g0 5ssqvm2+B5aMzqjbPOXUp/G4tT6pBQxJGtYiNSuxLjN88NFNPdPLp9fDzrF/ygV3JKhsG9 ChGSGChLHtOE3F7hT5qugUl8ZyLOLqGy7PuKIAaMPffCMG8h7ekhA/MVCCYZPA== 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 4bS7sp39Zvz9lS; Wed, 25 Jun 2025 17:22: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 55PHM6tK073067; Wed, 25 Jun 2025 17:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PHM6Xn072868; Wed, 25 Jun 2025 17:22:06 GMT (envelope-from git) Date: Wed, 25 Jun 2025 17:22:06 GMT Message-Id: <202506251722.55PHM6Xn072868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 7ed1628066ea - main - contrib/llvm-project: re-add clang/tools/clang-scan-deps List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ed1628066eaf55b86f35af86efe804508201cc8 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=7ed1628066eaf55b86f35af86efe804508201cc8 commit 7ed1628066eaf55b86f35af86efe804508201cc8 Merge: 7b26124ae106 97f3af78f2b8 Author: Dimitry Andric AuthorDate: 2025-06-25 17:19:51 +0000 Commit: Dimitry Andric CommitDate: 2025-06-25 17:21:40 +0000 contrib/llvm-project: re-add clang/tools/clang-scan-deps This is in preparation for adding it as an optional tool in base. MFC after: 1 week contrib/llvm-project/FREEBSD-Xlist | 3 +- .../clang/tools/clang-scan-deps/ClangScanDeps.cpp | 1055 ++++++++++++++++++++ .../clang/tools/clang-scan-deps/Opts.td | 42 + 3 files changed, 1098 insertions(+), 2 deletions(-) diff --cc contrib/llvm-project/FREEBSD-Xlist index 45cd2c1d6f46,000000000000..43fa40070f5d mode 100644,000000..100644 --- a/contrib/llvm-project/FREEBSD-Xlist +++ b/contrib/llvm-project/FREEBSD-Xlist @@@ -1,1018 -1,0 +1,1017 @@@ +.ci/ +.clang-format +.clang-tidy +.git-blame-ignore-revs +.gitattributes +.github/ +.gitignore +.mailmap +CODE_OF_CONDUCT.md +CONTRIBUTING.md +LICENSE.TXT +README.md +SECURITY.md +bolt/ +clang/.clang-format +clang/.clang-tidy +clang/.gitignore +clang/CMakeLists.txt +clang/CodeOwners.rst +clang/INSTALL.txt +clang/NOTES.txt +clang/README.txt +clang/bindings/ +clang/cmake/ +clang/docs/ +clang/examples/ +clang/include/CMakeLists.txt +clang/include/clang/AST/CMakeLists.txt +clang/include/clang/Basic/CMakeLists.txt +clang/include/clang/Basic/Target/ +clang/include/clang/Basic/Version.inc.in +clang/include/clang/CIR/CMakeLists.txt +clang/include/clang/CIR/Dialect/CMakeLists.txt +clang/include/clang/CIR/Dialect/IR/CMakeLists.txt +clang/include/clang/CMakeLists.txt +clang/include/clang/Config/ +clang/include/clang/Driver/CMakeLists.txt +clang/include/clang/Format/.clang-format +clang/include/clang/Parse/CMakeLists.txt +clang/include/clang/Sema/CMakeLists.txt +clang/include/clang/Serialization/CMakeLists.txt +clang/include/clang/StaticAnalyzer/Checkers/CMakeLists.txt +clang/include/clang/Tooling/Syntax/CMakeLists.txt +clang/lib/APINotes/CMakeLists.txt +clang/lib/ARCMigrate/CMakeLists.txt +clang/lib/AST/CMakeLists.txt +clang/lib/ASTMatchers/CMakeLists.txt +clang/lib/ASTMatchers/Dynamic/CMakeLists.txt +clang/lib/Analysis/CMakeLists.txt +clang/lib/Analysis/FlowSensitive/CMakeLists.txt +clang/lib/Analysis/FlowSensitive/Models/CMakeLists.txt +clang/lib/Analysis/plugins/CMakeLists.txt +clang/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt +clang/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt +clang/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt +clang/lib/Basic/CMakeLists.txt +clang/lib/CIR/CMakeLists.txt +clang/lib/CIR/Dialect/CMakeLists.txt +clang/lib/CIR/Dialect/IR/CMakeLists.txt +clang/lib/CMakeLists.txt +clang/lib/CodeGen/CMakeLists.txt +clang/lib/CodeGen/README.txt +clang/lib/CrossTU/CMakeLists.txt +clang/lib/DirectoryWatcher/CMakeLists.txt +clang/lib/Driver/CMakeLists.txt +clang/lib/Edit/CMakeLists.txt +clang/lib/ExtractAPI/CMakeLists.txt +clang/lib/Format/.clang-format +clang/lib/Format/CMakeLists.txt +clang/lib/Frontend/CMakeLists.txt +clang/lib/Frontend/Rewrite/CMakeLists.txt +clang/lib/FrontendTool/CMakeLists.txt +clang/lib/Headers/CMakeLists.txt +clang/lib/Index/CMakeLists.txt +clang/lib/IndexSerialization/CMakeLists.txt +clang/lib/InstallAPI/CMakeLists.txt +clang/lib/Interpreter/CMakeLists.txt +clang/lib/Lex/CMakeLists.txt +clang/lib/Parse/CMakeLists.txt +clang/lib/Rewrite/CMakeLists.txt +clang/lib/Sema/CMakeLists.txt +clang/lib/Serialization/CMakeLists.txt +clang/lib/StaticAnalyzer/CMakeLists.txt +clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt +clang/lib/StaticAnalyzer/Core/CMakeLists.txt +clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt +clang/lib/StaticAnalyzer/README.txt +clang/lib/Support/CMakeLists.txt +clang/lib/Testing/CMakeLists.txt +clang/lib/Tooling/ASTDiff/CMakeLists.txt +clang/lib/Tooling/CMakeLists.txt +clang/lib/Tooling/Core/CMakeLists.txt +clang/lib/Tooling/DependencyScanning/CMakeLists.txt +clang/lib/Tooling/Inclusions/CMakeLists.txt +clang/lib/Tooling/Inclusions/Stdlib/CMakeLists.txt +clang/lib/Tooling/Refactoring/CMakeLists.txt +clang/lib/Tooling/Syntax/CMakeLists.txt +clang/lib/Tooling/Transformer/CMakeLists.txt +clang/runtime/ +clang/test/ +clang/tools/CMakeLists.txt +clang/tools/amdgpu-arch/ +clang/tools/apinotes-test/ +clang/tools/arcmt-test/ +clang/tools/c-arcmt-test/ +clang/tools/c-index-test/ +clang/tools/clang-check/ +clang/tools/clang-diff/ +clang/tools/clang-extdef-mapping/ +clang/tools/clang-format/.clang-format +clang/tools/clang-format/CMakeLists.txt +clang/tools/clang-format/clang-format-bbedit.applescript +clang/tools/clang-format/clang-format-diff.py +clang/tools/clang-format/clang-format-sublime.py +clang/tools/clang-format/clang-format-test.el +clang/tools/clang-format/clang-format.el +clang/tools/clang-format/clang-format.py +clang/tools/clang-format/fuzzer/ +clang/tools/clang-format/git-clang-format +clang/tools/clang-format/git-clang-format.bat +clang/tools/clang-format-vs/ +clang/tools/clang-fuzzer/ +clang/tools/clang-import-test/ +clang/tools/clang-installapi/ +clang/tools/clang-linker-wrapper/ +clang/tools/clang-nvlink-wrapper/ +clang/tools/clang-offload-bundler/ +clang/tools/clang-offload-packager/ +clang/tools/clang-refactor/ +clang/tools/clang-rename/ +clang/tools/clang-repl/ - clang/tools/clang-scan-deps/ ++clang/tools/clang-scan-deps/CMakeLists.txt +clang/tools/clang-shlib/ +clang/tools/diag-build/ +clang/tools/diagtool/ +clang/tools/driver/CMakeLists.txt +clang/tools/driver/Info.plist.in +clang/tools/include-mapping/ +clang/tools/libclang/ +clang/tools/nvptx-arch/ +clang/tools/scan-build/ +clang/tools/scan-build-py/ +clang/tools/scan-view/ +clang/unittests/ +clang/utils/ABITest/ +clang/utils/CIndex/ +clang/utils/CaptureCmd +clang/utils/ClangVisualizers/ +clang/utils/CmpDriver +clang/utils/FindSpecRefs +clang/utils/FuzzTest +clang/utils/TableGen/CMakeLists.txt +clang/utils/TestUtils/ +clang/utils/VtableTest/ +clang/utils/analyze_safe_buffer_debug_notes.py +clang/utils/analyzer/ +clang/utils/bash-autocomplete.sh +clang/utils/builtin-defines.c +clang/utils/bundle_resources.py +clang/utils/check_cfc/ +clang/utils/clangdiag.py +clang/utils/convert_arm_neon.py +clang/utils/creduce-clang-crash.py +clang/utils/find-unused-diagnostics.sh +clang/utils/hmaptool/ +clang/utils/make-ast-dump-check.sh +clang/utils/modfuzz.py +clang/utils/module-deps-to-rsp.py +clang/utils/perf-training/ +clang/utils/token-delta.py +clang/utils/valgrind/ +clang/www/ +clang-tools-extra/ +cmake/ +compiler-rt/.gitignore +compiler-rt/CMakeLists.txt +compiler-rt/CODE_OWNERS.TXT +compiler-rt/cmake/ +compiler-rt/docs/ +compiler-rt/include/CMakeLists.txt +compiler-rt/lib/CMakeLists.txt +compiler-rt/lib/asan/.clang-format +compiler-rt/lib/asan/CMakeLists.txt +compiler-rt/lib/asan/scripts/ +compiler-rt/lib/asan/tests/ +compiler-rt/lib/asan_abi/CMakeLists.txt +compiler-rt/lib/builtins/CMakeLists.txt +compiler-rt/lib/builtins/Darwin-excludes/ +compiler-rt/lib/builtins/macho_embedded/ +compiler-rt/lib/cfi/CMakeLists.txt +compiler-rt/lib/ctx_profile/CMakeLists.txt +compiler-rt/lib/ctx_profile/tests/CMakeLists.txt +compiler-rt/lib/dfsan/.clang-format +compiler-rt/lib/dfsan/CMakeLists.txt +compiler-rt/lib/dfsan/scripts/ +compiler-rt/lib/fuzzer/CMakeLists.txt +compiler-rt/lib/fuzzer/afl/ +compiler-rt/lib/fuzzer/build.sh +compiler-rt/lib/fuzzer/dataflow/ +compiler-rt/lib/fuzzer/scripts/ +compiler-rt/lib/fuzzer/standalone/ +compiler-rt/lib/fuzzer/tests/ +compiler-rt/lib/gwp_asan/CMakeLists.txt +compiler-rt/lib/gwp_asan/scripts/ +compiler-rt/lib/gwp_asan/tests/ +compiler-rt/lib/hwasan/.clang-format +compiler-rt/lib/hwasan/CMakeLists.txt +compiler-rt/lib/hwasan/scripts/ +compiler-rt/lib/interception/.clang-format +compiler-rt/lib/interception/CMakeLists.txt +compiler-rt/lib/interception/tests/ +compiler-rt/lib/lsan/.clang-format +compiler-rt/lib/lsan/CMakeLists.txt +compiler-rt/lib/memprof/CMakeLists.txt +compiler-rt/lib/memprof/tests/CMakeLists.txt +compiler-rt/lib/msan/.clang-format +compiler-rt/lib/msan/CMakeLists.txt +compiler-rt/lib/msan/tests/ +compiler-rt/lib/nsan/CMakeLists.txt +compiler-rt/lib/nsan/tests/CMakeLists.txt +compiler-rt/lib/orc/CMakeLists.txt +compiler-rt/lib/orc/tests/CMakeLists.txt +compiler-rt/lib/orc/tests/tools/CMakeLists.txt +compiler-rt/lib/orc/tests/unit/CMakeLists.txt +compiler-rt/lib/profile/CMakeLists.txt +compiler-rt/lib/rtsan/CMakeLists.txt +compiler-rt/lib/rtsan/tests/CMakeLists.txt +compiler-rt/lib/safestack/.clang-format +compiler-rt/lib/safestack/CMakeLists.txt +compiler-rt/lib/sanitizer_common/.clang-format +compiler-rt/lib/sanitizer_common/CMakeLists.txt +compiler-rt/lib/sanitizer_common/scripts/ +compiler-rt/lib/sanitizer_common/symbolizer/CMakeLists.txt +compiler-rt/lib/sanitizer_common/tests/ +compiler-rt/lib/scudo/standalone/CMakeLists.txt +compiler-rt/lib/scudo/standalone/benchmarks/ +compiler-rt/lib/scudo/standalone/fuzz/CMakeLists.txt +compiler-rt/lib/scudo/standalone/tests/ +compiler-rt/lib/scudo/standalone/tools/ +compiler-rt/lib/stats/CMakeLists.txt +compiler-rt/lib/tsan/.clang-format +compiler-rt/lib/tsan/CMakeLists.txt +compiler-rt/lib/tsan/analyze_libtsan.sh +compiler-rt/lib/tsan/check_analyze.sh +compiler-rt/lib/tsan/check_cmake.sh +compiler-rt/lib/tsan/dd/CMakeLists.txt +compiler-rt/lib/tsan/go/build.bat +compiler-rt/lib/tsan/go/buildgo.sh +compiler-rt/lib/tsan/rtl/CMakeLists.txt +compiler-rt/lib/tsan/tests/ +compiler-rt/lib/ubsan/CMakeLists.txt +compiler-rt/lib/ubsan_minimal/CMakeLists.txt +compiler-rt/lib/xray/CMakeLists.txt +compiler-rt/lib/xray/tests/ +compiler-rt/test/ +compiler-rt/tools/ +compiler-rt/unittests/ +compiler-rt/utils/ +compiler-rt/www/ +cross-project-tests/ +flang/ +libc/ +libclc/ +libcxx/.clang-format +libcxx/.clang-tidy +libcxx/.gitignore +libcxx/CMakeLists.txt +libcxx/TODO.TXT +libcxx/appveyor-reqs-install.cmd +libcxx/appveyor.yml +libcxx/benchmarks/ +libcxx/cmake/ +libcxx/docs/ +libcxx/include/CMakeLists.txt +libcxx/include/__config_site.in +libcxx/include/__support/ +libcxx/lib/ +libcxx/modules/CMakeLists.txt +libcxx/modules/CMakeLists.txt.in +libcxx/modules/README.md +libcxx/src/CMakeLists.txt +libcxx/src/support/win32/ +libcxx/test/ +libcxx/utils/ +libcxxabi/ +libunwind/.clang-format +libunwind/CMakeLists.txt +libunwind/cmake/ +libunwind/docs/ +libunwind/include/CMakeLists.txt +libunwind/src/CMakeLists.txt +libunwind/test/ +lld/CMakeLists.txt +lld/COFF/CMakeLists.txt +lld/Common/CMakeLists.txt +lld/ELF/CMakeLists.txt +lld/MachO/CMakeLists.txt +lld/MinGW/ +lld/cmake/ +lld/docs/CMakeLists.txt +lld/test/ +lld/tools/lld/CMakeLists.txt +lld/unittests/ +lld/utils/ +lld/wasm/ +lldb/.clang-format +lldb/.clang-tidy +lldb/.gitignore +lldb/CMakeLists.txt +lldb/CodeOwners.rst +lldb/bindings/CMakeLists.txt +lldb/bindings/lua/CMakeLists.txt +lldb/bindings/python/CMakeLists.txt +lldb/bindings/python/get-python-config.py +lldb/cmake/ +lldb/docs/.htaccess +lldb/docs/CMakeLists.txt +lldb/docs/conf.py +lldb/docs/doxygen-mainpage.dox +lldb/docs/doxygen.cfg.in +lldb/docs/index.rst +lldb/docs/resources/ +lldb/docs/testsuite/ +lldb/docs/use/ +lldb/examples/ +lldb/include/lldb/Host/android/ +lldb/include/lldb/Host/linux/ +lldb/include/lldb/Host/macosx/ +lldb/include/lldb/Host/windows/ +lldb/packages/ +lldb/resources/ +lldb/scripts/ +lldb/source/API/CMakeLists.txt +lldb/source/Breakpoint/CMakeLists.txt +lldb/source/CMakeLists.txt +lldb/source/Commands/CMakeLists.txt +lldb/source/Core/CMakeLists.txt +lldb/source/DataFormatters/CMakeLists.txt +lldb/source/Expression/CMakeLists.txt +lldb/source/Host/CMakeLists.txt +lldb/source/Host/android/ +lldb/source/Host/linux/ +lldb/source/Host/macosx/ +lldb/source/Host/windows/ +lldb/source/Initialization/CMakeLists.txt +lldb/source/Interpreter/CMakeLists.txt +lldb/source/Plugins/ABI/AArch64/CMakeLists.txt +lldb/source/Plugins/ABI/ARC/CMakeLists.txt +lldb/source/Plugins/ABI/ARM/CMakeLists.txt +lldb/source/Plugins/ABI/CMakeLists.txt +lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt +lldb/source/Plugins/ABI/MSP430/CMakeLists.txt +lldb/source/Plugins/ABI/Mips/CMakeLists.txt +lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt +lldb/source/Plugins/ABI/RISCV/CMakeLists.txt +lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt +lldb/source/Plugins/ABI/X86/CMakeLists.txt +lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt +lldb/source/Plugins/Architecture/Arm/CMakeLists.txt +lldb/source/Plugins/Architecture/CMakeLists.txt +lldb/source/Plugins/Architecture/Mips/CMakeLists.txt +lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt +lldb/source/Plugins/CMakeLists.txt +lldb/source/Plugins/Disassembler/CMakeLists.txt +lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/Darwin-Kernel/ +lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ +lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/Static/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/wasm-DYLD/CMakeLists.txt +lldb/source/Plugins/ExpressionParser/CMakeLists.txt +lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt +lldb/source/Plugins/Instruction/ARM/CMakeLists.txt +lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt +lldb/source/Plugins/Instruction/CMakeLists.txt +lldb/source/Plugins/Instruction/LoongArch/CMakeLists.txt +lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt +lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt +lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt +lldb/source/Plugins/Instruction/RISCV/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/ASanLibsanitizers/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/Utility/CMakeLists.txt +lldb/source/Plugins/JITLoader/CMakeLists.txt +lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt +lldb/source/Plugins/Language/CMakeLists.txt +lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt +lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt +lldb/source/Plugins/Language/ObjC/CMakeLists.txt +lldb/source/Plugins/Language/ObjCPlusPlus/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/ObjC/GNUstepObjCRuntime/CMakeLists.txt +lldb/source/Plugins/MemoryHistory/CMakeLists.txt +lldb/source/Plugins/MemoryHistory/asan/CMakeLists.txt +lldb/source/Plugins/ObjectContainer/BSD-Archive/CMakeLists.txt +lldb/source/Plugins/ObjectContainer/CMakeLists.txt +lldb/source/Plugins/ObjectContainer/Mach-O-Fileset/CMakeLists.txt +lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ +lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt +lldb/source/Plugins/ObjectFile/CMakeLists.txt +lldb/source/Plugins/ObjectFile/COFF/CMakeLists.txt +lldb/source/Plugins/ObjectFile/ELF/CMakeLists.txt +lldb/source/Plugins/ObjectFile/JSON/CMakeLists.txt +lldb/source/Plugins/ObjectFile/Mach-O/ +lldb/source/Plugins/ObjectFile/Minidump/CMakeLists.txt +lldb/source/Plugins/ObjectFile/PDB/CMakeLists.txt +lldb/source/Plugins/ObjectFile/PECOFF/ +lldb/source/Plugins/ObjectFile/Placeholder/CMakeLists.txt +lldb/source/Plugins/ObjectFile/wasm/CMakeLists.txt +lldb/source/Plugins/OperatingSystem/CMakeLists.txt +lldb/source/Plugins/OperatingSystem/Python/CMakeLists.txt +lldb/source/Plugins/Platform/Android/ +lldb/source/Plugins/Platform/CMakeLists.txt +lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt +lldb/source/Plugins/Platform/Linux/ +lldb/source/Plugins/Platform/MacOSX/ +lldb/source/Plugins/Platform/NetBSD/CMakeLists.txt +lldb/source/Plugins/Platform/OpenBSD/CMakeLists.txt +lldb/source/Plugins/Platform/POSIX/CMakeLists.txt +lldb/source/Plugins/Platform/QemuUser/CMakeLists.txt +lldb/source/Plugins/Platform/Windows/ +lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt +lldb/source/Plugins/Process/CMakeLists.txt +lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt +lldb/source/Plugins/Process/FreeBSDKernel/CMakeLists.txt +lldb/source/Plugins/Process/Linux/ +lldb/source/Plugins/Process/MacOSX-Kernel/ +lldb/source/Plugins/Process/NetBSD/CMakeLists.txt +lldb/source/Plugins/Process/POSIX/CMakeLists.txt +lldb/source/Plugins/Process/Utility/CMakeLists.txt +lldb/source/Plugins/Process/Windows/ +lldb/source/Plugins/Process/elf-core/CMakeLists.txt +lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt +lldb/source/Plugins/Process/mach-core/ +lldb/source/Plugins/Process/minidump/CMakeLists.txt +lldb/source/Plugins/Process/scripted/CMakeLists.txt +lldb/source/Plugins/REPL/CMakeLists.txt +lldb/source/Plugins/REPL/Clang/CMakeLists.txt +lldb/source/Plugins/RegisterTypeBuilder/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt +lldb/source/Plugins/StructuredData/CMakeLists.txt +lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt +lldb/source/Plugins/SymbolFile/Breakpad/CMakeLists.txt +lldb/source/Plugins/SymbolFile/CMakeLists.txt +lldb/source/Plugins/SymbolFile/CTF/CMakeLists.txt +lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt +lldb/source/Plugins/SymbolFile/JSON/CMakeLists.txt +lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt +lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt +lldb/source/Plugins/SymbolFile/Symtab/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/DebugSymbols/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/Debuginfod/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/Default/CMakeLists.txt +lldb/source/Plugins/SymbolVendor/CMakeLists.txt +lldb/source/Plugins/SymbolVendor/ELF/CMakeLists.txt +lldb/source/Plugins/SymbolVendor/MacOSX/ +lldb/source/Plugins/SymbolVendor/PECOFF/CMakeLists.txt +lldb/source/Plugins/SymbolVendor/wasm/CMakeLists.txt +lldb/source/Plugins/SystemRuntime/ +lldb/source/Plugins/Trace/CMakeLists.txt +lldb/source/Plugins/Trace/common/CMakeLists.txt +lldb/source/Plugins/Trace/intel-pt/CMakeLists.txt +lldb/source/Plugins/TraceExporter/CMakeLists.txt +lldb/source/Plugins/TraceExporter/common/CMakeLists.txt +lldb/source/Plugins/TraceExporter/ctf/CMakeLists.txt +lldb/source/Plugins/TypeSystem/CMakeLists.txt +lldb/source/Plugins/TypeSystem/Clang/CMakeLists.txt +lldb/source/Plugins/UnwindAssembly/CMakeLists.txt +lldb/source/Plugins/UnwindAssembly/InstEmulation/CMakeLists.txt +lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt +lldb/source/Symbol/CMakeLists.txt +lldb/source/Target/CMakeLists.txt +lldb/source/Utility/CMakeLists.txt +lldb/source/Version/CMakeLists.txt +lldb/test/ +lldb/tools/CMakeLists.txt +lldb/tools/argdumper/CMakeLists.txt +lldb/tools/darwin-debug/ +lldb/tools/darwin-threads/ +lldb/tools/debugserver/ +lldb/tools/driver/CMakeLists.txt +lldb/tools/driver/lldb-Info.plist.in +lldb/tools/intel-features/ +lldb/tools/lldb-dap/ +lldb/tools/lldb-fuzzer/ +lldb/tools/lldb-instr/CMakeLists.txt +lldb/tools/lldb-server/CMakeLists.txt +lldb/tools/lldb-test/ +lldb/tools/lldb-vscode +lldb/unittests/ +lldb/use_lldb_suite_root.py +lldb/utils/CMakeLists.txt +lldb/utils/TableGen/CMakeLists.txt +lldb/utils/lit-cpuid/ +lldb/utils/lldb-dotest/ +lldb/utils/lldb-repro/ +lldb/utils/lui/ +llvm/.clang-format +llvm/.clang-tidy +llvm/.gitattributes +llvm/.gitignore +llvm/CMakeLists.txt +llvm/CODE_OWNERS.TXT +llvm/CREDITS.TXT +llvm/README.txt +llvm/RELEASE_TESTERS.TXT +llvm/benchmarks/ +llvm/bindings/ +llvm/cmake/ +llvm/configure +llvm/docs/ +llvm/examples/ +llvm/include/CMakeLists.txt +llvm/include/llvm/CMakeLists.txt +llvm/include/llvm/CodeGen/CMakeLists.txt +llvm/include/llvm/Config/ +llvm/include/llvm/Frontend/CMakeLists.txt +llvm/include/llvm/Frontend/OpenACC/CMakeLists.txt +llvm/include/llvm/Frontend/OpenMP/CMakeLists.txt +llvm/include/llvm/IR/CMakeLists.txt +llvm/include/llvm/Support/CMakeLists.txt +llvm/include/llvm/Support/LICENSE.TXT +llvm/include/llvm/TargetParser/CMakeLists.txt +llvm/lib/Analysis/CMakeLists.txt +llvm/lib/Analysis/models/ +llvm/lib/AsmParser/CMakeLists.txt +llvm/lib/BinaryFormat/CMakeLists.txt +llvm/lib/Bitcode/CMakeLists.txt +llvm/lib/Bitcode/Reader/CMakeLists.txt +llvm/lib/Bitcode/Writer/CMakeLists.txt +llvm/lib/Bitstream/CMakeLists.txt +llvm/lib/Bitstream/Reader/CMakeLists.txt +llvm/lib/CMakeLists.txt +llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt +llvm/lib/CodeGen/CMakeLists.txt +llvm/lib/CodeGen/GlobalISel/CMakeLists.txt +llvm/lib/CodeGen/MIRParser/CMakeLists.txt +llvm/lib/CodeGen/README.txt +llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt +llvm/lib/CodeGenData/CMakeLists.txt +llvm/lib/CodeGenTypes/CMakeLists.txt +llvm/lib/DWARFLinker/CMakeLists.txt +llvm/lib/DWARFLinker/Classic/CMakeLists.txt +llvm/lib/DWARFLinker/Parallel/CMakeLists.txt +llvm/lib/DWP/CMakeLists.txt +llvm/lib/DebugInfo/BTF/CMakeLists.txt +llvm/lib/DebugInfo/CMakeLists.txt +llvm/lib/DebugInfo/CodeView/CMakeLists.txt +llvm/lib/DebugInfo/DWARF/CMakeLists.txt +llvm/lib/DebugInfo/GSYM/CMakeLists.txt +llvm/lib/DebugInfo/LogicalView/CMakeLists.txt +llvm/lib/DebugInfo/MSF/CMakeLists.txt +llvm/lib/DebugInfo/PDB/CMakeLists.txt +llvm/lib/DebugInfo/Symbolize/CMakeLists.txt +llvm/lib/Debuginfod/CMakeLists.txt +llvm/lib/Demangle/CMakeLists.txt +llvm/lib/ExecutionEngine/CMakeLists.txt +llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt +llvm/lib/ExecutionEngine/IntelJITProfiling/CMakeLists.txt +llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt +llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt +llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt +llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt +llvm/lib/ExecutionEngine/Orc/CMakeLists.txt +llvm/lib/ExecutionEngine/Orc/Debugging/CMakeLists.txt +llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt +llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt +llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt +llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt +llvm/lib/Extensions/ +llvm/lib/FileCheck/CMakeLists.txt +llvm/lib/Frontend/CMakeLists.txt +llvm/lib/Frontend/Driver/CMakeLists.txt +llvm/lib/Frontend/HLSL/CMakeLists.txt +llvm/lib/Frontend/Offloading/CMakeLists.txt +llvm/lib/Frontend/OpenACC/CMakeLists.txt +llvm/lib/Frontend/OpenMP/CMakeLists.txt +llvm/lib/FuzzMutate/CMakeLists.txt +llvm/lib/Fuzzer/ +llvm/lib/IR/CMakeLists.txt +llvm/lib/IRPrinter/CMakeLists.txt +llvm/lib/IRReader/CMakeLists.txt +llvm/lib/InterfaceStub/CMakeLists.txt +llvm/lib/LTO/CMakeLists.txt +llvm/lib/LineEditor/CMakeLists.txt +llvm/lib/Linker/CMakeLists.txt +llvm/lib/MC/CMakeLists.txt +llvm/lib/MC/MCDisassembler/CMakeLists.txt +llvm/lib/MC/MCParser/CMakeLists.txt +llvm/lib/MCA/CMakeLists.txt +llvm/lib/ObjCopy/CMakeLists.txt +llvm/lib/Object/CMakeLists.txt +llvm/lib/ObjectYAML/CMakeLists.txt +llvm/lib/Option/CMakeLists.txt +llvm/lib/Passes/CMakeLists.txt +llvm/lib/ProfileData/CMakeLists.txt +llvm/lib/ProfileData/Coverage/CMakeLists.txt +llvm/lib/Remarks/CMakeLists.txt +llvm/lib/SandboxIR/CMakeLists.txt +llvm/lib/Support/BLAKE3/.clang-format +llvm/lib/Support/BLAKE3/CMakeLists.txt +llvm/lib/Support/CMakeLists.txt +llvm/lib/Support/rpmalloc/ +llvm/lib/TableGen/CMakeLists.txt +llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt +llvm/lib/Target/AArch64/CMakeLists.txt +llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt +llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt +llvm/lib/Target/AArch64/Utils/CMakeLists.txt +llvm/lib/Target/AArch64/peephole-sxtw.mir +llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt +llvm/lib/Target/AMDGPU/CMakeLists.txt +llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt +llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt +llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt +llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt +llvm/lib/Target/ARC/CMakeLists.txt +llvm/lib/Target/ARC/Disassembler/CMakeLists.txt +llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt +llvm/lib/Target/ARM/AsmParser/CMakeLists.txt +llvm/lib/Target/ARM/CMakeLists.txt +llvm/lib/Target/ARM/Disassembler/CMakeLists.txt +llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/ARM/README-Thumb.txt +llvm/lib/Target/ARM/README-Thumb2.txt +llvm/lib/Target/ARM/README.txt +llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt +llvm/lib/Target/ARM/Utils/CMakeLists.txt +llvm/lib/Target/AVR/AsmParser/CMakeLists.txt +llvm/lib/Target/AVR/CMakeLists.txt +llvm/lib/Target/AVR/Disassembler/CMakeLists.txt +llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt +llvm/lib/Target/BPF/AsmParser/CMakeLists.txt +llvm/lib/Target/BPF/CMakeLists.txt +llvm/lib/Target/BPF/Disassembler/CMakeLists.txt +llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt +llvm/lib/Target/CMakeLists.txt +llvm/lib/Target/CSKY/AsmParser/CMakeLists.txt +llvm/lib/Target/CSKY/CMakeLists.txt +llvm/lib/Target/CSKY/Disassembler/CMakeLists.txt +llvm/lib/Target/CSKY/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/CSKY/TargetInfo/CMakeLists.txt +llvm/lib/Target/DirectX/CMakeLists.txt +llvm/lib/Target/DirectX/DXILWriter/CMakeLists.txt +llvm/lib/Target/DirectX/DirectXIRPasses/CMakeLists.txt +llvm/lib/Target/DirectX/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/DirectX/TargetInfo/CMakeLists.txt +llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt +llvm/lib/Target/Hexagon/CMakeLists.txt +llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt +llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt +llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt +llvm/lib/Target/Lanai/CMakeLists.txt +llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt +llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt +llvm/lib/Target/LoongArch/AsmParser/CMakeLists.txt +llvm/lib/Target/LoongArch/CMakeLists.txt +llvm/lib/Target/LoongArch/Disassembler/CMakeLists.txt +llvm/lib/Target/LoongArch/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/LoongArch/TargetInfo/CMakeLists.txt +llvm/lib/Target/M68k/AsmParser/CMakeLists.txt +llvm/lib/Target/M68k/CMakeLists.txt +llvm/lib/Target/M68k/Disassembler/CMakeLists.txt +llvm/lib/Target/M68k/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/M68k/TargetInfo/CMakeLists.txt +llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt +llvm/lib/Target/MSP430/CMakeLists.txt +llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt +llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/MSP430/README.txt +llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt +llvm/lib/Target/Mips/AsmParser/CMakeLists.txt +llvm/lib/Target/Mips/CMakeLists.txt +llvm/lib/Target/Mips/Disassembler/CMakeLists.txt +llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt +llvm/lib/Target/NVPTX/CMakeLists.txt +llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt +llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt +llvm/lib/Target/PowerPC/CMakeLists.txt +llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt +llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/PowerPC/README.txt +llvm/lib/Target/PowerPC/README_ALTIVEC.txt +llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt +llvm/lib/Target/README.txt +llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt +llvm/lib/Target/RISCV/CMakeLists.txt +llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt +llvm/lib/Target/RISCV/MCA/CMakeLists.txt +llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt +llvm/lib/Target/SPIRV/Analysis/CMakeLists.txt +llvm/lib/Target/SPIRV/CMakeLists.txt +llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/SPIRV/TargetInfo/CMakeLists.txt +llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt +llvm/lib/Target/Sparc/CMakeLists.txt +llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt +llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Sparc/README.txt +llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt +llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt +llvm/lib/Target/SystemZ/CMakeLists.txt +llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt +llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt +llvm/lib/Target/VE/AsmParser/CMakeLists.txt +llvm/lib/Target/VE/CMakeLists.txt +llvm/lib/Target/VE/Disassembler/CMakeLists.txt +llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/VE/TargetInfo/CMakeLists.txt +llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt +llvm/lib/Target/WebAssembly/CMakeLists.txt +llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt +llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt +llvm/lib/Target/WebAssembly/Utils/CMakeLists.txt +llvm/lib/Target/X86/AsmParser/CMakeLists.txt +llvm/lib/Target/X86/CMakeLists.txt +llvm/lib/Target/X86/Disassembler/CMakeLists.txt +llvm/lib/Target/X86/MCA/CMakeLists.txt +llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/X86/README-FPStack.txt +llvm/lib/Target/X86/README-SSE.txt +llvm/lib/Target/X86/README-X86-64.txt +llvm/lib/Target/X86/README.txt +llvm/lib/Target/X86/TargetInfo/CMakeLists.txt +llvm/lib/Target/XCore/CMakeLists.txt +llvm/lib/Target/XCore/Disassembler/CMakeLists.txt +llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/XCore/README.txt +llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt +llvm/lib/Target/Xtensa/AsmParser/CMakeLists.txt +llvm/lib/Target/Xtensa/CMakeLists.txt +llvm/lib/Target/Xtensa/Disassembler/CMakeLists.txt +llvm/lib/Target/Xtensa/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Xtensa/TargetInfo/CMakeLists.txt +llvm/lib/TargetParser/CMakeLists.txt +llvm/lib/Testing/Annotations/CMakeLists.txt +llvm/lib/Testing/CMakeLists.txt +llvm/lib/Testing/Support/CMakeLists.txt +llvm/lib/TextAPI/BinaryReader/CMakeLists.txt +llvm/lib/TextAPI/CMakeLists.txt +llvm/lib/ToolDrivers/CMakeLists.txt +llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt +llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt +llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt +llvm/lib/Transforms/CFGuard/CMakeLists.txt +llvm/lib/Transforms/CMakeLists.txt +llvm/lib/Transforms/Coroutines/CMakeLists.txt +llvm/lib/Transforms/HipStdPar/CMakeLists.txt +llvm/lib/Transforms/IPO/CMakeLists.txt +llvm/lib/Transforms/InstCombine/CMakeLists.txt +llvm/lib/Transforms/Instrumentation/CMakeLists.txt +llvm/lib/Transforms/ObjCARC/CMakeLists.txt +llvm/lib/Transforms/Scalar/CMakeLists.txt +llvm/lib/Transforms/Utils/CMakeLists.txt +llvm/lib/Transforms/Vectorize/CMakeLists.txt +llvm/lib/WindowsDriver/CMakeLists.txt +llvm/lib/WindowsManifest/CMakeLists.txt +llvm/lib/XRay/CMakeLists.txt +llvm/projects/ +llvm/resources/ +llvm/runtimes/ +llvm/test/ +llvm/tools/CMakeLists.txt +llvm/tools/bugpoint/CMakeLists.txt +llvm/tools/bugpoint-passes/ +llvm/tools/dsymutil/ +llvm/tools/dxil-dis/ +llvm/tools/gold/ +llvm/tools/llc/CMakeLists.txt +llvm/tools/lli/CMakeLists.txt +llvm/tools/lli/ChildTarget/CMakeLists.txt +llvm/tools/llvm-ar/CMakeLists.txt +llvm/tools/llvm-as/CMakeLists.txt +llvm/tools/llvm-as-fuzzer/ +llvm/tools/llvm-bcanalyzer/CMakeLists.txt +llvm/tools/llvm-c-test/ +llvm/tools/llvm-cat/ +llvm/tools/llvm-cfi-verify/ - llvm/tools/llvm-cgdata/ +llvm/tools/llvm-config/ +llvm/tools/llvm-cov/CMakeLists.txt +llvm/tools/llvm-cvtres/ +llvm/tools/llvm-cxxdump/CMakeLists.txt +llvm/tools/llvm-cxxfilt/CMakeLists.txt +llvm/tools/llvm-cxxmap/CMakeLists.txt +llvm/tools/llvm-debuginfo-analyzer/CMakeLists.txt +llvm/tools/llvm-debuginfod/ +llvm/tools/llvm-debuginfod-find/ +llvm/tools/llvm-diff/CMakeLists.txt +llvm/tools/llvm-diff/lib/CMakeLists.txt +llvm/tools/llvm-dis/CMakeLists.txt +llvm/tools/llvm-dis-fuzzer/ +llvm/tools/llvm-dlang-demangle-fuzzer/ +llvm/tools/llvm-driver/ +llvm/tools/llvm-dwarfdump/CMakeLists.txt +llvm/tools/llvm-dwarfdump/fuzzer/ +llvm/tools/llvm-dwarfutil/CMakeLists.txt +llvm/tools/llvm-dwp/CMakeLists.txt +llvm/tools/llvm-exegesis/ +llvm/tools/llvm-extract/CMakeLists.txt +llvm/tools/llvm-gsymutil/ +llvm/tools/llvm-ifs/ +llvm/tools/llvm-isel-fuzzer/ +llvm/tools/llvm-itanium-demangle-fuzzer/ +llvm/tools/llvm-jitlink/ +llvm/tools/llvm-jitlistener/ +llvm/tools/llvm-libtool-darwin/ +llvm/tools/llvm-link/CMakeLists.txt +llvm/tools/llvm-lipo/ +llvm/tools/llvm-lto/CMakeLists.txt +llvm/tools/llvm-lto2/CMakeLists.txt +llvm/tools/llvm-mc/CMakeLists.txt +llvm/tools/llvm-mc-assemble-fuzzer/ +llvm/tools/llvm-mc-disassemble-fuzzer/ +llvm/tools/llvm-mca/CMakeLists.txt +llvm/tools/llvm-microsoft-demangle-fuzzer/ +llvm/tools/llvm-ml/ +llvm/tools/llvm-modextract/CMakeLists.txt +llvm/tools/llvm-mt/ +llvm/tools/llvm-nm/CMakeLists.txt +llvm/tools/llvm-objcopy/CMakeLists.txt +llvm/tools/llvm-objdump/CMakeLists.txt +llvm/tools/llvm-opt-fuzzer/ +llvm/tools/llvm-opt-report/ +llvm/tools/llvm-pdbutil/CMakeLists.txt +llvm/tools/llvm-profdata/CMakeLists.txt +llvm/tools/llvm-profgen/ +llvm/tools/llvm-rc/ +llvm/tools/llvm-readobj/CMakeLists.txt +llvm/tools/llvm-readtapi/ +llvm/tools/llvm-reduce/ +llvm/tools/llvm-remarkutil/CMakeLists.txt +llvm/tools/llvm-rtdyld/CMakeLists.txt +llvm/tools/llvm-rust-demangle-fuzzer/ +llvm/tools/llvm-shlib/ +llvm/tools/llvm-sim/CMakeLists.txt +llvm/tools/llvm-size/CMakeLists.txt +llvm/tools/llvm-special-case-list-fuzzer/ +llvm/tools/llvm-split/ +llvm/tools/llvm-stress/CMakeLists.txt +llvm/tools/llvm-strings/CMakeLists.txt +llvm/tools/llvm-symbolizer/CMakeLists.txt +llvm/tools/llvm-tli-checker/CMakeLists.txt +llvm/tools/llvm-undname/ +llvm/tools/llvm-xray/CMakeLists.txt +llvm/tools/llvm-yaml-numeric-parser-fuzzer/ +llvm/tools/llvm-yaml-parser-fuzzer/ +llvm/tools/lto/ +llvm/tools/obj2yaml/ +llvm/tools/opt/CMakeLists.txt +llvm/tools/opt-viewer/ +llvm/tools/reduce-chunk-list/ +llvm/tools/remarks-shlib/ +llvm/tools/sancov/ +llvm/tools/sanstats/ +llvm/tools/spirv-tools/ +llvm/tools/verify-uselistorder/ +llvm/tools/vfabi-demangle-fuzzer/ +llvm/tools/xcode-toolchain/ +llvm/tools/yaml2obj/ +llvm/unittests/ +llvm/utils/DSAclean.py +llvm/utils/DSAextract.py +llvm/utils/FileCheck/ +llvm/utils/GenLibDeps.pl +llvm/utils/GetSourceVersion +llvm/utils/KillTheDoctor/ +llvm/utils/LLVMVisualizers/ +llvm/utils/Misc/ +llvm/utils/PerfectShuffle/ +llvm/utils/Reviewing/ +llvm/utils/TableGen/Basic/CMakeLists.txt +llvm/utils/TableGen/CMakeLists.txt +llvm/utils/TableGen/Common/CMakeLists.txt +llvm/utils/TableGen/README.md +llvm/utils/TableGen/jupyter/ +llvm/utils/TableGen/tdtags +llvm/utils/Target/ +llvm/utils/UnicodeData/ +llvm/utils/UpdateCMakeLists.pl +llvm/utils/UpdateTestChecks/ +llvm/utils/abtest.py +llvm/utils/add_argument_names.py +llvm/utils/bisect +llvm/utils/bisect-skip-count +llvm/utils/bugpoint/ +llvm/utils/bugpoint_gisel_reducer.py +llvm/utils/check-each-file +llvm/utils/check_ninja_deps.py +llvm/utils/chunk-print-before-all.py +llvm/utils/clang-parse-diagnostics-file +llvm/utils/codegen-diff +llvm/utils/collect_and_build_with_pgo.py +llvm/utils/convert-constraint-log-to-z3.py +llvm/utils/count/ +llvm/utils/count_running_jobs.py +llvm/utils/create_ladder_graph.py +llvm/utils/crosstool/ +llvm/utils/demangle_tree.py +llvm/utils/docker/ +llvm/utils/emacs/ +llvm/utils/extract-section.py +llvm/utils/extract_symbols.py +llvm/utils/extract_vplan.py +llvm/utils/filecheck_lint/ +llvm/utils/findmisopt +llvm/utils/findoptdiff +llvm/utils/findsym.pl +llvm/utils/fpcmp/ +llvm/utils/gdb-scripts/ +llvm/utils/git/ +llvm/utils/gn/ +llvm/utils/indirect_calls.py +llvm/utils/jedit/ +llvm/utils/kate/ +llvm/utils/lint/ +llvm/utils/lit/ +llvm/utils/lldbDataFormatters.py +llvm/utils/llvm-gisel-cov.py +llvm/utils/llvm-lit/ +llvm/utils/llvm-locstats/ +llvm/utils/llvm-mca-compare.py +llvm/utils/llvm-native-gxx +llvm/utils/llvm-original-di-preservation.py +llvm/utils/llvm.grm +llvm/utils/merge-stats.py +llvm/utils/mlgo-utils/ +llvm/utils/not/ *** 71 LINES SKIPPED *** From nobody Wed Jun 25 17:53:12 2025 X-Original-To: dev-commits-src-main@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 4bS8Yr6PzNz60Kb2; Wed, 25 Jun 2025 17:53: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 4bS8Yr5c73z3qQ9; Wed, 25 Jun 2025 17:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750874000; 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=XXD/xPfp9U2xo0QtAnF6c8LvaMFBzfNPCwUFagF8DcY=; b=Pbl4GYD28KU1xY+OOMGrb5rLX9cnJjLh0CWX3hAqNlHee9zQ+e9LPTk7rqbTa5JS+vwXnm ThOaM1HhymgSM4pOa/4gNDsfT/Fgo/3++RHLoHbm2QimU8L7ui8PnvEIebD1uvMknvppxt Bn8xVtttcfcmUP9uqP/fhnI7+9EDRUhu+jQIZKBMqvPHSgncHiVhXA+Gj4VN+TDxCsYr3z 8exAYUqzb3lXCnqCU1e7CmTiZUgRt1R8w9KdNDMGJHooQ7bRVAo2xlVsvusiGbii4NrI6E ZPGDtTsyBt4zuZOn3WC/Z3XefkkxQxefWQ9gHmCHjWCMpmSlr29Is2KsgnDcfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750874000; 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=XXD/xPfp9U2xo0QtAnF6c8LvaMFBzfNPCwUFagF8DcY=; b=nLnHC8nGJVxNY212yzp3enzz6jyEseIfrZEy0yJKALnfYpqdspKAo6mMUb35gMlk3mw2J5 BwEL+R3lyiAPhEpzbcIvhQiNpFmpH61B3DkqOlNSQfiUOpiR21lCH7KEnJXoq6Jn1l1/T2 a2RfMixQs0h8o0D2G+9JDPodwPkvxVL+wjBwHc2546WfZFNV8JEVelctpA0mzeV33shFtz nxUp6hQCBjwbexoXiI81w9mldK5RLCFcHd7jhapg5FR5VsWKUrc4YvEonHo6y592Lfx5Rp 9m7P0aWQmQmDsczRDweXZoZQjjrbhLyKMtkH9hYRv95S85LWEfOZUQTkDXt6Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750874000; a=rsa-sha256; cv=none; b=fxnrzamfOYMD6+Wno4zBlpjtx8+FFxE19sj+rDmI94gtZF9XQO/3mTIsJ57QjGGHltW+d9 1KdunfpdoomjXJmFbjX0BvsKPq1DEc8UFxvyzhMnTunP9VpeGKROqhhJTjtSceGk/UvH/p 4aRGronbjEzf/CBShRfQxweK/op+8B8TVKvj6JBFD63QNKTIplBMdKQVNrg5M6WtBGruMo xjIP2k6JLYYAyeT8vEiPNtLpb2aDt0qSuk9px8CEzJpOlYWjl0vTZoSXNW3+XGcE65ba4m OI0BcGjNSgq6Tt1TGx0roJQgulPfWOPJQ6zVn07ELpvAmaNgg/poBfCitQPufw== 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 4bS8Yr4zjjzC8C; Wed, 25 Jun 2025 17:53: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 55PHrK1w034222; Wed, 25 Jun 2025 17:53:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PHrCSR034187; Wed, 25 Jun 2025 17:53:12 GMT (envelope-from git) Date: Wed, 25 Jun 2025 17:53:12 GMT Message-Id: <202506251753.55PHrCSR034187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 4c07abdbacf4 - main - mandoc: Vendor import of upstream at 2025-06-13 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c07abdbacf49e4ba749b8720916d8cd340a50b8 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=4c07abdbacf49e4ba749b8720916d8cd340a50b8 commit 4c07abdbacf49e4ba749b8720916d8cd340a50b8 Merge: 7ed1628066ea 7a0bec970311 Author: Alexander Ziaee AuthorDate: 2025-06-25 17:50:25 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 17:52:14 +0000 mandoc: Vendor import of upstream at 2025-06-13 Interesting changes: + Lb is now part of SNYOPSIS, the LIBRARY section is deprecated + Ft now takes multiple args, and no longer should be quoted + Fix a segfaut on malformed Tg markup contrib/mandoc/mandocdb.c | 27 ++++++++-- contrib/mandoc/mdoc.7 | 109 +++++++++++++++++++++++------------------ contrib/mandoc/mdoc_macro.c | 7 ++- contrib/mandoc/mdoc_validate.c | 37 +++++++++++--- 4 files changed, 117 insertions(+), 63 deletions(-) From nobody Wed Jun 25 17:56:37 2025 X-Original-To: dev-commits-src-main@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 4bS8df3f8pz60Kbm; Wed, 25 Jun 2025 17:56: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 4bS8df0tDkz3v0m; Wed, 25 Jun 2025 17:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750874198; 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=bitcenbwQ7fA5LkBRoiD8NMRJ3b9KvdZj5L9OTNTLzQ=; b=MAVA9ejV7nbnx/pPFt+GfrghS3xHVBDVkL69JSXEb8FxKLpzwUDoIUsuGK7iYQ2Za/Bj/m NjJCQd2Jnh4SBY4ByYG3Y84+l5G3QutOo9lgU8+RxcdLFEpqsJxLv7sK5wGvZ89SF9w058 U52Ul53iJnWaE1/FNg1jpqun2cRrYbLoCkLABJh4n9Kfpgj766lOpGB4HfEtnW00AfRpNz +HE9wXP7FeA/w3QqbmFn4R02ydqj0SEY1CJ2jhYcPKiOj3XbuLPk1tIYP8f1wbj8xZcLjQ Y0dGoXVpM9sTDGJldZh1HdwUmzyXBm11X/d7nGhs6PdP/GrgdPhxo0LBCV14vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750874198; 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=bitcenbwQ7fA5LkBRoiD8NMRJ3b9KvdZj5L9OTNTLzQ=; b=xazIuRpjtez8xUCG2k8eurd9+zlhqYMwhjc/6DnPNXL7ZHKZlAL+1AStVkqp7OfaNqJROW ehzmCYOof2qomFJViKPnqaSKonHhAzNtzmigLkx5kveVs7J29nQQz+93VPp9byn+lCMxto TIjUDYFG23DaF2LtbFFnaHLl20GHWw5qG5qzZMFuTs5pxKYk4CG57M77zb5vCTtERpx64a b3F++pkYfXHUA33gRwXIXVHYS7neIJ/AEZejIPiT10A3tW8HaU8t3usyPy7kv1/lzbGO9t MFEsWsDg53QJjhij4BN/HdTU9Y4jm17/LCfp3tFIjBUcds9cL5BrcZ8qpWBSPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750874198; a=rsa-sha256; cv=none; b=Afhdfq/8smR0834vpmHrVjAt2IXEC+IFRCk2JzF1/v2qUwAB4PuMXK2S9Ak+G14yfIozXS kql6nXXwJ4WdCEzL9BtBXtFF/G8lR9DuSz658+9XG6pP4j8kfF77wwYDdSg0V5DbMk9k2N w8r/tvxqexaRyVH3L/ACxEk0WVYFjllOPF4YT0I6PfI9CEn1BijFDAcya/aZRetr8R18i+ ZoSaH+uqqhlFmqMtw2mm35ma0gO2zgE3/Y2KLWOzKkXm88gxlFgl0KFFmRvY4OCN61V7ec CepoOn09F09ZnL/NqtKErJClTPVf7qwd7JQHVkctTIZHuia2VaSzQbP271ht8g== 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 4bS8df0H6lzC2R; Wed, 25 Jun 2025 17:56: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 55PHubXb035287; Wed, 25 Jun 2025 17:56:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PHubhT035284; Wed, 25 Jun 2025 17:56:37 GMT (envelope-from git) Date: Wed, 25 Jun 2025 17:56:37 GMT Message-Id: <202506251756.55PHubhT035284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1cd5c35d136e - main - counter(9): rate limit periods may be more than 1 second List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cd5c35d136e2c8605b9ba23e6a5879539411947 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1cd5c35d136e2c8605b9ba23e6a5879539411947 commit 1cd5c35d136e2c8605b9ba23e6a5879539411947 Author: Kristof Provost AuthorDate: 2025-06-03 07:07:14 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 17:56:22 +0000 counter(9): rate limit periods may be more than 1 second Teach counter_rate() to deal with periods of more than 1 second, so we can express 'at most 100 in 10 seconds', which is different from 'at most 10 in 1 second'. While here move the struct counter_rate definition into subr_counter.c so users cannot mess with its internals. Add allocation and free functions. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50796 --- share/man/man9/counter.9 | 27 +++++++++++++++++++---- sys/kern/subr_counter.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++-- sys/netinet/ip_icmp.c | 9 ++++---- sys/netinet6/icmp6.c | 9 ++++---- sys/sys/counter.h | 13 ++++------- 5 files changed, 90 insertions(+), 25 deletions(-) diff --git a/share/man/man9/counter.9 b/share/man/man9/counter.9 index 1d3f3281ac0b..05af87e8263e 100644 --- a/share/man/man9/counter.9 +++ b/share/man/man9/counter.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 11, 2021 +.Dd June 19, 2025 .Dt COUNTER 9 .Os .Sh NAME @@ -49,8 +49,14 @@ .Fn counter_u64_fetch "counter_u64_t c" .Ft void .Fn counter_u64_zero "counter_u64_t c" +.Ft struct counter_rate * +.Fn counter_rate_alloc "int flags" "int period" .Ft int64_t .Fn counter_ratecheck "struct counter_rate *cr" "int64_t limit" +.Ft uint64_t +.Fn counter_rate_get "struct counter_rate *cr" +.Ft void +.Fn counter_rate_free "struct counter_rate *cr" .Fn COUNTER_U64_SYSINIT "counter_u64_t c" .Fn COUNTER_U64_DEFINE_EARLY "counter_u64_t c" .In sys/sysctl.h @@ -133,6 +139,13 @@ value for any moment. Clear the counter .Fa c and set it to zero. +.It Fn counter_rate_alloc flags period +Allocate a new struct counter_rate. +.Fa flags +is passed to +.Xr malloc 9 . +.Fa period +is the time over which the rate is checked. .It Fn counter_ratecheck cr limit The function is a multiprocessor-friendly version of .Fn ppsratecheck @@ -140,11 +153,17 @@ which uses .Nm internally. Returns non-negative value if the rate is not yet reached during the current -second, and a negative value otherwise. -If the limit was reached on previous second, but was just reset back to zero, -then +period, and a negative value otherwise. +If the limit was reached during the previous period, but was just reset back +to zero, then .Fn counter_ratecheck returns number of events since previous reset. +.It Fn counter_rate_get cr +The number of hits to this check within the current period. +.It Fn counter_rate_free cr +Free the +.Fa cr +counter. .It Fn COUNTER_U64_SYSINIT c Define a .Xr SYSINIT 9 diff --git a/sys/kern/subr_counter.c b/sys/kern/subr_counter.c index 2cb987cb67f9..b629abc99315 100644 --- a/sys/kern/subr_counter.c +++ b/sys/kern/subr_counter.c @@ -40,6 +40,8 @@ #define IN_SUBR_COUNTER_C #include +static MALLOC_DEFINE(M_COUNTER_RATE, "counter_rate", "counter rate allocations"); + void counter_u64_zero(counter_u64_t c) { @@ -114,6 +116,57 @@ sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS) return (0); } +/* + * counter(9) based rate checking. + */ +struct counter_rate { + counter_u64_t cr_rate; /* Events since last second */ + volatile int cr_lock; /* Lock to clean the struct */ + int cr_ticks; /* Ticks on last clean */ + int cr_over; /* Over limit since cr_ticks? */ + int cr_period; /* Allow cr_rate per cr_period seconds. */ +}; + +struct counter_rate * +counter_rate_alloc(int flags, int period) +{ + struct counter_rate *new; + + new = malloc(sizeof(struct counter_rate), M_COUNTER_RATE, + flags | M_ZERO); + if (new == NULL) + return (NULL); + + new->cr_rate = counter_u64_alloc(flags); + if (new->cr_rate == NULL) { + free(new, M_COUNTER_RATE); + return (NULL); + } + new->cr_ticks = ticks; + new->cr_period = period; + + return (new); +} + +void +counter_rate_free(struct counter_rate *rate) +{ + if (rate == NULL) + return; + + counter_u64_free(rate->cr_rate); + free(rate, M_COUNTER_RATE); +} + +uint64_t +counter_rate_get(struct counter_rate *cr) +{ + if (cr->cr_ticks < (tick - (hz * cr->cr_period))) + return (0); + + return (counter_u64_fetch(cr->cr_rate)); +} + /* * MP-friendly version of ppsratecheck(). * @@ -132,7 +185,7 @@ counter_ratecheck(struct counter_rate *cr, int64_t limit) val = cr->cr_over; now = ticks; - if ((u_int)(now - cr->cr_ticks) >= hz) { + if ((u_int)(now - cr->cr_ticks) >= (hz * cr->cr_period)) { /* * Time to clear the structure, we are in the next second. * First try unlocked read, and then proceed with atomic. @@ -143,7 +196,7 @@ counter_ratecheck(struct counter_rate *cr, int64_t limit) * Check if other thread has just went through the * reset sequence before us. */ - if ((u_int)(now - cr->cr_ticks) >= hz) { + if ((u_int)(now - cr->cr_ticks) >= (hz * cr->cr_period)) { val = counter_u64_fetch(cr->cr_rate); counter_u64_zero(cr->cr_rate); cr->cr_over = 0; diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 17d15d7d9629..cb4b6df57c57 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1090,7 +1090,7 @@ ip_next_mtu(int mtu, int dir) * the 'final' error, but it doesn't make sense to solve the printing * delay with more complex code. */ -VNET_DEFINE_STATIC(struct counter_rate, icmp_rates[BANDLIM_MAX]); +VNET_DEFINE_STATIC(struct counter_rate *, icmp_rates[BANDLIM_MAX]); #define V_icmp_rates VNET(icmp_rates) static const char *icmp_rate_descrs[BANDLIM_MAX] = { @@ -1158,8 +1158,7 @@ icmp_bandlimit_init(void) { for (int i = 0; i < BANDLIM_MAX; i++) { - V_icmp_rates[i].cr_rate = counter_u64_alloc(M_WAITOK); - V_icmp_rates[i].cr_ticks = ticks; + V_icmp_rates[i] = counter_rate_alloc(M_WAITOK, 1); icmplim_new_jitter(i); } } @@ -1172,7 +1171,7 @@ icmp_bandlimit_uninit(void) { for (int i = 0; i < BANDLIM_MAX; i++) - counter_u64_free(V_icmp_rates[i].cr_rate); + counter_rate_free(V_icmp_rates[i]); } VNET_SYSUNINIT(icmp_bandlimit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, icmp_bandlimit_uninit, NULL); @@ -1189,7 +1188,7 @@ badport_bandlim(int which) KASSERT(which >= 0 && which < BANDLIM_MAX, ("%s: which %d", __func__, which)); - pps = counter_ratecheck(&V_icmp_rates[which], V_icmplim + + pps = counter_ratecheck(V_icmp_rates[which], V_icmplim + V_icmplim_curr_jitter[which]); if (pps > 0) { if (V_icmplim_output) diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 9ea640fd24c8..d89515d7eda5 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2844,7 +2844,7 @@ sysctl_icmp6lim_and_jitter(SYSCTL_HANDLER_ARGS) } -VNET_DEFINE_STATIC(struct counter_rate, icmp6_rates[RATELIM_MAX]); +VNET_DEFINE_STATIC(struct counter_rate *, icmp6_rates[RATELIM_MAX]); #define V_icmp6_rates VNET(icmp6_rates) static void @@ -2852,8 +2852,7 @@ icmp6_ratelimit_init(void) { for (int i = 0; i < RATELIM_MAX; i++) { - V_icmp6_rates[i].cr_rate = counter_u64_alloc(M_WAITOK); - V_icmp6_rates[i].cr_ticks = ticks; + V_icmp6_rates[i] = counter_rate_alloc(M_WAITOK, 1); icmp6lim_new_jitter(i); } } @@ -2866,7 +2865,7 @@ icmp6_ratelimit_uninit(void) { for (int i = 0; i < RATELIM_MAX; i++) - counter_u64_free(V_icmp6_rates[i].cr_rate); + counter_rate_free(V_icmp6_rates[i]); } VNET_SYSUNINIT(icmp6_ratelimit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, icmp6_ratelimit_uninit, NULL); @@ -2916,7 +2915,7 @@ icmp6_ratelimit(const struct in6_addr *dst, const int type, const int code) break; }; - pps = counter_ratecheck(&V_icmp6_rates[which], V_icmp6errppslim + + pps = counter_ratecheck(V_icmp6_rates[which], V_icmp6errppslim + V_icmp6lim_curr_jitter[which]); if (pps > 0) { if (V_icmp6lim_output) diff --git a/sys/sys/counter.h b/sys/sys/counter.h index 65d6a54b47a6..e303fc4ecbc2 100644 --- a/sys/sys/counter.h +++ b/sys/sys/counter.h @@ -60,17 +60,12 @@ uint64_t counter_u64_fetch(counter_u64_t); counter_u64_zero((a)[_i]); \ } while (0) -/* - * counter(9) based rate checking. - */ -struct counter_rate { - counter_u64_t cr_rate; /* Events since last second */ - volatile int cr_lock; /* Lock to clean the struct */ - int cr_ticks; /* Ticks on last clean */ - int cr_over; /* Over limit since cr_ticks? */ -}; +struct counter_rate; +struct counter_rate *counter_rate_alloc(int flags, int period); +void counter_rate_free(struct counter_rate *); int64_t counter_ratecheck(struct counter_rate *, int64_t); +uint64_t counter_rate_get(struct counter_rate *); #define COUNTER_U64_SYSINIT(c) \ SYSINIT(c##_counter_sysinit, SI_SUB_COUNTER, \ From nobody Wed Jun 25 17:56:39 2025 X-Original-To: dev-commits-src-main@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 4bS8dh0FdRz60Kw6; Wed, 25 Jun 2025 17: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 4bS8dg2cZFz3trw; Wed, 25 Jun 2025 17:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750874199; 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=LSVu2vpm6+/3l0ylvVS0GTcypRPdKcjJG0na7ewzlJs=; b=Dsn6KdMLLG7Fnd4o0cPo8uoh+hYB8I06H5q8RsDBF98/JNrFgHWlD3On4Jlam3z7ixkZBF KLSPj1N/MYDQMOSYpFDO6PGOcbmhRd8LralqQev7xI4IguPHhgD9ZVWChu7fheXNqSlNJh RnYFWhbZqRBJD6Qr/Pda+jSgM3v4xqmhWR8frYf/OTlvP68OS9o9e4tz8IFjkyKBhO7q0Q l5EUoSteTMMAl15i7pofqIk1SMhb0Vq+X71fO6m9mzI3F81AgzO9F9j3VbdYe2adMnj1Do +CCRmg2N529+SvTDqIEJ40WwTn9V/j3SfoROCXRg8XyJbRRBhSgq0NX7qDqIsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750874199; 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=LSVu2vpm6+/3l0ylvVS0GTcypRPdKcjJG0na7ewzlJs=; b=gdsrUOUYTpuJXtRCoJVwOkdJtAxe50mYOzjDLram8HBpAU+OM4CxAXqk+4F30XiZJTFtXS NbZte5evbWoT0sod3DITbqBHj7yWUAbp7kZRFfQU6N7tX6LzWNRv28FsL3j8cx2sv1p4vz ytMqCsMHlw+AyFfEXZD6o1r4p5Hw6qxnGGOvcfP8Gi5mthI4nkQkby/Z9B3ItU/vSNhl7f PPX/F4b0kF6h7QRDFI7xQdapN5wVeDGvRvp4Yc+8wmHQry7tK1sIngEcbfqGjeASa/Tug3 JLDC1sv0l1WbvW3GZgTcdPvXRC0khEolNXDcHAiKDlmKcYjeX9uFMm4vTwBkVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750874199; a=rsa-sha256; cv=none; b=AE0RbCoLjdA4i9Kx/i6fr9pghPBRp1lm8KCimVNFOrcyKJ5vy9S3J70XoE2UY6WC8T0tvY docBat2RcHlwuUaVSJm5qlwwbrEfEtOyOXlLi6bMl1a+AVJrtVkGOGLG5XwNks+PDBz4Bi xpJoyGS9o2KdCNx+USt9xInAwMBRHWYEhmq7906Wn1sEDPWh3hGdweHkBVsw0QQ+ku7Rit iDzCxx+usbBUkNrKdSikDp35HQZTPqngS75kNt1cMTIWJoBPwTHl+vW6rc3n83E0gM6qpe JOO5mEQS2GS4y1F6fy5HtqBRCdsUikVTRq1DGzvfsODkhEBxC9OC8MUIDYkQhA== 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 4bS8dg1J3WzC2S; Wed, 25 Jun 2025 17:56: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 55PHudTY035321; Wed, 25 Jun 2025 17:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PHudsV035318; Wed, 25 Jun 2025 17:56:39 GMT (envelope-from git) Date: Wed, 25 Jun 2025 17:56:39 GMT Message-Id: <202506251756.55PHudsV035318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 53a341d0e445 - main - pf: use counter_rate() for rate checking List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53a341d0e445269590dcb32f8c8320c3459a21c4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=53a341d0e445269590dcb32f8c8320c3459a21c4 commit 53a341d0e445269590dcb32f8c8320c3459a21c4 Author: Kristof Provost AuthorDate: 2025-06-05 16:45:28 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 17:56:23 +0000 pf: use counter_rate() for rate checking This has the advantage of not requiring a lock. The current src node code runs the rate check under a lock, so this won't immediately improve performance. This prepares the way for future work, introducing packet rate matching on rules, where the lack of lock will be important. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50797 --- sys/net/pfvar.h | 10 +++++++++- sys/netpfil/pf/pf.c | 42 +++++++++++++++--------------------------- sys/netpfil/pf/pf_ioctl.c | 15 ++++++--------- sys/netpfil/pf/pf_nl.c | 15 +++++---------- 4 files changed, 35 insertions(+), 47 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 24095ea28b24..8afba0525351 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -793,6 +793,12 @@ struct pf_keth_rule { uint32_t ridentifier; }; +struct pf_kthreshold { + uint32_t limit; + uint32_t seconds; + struct counter_rate *cr; +}; + RB_HEAD(pf_krule_global, pf_krule); RB_PROTOTYPE(pf_krule_global, pf_krule, entry_global, pf_krule_compare); @@ -926,7 +932,7 @@ struct pf_ksrc_node { counter_u64_t packets[2]; u_int32_t states; u_int32_t conn; - struct pf_threshold conn_rate; + struct pf_kthreshold conn_rate; u_int32_t creation; u_int32_t expire; sa_family_t af; @@ -2520,6 +2526,8 @@ struct pf_state_key *pf_alloc_state_key(int); int pf_translate(struct pf_pdesc *, struct pf_addr *, u_int16_t, struct pf_addr *, u_int16_t, u_int16_t, int); int pf_translate_af(struct pf_pdesc *); +bool pf_init_threshold(struct pf_kthreshold *, uint32_t, uint32_t); + void pfr_initialize(void); void pfr_cleanup(void); int pfr_match_addr(struct pfr_ktable *, struct pf_addr *, sa_family_t); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 03179541b890..09762abb2a16 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -307,10 +307,7 @@ VNET_DEFINE(uma_zone_t, pf_udp_mapping_z); VNET_DEFINE(struct unrhdr64, pf_stateid); static void pf_src_tree_remove_state(struct pf_kstate *); -static void pf_init_threshold(struct pf_threshold *, u_int32_t, - u_int32_t); -static void pf_add_threshold(struct pf_threshold *); -static int pf_check_threshold(struct pf_threshold *); +static int pf_check_threshold(struct pf_kthreshold *); static void pf_change_ap(struct pf_pdesc *, struct pf_addr *, u_int16_t *, struct pf_addr *, u_int16_t); @@ -795,34 +792,21 @@ pf_set_protostate(struct pf_kstate *s, int which, u_int8_t newstate) s->src.state = newstate; } -static void -pf_init_threshold(struct pf_threshold *threshold, +bool +pf_init_threshold(struct pf_kthreshold *threshold, u_int32_t limit, u_int32_t seconds) { - threshold->limit = limit * PF_THRESHOLD_MULT; + threshold->limit = limit; threshold->seconds = seconds; - threshold->count = 0; - threshold->last = time_uptime; -} - -static void -pf_add_threshold(struct pf_threshold *threshold) -{ - u_int32_t t = time_uptime, diff = t - threshold->last; + threshold->cr = counter_rate_alloc(M_NOWAIT, seconds); - if (diff >= threshold->seconds) - threshold->count = 0; - else - threshold->count -= threshold->count * diff / - threshold->seconds; - threshold->count += PF_THRESHOLD_MULT; - threshold->last = t; + return (threshold->cr != NULL); } static int -pf_check_threshold(struct pf_threshold *threshold) +pf_check_threshold(struct pf_kthreshold *threshold) { - return (threshold->count > threshold->limit); + return (counter_ratecheck(threshold->cr, threshold->limit) < 0); } static bool @@ -837,7 +821,6 @@ pf_src_connlimit(struct pf_kstate *state) src_node->conn++; state->src.tcp_est = 1; - pf_add_threshold(&src_node->conn_rate); if (state->rule->max_src_conn && state->rule->max_src_conn < @@ -1031,6 +1014,7 @@ pf_free_src_node(struct pf_ksrc_node *sn) counter_u64_free(sn->bytes[i]); counter_u64_free(sn->packets[i]); } + counter_rate_free(sn->conn_rate.cr); uma_zfree(V_pf_sources_z, sn); } @@ -1095,9 +1079,13 @@ pf_insert_src_node(struct pf_ksrc_node *sns[PF_SN_MAX], } if (sn_type == PF_SN_LIMIT) - pf_init_threshold(&(*sn)->conn_rate, + if (! pf_init_threshold(&(*sn)->conn_rate, rule->max_src_conn_rate.limit, - rule->max_src_conn_rate.seconds); + rule->max_src_conn_rate.seconds)) { + pf_free_src_node(*sn); + reason = PFRES_MEMORY; + goto done; + } MPASS((*sn)->lock == NULL); (*sn)->lock = &(*sh)->lock; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index c8ad007e2e92..c312ad001a60 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1537,7 +1537,7 @@ pf_addr_copyout(struct pf_addr_wrap *addr) static void pf_src_node_copy(const struct pf_ksrc_node *in, struct pf_src_node *out) { - int secs = time_uptime, diff; + int secs = time_uptime; bzero(out, sizeof(struct pf_src_node)); @@ -1564,14 +1564,11 @@ pf_src_node_copy(const struct pf_ksrc_node *in, struct pf_src_node *out) out->expire = 0; /* Adjust the connection rate estimate. */ - out->conn_rate = in->conn_rate; - diff = secs - in->conn_rate.last; - if (diff >= in->conn_rate.seconds) - out->conn_rate.count = 0; - else - out->conn_rate.count -= - in->conn_rate.count * diff / - in->conn_rate.seconds; + out->conn_rate.limit = in->conn_rate.limit; + out->conn_rate.seconds = in->conn_rate.seconds; + /* If there's no limit there's no counter_rate. */ + if (in->conn_rate.cr != NULL) + out->conn_rate.count = counter_rate_get(in->conn_rate.cr); } #ifdef ALTQ diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 4d631568f991..a975501794e6 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1728,23 +1728,18 @@ pf_handle_get_ruleset(struct nlmsghdr *hdr, struct nl_pstate *npt) static bool nlattr_add_pf_threshold(struct nl_writer *nw, int attrtype, - struct pf_threshold *t, int secs) + struct pf_kthreshold *t) { int off = nlattr_add_nested(nw, attrtype); - int diff, conn_rate_count; + int conn_rate_count = 0; /* Adjust the connection rate estimate. */ - conn_rate_count = t->count; - diff = secs - t->last; - if (diff >= t->seconds) - conn_rate_count = 0; - else - conn_rate_count -= t->count * diff / t->seconds; + if (t->cr != NULL) + conn_rate_count = counter_rate_get(t->cr); nlattr_add_u32(nw, PF_TH_LIMIT, t->limit); nlattr_add_u32(nw, PF_TH_SECONDS, t->seconds); nlattr_add_u32(nw, PF_TH_COUNT, conn_rate_count); - nlattr_add_u32(nw, PF_TH_LAST, t->last); nlattr_set_len(nw, off); @@ -1803,7 +1798,7 @@ pf_handle_get_srcnodes(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_u64(nw, PF_SN_EXPIRE, 0); nlattr_add_pf_threshold(nw, PF_SN_CONNECTION_RATE, - &n->conn_rate, secs); + &n->conn_rate); nlattr_add_u8(nw, PF_SN_NODE_TYPE, n->type); From nobody Wed Jun 25 17:56:40 2025 X-Original-To: dev-commits-src-main@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 4bS8dj0fWVz60Kkb; Wed, 25 Jun 2025 17:56: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 4bS8dh37RKz3v5q; Wed, 25 Jun 2025 17: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=1750874200; 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=gLkVlpasdDIdFuvUkKHosZSt8GIavVpmthFPdMnq8K0=; b=idd6gc/Dlox02kGIvrjpdQUXpSybouI/gvA3lY7Bm/NCy/gP/Qi51Jyr7HlUB5cZthQd34 Vc7yHA/N3G+Sf2WS+ubRYwroYSlqmZnA0J5REDVC4wU5DV4e3Fez1VnhP4HKTbPvEkPaza uey4AOcxQr7g2hpYHGKyJMk9jOEm1EgPQFwMtFpEsV+a/r4m6+s1p6kLV/PObtzqbe4r0W 6fu9kT0/s64M8cFQVWtfQirpyg0blkApJ0d9vJ25V9BE1bwiW5nSnQRlBuBUD6/YBkwxgB 3HU0Vuz+C8g4ZcBg8ovhE5BYZ8tagekDYWb0gV/KOf9n0Tt9q+fd9LJuh2oKFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750874200; 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=gLkVlpasdDIdFuvUkKHosZSt8GIavVpmthFPdMnq8K0=; b=sDRysH8OkhtVyDEoF0My0pFEZsHvYpTasLEwGlmsXYZzDtUYE0aK5FZzEMYlpNyi5Gi6ZC jN31zJA6jBJpA1P3hipf8NZtGsurbZ6UIoLW5LVP8tj7q24mbstXTVZzB6KPfCV9Y6KBs6 hkxcUopeGKygnBHfed9pqZXwJ8KoXKDFZUbWFTvo8i/ofyKR6+6/BkxRkz5u548McXX0km 2zPyEDh24dzf7htmp6T33VmnVW0Kvi5T1jCwPJEmn7+aBlmZ9tydjEGMuQgC7cl1uds82+ WmxrELVcR047fDpI/2OA98rezs+OBBD9T/gcQ9QFFqmV25/fhsqawNjlWUoLfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750874200; a=rsa-sha256; cv=none; b=x9SuVGD1UlQFZj7BvmZq0DNajkhGg7L6uRYgCKW0dvaT5T/7VtsonTXE7M3A4ahJoy7nCT qKmn4xgm9D3yaXFvbPRMQkAb3Yki39DOoSzvSFmhgUJ1LQgoPhfpBLlfsOi9w6vDG1IcOF oTeuGz7/bdotqGeSqxmDM4oH43mCdgtRL7MlbGgTqE8Hb279PME9sSTLE99CZrvz2m2CZu DGcm5agetDuXCoKDvZschWuEozJS7EYEADSP4DYb1S9tW22j3uQQzvgbnvYxvnAtLrjOSu FTaUU5US+P96DdrlTfopGykGMBw13LKjYOMEgEPMZi+q+oV+jlLt110F2KAl7g== 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 4bS8dh2QnZzByj; Wed, 25 Jun 2025 17: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 55PHuech035362; Wed, 25 Jun 2025 17: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 55PHueAK035359; Wed, 25 Jun 2025 17:56:40 GMT (envelope-from git) Date: Wed, 25 Jun 2025 17:56:40 GMT Message-Id: <202506251756.55PHueAK035359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ff11f1c8c76c - main - pf: add a generic packet rate matching filter List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff11f1c8c76c053b442f1f1df97272939fbf5afc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff11f1c8c76c053b442f1f1df97272939fbf5afc commit ff11f1c8c76c053b442f1f1df97272939fbf5afc Author: Kristof Provost AuthorDate: 2025-06-03 07:15:21 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 17:56:23 +0000 pf: add a generic packet rate matching filter allows things like pass in proto icmp max-pkt-rate 100/10 all packets matching the rule in the direction the state was created are taken into consideration (typically: requests, but not replies). Just like with the other max-*, the rule stops matching if the maximum is reached, so in typical scenarios the default block rule would kick in then. with input from Holger Mikolon ok mikeb Obtained from: OpenBSD, henning , 5a4ae9a9cb Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50798 --- lib/libpfctl/libpfctl.c | 34 ++++++++++++++++++++++++---------- lib/libpfctl/libpfctl.h | 15 ++++++++------- sbin/pfctl/parse.y | 24 +++++++++++++++++++++++- sbin/pfctl/pfctl_parser.c | 3 +++ share/man/man5/pf.conf.5 | 19 ++++++++++++++++++- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 11 +++++++++++ sys/netpfil/pf/pf_ioctl.c | 4 +++- sys/netpfil/pf/pf_nl.c | 13 +++++++++++++ sys/netpfil/pf/pf_nl.h | 1 + 10 files changed, 105 insertions(+), 20 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index cbc193268505..4789448d2a37 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1208,6 +1208,19 @@ snl_add_msg_attr_uid(struct snl_writer *nw, uint32_t type, const struct pf_rule_ snl_end_attr_nested(nw, off); } +static void +snl_add_msg_attr_threshold(struct snl_writer *nw, uint32_t type, const struct pfctl_threshold *th) +{ + int off; + + off = snl_add_msg_attr_nested(nw, type); + + snl_add_msg_attr_u32(nw, PF_TH_LIMIT, th->limit); + snl_add_msg_attr_u32(nw, PF_TH_SECONDS, th->seconds); + + snl_end_attr_nested(nw, off); +} + static void snl_add_msg_attr_pf_rule(struct snl_writer *nw, uint32_t type, const struct pfctl_rule *r) { @@ -1228,6 +1241,7 @@ snl_add_msg_attr_pf_rule(struct snl_writer *nw, uint32_t type, const struct pfct snl_add_msg_attr_rpool(nw, PF_RT_RPOOL_RDR, &r->rdr); snl_add_msg_attr_rpool(nw, PF_RT_RPOOL_NAT, &r->nat); snl_add_msg_attr_rpool(nw, PF_RT_RPOOL_RT, &r->route); + snl_add_msg_attr_threshold(nw, PF_RT_PKTRATE, &r->pktrate); snl_add_msg_attr_u32(nw, PF_RT_OS_FINGERPRINT, r->os_fingerprint); snl_add_msg_attr_u32(nw, PF_RT_RTABLEID, r->rtableid); snl_add_msg_attr_timeouts(nw, PF_RT_TIMEOUT, r->timeout); @@ -1581,6 +1595,15 @@ static const struct snl_attr_parser ap_rule_uid[] = { SNL_DECLARE_ATTR_PARSER(rule_uid_parser, ap_rule_uid); #undef _OUT +#define _OUT(_field) offsetof(struct pfctl_threshold, _field) +static const struct snl_attr_parser ap_pfctl_threshold[] = { + { .type = PF_TH_LIMIT, .off = _OUT(limit), .cb = snl_attr_get_uint32 }, + { .type = PF_TH_SECONDS, .off = _OUT(seconds), .cb = snl_attr_get_uint32 }, + { .type = PF_TH_COUNT, .off = _OUT(count), .cb = snl_attr_get_uint32 }, +}; +SNL_DECLARE_ATTR_PARSER(pfctl_threshold_parser, ap_pfctl_threshold); +#undef _OUT + struct pfctl_nl_get_rule { struct pfctl_rule r; char anchor_call[MAXPATHLEN]; @@ -1668,6 +1691,7 @@ static struct snl_attr_parser ap_getrule[] = { { .type = PF_RT_SRC_NODES_LIMIT, .off = _OUT(r.src_nodes_type[PF_SN_LIMIT]), .cb = snl_attr_get_uint64 }, { .type = PF_RT_SRC_NODES_NAT, .off = _OUT(r.src_nodes_type[PF_SN_NAT]), .cb = snl_attr_get_uint64 }, { .type = PF_RT_SRC_NODES_ROUTE, .off = _OUT(r.src_nodes_type[PF_SN_ROUTE]), .cb = snl_attr_get_uint64 }, + { .type = PF_RT_PKTRATE, .off = _OUT(r.pktrate), .arg = &pfctl_threshold_parser, .cb = snl_attr_get_nested }, }; #undef _OUT SNL_DECLARE_PARSER(getrule_parser, struct genlmsghdr, snl_f_p_empty, ap_getrule); @@ -3001,16 +3025,6 @@ pfctl_get_ruleset(struct pfctl_handle *h, const char *path, uint32_t nr, struct return (e.error); } -#define _OUT(_field) offsetof(struct pfctl_threshold, _field) -static const struct snl_attr_parser ap_pfctl_threshold[] = { - { .type = PF_TH_LIMIT, .off = _OUT(limit), .cb = snl_attr_get_uint32 }, - { .type = PF_TH_SECONDS, .off = _OUT(seconds), .cb = snl_attr_get_uint32 }, - { .type = PF_TH_COUNT, .off = _OUT(count), .cb = snl_attr_get_uint32 }, - { .type = PF_TH_LAST, .off = _OUT(last), .cb = snl_attr_get_uint32 }, -}; -SNL_DECLARE_ATTR_PARSER(pfctl_threshold_parser, ap_pfctl_threshold); -#undef _OUT - #define _OUT(_field) offsetof(struct pfctl_src_node, _field) static struct snl_attr_parser ap_srcnode[] = { { .type = PF_SN_ADDR, .off = _OUT(addr), .cb = snl_attr_get_in6_addr }, diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 4d481f436674..7de7a08e90bf 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -159,6 +159,13 @@ struct pfctl_rules_info { uint32_t ticket; }; +struct pfctl_threshold { + uint32_t limit; + uint32_t seconds; + uint32_t count; + uint32_t last; +}; + struct pfctl_rule { struct pf_rule_addr src; struct pf_rule_addr dst; @@ -181,6 +188,7 @@ struct pfctl_rule { struct pfctl_pool rdr; }; struct pfctl_pool route; + struct pfctl_threshold pktrate; uint64_t evaluations; uint64_t packets[2]; @@ -396,13 +404,6 @@ struct pfctl_syncookies { uint32_t halfopen_states; }; -struct pfctl_threshold { - uint32_t limit; - uint32_t seconds; - uint32_t count; - uint32_t last; -}; - struct pfctl_src_node { struct pf_addr addr; struct pf_addr raddr; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 1b137eecfa47..5d4d2b86fd58 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -308,6 +308,10 @@ static struct filter_opts { int settos; int randomid; int max_mss; + struct { + uint32_t limit; + uint32_t seconds; + } pktrate; } filter_opts; static struct antispoof_opts { @@ -531,7 +535,7 @@ int parseport(char *, struct range *r, int); %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW ALLOW_RELATED %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS %token DIVERTTO DIVERTREPLY BRIDGE_TO RECEIVEDON NE LE GE AFTO NATTO RDRTO -%token BINATTO +%token BINATTO MAXPKTRATE %token STRING %token NUMBER %token PORTBINARY @@ -1012,6 +1016,8 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto r.prob = $9.prob; r.rtableid = $9.rtableid; r.ridentifier = $9.ridentifier; + r.pktrate.limit = $9.pktrate.limit; + r.pktrate.seconds = $9.pktrate.seconds; if ($9.tag) if (strlcpy(r.tagname, $9.tag, @@ -2489,6 +2495,8 @@ pfrule : action dir logquick interface route af proto fromto r.tos = $9.tos; r.keep_state = $9.keep.action; + r.pktrate.limit = $9.pktrate.limit; + r.pktrate.seconds = $9.pktrate.seconds; o = $9.keep.options; /* 'keep state' by default on pass rules. */ @@ -3112,6 +3120,19 @@ filter_opt : USER uids { } filter_opts.marker |= FOM_AFTO; } + | MAXPKTRATE NUMBER '/' NUMBER { + if ($2 < 0 || $2 > UINT_MAX || + $4 < 0 || $4 > UINT_MAX) { + yyerror("only positive values permitted"); + YYERROR; + } + if (filter_opts.pktrate.limit) { + yyerror("cannot respecify max-pkt-rate"); + YYERROR; + } + filter_opts.pktrate.limit = $2; + filter_opts.pktrate.seconds = $4; + } | filter_sets ; @@ -6697,6 +6718,7 @@ lookup(char *s) { "matches", MATCHES}, { "max", MAXIMUM}, { "max-mss", MAXMSS}, + { "max-pkt-rate", MAXPKTRATE}, { "max-src-conn", MAXSRCCONN}, { "max-src-conn-rate", MAXSRCCONNRATE}, { "max-src-nodes", MAXSRCNODES}, diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 2d88c6d00605..32e98eb20b7c 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1007,6 +1007,9 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" tos 0x%2.2x", r->tos); if (r->prio) printf(" prio %u", r->prio == PF_PRIO_ZERO ? 0 : r->prio); + if (r->pktrate.limit) + printf(" max-pkt-rate %u/%u", r->pktrate.limit, + r->pktrate.seconds); if (r->scrub_flags & PFSTATE_SETMASK) { char *comma = ""; printf(" set ("); diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index edcb335619ba..010096369c83 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 12, 2025 +.Dd June 17, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -2216,6 +2216,22 @@ directive occurs only at configuration file parse time, not during runtime. .It Ar ridentifier Aq Ar number Add an identifier (number) to the rule, which can be used to correlate the rule to pflog entries, even after ruleset updates. +.It Cm max-pkt-rate Ar number Ns / Ns Ar seconds +Measure the rate of packets matching the rule and states created by it. +When the specified rate is exceeded, the rule stops matching. +Only packets in the direction in which the state was created are considered, +so that typically requests are counted and replies are not. +For example: +.Pp +.Bd -literal -offset indent -compact +block in proto icmp +pass in proto icmp max-pkt-rate 100/10 +.Ed +.Pp +passes up to 100 icmp packets per 10 seconds. +When the rate is exceeded, all icmp is blocked until the rate falls below +100 per 10 seconds again. +.Pp .It Xo Ar queue Aq Ar queue .No \*(Ba ( Aq Ar queue , .Aq Ar queue ) @@ -3388,6 +3404,7 @@ filteropt = user | group | flags | icmp-type | icmp6-type | "tos" tos | "max-mss" number | "random-id" | "reassemble tcp" | fragmentation | "allow-opts" | "label" string | "tag" string | [ "!" ] "tagged" string | + "max-pkt-rate" number "/" seconds | "set prio" ( number | "(" number [ [ "," ] number ] ")" ) | "queue" ( string | "(" string [ [ "," ] string ] ")" ) | "rtable" number | "probability" number"%" | "prio" number | diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 8afba0525351..33574dbd5c2a 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -821,6 +821,7 @@ struct pf_krule { struct pf_kpool nat; struct pf_kpool rdr; struct pf_kpool route; + struct pf_kthreshold pktrate; struct pf_counter_u64 evaluations; struct pf_counter_u64 packets[2]; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 09762abb2a16..908f1b83e542 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -445,6 +445,12 @@ VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); SDT_PROBE5(pf, ip, state, lookup, pd->kif, k, (pd->dir), pd, (s)); \ if ((s) == NULL) \ return (PF_DROP); \ + if ((s)->rule->pktrate.limit && pd->dir == (s)->direction) { \ + if (pf_check_threshold(&(s)->rule->pktrate)) { \ + s = NULL; \ + return (PF_DROP); \ + } \ + } \ if (PACKET_LOOPED(pd)) \ return (PF_PASS); \ } while (0) @@ -5606,6 +5612,11 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) pf_osfp_fingerprint(pd, ctx->th), r->os_fingerprint)), TAILQ_NEXT(r, entries)); + /* must be last! */ + if (r->pktrate.limit) { + PF_TEST_ATTRIB((pf_check_threshold(&r->pktrate)), + TAILQ_NEXT(r, entries)); + } /* FALLTHROUGH */ if (r->tag) ctx->tag = r->tag; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index c312ad001a60..05a7e1311ad8 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2156,7 +2156,6 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, if (rule->rtableid > 0 && rule->rtableid >= rt_numfibs) error = EBUSY; - #ifdef ALTQ /* set queue IDs */ if (rule->qname[0] != 0) { @@ -2181,6 +2180,9 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, error = EINVAL; if (!rule->log) rule->logif = 0; + if (! pf_init_threshold(&rule->pktrate, rule->pktrate.limit, + rule->pktrate.seconds)) + error = ENOMEM; if (pf_addr_setup(ruleset, &rule->src.addr, rule->af)) error = ENOMEM; if (pf_addr_setup(ruleset, &rule->dst.addr, rule->af)) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index a975501794e6..48cba96b04b0 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -51,6 +51,9 @@ #include _DECLARE_DEBUG(LOG_DEBUG); +static bool nlattr_add_pf_threshold(struct nl_writer *, int, + struct pf_kthreshold *); + struct nl_parsed_state { uint8_t version; uint32_t id; @@ -679,6 +682,14 @@ nlattr_add_timeout(struct nl_writer *nw, int attrtype, uint32_t *timeout) return (true); } +#define _OUT(_field) offsetof(struct pf_kthreshold, _field) +static const struct nlattr_parser nla_p_threshold[] = { + { .type = PF_TH_LIMIT, .off = _OUT(limit), .cb = nlattr_get_uint32 }, + { .type = PF_TH_SECONDS, .off = _OUT(seconds), .cb = nlattr_get_uint32 }, +}; +NL_DECLARE_ATTR_PARSER(threshold_parser, nla_p_threshold); +#undef _OUT + #define _OUT(_field) offsetof(struct pf_krule, _field) static const struct nlattr_parser nla_p_rule[] = { { .type = PF_RT_SRC, .off = _OUT(src), .arg = &rule_addr_parser,.cb = nlattr_get_nested }, @@ -749,6 +760,7 @@ static const struct nlattr_parser nla_p_rule[] = { { .type = PF_RT_NAF, .off = _OUT(naf), .cb = nlattr_get_uint8 }, { .type = PF_RT_RPOOL_RT, .off = _OUT(route), .arg = &pool_parser, .cb = nlattr_get_nested }, { .type = PF_RT_RCV_IFNOT, .off = _OUT(rcvifnot), .cb = nlattr_get_bool }, + { .type = PF_RT_PKTRATE, .off = _OUT(pktrate), .arg = &threshold_parser, .cb = nlattr_get_nested }, }; NL_DECLARE_ATTR_PARSER(rule_parser, nla_p_rule); #undef _OUT @@ -1003,6 +1015,7 @@ pf_handle_getrule(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_u64(nw, PF_RT_SRC_NODES_LIMIT, counter_u64_fetch(rule->src_nodes[PF_SN_LIMIT])); nlattr_add_u64(nw, PF_RT_SRC_NODES_NAT, counter_u64_fetch(rule->src_nodes[PF_SN_NAT])); nlattr_add_u64(nw, PF_RT_SRC_NODES_ROUTE, counter_u64_fetch(rule->src_nodes[PF_SN_ROUTE])); + nlattr_add_pf_threshold(nw, PF_RT_PKTRATE, &rule->pktrate); error = pf_kanchor_copyout(ruleset, rule, anchor_call, sizeof(anchor_call)); MPASS(error == 0); diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 0f2f0b01415c..97ef574995f5 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -278,6 +278,7 @@ enum pf_rule_type_t { PF_RT_SRC_NODES_LIMIT = 79, /* u64 */ PF_RT_SRC_NODES_NAT = 80, /* u64 */ PF_RT_SRC_NODES_ROUTE = 81, /* u64 */ + PF_RT_PKTRATE = 82, /* nested, pf_threshold_type_t */ }; enum pf_addrule_type_t { From nobody Wed Jun 25 18:26:32 2025 X-Original-To: dev-commits-src-main@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 4bS9Jc0Kzwz60M9Z for ; Wed, 25 Jun 2025 18:26:56 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-9.consmr.mail.ne1.yahoo.com (sonic307-9.consmr.mail.ne1.yahoo.com [66.163.190.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bS9Jb3b6bz3FvH for ; Wed, 25 Jun 2025 18:26:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=ViTlnm8K; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 66.163.190.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1750876009; bh=UXcHGt805nbNksLcaYjltv/sUjJEuagSOmOJrozUv20=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=ViTlnm8K+M6QTFuRASmi90STT+pm/FVVcvX29lVZRPqVTsSjO+n3in/TVumaKig95UzXZ62134G04FIKXVQHCbZtR3W+/nw63+DtEXqBis6eMSM1BH32x8UC7TqKjAi1IO5JZn7cu4YuCvL9uDClHS9PzMVVoJAfLpEwKDqIl7lb1qR8GMIokRZHfKxQ4MzTMnguZuWQiQ48qUe9B8jGBnSSynxd55roXeKbqlC/UQ5w9XdxOnnD8n51Erq6ekiEeKomiZoOm/GI50MbU4oz4W8StLlHGMhtQXloea/19zcj6Q6ybZn8CSwUjG9jLcfbee46zVnAnm9G04RW/iabdQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1750876009; bh=GfjHkZuB4P9L6eFKXfH1ZNDZCnApZMg/aUuEW0VHb4L=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=WFO6Cq2BO+RirmiQAEIBdCRCr2H+xg6M2eKfP7rCrVnwYiQuQ7DHh228M6IXd5ClD869l0CSBM0drVpxtdgBZJvZ11/KdpaDF+NyuJtq7xZImPC9xqwj/RqIFr3aJPGwUNUvNivR+aiDg/3yrTbfMprNiom+G3SgSyExfU+t6qRmEg7PtA1juJ5LLgpbc9gwmhFGUCCxAgERnKbhgPFXDQXiDPCndEbwU0ajBjqh1RP2hnbLSNk/8OXs09RWsko+OFG4InjvpXjtUSxD+ImPkvg18d3bsvjrKfpDG1oViuJAZydQvVOIeaRBnV0swiNhQpcL2qDcMGgCQZO/NIcLrA== X-YMail-OSG: JfYYP8gVM1loPhp3EhucyOZHcOz8d_lRdAy9ByMEBrbbiXnYVP9T8g7_UotfGQw FD4nv4aYO1ds6_Rc1ROprJzWnEKUYV5PvjGMQ34oZFA4PuVRldzNtnRN1CEsClxf1FSYEJ_vB.BQ v_.DclsqSwdCetxrUoyQT.2bTmyrkrj3Lu_wz25iS2sy0OCAzeV18N1LDuNd62HgQSu8aTE_LL8J b.QwX8KafexB.CiYSrssdKQx1HyYBQ_oeHqjXmxJUXO_45npVVY3t4sAWxWP5ZDsI3jf3t.MCaj5 XSOOxd_JKy_Or7etCUs7MRvOi8vq1IQ0LFGLsRw.S66ujJdiWvOR.MY6hLvkqGCM.TJM2OnKgRWn kRS4xzIvm_6lj3qG2F_FXw2t199ZhFnM1GXHO06x0oP1gPbRfSjb1YCDL9REKttgC4sj.MSlPvIg kj666KMTMbOTktb.GmquMzowDSqbjRtsuzJKh8wCMZSgfmd0qNvtfr7B5VoM3EXerWcE6KV_ovyy HUj_o3dIkwDzkpqhF7N2Bj2TbhlMZk7BV3rLkp9pbbrCvobWHtqeIm74Q70zKfxd0gZ6A1GiladM UJ2IcBG2PDXyD2g2VyUpCrlu8rCqZ23rDzjpAV_UOtbLEMebcseipjo91ZTiVTwRxxB6ETzD75V7 RaEt4zrakC4cEvV3HFgXKZwXCj.ypSH8OmETrc__kPyk26r2_piTFf54JjIGkg0TfQX_mnQ8kF8h FRc_gb4AHSSLYvBd7NIo0sdqev.9QfqQOEqAA6zm_yihSRkrZLH9FxkmzW3aPwg6zhQEM4ZZaJC5 mXrDJzKhk3vICCb5edby_xgL9I22jDkrK8kzvI4iukx23aRrpNuYtdj6xExUsA5hN18uGMAxE_WP nIGLqwsPT9M1z9KZbdLwnq75N36vKFcp3dxjrkvYeWugg56FSYvlyoDCmWI1iZ8Wb_0.PqS5CBnU aD8eQKglBfxxKhkq9GK5P5w.Ocv0EXdjllTquGGzGewkC0hwEts_ix2Pi.KGLZV1FwzvDp4hnYL8 y0BSUpwTdNMPODbD8e5HDyy6P1zRt4P5SN2s7yu1.A1_xMWOXgrCb2wTf1Iotphgh.PMB3dYx6Ts 29Am5UyJpFCa9x79JtSrQsWFaTrYlJDR7Qzz0Lc1oXzpWNm3XAqW5.UccKHTiuC3qdqs20mV1l_C CwuuUIwv6ILK7LiDjzZ4dYZ1Ecbn5uqBO7BW7GW3zsHAK4KCvT4qmTNvfor.VbNiikqtxSBbEen5 CdWuXzkO4Xxq0S2JJFhIPJzA9BZDOrGfxxgArY37mFfNhOw2Rh27xjjmkzPjF0qK50zn95U4.BJU z.tY_vCJXr6j0FWABpfdAVEJvr1Zi75gBPICFssscjshGocBegv_nZMNvi3a0Ajbq9jLHqM2wfIb RQrWjJfOhZBXZgRjQXSmSxlDvxbPz4mzGg9JRettYqQbkzrMj0_Nbp3SxvQJvip.V9HegXl8vP4r nKk9Xy1c7Hk9T1wDg_99HhfjrQUpPoi6ZjRzbDudSPjsdS2B0E2EOBtIWtMKpd3KKzVTwsqksTSV SqcfTJD1aHR9cqUl88JCmWncFIRZikCKD4pf1emF1RuFqPehEdd4TNGFAt3_o1IFjmpZdiyq6ik8 xY4WEvsRwzS036J3CK7.nQYRqcDNd5hZOsHV55XJmZZJkrr_4Wysicnk9lRauJ_D1ndi3aSPss9s zxk2B64wvR63y0rtYmsLmzYhzImdcwch0WtrvEfQk3oC7j9pp8LI.7npGAkivzGdQXd1YOAJZ799 tzjwK3IM0lGiwJ2u7B6DuzDf4iskI2ixJb9NKFrFaJABpLFt_YpiH4E4ce.Q8183VFKIiGrNfEM1 vLmju79Ym0YbWmNaMnj4iXu8lPYzOusfvC_GNCdNjd5U6kmPH7J25ug4UWP.Ev04l1OG_S9ZKdwR ZaK2i3cx_8gbXXmtDg6Wlr2gZ15qK61AtkI6BXh.KCVBRKqoPiyp9xF2.qqyzZJpxnn4qnXrPA6I KqZwoiD6.eeuGuDWIAxPVo.y21gpa94AP6UeBxHz6FGZuV3ib45tsCbYJvl5A1aDzfZ398OQ9B.i bkkiy4Zh9NQ6yYfnPmUXUZ0ocJBmcpVSA8y.coWgcE8CTiWzgMGYcKj9PeD7lJ2vPWHO8T1twDj_ vZodvHXL7NpZF6ltyyGlICSZbfRmQSBCYAZZ9GgMkMwnQBm5bN0Efpm3TodoM7aPi5zjPDATwq_8 5XUA21oS6f9ZjVIgAtZIjUaSdYPXpqICsk2Hn6H964MTxYHcL7DitWRSjGud68LJCzFLja6hjKwQ lEA-- X-Sonic-MF: X-Sonic-ID: aec2703a-17be-408d-b85f-1591da061caf Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Wed, 25 Jun 2025 18:26:49 +0000 Received: by hermes--production-gq1-74d64bb7d7-w6q4t (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 619eb514685e267502dc476f7d33f04b; Wed, 25 Jun 2025 18:26:43 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: git: 288ba78edcfd - main - dev/psci: Check for functions before calling Message-Id: <60E32387-B0BA-4ADD-A897-DC988136D2F9@yahoo.com> Date: Wed, 25 Jun 2025 11:26:32 -0700 To: Andrew Turner , "Bjoern A. Zeeb" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3826.600.51.1.1) References: <60E32387-B0BA-4ADD-A897-DC988136D2F9.ref@yahoo.com> X-Spamd-Result: default: False [-0.45 / 15.00]; NEURAL_SPAM_MEDIUM(0.96)[0.961]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.46)[-0.455]; NEURAL_HAM_SHORT(-0.45)[-0.455]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; DKIM_TRACE(0.00)[yahoo.com:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.163.190.32:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.190.32:from]; FROM_HAS_DN(0.00)[] X-Rspamd-Queue-Id: 4bS9Jb3b6bz3FvH X-Spamd-Bar: / Andrew Turner wrote on Date: Wed, 25 Jun 2025 11:22:51 UTC : > The branch main has been updated by andrew: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D288ba78edcfd82b4b558a46fae78e407= 6acbe200 >=20 > commit 288ba78edcfd82b4b558a46fae78e4076acbe200 > Author: Andrew Turner > AuthorDate: 2025-06-24 16:47:28 +0000 > Commit: Andrew Turner > CommitDate: 2025-06-24 17:45:42 +0000 >=20 > dev/psci: Check for functions before calling >=20 > In the SMCCC TRNG and Errata ABI drivers check if the version > functions are implemented before calling them. Without this the = firmware > may complain about an unimplemented function being called. >=20 > Reported by: bz > Reviewed by: bz > Sponsored by: Arm Ltd > Differential Revision: https://reviews.freebsd.org/D50978 > --- I wonder if a debug mode or verbose mode should report the !=3D SMCCC_RET_SUCCESS cases for smccc_arch_features. If this change had already been in place, the older status might not have been noticed. As bz wrote elsewhere: "That said seems like it's still a good idea to add these bits to my TF-A." Having a way to check on if a TF-A instance is too old to have a known status for handling things that are now requested could be a good thing. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Wed Jun 25 19:10:15 2025 X-Original-To: dev-commits-src-main@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 4bSBGc3p54z60Pbj; Wed, 25 Jun 2025 19:10: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 4bSBGc29hfz3fgR; Wed, 25 Jun 2025 19:10:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750878616; 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=fmNsZ7OiybNIg6u4aAP0ysJdBC4SnXQwIcg1zW62tJE=; b=cdeUNXog/MGCYA20jUK7marT77wig0x6+5cSltEV/PsyYaFcJr4/9ULLsIkgMGYleG6pd7 qp1fKXhlJOUArK5atP8dhVeSOr/yzmV5DqU6o+lKthDx1CgTgjdTHVxyyObHQpWoeixOrH wmCS1mTL5bLBYmneV+IoQNsWO2guOWRn2UMWuPatjiItFdZv7OagAiQH1Jw5Jztx4GWokT mM//QYWM24tyfOcN14uupQqgXdNnnUy9beoG4PLSbXmdj49Pvy2tpyvZUtkcnN2lTItvcA 0whSyCWDiE8qUN0NhGaacVsU9C2tkIQudZUxJSP56B744kKcyEwtEiahByrBaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750878616; 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=fmNsZ7OiybNIg6u4aAP0ysJdBC4SnXQwIcg1zW62tJE=; b=Kph4LmIewe/T4pRS79Y817Z65NeyfY3Be8oQhZMFXX7DZxZx++2I9P2rlXLB+v/V0tGT5t 0amVV9lSWdICi0NwlqDiLLBkY8Zmu0uNNUe695eCDrnEocgHbenWTceFvPtB0ctHu6RlOT q5OBlyhM6wjzEfcLkcbv0CBDzGJ+x3zMQa173a1Ygcel9y1oQkZJAukoikZGYnS26I3FHg gD6RzyK+7z0ccZI+GPS8w1oFJTBBKWtgbBmIcl/pLFjPr5WzB/8cNWyiy4fKagBzu4/RCD bEcZws9SUUvoJQx1NRryTj37k/R0kkhiYJjNKo2ejjjx9CiIie6CluMpS6lpNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750878616; a=rsa-sha256; cv=none; b=mEbH38Ceq/O/QXetkPVsaWe2l088VKS8rReAr4MhCaTvHWk6iPMplqn8L5T8HWn/Wb40qg yo3B6KYH3bfWuRjSKEjQytrUz+Lalby38rmul9MP7PN+mEe2Wu+IIBh6/Eh0yR++/UXCVZ rr1vb/jVgzy7xMCkeaxuqcAQVu2s6RtWPwgC11n0/F9ZrbhDQJygTLDYg9DwAAsveEaHNM kcFgYLHAckH5rtRqDqe5Qx73cU82z4xdfb8MzqUvBSyLQwGiUCry/kAqaYYdXDVvWGukL3 PCyvMuFGQ2YkRYO0867zCHChIES9zVOUBKvm5iwJL4a4glDtUj7ynUTkhg7qYw== 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 4bSBGb72LCzVFH; Wed, 25 Jun 2025 19:10: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 55PJAFaO076813; Wed, 25 Jun 2025 19:10:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PJAF9S076800; Wed, 25 Jun 2025 19:10:15 GMT (envelope-from git) Date: Wed, 25 Jun 2025 19:10:15 GMT Message-Id: <202506251910.55PJAF9S076800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 07297aee35f2 - main - vm_page: update comments and KASSERT()s concerning page allocation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 07297aee35f26cfd37aef078ff6c0cbe67bbba15 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=07297aee35f26cfd37aef078ff6c0cbe67bbba15 commit 07297aee35f26cfd37aef078ff6c0cbe67bbba15 Author: Alan Cox AuthorDate: 2025-06-19 05:45:42 +0000 Commit: Alan Cox CommitDate: 2025-06-25 19:09:49 +0000 vm_page: update comments and KASSERT()s concerning page allocation Update the legend describing the arguments to the most commonly used page allocation functions. Notably, eliminate a reference to a function that no longer exists; and update to reflect the elimination of VM_ALLOC_NOOBJ, specifically, VM_ALLOC_WAITOK is no longer a legal option to vm_page_alloc{,_contig}(). Eliminate a nonsensical KASSERT(). VM_ALLOC_SBUSY is forbidden as an argument to vm_page_alloc_noobj{,_contig,}_domain() by a KASSERT(), so having a different KASSERT() that tests for it is nonsensical. Strengthen other KASSERT()s involving VM_ALLOC_NOBUSY and VM_ALLOC_NOFREE. Reviewed by: kib, markj, dougm (an earlier version) Differential Revision: https://reviews.freebsd.org/D49391 --- sys/vm/vm_page.c | 55 ++++++++++++++++++++++++++++++++----------------------- sys/vm/vm_page.h | 36 +++++++++++++++++++----------------- 2 files changed, 51 insertions(+), 40 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 5b05f0dc11c9..bbae55895c2c 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1983,7 +1983,10 @@ vm_page_iter_rename(struct pctrie_iter *old_pages, vm_page_t m, * intends to allocate * VM_ALLOC_NOBUSY do not exclusive busy the page * VM_ALLOC_NODUMP do not include the page in a kernel core dump + * VM_ALLOC_NOFREE page will never be freed + * VM_ALLOC_NOWAIT ignored (default behavior) * VM_ALLOC_SBUSY shared busy the allocated page + * VM_ALLOC_WAITFAIL in case of failure, sleep before returning * VM_ALLOC_WIRED wire the allocated page * VM_ALLOC_ZERO prefer a zeroed page */ @@ -2081,11 +2084,12 @@ vm_page_alloc_domain_iter(vm_object_t object, vm_pindex_t pindex, int domain, vm_page_t m; int flags; -#define VPA_FLAGS (VM_ALLOC_CLASS_MASK | VM_ALLOC_WAITFAIL | \ - VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY | \ - VM_ALLOC_SBUSY | VM_ALLOC_WIRED | \ - VM_ALLOC_NODUMP | VM_ALLOC_ZERO | \ - VM_ALLOC_NOFREE | VM_ALLOC_COUNT_MASK) +#define VM_ALLOC_COMMON (VM_ALLOC_CLASS_MASK | VM_ALLOC_NODUMP | \ + VM_ALLOC_NOWAIT | VM_ALLOC_WAITFAIL | \ + VM_ALLOC_WIRED | VM_ALLOC_ZERO) +#define VPA_FLAGS (VM_ALLOC_COMMON | VM_ALLOC_COUNT_MASK | \ + VM_ALLOC_NOBUSY | VM_ALLOC_NOFREE | \ + VM_ALLOC_SBUSY) KASSERT((req & ~VPA_FLAGS) == 0, ("invalid request %#x", req)); KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != @@ -2234,15 +2238,18 @@ found: * * allocation classes: * VM_ALLOC_NORMAL normal process request - * VM_ALLOC_SYSTEM system *really* needs a page + * VM_ALLOC_SYSTEM system *really* needs the pages * VM_ALLOC_INTERRUPT interrupt time request * * optional allocation flags: - * VM_ALLOC_NOBUSY do not exclusive busy the page - * VM_ALLOC_NODUMP do not include the page in a kernel core dump - * VM_ALLOC_SBUSY shared busy the allocated page - * VM_ALLOC_WIRED wire the allocated page - * VM_ALLOC_ZERO prefer a zeroed page + * VM_ALLOC_NOBUSY do not exclusive busy the pages + * VM_ALLOC_NODUMP do not include the pages in a kernel core dump + * VM_ALLOC_NORECLAIM do not reclaim after initial failure + * VM_ALLOC_NOWAIT ignored (default behavior) + * VM_ALLOC_SBUSY shared busy the allocated pages + * VM_ALLOC_WAITFAIL in case of failure, sleep before returning + * VM_ALLOC_WIRED wire the allocated pages + * VM_ALLOC_ZERO prefer zeroed pages */ vm_page_t vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req, @@ -2321,7 +2328,9 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, vm_page_t m, m_ret, mpred; u_int busy_lock, flags, oflags; -#define VPAC_FLAGS (VPA_FLAGS | VM_ALLOC_NORECLAIM) +#define VPAC_FLAGS (VM_ALLOC_COMMON | VM_ALLOC_COUNT_MASK | \ + VM_ALLOC_NOBUSY | VM_ALLOC_NORECLAIM | \ + VM_ALLOC_SBUSY) KASSERT((req & ~VPAC_FLAGS) == 0, ("invalid request %#x", req)); KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != @@ -2422,11 +2431,8 @@ vm_page_alloc_noobj_domain(int domain, int req) vm_page_t m; int flags; -#define VPAN_FLAGS (VM_ALLOC_CLASS_MASK | VM_ALLOC_WAITFAIL | \ - VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | \ - VM_ALLOC_NOBUSY | VM_ALLOC_WIRED | \ - VM_ALLOC_NODUMP | VM_ALLOC_ZERO | \ - VM_ALLOC_NOFREE | VM_ALLOC_COUNT_MASK) +#define VPAN_FLAGS (VM_ALLOC_COMMON | VM_ALLOC_COUNT_MASK | \ + VM_ALLOC_NOFREE | VM_ALLOC_WAITOK) KASSERT((req & ~VPAN_FLAGS) == 0, ("invalid request %#x", req)); @@ -2624,15 +2630,13 @@ vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, vm_page_t m, m_ret; u_int flags; -#define VPANC_FLAGS (VPAN_FLAGS | VM_ALLOC_NORECLAIM) +#define VPANC_FLAGS (VM_ALLOC_COMMON | VM_ALLOC_COUNT_MASK | \ + VM_ALLOC_NORECLAIM | VM_ALLOC_WAITOK) KASSERT((req & ~VPANC_FLAGS) == 0, ("invalid request %#x", req)); KASSERT((req & (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)) != (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM), ("invalid request %#x", req)); - KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != - (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), - ("invalid request %#x", req)); KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); while ((m_ret = vm_page_find_contig_domain(domain, req, npages, @@ -5141,15 +5145,20 @@ vm_page_grab_valid_unlocked(vm_page_t *mp, vm_object_t object, * allocation classes: * VM_ALLOC_NORMAL normal process request * VM_ALLOC_SYSTEM system *really* needs the pages + * VM_ALLOC_INTERRUPT interrupt time request * * The caller must always specify that the pages are to be busied and/or * wired. * * optional allocation flags: * VM_ALLOC_IGN_SBUSY do not sleep on soft busy pages - * VM_ALLOC_NOBUSY do not exclusive busy the page + * VM_ALLOC_NOBUSY do not exclusive busy the pages + * VM_ALLOC_NODUMP do not include the pages in a kernel core dump + * VM_ALLOC_NOFREE pages will never be freed * VM_ALLOC_NOWAIT do not sleep - * VM_ALLOC_SBUSY set page to sbusy state + * VM_ALLOC_SBUSY set pages to sbusy state + * VM_ALLOC_WAITFAIL in case of failure, sleep before returning + * VM_ALLOC_WAITOK ignored (default behavior) * VM_ALLOC_WIRED wire the pages * VM_ALLOC_ZERO zero and validate any invalid pages * diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index ba3f88864661..8f2d5aee3cd4 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -462,13 +462,15 @@ extern long first_page; /* first physical page number */ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); /* - * Page allocation parameters for vm_page for the functions - * vm_page_alloc(), vm_page_grab(), vm_page_alloc_contig() and - * vm_page_alloc_freelist(). Some functions support only a subset - * of the flags, and ignore others, see the flags legend. + * vm_page allocation arguments for the functions vm_page_alloc(), + * vm_page_alloc_contig(), vm_page_alloc_noobj(), vm_page_grab(), and + * vm_page_grab_pages(). Each function supports only a subset of the flags. + * See the flags legend. * - * The meaning of VM_ALLOC_ZERO differs slightly between the vm_page_alloc*() - * and the vm_page_grab*() functions. See these functions for details. + * The meaning of VM_ALLOC_ZERO varies: vm_page_alloc_noobj(), vm_page_grab(), + * and vm_page_grab_pages() guarantee that the returned pages are zeroed; in + * contrast vm_page_alloc() and vm_page_alloc_contig() do not, leaving it to + * the caller to test the page's flags for PG_ZERO. * * Bits 0 - 1 define class. * Bits 2 - 15 dedicated for flags. @@ -476,7 +478,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); * (a) - vm_page_alloc() supports the flag. * (c) - vm_page_alloc_contig() supports the flag. * (g) - vm_page_grab() supports the flag. - * (n) - vm_page_alloc_noobj() and vm_page_alloc_freelist() support the flag. + * (n) - vm_page_alloc_noobj() supports the flag. * (p) - vm_page_grab_pages() supports the flag. * Bits above 15 define the count of additional pages that the caller * intends to allocate. @@ -485,26 +487,26 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_INTERRUPT 1 #define VM_ALLOC_SYSTEM 2 #define VM_ALLOC_CLASS_MASK 3 -#define VM_ALLOC_WAITOK 0x0008 /* (acn) Sleep and retry */ -#define VM_ALLOC_WAITFAIL 0x0010 /* (acn) Sleep and return error */ +#define VM_ALLOC_WAITOK 0x0008 /* (gnp) Sleep and retry */ +#define VM_ALLOC_WAITFAIL 0x0010 /* (acgnp) Sleep and return error */ #define VM_ALLOC_WIRED 0x0020 /* (acgnp) Allocate a wired page */ #define VM_ALLOC_ZERO 0x0040 /* (acgnp) Allocate a zeroed page */ #define VM_ALLOC_NORECLAIM 0x0080 /* (c) Do not reclaim after failure */ -#define VM_ALLOC_NOFREE 0x0100 /* (an) Page will never be released */ +#define VM_ALLOC_NOFREE 0x0100 /* (agnp) Page will never be freed */ #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ -#define VM_ALLOC_NOCREAT 0x0400 /* (gp) Don't create a page */ +#define VM_ALLOC_NOCREAT 0x0400 /* (gp) Do not allocate a page */ #define VM_ALLOC_AVAIL1 0x0800 -#define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ -#define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ +#define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy state */ +#define VM_ALLOC_NODUMP 0x2000 /* (acgnp) Do not include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ #define VM_ALLOC_NOWAIT 0x8000 /* (acgnp) Do not sleep */ #define VM_ALLOC_COUNT_MAX 0xffff #define VM_ALLOC_COUNT_SHIFT 16 #define VM_ALLOC_COUNT_MASK (VM_ALLOC_COUNT(VM_ALLOC_COUNT_MAX)) -#define VM_ALLOC_COUNT(count) ({ \ - KASSERT((count) <= VM_ALLOC_COUNT_MAX, \ - ("%s: invalid VM_ALLOC_COUNT value", __func__)); \ - (count) << VM_ALLOC_COUNT_SHIFT; \ +#define VM_ALLOC_COUNT(count) ({ /* (acgn) Additional pages */ \ + KASSERT((count) <= VM_ALLOC_COUNT_MAX, \ + ("%s: invalid VM_ALLOC_COUNT value", __func__)); \ + (count) << VM_ALLOC_COUNT_SHIFT; \ }) #ifdef M_NOWAIT From nobody Wed Jun 25 19:48:12 2025 X-Original-To: dev-commits-src-main@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 4bSC6b3B5Nz60RX5 for ; Wed, 25 Jun 2025 19:48:23 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (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 ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSC6b0cCGz47Gd; Wed, 25 Jun 2025 19:48:22 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; none Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 01C3FA64805; Wed, 25 Jun 2025 19:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zabbadoz.net; s=20240622; t=1750880891; bh=bAFWYrhDEdsAEd090r70QkzcMDAnr8bLLD6RwdYXPTQ=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=WUQXJE76R8gw72yNTmjS0mnYTLT4xt0k+NZ66f8evSMaPfz3FNti6rdKu6HX+OWrE ybXLMdq4tqTWv9hAXnoHFunDIiTdnLWOd2UJAEJHt5CVbsOliEn3HW6ZuWhM7OIAiV pnKB9LWEDb+sjLuRKqbLJCQ8RSirrRrc/WmmOtu0GBAM0Ww3thBNNmo5XAUT1K1AE0 PAtW0mdStm4VKBYSwPwd8ZsFdB8tr6yBYcMpk38hKgJrMDyXj6vePHcNh2Sg4zYNg0 SpuIV7Yjgr2S1i5cAEDIB2Aap1XV8tkx4cEkgSyuq7uZiuS+bm0inA1gq00YZO4OjB ye4hxFYMHeHcQFT9SCiHbnRceX2ETXgaF/K/BOdTcyDGwgtlm6x5wGWqU45zB6OyEg baYvWyQW0h3ELuN+LBBPByi5yKZdl8OduF27mHAfjM065bbcm13N1/AURKtr4gu2ek P2tMw1YXfYY55gNCNF9H5g8ml+73C72KQcAEc8WUkW9wOHgDCvGgl9bg0voXwNIgJi 0BUXUk0jJCe8SJSEJtSlKtH+cMnpQTdoVbFNu82CBt1O9445uNnOOQO4Ze6b3wOSvv 4usDq+HxUY2o7k9pNK0er4xjAgZKWIjnchz9svD/ViG/gqWRLfv0u5xqFUBNvUsm7E 5qGM46+ybbsZ4vzwpp5FJchM= Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 60C0F2D029E0; Wed, 25 Jun 2025 19:48:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id I4s-LDIg3fqt; Wed, 25 Jun 2025 19:48:12 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:3e64:cfff:fe55:bc80]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 60B5C2D029D8; Wed, 25 Jun 2025 19:48:12 +0000 (UTC) Date: Wed, 25 Jun 2025 19:48:12 +0000 (UTC) From: "Bjoern A. Zeeb" To: Mark Millard cc: Andrew Turner , dev-commits-src-main@freebsd.org Subject: Re: git: 288ba78edcfd - main - dev/psci: Check for functions before calling In-Reply-To: <60E32387-B0BA-4ADD-A897-DC988136D2F9@yahoo.com> Message-ID: <3s789nos-rq00-6n4q-46pq-280r4n3q22q6@yvfgf.mnoonqbm.arg> References: <60E32387-B0BA-4ADD-A897-DC988136D2F9.ref@yahoo.com> <60E32387-B0BA-4ADD-A897-DC988136D2F9@yahoo.com> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4bSC6b0cCGz47Gd X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3320, ipnet:2003::/19, country:DE] On Wed, 25 Jun 2025, Mark Millard wrote: > Andrew Turner wrote on > Date: Wed, 25 Jun 2025 11:22:51 UTC : > >> The branch main has been updated by andrew: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=288ba78edcfd82b4b558a46fae78e4076acbe200 >> >> commit 288ba78edcfd82b4b558a46fae78e4076acbe200 >> Author: Andrew Turner >> AuthorDate: 2025-06-24 16:47:28 +0000 >> Commit: Andrew Turner >> CommitDate: 2025-06-24 17:45:42 +0000 >> >> dev/psci: Check for functions before calling >> >> In the SMCCC TRNG and Errata ABI drivers check if the version >> functions are implemented before calling them. Without this the firmware >> may complain about an unimplemented function being called. >> >> Reported by: bz >> Reviewed by: bz >> Sponsored by: Arm Ltd >> Differential Revision: https://reviews.freebsd.org/D50978 >> --- > > > I wonder if a debug mode or verbose mode should report > the != SMCCC_RET_SUCCESS cases for smccc_arch_features. > If this change had already been in place, the older > status might not have been noticed. As bz wrote > elsewhere: > > "That said seems like it's still a good idea to add > these bits to my TF-A." > > Having a way to check on if a TF-A instance is too > old to have a known status for handling things that > are now requested could be a good thing. Please read the comments on the review. -- Bjoern A. Zeeb r15:7 From nobody Wed Jun 25 20:02:01 2025 X-Original-To: dev-commits-src-main@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 4bSCQL20xrz60SDt; Wed, 25 Jun 2025 20:02: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 4bSCQK6YRtz3GXT; Wed, 25 Jun 2025 20:02:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881721; 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=EQZtYEUhkaUSVb4S1ul4w8qY5yv9+dkVBVjYQBsDDmU=; b=GbnGtdRIXk6jWLc2bbpVOCzsvgcNWoZN2pBWr3gcjv757U1uD3jWDekX1D35/LJoASxt5F 5yHPJ9gdTx/My46c4AcDpn4Sxh4obK/B3RjmDdmGLn1HJjgnTCWk8WhK3n/6wBp1pVNBf/ ZArDmdB1DY6QEuK/3ekv2hNTZbWbknJWCKuDQXOLXpAicffMFkiQ1Y/wchdFm/1Q3c7vTt O4L0a2aYEH2Y94zqCBtJzhB0WhebJyuCUeKYOmpYmFcgUp9B8cRgHoaTjzAGZojqsygukD fWPcnoQAXl5HhHVF1wNjZESg0SuENsm7uu+inFkGJnMeRqGk+/br0JV7N89A6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881721; 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=EQZtYEUhkaUSVb4S1ul4w8qY5yv9+dkVBVjYQBsDDmU=; b=ulotbUHSf6YzAR4oWc8F5iw7xyQeAHdrW3titC30rIpANpJV0KNWqf0r6S9jDqYySiMUOT kPcwwKkmyFkUig/kkmPGLqNdzVj7ZTfqKgI7ns+Eg8hKXFmCyDr/zUeR06cKfNeX+lRNqW 2uzZOMUIhacJLV8pqdJqWb0BpO/2RDoPk+ibb5v2yXt2Piq9yQEcy9uirTToR0BtOWZXbD LWyu2+JAJZOpMpGyPi8MDuoa1Xc4KU0OQEeLEjY/VN/e/qxLBFuhsalQPQshrzVG9hii6Q D0W0MvfXQ/VAxEAS/juPUNPntItZESkY3PnboKRzRS5UhTjPBiOfZYrbijHdGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881721; a=rsa-sha256; cv=none; b=dOfjn9BHB79USNO5IEORFhfAo/0MmKljLYlqLh0VKuwU8amKVaXxtnKqZs2fo9MPHfAySW StQre+7XKRHpgQuBMzCF7yBqhBMCq9Z9BAdrebdkCuLZ6ofasH9DE2whkzowLsgtc467xj QPbG0Rjrm6u9QrH4x2TiBe2KaiVbMIUOit3v1ABKzmb/rCa9jU5uYnY1u1Ok1I9hwlhbdt Xd70uk4G1W0uV7ODemdV2lB50CElfUyYe+XcaUPmtWGHTRzJViklMp1/+q5EEMGpXPEAis YxF8EWZsh8gTxubBaDqevGfdMZO2wdvIZKLwIsGgEcUpxEkAbRgp4SeokAfzpQ== 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 4bSCQK5f5dzY6f; Wed, 25 Jun 2025 20:02:01 +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 55PK218u079584; Wed, 25 Jun 2025 20:02:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK21NH079581; Wed, 25 Jun 2025 20:02:01 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:02:01 GMT Message-Id: <202506252002.55PK21NH079581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 0d7abc6e1f78 - main - IfAPI: Finish etherswitch driver conversions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d7abc6e1f785fa576909bbdba0a66a45be18a90 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=0d7abc6e1f785fa576909bbdba0a66a45be18a90 commit 0d7abc6e1f785fa576909bbdba0a66a45be18a90 Author: Justin Hibbits AuthorDate: 2025-02-11 21:13:36 +0000 Commit: Justin Hibbits CommitDate: 2025-06-25 19:53:13 +0000 IfAPI: Finish etherswitch driver conversions These drivers are not compiled by default, so were missed in the conversion. Sponsored by: Juniper Networks, Inc. --- sys/dev/etherswitch/arswitch/arswitch.c | 2 +- sys/dev/etherswitch/e6000sw/e6060sw.c | 8 ++++---- sys/dev/etherswitch/infineon/adm6996fc.c | 8 ++++---- sys/dev/etherswitch/micrel/ksz8995ma.c | 8 ++++---- sys/dev/etherswitch/mtkswitch/mtkswitch.c | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index 924793a0488f..c53c82f1750c 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -163,7 +163,7 @@ arswitch_attach_phys(struct arswitch_softc *sc) #if 0 DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", device_get_nameunit(sc->miibus[phy]), - sc->ifp[phy]->if_xname); + if_name(sc->ifp[phy])); #endif if (err != 0) { device_printf(sc->sc_dev, diff --git a/sys/dev/etherswitch/e6000sw/e6060sw.c b/sys/dev/etherswitch/e6000sw/e6060sw.c index 901f887ffdc6..0af71692091c 100644 --- a/sys/dev/etherswitch/e6000sw/e6060sw.c +++ b/sys/dev/etherswitch/e6000sw/e6060sw.c @@ -214,9 +214,9 @@ e6060sw_attach_phys(struct e6060sw_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - sc->ifp[port]->if_softc = sc; - sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | - IFF_DRV_RUNNING | IFF_SIMPLEX; + if_setsoftc(sc->ifp[port], sc); + if_setflagbits(sc->ifp[port], IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX, 0); if_initname(sc->ifp[port], name, port); sc->miibus[port] = malloc(sizeof(device_t), M_E6060SW, M_WAITOK | M_ZERO); @@ -225,7 +225,7 @@ e6060sw_attach_phys(struct e6060sw_softc *sc) BMSR_DEFCAPMASK, phy + sc->smi_offset, MII_OFFSET_ANY, 0); DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", device_get_nameunit(*sc->miibus[port]), - sc->ifp[port]->if_xname); + if_name(sc->ifp[port])); if (err != 0) { device_printf(sc->sc_dev, "attaching PHY %d failed\n", diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c index 58a3f9625d4a..fedab27c2610 100644 --- a/sys/dev/etherswitch/infineon/adm6996fc.c +++ b/sys/dev/etherswitch/infineon/adm6996fc.c @@ -173,9 +173,9 @@ adm6996fc_attach_phys(struct adm6996fc_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - sc->ifp[port]->if_softc = sc; - sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | - IFF_DRV_RUNNING | IFF_SIMPLEX; + if_setsoftc(sc->ifp[port], sc); + if_setflagbits(sc->ifp[port], IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX, 0); if_initname(sc->ifp[port], name, port); sc->miibus[port] = malloc(sizeof(device_t), M_ADM6996FC, M_WAITOK | M_ZERO); @@ -184,7 +184,7 @@ adm6996fc_attach_phys(struct adm6996fc_softc *sc) BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", device_get_nameunit(*sc->miibus[port]), - sc->ifp[port]->if_xname); + if_name(sc->ifp[port])); if (err != 0) { device_printf(sc->sc_dev, "attaching PHY %d failed\n", diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c index c2ac994fe882..cbffd5e39f49 100644 --- a/sys/dev/etherswitch/micrel/ksz8995ma.c +++ b/sys/dev/etherswitch/micrel/ksz8995ma.c @@ -219,9 +219,9 @@ ksz8995ma_attach_phys(struct ksz8995ma_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - sc->ifp[port]->if_softc = sc; - sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | - IFF_DRV_RUNNING | IFF_SIMPLEX; + if_setsoftc(sc->ifp[port], sc); + if_setflagbits(sc->ifp[port], IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX, 0); if_initname(sc->ifp[port], name, port); sc->miibus[port] = malloc(sizeof(device_t), M_KSZ8995MA, M_WAITOK | M_ZERO); @@ -230,7 +230,7 @@ ksz8995ma_attach_phys(struct ksz8995ma_softc *sc) BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", device_get_nameunit(*sc->miibus[port]), - sc->ifp[port]->if_xname); + if_name(sc->ifp[port])); if (err != 0) { device_printf(sc->sc_dev, "attaching PHY %d failed\n", diff --git a/sys/dev/etherswitch/mtkswitch/mtkswitch.c b/sys/dev/etherswitch/mtkswitch/mtkswitch.c index 89e092d02ac4..ff7aee22398f 100644 --- a/sys/dev/etherswitch/mtkswitch/mtkswitch.c +++ b/sys/dev/etherswitch/mtkswitch/mtkswitch.c @@ -121,9 +121,9 @@ mtkswitch_attach_phys(struct mtkswitch_softc *sc) continue; } sc->ifp[phy] = if_alloc(IFT_ETHER); - sc->ifp[phy]->if_softc = sc; - sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | - IFF_DRV_RUNNING | IFF_SIMPLEX; + if_setsoftc(sc->ifp[phy], sc); + if_setflagbits(sc->ifp[phy], IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX, 0); sc->ifname[phy] = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK); bcopy(name, sc->ifname[phy], strlen(name) + 1); if_initname(sc->ifp[phy], sc->ifname[phy], @@ -138,7 +138,7 @@ mtkswitch_attach_phys(struct mtkswitch_softc *sc) } else { DPRINTF(sc->sc_dev, "%s attached to pseudo interface " "%s\n", device_get_nameunit(sc->miibus[phy]), - sc->ifp[phy]->if_xname); + if_name(sc->ifp[phy])); } } return (err); From nobody Wed Jun 25 20:02:02 2025 X-Original-To: dev-commits-src-main@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 4bSCQM1k0Rz60SXv; Wed, 25 Jun 2025 20:02: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 4bSCQM08v5z3Gm1; Wed, 25 Jun 2025 20:02:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881723; 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=ShHGUaPBtaKqTruVgcUdPPo5ntfBWzIoIkaM3EwMc8s=; b=akUTMjg1xbmuii5u8pFuiE2RfEMCGQFTRd8Xbic3qWVI+SHDQftpYX2NeIdDQmEtInfbl2 gc7Ex3doz67UuGBRdnPQOsS6D3bRzclGrjxa18pbnJfIauP0cJkIYA2zG1E/E09i4nGFgn lFnUvWH8AYsjHByjXRH6ksFZod7YoBG1xLnUsrS5JO4OvM4H7FX6b4uUWg4RmJ7bhaokfj xEGTEFtC7tBx3h1YTSgPLiS4rhhPhvaTIQom1NIP0PK0JycQ68i9i4uqbfuHQX1tjXQNck PvwKjH7RvIM+4070wP6rLvj0Ihb0hapWaOrraL4lr+QTspLvoGV7ZazBDmkwBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881723; 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=ShHGUaPBtaKqTruVgcUdPPo5ntfBWzIoIkaM3EwMc8s=; b=hZRgGHjCD8W1Y11766nVA1Hs2LRKWfTKuuJIFeNGG7IIRrWi4PSQXNQ7h6BkUFnYc3lGsE Jbd31I3VmR/u1swuXB5PUvuJ8eEs9EwYOmojUx5Pllp7ppjAUmz/Jm682Qt6+VWDNr00ca BzNfLdzesqkUCPdmoFeAqwy7c5x3vUw0LtmvrWDFNwzDVezD1A2mOyYrJqXutlP0qpFcmR yAF2NHttt+VofP/ibBK+GkB48Ve7luY/oHs1GSgHn1nDpFUfyyBtNCyrCGNTLLdHRnKnLr 61AJJP6UBUiqM9Lf0by/+FepmK9PiUZyBx0gjMCXK1wVUMDx+zAIHCVmINd4yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881723; a=rsa-sha256; cv=none; b=OmKa5U93tFTTMA5CIRjsvXe3I6YPEWEhfUu1yQ1t6e576paCPnw4nmK4rEuAmbfgP5GwuC 7p9K4XqxNhr/Kq8eQt4B4gmOk6qUTjq5duTZwVHw3xLyhq6OiHMKJXWYNv6UCMWBPJSMFf ST8gBKLYnU1E5LyWiYpRl/hY35YLvLMVVLS55/mf+pNE1estyly6lUcC/msXWYVSVicdtO b8/AGDm3jdsJtawcWMOZqyeToW0cPucGyKc9a0xJk4E1zMDvB8dU9oOG/Atpz7kXka/Vj/ IMqEVRi64W7B7vCIHjx3t1lgwNCzBazCcuXCv5qW+aVCd4xCugr9gZTbEE3i2A== 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 4bSCQL6ZMLzY6w; Wed, 25 Jun 2025 20:02: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 55PK22TY079625; Wed, 25 Jun 2025 20:02:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK22Zn079622; Wed, 25 Jun 2025 20:02:02 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:02:02 GMT Message-Id: <202506252002.55PK22Zn079622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 564df56098e0 - main - nexus: Add device_shutdown where missing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 564df56098e0b4afb0e45e9bc22b6168b3271071 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=564df56098e0b4afb0e45e9bc22b6168b3271071 commit 564df56098e0b4afb0e45e9bc22b6168b3271071 Author: Justin Hibbits AuthorDate: 2025-06-25 15:18:46 +0000 Commit: Justin Hibbits CommitDate: 2025-06-25 19:53:24 +0000 nexus: Add device_shutdown where missing At shutdown devices may need to do extra work to clean up state, etc. This is done in a device_shutdown kobj method on a driver, with the default being a `do nothing` method. Only x86's nexus driver includes the device_shutdown method to propagate down to its children, so on other architectures the device_shutdown stops at the root, and thus device_shutdown is never called for any real devices. Add this missing method to the nexus drivers of the other architectures so devices have a chance to properly shutdown. Sponsored by: Juniper Networks, Inc. --- sys/arm/arm/nexus.c | 1 + sys/arm64/arm64/nexus.c | 3 +++ sys/powerpc/powerpc/nexus.c | 1 + sys/riscv/riscv/nexus.c | 1 + 4 files changed, 6 insertions(+) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 3653d7087a5c..c0a79736c665 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -114,6 +114,7 @@ static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), /* Bus interface */ DEVMETHOD(bus_add_child, nexus_add_child), diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 2de996447edd..26b3389db172 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -126,6 +126,9 @@ static ofw_bus_map_intr_t nexus_ofw_map_intr; #endif static device_method_t nexus_methods[] = { + /* Device interface */ + DEVMETHOD(device_shutdown, bus_generic_shutdown), + /* Bus interface */ DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_print_child, nexus_print_child), diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index 029b6ef8a479..313b1f4792b9 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -86,6 +86,7 @@ static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c index 836e1648edeb..d08274aba9b2 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -100,6 +100,7 @@ static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_fdt_probe), DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), /* OFW interface */ DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), From nobody Wed Jun 25 20:04:39 2025 X-Original-To: dev-commits-src-main@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 4bSCTM5jK3z60SSs; Wed, 25 Jun 2025 20:04: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 4bSCTM4vFfz3JJ6; Wed, 25 Jun 2025 20:04:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881879; 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=61UzK66+hSmQPOdwqRbsps2c17LfX4y9UD8ouB39YKA=; b=raRFiRPjPKCFzEvMbKEjQqT7LFJ8kszC1k9Q4Yr6dv9oRBXZAm4Y1Dxdk905u/YB8egssi fJfnMXUfJUDP1ojVSXYfRmvZwSO/7CUTR501qY459AlRAeifVJ6zHyN3DpHurVz6Dbc76A qQpswwKGwZ97ht1Gp+9rM9vfhgbk6kOJxaOnI2H7hUHWscXsYn+tRb9huzQ1uEXycymvRG J3Nva8JF62z1J3I+7ZzbS8+VmMNOJZ8Oz5JyF0A+5ZXQFb/0y8ea+Aks95hAlyYGfj8u01 AtwbsWmFII/KL8EPAnmHg/aD74p1pt7p88/z1hBCi7prU7YMe2w0dgDaB2ELdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881879; 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=61UzK66+hSmQPOdwqRbsps2c17LfX4y9UD8ouB39YKA=; b=yAc4i+qnC5m56kYYFDxeXA3nX+sdKt24YDLcRE98R/H3emHeygRCzlI1wPlNmi4qp68C+Y C01cvB3yIZxW4eYAOcl5p/iRGzKGzUnKiuonc8mfNZcpo4sTeG4wFxhfhzwCHuJCpakpAO +5cree69Xj2uuly+043tsbByTZj3AScP9QFNPoFMAZ5bGd77VlPm9rxUfP3zUoxZj90273 M9Z7r91p6pLoTXOk3BQfAXy58/268/rBO5uI/gDD9Fl1afbliqoa6nGr6/VOA2udeA4iE9 6s4BjBvWSTU8DmZTFKpXvLaDWNOYX9vqc6VR+9DpeGvirGdPSLZ83mfyqKr78w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881879; a=rsa-sha256; cv=none; b=UbIG52X3SqiuWjrbiZmE0mEoajT0OT2ybRDTwCDQ4OaJo6fHha47v8/v8If32l2uwyxqh/ 6Vzr0dp+Ts1wkMdCiR6CkxSBvoY4YnavwllQdDrjQyK7sM5ZP+K5oFIyX7eeKYS5pYbYqB ydJSKYTf0cqGCuqdOWwUzzQrhCebECtl/y34stYk0L4ZePLmXR/xtfn5FkAZIFpLkPghrw 94OdcY/Fq1jpyFZTpXms2DrqPDBZ58+7PCFvaDv1EKsMHjRaCRhIY7LW3JRlSNzGxvpcas 3YzqVikZ1+KOZKAairwxKUatFQ+149mLfDlape1ABMPICRTeQe32iQvQnEXDzQ== 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 4bSCTM3mlGzY72; Wed, 25 Jun 2025 20:04: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 55PK4dk5080533; Wed, 25 Jun 2025 20:04:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK4d0k080531; Wed, 25 Jun 2025 20:04:39 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:04:39 GMT Message-Id: <202506252004.55PK4d0k080531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c7adc9ad973e - main - pfctl tests: max-pkt-rate test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7adc9ad973e5c864d1bcde32783eaa16afc7095 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c7adc9ad973e5c864d1bcde32783eaa16afc7095 commit c7adc9ad973e5c864d1bcde32783eaa16afc7095 Author: Kristof Provost AuthorDate: 2025-06-05 14:50:20 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 20:04:14 +0000 pfctl tests: max-pkt-rate test Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/tests/files/pf1068.in | 1 + sbin/pfctl/tests/files/pf1068.ok | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + 3 files changed, 3 insertions(+) diff --git a/sbin/pfctl/tests/files/pf1068.in b/sbin/pfctl/tests/files/pf1068.in new file mode 100644 index 000000000000..993cfa37f8f9 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1068.in @@ -0,0 +1 @@ +pass in proto icmp max-pkt-rate 100/10 diff --git a/sbin/pfctl/tests/files/pf1068.ok b/sbin/pfctl/tests/files/pf1068.ok new file mode 100644 index 000000000000..bd36043207f9 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1068.ok @@ -0,0 +1 @@ +pass in proto icmp all max-pkt-rate 100/10 keep state diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 7e43556d2c4d..2b237ed0922e 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -176,3 +176,4 @@ PFCTL_TEST_IFACE(1064, "Interface translation: IPv6 rule, interface with bracket PFCTL_TEST(1065, "no nat") PFCTL_TEST(1066, "no rdr") PFCTL_TEST_FAIL(1067, "route-to can't be used on block rules") +PFCTL_TEST(1068, "max-pkt-rate") From nobody Wed Jun 25 20:04:40 2025 X-Original-To: dev-commits-src-main@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 4bSCTN6xBHz60SfM; Wed, 25 Jun 2025 20:04: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 4bSCTN42Hwz3JSr; Wed, 25 Jun 2025 20:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881880; 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=L32OjE7hCYKF3ZIQ6eNhVIIUqgdJwcmeCZCXW7193+c=; b=f9/ycy1OSZyTyzf/zt6KyXLDQyRkKbCruVDCd1GrrFb4rzyTR0ALC9PhGxyf5/Xyrqmzq6 sb59omPp8Yqr88DH0L+9HrzFfPzWficzQJaJJtHKTzGYPdFv15FyJK0zZP7AsfivVqmSLj ES3+WeD79WnIvdc3qNUq5dushtC5qHHrFwlr1PwM1jSqovl0+UMl1pDt17C9Dq3su9yRX+ Qr0kv+GsQTgTKGr9t++HDUx5ylngDUJV1M7lgOh5cldtcHmF4R0XKY8+iaB3Vb8iTkjGFK tWOzG68svOLdpill/zSlo6UFCz7V13cNjKasF94gbslpfxpKbG0PBcTSHfkNYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881880; 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=L32OjE7hCYKF3ZIQ6eNhVIIUqgdJwcmeCZCXW7193+c=; b=SVi5PcuD4bJF2yDq7GVasbZUiW7rGZdtAvbPmoU9xOZ7neKPfW+BYM08G5u5xWdj3hZfbC 5n0FygzAjFPrkTA7Web1HL+KA0O8/sldRcQwL3IgezPrTLVm6iEcZwCGHn9WCs2NMn3gay Qi+9oe+/cuSy+DuSjYxcbMcxFYbjArVUqebZ/kk5+4wyV6lMuRET7K7cpC9nTNbbK6ILVf ptj0kM+Db+bPBpIi16pm84KQBZ9NNwvzaoIVvZc4ikNh6ROZpteqwT9t03+/Fl21zvRxkB xj83IudOABASuOn4KiZRRvFpMwvE4hlOQCZ7jG5fYZ6nQXMv+YUF7KZDuzbRqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881880; a=rsa-sha256; cv=none; b=JW7dalK+dnXOiRPVqDhdALJs+4pUXEBoN3bEx8Im5AG6mq0g67kgTyoRgVjMK5CB6CYNMs L96phdfRcjyrnJ/y4tnWbryzOSVV2PlSKl4q8IVxbzuqzHkyVhqiR87iztBzYQjRQKsyxT WB1ypiRA3nTk54+0HTTk08wC/+mxJucedFxZWNmVthdI2rGvALTUbenQB0pqPukRe7qWgA GLGRdEQB4aH8FfrGPDmXyMTekZSwd/6iYzSkWaG/fvORKLkvNd/NBHD5M7XxaSrn6ap1Aj LWqHzRIB8hT5vvMwg06zOH3Zp6/8bEKOjpdDn7GR8TzrFS24uxe9C5O/PzrcIg== 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 4bSCTN3dgTzXRn; Wed, 25 Jun 2025 20:04: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 55PK4ejn080567; Wed, 25 Jun 2025 20:04:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK4eBe080564; Wed, 25 Jun 2025 20:04:40 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:04:40 GMT Message-Id: <202506252004.55PK4eBe080564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c5f21023771a - main - pf tests: basic max-pkt-rate test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5f21023771ad896cee847c67c644aeaa2ed32f9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c5f21023771ad896cee847c67c644aeaa2ed32f9 commit c5f21023771ad896cee847c67c644aeaa2ed32f9 Author: Kristof Provost AuthorDate: 2025-06-05 16:04:15 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 20:04:14 +0000 pf tests: basic max-pkt-rate test Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/max_pkt_rate.sh | 82 ++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index e926c9dd50c2..fe2740ed0e7f 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -22,6 +22,7 @@ ATF_TESTS_SH+= altq \ killstate \ macro \ match \ + max_pkt_rate \ max_states \ mbuf \ modulate \ diff --git a/tests/sys/netpfil/pf/max_pkt_rate.sh b/tests/sys/netpfil/pf/max_pkt_rate.sh new file mode 100644 index 000000000000..d1e92a64de1d --- /dev/null +++ b/tests/sys/netpfil/pf/max_pkt_rate.sh @@ -0,0 +1,82 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2025 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic maximum packet rate test' + atf_set require.user root +} + +basic_body() +{ + pft_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a inet 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "pass in proto icmp max-pkt-rate 2/2" + + # One ping will pass + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + # As will a second + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + # But the third should fail + atf_check -s exit:2 -o ignore \ + ping -c 1 192.0.2.1 + + # But three seconds later we can ping again + sleep 3 + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 +} + +basic_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} From nobody Wed Jun 25 20:04:41 2025 X-Original-To: dev-commits-src-main@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 4bSCTQ0Cx1z60SYQ; Wed, 25 Jun 2025 20:04: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 4bSCTP4pJWz3JR8; Wed, 25 Jun 2025 20:04:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881881; 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=ax/naApQwRRnMt/pY1vRjQEq9bdKNxjqzxB+7dLOOx8=; b=A0VLcXZP50e9r9R34qa147WOUZyvuGlThBPNVyUDWsArx5+1I77JEEVCm8Vm2zXK2PlAli VeGaMf3DeurUXPMFtmHIfHN5QOaPlxawaXL377BjdTcijWXGrx1k9g/yG6Ve7lgmA/3kvE FGoZbzOVO3Py1+hbCuOwYGnzTk09EUU57+fLKey9sZA/Nn7eT5HXAx0XfJ5ozvR4FJXUmz NtYaws7/1tuqH1Ii6CIf5WxKK8y1MXeAASVMvehhrRuTwEZ6VaFzGzFGWfbncDJvYjbGJd MOqKR6UrhqNnIMJxT6DT5Q0y4QUua0aFdQ5iY2NutoRonn4HV2h+ABdVCLcGHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881881; 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=ax/naApQwRRnMt/pY1vRjQEq9bdKNxjqzxB+7dLOOx8=; b=VAJ/9OJ7nDrkQEp3SXiw84ZR/BKsI91MhZKDxhmdbLDeqrfVHoKjinB+pnjhww/RcQyut9 o6YmtRpVK/+isZd49FQqxmbKATHzjCpMR1HOgt2qG+p/l3W9irysVheMhcl52tkXiDqtl9 OIxDnT2exCWYrn7tAfrIX5AoI6MH+KZAlp8II/PElDtoN/TgIHawJb4KRxTpBV/VOX6d7e 0i2+CEQBluVc540udHBw8d7S9OTY7hLlZ98P8w1i5Ko0ownxe2ZX0RgGunPdv/geb4e8qx y3vaEPdkeBAkAAEKmLQFzOsT9ZqiN+rivmyeeVWjDFEWhSinGTfow1ZY5Qm3Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881881; a=rsa-sha256; cv=none; b=YFoRQdWBXWzIjHKR3UOLD4mEFP4pf0bLW91IIgQ12jvjEPhE4wDTNghJZfu9iSoRFVrsjY 5QA6+sLfT48YNNWGkgpZMkhoGMMyRtEfU5VDyg+4XUx9V91bCesJ57LxIJkUjXGA/kPEAv cSqiJgKgA2iMTVem8SozVw6risvkmjR8p6aJfWfylSgTXLgPfrVZX3jXrP0XiI4kN9Zpgk +q0KD8V3t5nbJBE4otrIFAsTe3dLDouIqebmDdLzoro2pItT196YLYTEvGMoUf2bcqgyqZ n2f7pv2D+9t9OTNcfmpq/o0xXKvhqmuIG3IJn27Qyw53CGUg4feB2YVp3HDGlw== 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 4bSCTP4H9LzXnV; Wed, 25 Jun 2025 20:04: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 55PK4fdU080601; Wed, 25 Jun 2025 20:04:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK4fjJ080598; Wed, 25 Jun 2025 20:04:41 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:04:41 GMT Message-Id: <202506252004.55PK4fjJ080598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: eb01c0dfe275 - main - pf.conf.5: tweak max-pkt-rate List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb01c0dfe27572247c64979f26d01ac11d3ff1bb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=eb01c0dfe27572247c64979f26d01ac11d3ff1bb commit eb01c0dfe27572247c64979f26d01ac11d3ff1bb Author: Kristof Provost AuthorDate: 2025-06-17 09:19:16 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 20:04:15 +0000 pf.conf.5: tweak max-pkt-rate Obtained from: OpenBSD, jmc , fbac9b3f44 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 010096369c83..3bdba4958aea 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -2221,15 +2221,14 @@ Measure the rate of packets matching the rule and states created by it. When the specified rate is exceeded, the rule stops matching. Only packets in the direction in which the state was created are considered, so that typically requests are counted and replies are not. -For example: -.Pp -.Bd -literal -offset indent -compact +For example, +to pass up to 100 ICMP packets per 10 seconds: +.Bd -literal -offset indent block in proto icmp pass in proto icmp max-pkt-rate 100/10 .Ed .Pp -passes up to 100 icmp packets per 10 seconds. -When the rate is exceeded, all icmp is blocked until the rate falls below +When the rate is exceeded, all ICMP is blocked until the rate falls below 100 per 10 seconds again. .Pp .It Xo Ar queue Aq Ar queue From nobody Wed Jun 25 20:04:42 2025 X-Original-To: dev-commits-src-main@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 4bSCTR0bkGz60SYR; Wed, 25 Jun 2025 20:04: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 4bSCTQ5GkBz3JLC; Wed, 25 Jun 2025 20:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881882; 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=V/QzfIWLXbwvz7Dw8uzNR7ECvrihZRE7xlH/O3bN1HY=; b=gaTeipG8BxzO9BDUV4MBP5YIkGRmN4nfb0twVnaI+4iPLe/Fh3ChQWZX4Hg1dwvlOETtQQ m5o5yDrH82JBWtMpMl3Uxuy4QpHPkItAeV0ohZzFJoUQJPUh/OsJv0IEMnuF7uEi8KayHQ qhutC9ERNIPaLGGsTaa32K6nTYm0J+kg3sDUHc8AMNNos/nq7F4CTSEYVCUEE9PNrsO3tP aUt58Hd2MMcM2raK02B3YukqbpMUGDpaZkGiP/dgGsWroQYgQ8zOoWWzWVZm5rOWG6detz EXpUJH6/g+t7nrvIcvEQiaRQkFgYmvo/F/qM8M4bAdRoLoxGFRy8H/IG0jRw2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881882; 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=V/QzfIWLXbwvz7Dw8uzNR7ECvrihZRE7xlH/O3bN1HY=; b=sdaj0zT0AZqt5fvpyN5zdK0UrcQIJuJbL+7JgAY8ewqU9Zo/VWTjCO8qyyf93Ic0d6JU28 eEZslnjA2grLm85nGKZnmuDpg/p199mV80w+Qs7fa4GZj784ppaYa94PUh6Rys+MI4MRDu afN7lrTblh1Y2JzhhEBld+JenBbUaMV5UeDjPw92X7nno5I42lpEXMgqGUWTa7kL/415dm 3X0eKFO3IT+gQEU4wVCrAncanPuyI8iPbOQ6DTXSBoU7UvVtegoTE9G4s+mU1A/Sp1rfJ3 BNKn/zIG5Bxo3nEV/VAvf7UtuWezJKkGzWF+6XASNoK5WbN0AHS1YKBNEurC/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881882; a=rsa-sha256; cv=none; b=P2/hwdW4WdRPiE6gP2t/N6q0qKGhF/0XHo9qD4DT7DEZ9pHaWzvAK6LOKB5wgjDDZGU/Um gObKK5eUqZgBMQiNJbP5VbGgfbLM1FdWilyyig9Wy4eijjEeVuXt/t2gRSDATRYbTbRNxV qZ3XdAqxLoL4wQzvECPIIzG8oSejSJ2eYb2UFfPp2rKkYsdlj37IWXTtntppNGbSiWAhi1 fJcvCHzgTcu6Z5BDTznezklYJL/2PvXOnyXpdHAX3x4BY53Wm9+SWRwbiyLdfCvhT+vRn0 B/QyWoJbRytXFFPxZc+r7B7x/BXWnQ20C7Ou9zmgHiOXSjXJbO1DX4tv/x419A== 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 4bSCTQ4tSZzXnW; Wed, 25 Jun 2025 20:04: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 55PK4gU7080634; Wed, 25 Jun 2025 20:04:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK4gmU080631; Wed, 25 Jun 2025 20:04:42 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:04:42 GMT Message-Id: <202506252004.55PK4gmU080631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 87adb6ab7660 - main - pfctl: nested anchors vs. pfctl/parse.y List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87adb6ab7660ac32237bc6e5976b0d01fff316b9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=87adb6ab7660ac32237bc6e5976b0d01fff316b9 commit 87adb6ab7660ac32237bc6e5976b0d01fff316b9 Author: Kristof Provost AuthorDate: 2025-06-17 09:24:31 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 20:04:15 +0000 pfctl: nested anchors vs. pfctl/parse.y bug reported and fix tested by Leonardo Guardati OK bluhm@ Obtained from: OpenBSD, sashan , aeb2b655bc Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 5d4d2b86fd58..0af53e2692d7 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5548,7 +5548,7 @@ process_tabledef(char *name, struct table_opts *opts, int popts) &opts->init_nodes); if (!(pf->opts & PF_OPT_NOACTION) && pfctl_define_table(name, opts->flags, opts->init_addr, - pf->anchor->name, &ab, pf->anchor->ruleset.tticket)) { + pf->anchor->path, &ab, pf->anchor->ruleset.tticket)) { if (sysctlbyname("net.pf.request_maxcount", &maxcount, &s, NULL, 0) == -1) From nobody Wed Jun 25 20:04:43 2025 X-Original-To: dev-commits-src-main@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 4bSCTS16tfz60SNx; Wed, 25 Jun 2025 20:04:44 +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 4bSCTR5tl4z3JRJ; Wed, 25 Jun 2025 20:04:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881883; 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=jjelGgliDJke/B4eDNCa98k9IGuT95qL/DmkDSIvUhM=; b=hcXNxSHwtj4ag7lcfqP93kwXZjxLUiqYfRjVlaDXC5mv4JxHXZO8ea8iPplwbM3HifoV77 ARS+ovWZuCzRzhuIJaju3H9RdGa8GMNQFDJtK53QBrgi3FZ2cVPWda6FB9kfQDMucMBWFJ 5pInnd03MQtaUABSXMspOw4J8azisSL6Kb0FU6DzXehx1HicTLBjI497mJ4glbT37jAYmd TkfL1rohAVohua+G8dna8BXP/TjH+MPinmbd+uKJGx1WLq2eAzsYEi9guTDxE3R2EgysBd UxvtOawKOvT+HpJpqLaVgzmRecH4MeJ0qZ6QsPYh/i/dMzREjeOqnTd+fv1VKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881883; 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=jjelGgliDJke/B4eDNCa98k9IGuT95qL/DmkDSIvUhM=; b=nRufJxd0U8RULlT8QkI8JgNtIQNHgl8X8WaSbNt7EVPKp5145hzUM0eW2B0psIcAF+Xz0D AjKp0IAIKHXnC6zNgamk1zE+0jbrXwOLCXc7cWOkfxfMRa5EyuIFOPgtm7ARY2nKxM2xIb rz083R+0W06M3VBa8tvegm8pYtADEhFbiAMft0XmNGLL9Ah2kuhOfbebosBmSw3RvcL3ow dGv9hzMa10vy+W/7uNauxdcEjiEOhOasan/VPiO7/2daSzaxbOoHfBkycsYF2pM0QEFln9 ITSdADCHQDfp40BYCG/De0zpDL3pCBHWXTzfb0R7+ED3ZZ2GYSa/3KwSRZjjeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881883; a=rsa-sha256; cv=none; b=K/HEvUftBlwadiaq+E/1zrEydi+9iMca4q7Y1RivFbrsnEXroJjDQfDvZROts52knLwF+p Ll2wSg4JzO+zCMtmf/iHfensgPKoVJRQmKIKSfkwSF1musEteW64eE+FSAnSS6jI3Z7ZGa P7E4vC5kAzfecU1mocMF0u+xJoIBeeAYB8LjcFCmYrV1lkjay1r2WV8TSUNfpt1IcO2nVx F4d5vj+Tmapjpii0ddNVrXDPY6cbjrIL2Rea5CD9DN+26yI8uiMOIAk3YVj76gW1xUHu/N pRENwjQ8Ra5SGqC9lbTi9v2NnUpraMi9TofPpRoI55Is1sbLqjkpJMVMU6bw2Q== 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 4bSCTR5RRNzXnX; Wed, 25 Jun 2025 20:04: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 55PK4huV080674; Wed, 25 Jun 2025 20:04:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK4h2w080671; Wed, 25 Jun 2025 20:04:43 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:04:43 GMT Message-Id: <202506252004.55PK4h2w080671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 809ba93c689f - main - pfctl: rule optimizer: anchor name vs. anchor path mix up List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 809ba93c689ff5a1fd04a45406363e09f43c8467 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=809ba93c689ff5a1fd04a45406363e09f43c8467 commit 809ba93c689ff5a1fd04a45406363e09f43c8467 Author: Kristof Provost AuthorDate: 2025-06-17 11:58:59 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 20:04:15 +0000 pfctl: rule optimizer: anchor name vs. anchor path mix up OK bluhm@ Obtained from: OpenBSD, sashan , a2fcc04574 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index 7817bcfd284a..530f1c241661 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -1337,7 +1337,7 @@ again: if (pfctl_define_table(tbl->pt_name, PFR_TFLAG_CONST, 1, - pf->astack[0]->name, tbl->pt_buf, pf->astack[0]->ruleset.tticket)) { + pf->astack[0]->path, tbl->pt_buf, pf->astack[0]->ruleset.tticket)) { warn("failed to create table %s in %s", tbl->pt_name, pf->astack[0]->name); return (1); From nobody Wed Jun 25 20:04:44 2025 X-Original-To: dev-commits-src-main@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 4bSCTT260jz60SfZ; Wed, 25 Jun 2025 20:04: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 4bSCTT0DXNz3JCp; Wed, 25 Jun 2025 20:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881885; 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=JOyE82eombOhL/q4TbJold6xQLwQXla62vnK6L7JClI=; b=sBItL6uhRCU1WYQBQ2TuABUymt37b7N8KRQaUOTdJ47RcNbZyqkGBeDJv6kvCh/zA4v2oa 2khuLVFgBP+9pflMioPOhPe9aqbdHyKTAy9x6IxzA5yi0qMDuD1eQOtWHaeLfLZejDDimH OrMjR7+AcBAByFQrQi0Q/+Q3MEBEAUbYyhjMzsKEo9TCqdw6U+eje+vwJtv1DM+hFQnJ7f cuOHhbRmEmfU7N8xUXGzVhRR9yuTi6Iu8P6BPy3ycTn//W82Fh+2EJgrFxJrLIxHYpam45 knRvJqSAekcP3YXoVxwx5CtypkJKlg3lwxDgk7TdPp3x4TGI5Zzxn8wnIBTm2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881885; 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=JOyE82eombOhL/q4TbJold6xQLwQXla62vnK6L7JClI=; b=G4kM23NGxTFF3uAlaPBLff5mgSgV243Hil+MBag/FR9WRZD7RhADzNFS9uiT+ru58tbBiJ jIpFHzmtf3Xg/4hTaZ49Y+t47dfKIo6yrjWm/HIMDwSnM0v5MNQs+0HSnL7R/QzupsrH+k UXWP+ZYelDVlp9hLgzbgdLHuohkQjwy8EnoGP/GBd4oZTozCUNsulNoxCQg1piWZz2NmgD gOkLKDPwC+DbMWU+9YvXDAkCDCVZMOf8Rt8PE+LhIPzHICuwHQtY78A2guJdMz3bLjYYK6 ifTg/CAAGJYvXOjGi3A21/lnejkH3ooVwFAIsWIMbEHWB/p0Gwo9m8H2TO6CZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881885; a=rsa-sha256; cv=none; b=do/Y/odLwvUIkIWTSbtJPcLz3T8LEiG6S5sxRu2Nxn9Wa+5NSzIl8IaeQkb0R+Nbp/lWCo tXl79CYDyiKXI8H5UK/snmDq/byl7GzYStUgcRRsf3iFS3HpYEOilMKZoOHMCJmfQStSnN 9TINsics+vKSPU+6Ag5FxhNR5CnhwLmiBpe6mBPGpTNkrhlJPNntpQZsp/ZG3fmumC/TXO mzan2cB+tS3CyPT/RfKQ+czM6ESpZ9Cc28lyiLDSqfl3juiFZM/Xl5f2KkofPrfsNC6B9C gIDbyMZ5d1L80+sIrbAmISdr9rduengr5lLacvqNPqbIIp9MWrsiNKxkfuM11w== 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 4bSCTS62L6zYMZ; Wed, 25 Jun 2025 20:04: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 55PK4iMi080707; Wed, 25 Jun 2025 20:04:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK4igF080704; Wed, 25 Jun 2025 20:04:44 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:04:44 GMT Message-Id: <202506252004.55PK4igF080704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a7d631f69d3f - main - pfctl: fix use-after-free and memory leak in pfctl_optimzie.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7d631f69d3fa993c701d681850d42a750886298 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a7d631f69d3fa993c701d681850d42a750886298 commit a7d631f69d3fa993c701d681850d42a750886298 Author: Kristof Provost AuthorDate: 2025-06-17 13:55:12 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 20:04:15 +0000 pfctl: fix use-after-free and memory leak in pfctl_optimzie.c OK bluhm@ Obtained from: OpenBSD, sashan , 43d70b8338 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_optimize.c | 64 ++++++++++++++++++++++++++------------------- sbin/pfctl/pfctl_parser.h | 1 + 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index 530f1c241661..d6417e8e73a1 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -241,6 +241,8 @@ int skip_cmp_src_addr(struct pfctl_rule *, struct pfctl_rule *); int skip_cmp_src_port(struct pfctl_rule *, struct pfctl_rule *); int superblock_inclusive(struct superblock *, struct pf_opt_rule *); void superblock_free(struct pfctl *, struct superblock *); +struct pf_opt_tbl *pf_opt_table_ref(struct pf_opt_tbl *); +void pf_opt_table_unref(struct pf_opt_tbl *); static int (*skip_comparitors[PF_SKIP_COUNT])(struct pfctl_rule *, @@ -345,9 +347,11 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) TAILQ_INSERT_TAIL( rs->rules[PF_RULESET_FILTER].active.ptr, r, entries); + pf_opt_table_unref(por->por_src_tbl); + pf_opt_table_unref(por->por_dst_tbl); free(por); } - free(block); + superblock_free(pf, block); } return (0); @@ -355,16 +359,8 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) error: while ((por = TAILQ_FIRST(&opt_queue))) { TAILQ_REMOVE(&opt_queue, por, por_entry); - if (por->por_src_tbl) { - pfr_buf_clear(por->por_src_tbl->pt_buf); - free(por->por_src_tbl->pt_buf); - free(por->por_src_tbl); - } - if (por->por_dst_tbl) { - pfr_buf_clear(por->por_dst_tbl->pt_buf); - free(por->por_dst_tbl->pt_buf); - free(por->por_dst_tbl); - } + pf_opt_table_unref(por->por_src_tbl); + pf_opt_table_unref(por->por_dst_tbl); free(por); } while ((block = TAILQ_FIRST(&superblocks))) { @@ -537,12 +533,14 @@ combine_rules(struct pfctl *pf, struct superblock *block) if (add_opt_table(pf, &p1->por_dst_tbl, p1->por_rule.af, &p2->por_rule.dst)) return (1); - p2->por_dst_tbl = p1->por_dst_tbl; if (p1->por_dst_tbl->pt_rulecount >= TABLE_THRESHOLD) { TAILQ_REMOVE(&block->sb_rules, p2, por_entry); free(p2); + } else { + p2->por_dst_tbl = + pf_opt_table_ref(p1->por_dst_tbl); } } else if (!src_eq && dst_eq && p1->por_dst_tbl == NULL && p2->por_src_tbl == NULL && @@ -559,12 +557,14 @@ combine_rules(struct pfctl *pf, struct superblock *block) if (add_opt_table(pf, &p1->por_src_tbl, p1->por_rule.af, &p2->por_rule.src)) return (1); - p2->por_src_tbl = p1->por_src_tbl; if (p1->por_src_tbl->pt_rulecount >= TABLE_THRESHOLD) { TAILQ_REMOVE(&block->sb_rules, p2, por_entry); free(p2); + } else { + p2->por_src_tbl = + pf_opt_table_ref(p1->por_src_tbl); } } } @@ -1249,6 +1249,7 @@ add_opt_table(struct pfctl *pf, struct pf_opt_tbl **tbl, sa_family_t af, ((*tbl)->pt_buf = calloc(1, sizeof(*(*tbl)->pt_buf))) == NULL) err(1, "calloc"); + (*tbl)->pt_refcnt = 1; (*tbl)->pt_buf->pfrb_type = PFRB_ADDRS; SIMPLEQ_INIT(&(*tbl)->pt_nodes); @@ -1657,20 +1658,8 @@ superblock_free(struct pfctl *pf, struct superblock *block) struct pf_opt_rule *por; while ((por = TAILQ_FIRST(&block->sb_rules))) { TAILQ_REMOVE(&block->sb_rules, por, por_entry); - if (por->por_src_tbl) { - if (por->por_src_tbl->pt_buf) { - pfr_buf_clear(por->por_src_tbl->pt_buf); - free(por->por_src_tbl->pt_buf); - } - free(por->por_src_tbl); - } - if (por->por_dst_tbl) { - if (por->por_dst_tbl->pt_buf) { - pfr_buf_clear(por->por_dst_tbl->pt_buf); - free(por->por_dst_tbl->pt_buf); - } - free(por->por_dst_tbl); - } + pf_opt_table_unref(por->por_src_tbl); + pf_opt_table_unref(por->por_dst_tbl); free(por); } if (block->sb_profiled_block) @@ -1678,3 +1667,24 @@ superblock_free(struct pfctl *pf, struct superblock *block) free(block); } +struct pf_opt_tbl * +pf_opt_table_ref(struct pf_opt_tbl *pt) +{ + /* parser does not run concurrently, we don't need atomic ops. */ + if (pt != NULL) + pt->pt_refcnt++; + + return (pt); +} + +void +pf_opt_table_unref(struct pf_opt_tbl *pt) +{ + if ((pt != NULL) && ((--pt->pt_refcnt) == 0)) { + if (pt->pt_buf != NULL) { + pfr_buf_clear(pt->pt_buf); + free(pt->pt_buf); + } + free(pt); + } +} diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 718c05b306b2..45d9ebc45bc9 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -258,6 +258,7 @@ struct pf_opt_tbl { char pt_name[PF_TABLE_NAME_SIZE]; int pt_rulecount; int pt_generated; + uint32_t pt_refcnt; struct node_tinithead pt_nodes; struct pfr_buffer *pt_buf; }; From nobody Wed Jun 25 20:04:45 2025 X-Original-To: dev-commits-src-main@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 4bSCTV6nnqz60SW4; Wed, 25 Jun 2025 20:04: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 4bSCTV0z2xz3JPG; Wed, 25 Jun 2025 20:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881886; 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=wj/V+H8j1Q1eOLQFknv64nzkj7RsNxeRQv48556AnGg=; b=rRqhtZ3XiOMwyQnwC0Dw/t4dYveJ3BuhfQImsEzDQYqnTngxMnMMj6zKwTqROdI82GkaMF /TLzUcztrADA46RSfp8RHPdrEaDBSwIyVBsPAdjL6vz/xsR21SyKTyiX+y8yCcSNXCDlqP Fp2TLsborleG4HlrkBSlUGj+JMAmtE297wEGZG2OVObyAmJrxXxVfpwzrsR5MWbYir/RUv BUs1Qik4+HmpxhRrHkXyDZhKuNgnZNylvTsejTUoGFHeeGZDscH5Ll0MoL3E0hyO5kVVQA VLOaejLDA/0htKejEtjoeVQbD7pM80aQ6JGVOGyuETpJymjwG7GDzRwXqKwHiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881886; 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=wj/V+H8j1Q1eOLQFknv64nzkj7RsNxeRQv48556AnGg=; b=EZt9vpKqXY2unKfbL64SUm+QkRUGchLMFwwQBf+djNYldVfQtg90utznAvG7LSxsMS6HMX o9u2KTYD2tB0JCNkYSvzh82NgQyH2miwnJ/Yd6zy1KZYsFoqOJIq476ems1DHoL3rm5hot p65D9sa8vawUqHZ5rJ8uWOSINWwez47qODitUTnlcnev7+wGX3vl6KiVodWQmck6TyIQdt ZEs94ehWh0xnCwr2mjrVvtFN3NmbSJqfSNSvAgrbLxCDNKBadBXBwX/3EChQJakNLR3cum VxqXYKMWmvnJ60/qsSFIu8CF1BkMWca+tn4/N9S2yeEGe8vFeZhUhBuMQ2NsFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881886; a=rsa-sha256; cv=none; b=m86QhQGW0p4x65BlH/YhsLv90QY1PT0m4xPoLKOSB+VfvhhyEBwbfPSklrtP/6IBL/hYGY +hGEa6d20TOj8EWmgdcpwhMgQmMjazoGKUa6c6InElD/hrxYBbCcNcsCPponY0jiCAHBLg M2s8Bylrxl/z3OOplMggy/u5+bqsoD83/0xxE28NvUKZaaeKC2KMxFXD9gIFrL4RwFXPsk zQlnYHBM2ckmeqJ70ygzL9nQlaU8cleYgmQT/QctK0Y9KNR5P56ERhAo4Dpij0xkhjLDKy /OOrfvJR+7xE8GZVYRYVMu9LycVWQXIzE11fbV47sMp746fZRl9vSeuzpeobVg== 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 4bSCTT74YmzYMS; Wed, 25 Jun 2025 20:04: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 55PK4jXO080741; Wed, 25 Jun 2025 20:04:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK4jth080738; Wed, 25 Jun 2025 20:04:45 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:04:45 GMT Message-Id: <202506252004.55PK4jth080738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: cd0169c9379c - main - pf: limit extra SCTP states List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd0169c9379c400ec75b77e87ca770e37f964276 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cd0169c9379c400ec75b77e87ca770e37f964276 commit cd0169c9379c400ec75b77e87ca770e37f964276 Author: Kristof Provost AuthorDate: 2025-06-21 09:13:22 +0000 Commit: Kristof Provost CommitDate: 2025-06-25 20:04:15 +0000 pf: limit extra SCTP states For SCTP we create states for all combinations of endpoints, to allow multihoming to work. Malicious users could abuse this to fill our state table more easily than they otherwise could, because we create states between all combinations of endpoints. Limit this to no more than 8 extra endpoints for each side of the connection. MFC after: 2 weeks Sponsored by: Orange Business Services --- sys/netpfil/pf/pf.c | 11 +++++++++++ tests/sys/netpfil/pf/sctp.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 908f1b83e542..c162b3dd8b3c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -205,6 +205,8 @@ VNET_DEFINE(size_t, pf_allrulecount); VNET_DEFINE(struct pf_krule *, pf_rulemarker); #endif +#define PF_SCTP_MAX_ENDPOINTS 8 + struct pf_sctp_endpoint; RB_HEAD(pf_sctp_endpoints, pf_sctp_endpoint); struct pf_sctp_source { @@ -7297,6 +7299,7 @@ pf_sctp_multihome_add_addr(struct pf_pdesc *pd, struct pf_addr *a, uint32_t v_ta }; struct pf_sctp_source *i; struct pf_sctp_endpoint *ep; + int count; PF_SCTP_ENDPOINTS_LOCK(); @@ -7315,13 +7318,21 @@ pf_sctp_multihome_add_addr(struct pf_pdesc *pd, struct pf_addr *a, uint32_t v_ta } /* Avoid inserting duplicates. */ + count = 0; TAILQ_FOREACH(i, &ep->sources, entry) { + count++; if (pf_addr_cmp(&i->addr, a, pd->af) == 0) { PF_SCTP_ENDPOINTS_UNLOCK(); return; } } + /* Limit the number of addresses per endpoint. */ + if (count >= PF_SCTP_MAX_ENDPOINTS) { + PF_SCTP_ENDPOINTS_UNLOCK(); + return; + } + i = malloc(sizeof(*i), M_PFTEMP, M_NOWAIT); if (i == NULL) { PF_SCTP_ENDPOINTS_UNLOCK(); diff --git a/tests/sys/netpfil/pf/sctp.py b/tests/sys/netpfil/pf/sctp.py index 230dbae0d327..da42ce527195 100644 --- a/tests/sys/netpfil/pf/sctp.py +++ b/tests/sys/netpfil/pf/sctp.py @@ -426,6 +426,34 @@ class TestSCTP(VnetTestTemplate): assert re.search(r"all sctp 192.0.2.4:.*192.0.2.3:1234", states) assert re.search(r"all sctp 192.0.2.4:.*192.0.2.2:1234", states) + @pytest.mark.require_user("root") + def test_limit_addresses(self): + srv_vnet = self.vnet_map["vnet2"] + + ifname = self.vnet_map["vnet1"].iface_alias_map["if1"].name + for i in range(0, 16): + ToolsHelper.print_output("/sbin/ifconfig %s inet alias 192.0.2.%d/24" % (ifname, 4 + i)) + + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.pf_rules([ + "block proto sctp", + "pass on lo", + "pass inet proto sctp to 192.0.2.0/24"]) + + # Set up a connection, which will try to create states for all addresses + # we have assigned + client = SCTPClient("192.0.2.3", 1234) + client.send(b"hello", 0) + rcvd = self.wait_object(srv_vnet.pipe) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] == "hello" + + # But the number should be limited to 9 (original + 8 extra) + states = ToolsHelper.get_output("/sbin/pfctl -ss | grep 192.0.2.2") + print(states) + assert(states.count('\n') <= 9) + @pytest.mark.require_user("root") def test_disallow_related(self): srv_vnet = self.vnet_map["vnet2"] From nobody Wed Jun 25 20:11:32 2025 X-Original-To: dev-commits-src-main@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 4bSCdj5PNLz60SjK for ; Wed, 25 Jun 2025 20:11:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic302-22.consmr.mail.ne1.yahoo.com (sonic302-22.consmr.mail.ne1.yahoo.com [66.163.186.148]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSCdj1x6cz3QpP for ; Wed, 25 Jun 2025 20:11:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1750882307; bh=tqzXp4Cz+8Y17+Jiv/kMjor1MY/4JnxB06sNW4ud8WM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=OF7hJm7AtcPqzxOuK4G7EAe3x7o/ImWsfF8wOTojBavBntwH8XxxiMHimvi0ZNh2KpGF8q8pl5vm0rh/zc+EVaPEZeka8cc7CCO8tcILMsB3sTxZMP2b9RFr3uRo1dGNnSbvByZVja7TUKZCa1sboEZaXweOdRhWSzktUsPHH9C43avnk4qQ8F4OqE5A2Gvt4S2F49goexXW0aNT/9csKVCiOl2OJfWPQOxskdzdQ3PzE5qhWaB0Ux0DdIFWoDjhZeAqlPdjZqo0KrxPKkkCV+UqTwbPy6b9oR5kWrzlVmmw1SBbLXOOCms1FkP2LvZz7xUD2r7PJJnRa43eX//48Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1750882307; bh=C6K3ZkO7gSLA6Y31q3Ft1GUvFtxldIZK+M15BjBKbHZ=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=IMUyQb0uPwTfqLZcCuyHT6oXuyCMPWcgtbm2P1nzokofsOtnQg3P1nK+251vpVC/MZqpOoevsuYA8ukDEFutEzXW3607Ar3StsI5+A8/i7Mtbb9LyP8Ya5oqq+UgbcgGvTtgsCzf9IlZNNps5RKVn24uQ7Jv+yfAGVOwtVql5JN/SiBfxkuytwojsgHWOpI1mauPufkaD40tizVU8E/Ja0paJ5CFm8pSqQbAJMBQsAllvbHftRNedzF5Gn7Pxnit8/SjAXK4f2Eh4+R9jGBmyntAXW/hG1d7flwRORX0RoITsY3k39xmyIJ5ggt7ReQNf0dRVCVNFmqFrNpphEN2Bw== X-YMail-OSG: zy42DswVM1l9i5Nsdz1x2L4FYcEpn2iVwbAVHCudrAVqKbkmh1CLvdtKpLaQ78t ToRHVdI9V0QveSlH6TcfedT5K9RJ5hduhnNUNfhMtOQZiagj8ptugmmgOnqWfJlvRnJ3Wh9YOGXz 29cALLWn0N6SFmosVu8KPbH.ksp4w6195f7IZkbmly7WPDnCFGOYiGWiCHHHqDucR2ntjf0jjKIS DuJ88dxqc6paru0k.sw0ZYI26XmP3.VXLn7i4UyO7zEDztnqJTatTrANelVPJ7TLWLmBf6Qdsg5t kBAG9ij1FZTiF4D0MKNpotczJ7cpnyiR2Rny9WvRpIB7AxuLzZMMKatXS7IhF1USB1i62npUhNsx whBHPTqMRVHUTpN2Umu9BmSdq0nbog3dPP5jGvsB.tOdCXJoQ8KweSLqZ554JqvqxSuTN.QjYrFd fSr6uIWxhC3Xb_4ARWuVwCxD5zjpAQljOZeogEqPukuG.Xp9AfzACjRyntq5qEBW9yeZ81hJXsUR lrYbM3toHnxCI_Z_Vno0IMeF2qjjgkIyY_1B.cFFCliKR0Q0pQ18M3NZ1MK7TF5o6E_OoMqIZBZR 4bMvsCCXYhRfGqLa4oREXrTmnj547s2O3Od2qaI7xmAwX1LuLUG1k4xza8MMj2FIFbQ7NXR2HOds DEzrlAcTkBJY4u343Sxi0HOgLdghab30rcoYNfn43gKZRr.VAf_fCte5VoSovUDd_4uPpLhNVP1L jauWZvbLY6MYAKbl9F3RSTHYvtYK9SYLM8QA9ObfnGILMMKUk3VB1CkNk4h.qxHGco8P4AcN6BLL dNDAtgG1MJ5KBjqOzpJL64fBU9ZZi7VPE7ofg2PfBtmeNdMp9rhdgh.cwQhSmboKwwnMKTEl.Nqo rQsLNWi1uo0k55nB2iCgHWTHdp4Y2FtHMlGni7gHIbPrg1VbBesYz.7aQqTxpRRbahHrdty7TxXW pNSbNeFm35.HkaZyBorcCPV._juNu9GMODcxLlq1CBbwKHTxrC4sEewQaMoPKZ2KowRrVUhqrYkV iQ7yqmh_rKMgEQgJVnoy1S1mM2hCgiSnnBIYlW5mi4EU.cQEx82upKm4IwrU6p1I112IRbJ8e38O GhjNzHpzP22C7U5.h3Nc08vBkdBSRf.A7mybAZFsqHE38S8ekhsycquV.EqfcN5.1.NDNq5v413F IUa7bBG6UJd.Ef1bAV2smy1iS0o54J4es8.1wAiwIVqvw2w970hrzm49OFXK98vg1efmQ5BOX6ao Rm77M293F57rEgX92rfLwj_oygs7IXe0masYBPOJwo6jwm6QCqEq0lyc3Cy5O2Wor6Iwebr2pLzr SemT66uxudYft_l8MulfN32A2o1w8.cYv6vxt3d074M4vxcwn6gupPwdk22cNf5_seJew.LG00SY zqJ81Bq_bgxVfDVYsCHQpAPIsnJygll0buAU_p94WSdoYMgYLuCNbOkPrdHfCGvNjw_UkHpAx.et Kcv3K0vT3hvITmBm9MdUW8zj7gmcNz484oMLz.OVgEaU2pTKm9z0aXgurM7M0WHP3uqyV3mql3M3 gcoNfABeaWRhUe0j9tfM5gugg7K4SL.9wj29EebD.Ii1W26B4d18b5lezRvXfHhclPKHNCoyrUVA Kq4xsYVAmPcchfFkOw7FkYaaVGxwBWqRKBYX7fs2ZEp7MLr8hD7HPGcCSFY8Mebvg7i4XGQgoXnN vV605BKcn5rxU5CcyaEM8TJ1FYuqNtBmTqYqyBgb.UAwwZTh0XCdmVB8GCDLlN3K.IRcVPZ3EPVF 7b78FVxPwZdyHnuIFaw7QzbAnhJajRS52411CrWbkwuFcmGEUfOFFRWD_u2cpmlbBOvfzTAvlrgs fqzHlz5leKP_k7nQPZ_VubSYp2XnyCWw4avACfnXZ_cWSD_hJ_c1aWGhwBPBuq7XxNfid3JWMwNF UZpysdB1LKxscrx8TNHG3YphgDu0vmQFMEub7Iy98gIkc8.UOnXCL6iwm8ER1FO141lRgm1BM2zR bDJrVsup_qImgwjPmZsfc96aUL7EWA0eTRd7T29CGpvlvUZpNDtePnwbkzVKN10KDBFkyJsTrf4U fXHd1aLuO5MRVJWhArRgxs1RIAvDaCCoqMlmxM9QEgmzkT7Q5NAGByWvrzF_7Klv2I4FBbLgcW1c vHDCA2gYLFnamDuB6wc4iFbGBO4ZXjh8cKF3ClCwFvnZeQ2VE24Fl4R.WLX2PqkmfOaVgZbjxKK7 zAVzGFdWmt6oTUXfApBasNSCMBsfrZ4rEccmKVD4g5l2Sk57P9tDgMM2dK58g2OhEWdLZvfVqHZ7 n4Dk- X-Sonic-MF: X-Sonic-ID: 831568a9-6ae3-4674-ba4a-adbe77cad299 Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Wed, 25 Jun 2025 20:11:47 +0000 Received: by hermes--production-gq1-74d64bb7d7-45lk9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 6622a4da9093430832e7bb43ca5d9820; Wed, 25 Jun 2025 20:11:43 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: 288ba78edcfd - main - dev/psci: Check for functions before calling From: Mark Millard In-Reply-To: <3s789nos-rq00-6n4q-46pq-280r4n3q22q6@yvfgf.mnoonqbm.arg> Date: Wed, 25 Jun 2025 13:11:32 -0700 Cc: Andrew Turner , dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7D17FF6C-DFD8-4921-A50F-B4A196EE86E6@yahoo.com> References: <60E32387-B0BA-4ADD-A897-DC988136D2F9.ref@yahoo.com> <60E32387-B0BA-4ADD-A897-DC988136D2F9@yahoo.com> <3s789nos-rq00-6n4q-46pq-280r4n3q22q6@yvfgf.mnoonqbm.arg> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Rspamd-Queue-Id: 4bSCdj1x6cz3QpP X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US] On Jun 25, 2025, at 12:48, Bjoern A. Zeeb = wrote: > On Wed, 25 Jun 2025, Mark Millard wrote: >=20 >> Andrew Turner wrote on >> Date: Wed, 25 Jun 2025 11:22:51 UTC : >>=20 >>> The branch main has been updated by andrew: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D288ba78edcfd82b4b558a46fae78e407= 6acbe200 >>>=20 >>> commit 288ba78edcfd82b4b558a46fae78e4076acbe200 >>> Author: Andrew Turner >>> AuthorDate: 2025-06-24 16:47:28 +0000 >>> Commit: Andrew Turner >>> CommitDate: 2025-06-24 17:45:42 +0000 >>>=20 >>> dev/psci: Check for functions before calling >>>=20 >>> In the SMCCC TRNG and Errata ABI drivers check if the version >>> functions are implemented before calling them. Without this the = firmware >>> may complain about an unimplemented function being called. >>>=20 >>> Reported by: bz >>> Reviewed by: bz >>> Sponsored by: Arm Ltd >>> Differential Revision: https://reviews.freebsd.org/D50978 >>> --- >>=20 >>=20 >> I wonder if a debug mode or verbose mode should report >> the !=3D SMCCC_RET_SUCCESS cases for smccc_arch_features. >> If this change had already been in place, the older >> status might not have been noticed. As bz wrote >> elsewhere: >>=20 >> "That said seems like it's still a good idea to add >> these bits to my TF-A." >>=20 >> Having a way to check on if a TF-A instance is too >> old to have a known status for handling things that >> are now requested could be a good thing. >=20 > Please read the comments on the review. If you mean the text: QUOTE If the firmware doesn't implement the Errata ABI then we may enable a workaround in the kernel even if we don't need to, e.g. when the firmware already has a workaround, or the combination of HW means it's not needed END QUOTE Sometimes that might be fine. But other times updating the TF-A may be more appropriate. Thus, sometimes one might want to learn about which workarounds (or no-ops) are being done because the TF-A involved does not claim to even have a feature. Then one can consider what is appropriate for the TF-A, possibly choosing to update it for some of what has workarounds/no-ops in the kernel. So, to some extent my suggestion generalizes beyond the 2 specific messages that you got and the specific changes made for those. It is only a suggestion, possibly not a very valuable one. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Wed Jun 25 22:31:09 2025 X-Original-To: dev-commits-src-main@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 4bSGkP5V9mz5yd0p; Wed, 25 Jun 2025 22:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSGkP1D2rz3w33; Wed, 25 Jun 2025 22:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750890669; 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=uDrnt55gb/7ZcARJR3YoKoL9fc79LnxOyBscrsHaiFc=; b=aKEHXkO8gE5/n0jSTO9ylh+gPFEMuEsrfpZgVYpglEm13zoOVafsQS1G0ceto40a+9kpvr dgEczGeKXZ7lp0+L6/bHzHkC/xz9a1jrSq4ZgJtVAofsrEJfD/lHgx8Gx33tJ4m2SN8r0d GYt8Z24CC8pT2TW/eDOvetJUjnKXzKBVIWg177KBw/7h2gIl6lpPe+UQJswbMN56J4FS9i k5WCE/Et+NUC+5Q6cbLzc5ksVa14jYj79KbKz+j8SF2Waf1mxtXVzwpQZpOUHGOm+z6gLS vSfyfo8nPz/FVUgx7HMCRP29l7btLmIL07E4DnPuKFZQ48rn+P4GsN9R59dD1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750890669; 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=uDrnt55gb/7ZcARJR3YoKoL9fc79LnxOyBscrsHaiFc=; b=Rve+y9Md/qxoRdBn0xS+xODfCSE40PRVTQC4tXQ3Nq/X4rdx9ViAnNlnkLJCFnSUKQO16i nJYmyYa365TR+vlNtdLVhv+0Zlpp6FsJG6JRwMP+F/XmBO4TykDBTMCTM0b6+Po+SVU46I H1u8/WqGLnDLOS8qKLmADLwiUOgHiugKfxwArmsnYl617ir/hxRMeEdcX8ItprzaSlycg/ JPn18rD8goKvQQ90NblQU/OfE32fljj8fTVuJjdtnZWCNqwpdye3w6+9wIOg5yzzgCV0lT YJd2WJu33Xl9VE438Vm2s1fbsPEjpCJoXWL054pdwyfH7rrA1IxWWa/3i0QdcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750890669; a=rsa-sha256; cv=none; b=d2VCkF8H4HnyopbdKPuVFz95Zik/0BTykS95FDrvDMOzNuAa4E9CWqu1TVFNo4QkT1iDd4 6b3W5fC2K3eGmDT3dqswN6L1V11PLNqJdPf2BLe+Egh04ngBZaOcD/+ci1K4iF5laD+u2A yRA7GQIFtKQUqK0t1PFCyojaNMg0a+Phr2lraaWFH3v+eHd6J+A2uEkEfVowavH4jP9YnG EO9TsVz5gotBHZHZlBcwlmwiSJ/yAdYETNoMZna5oqbkN0JH68DYD3ebcI1Zk8z4nvx+xh sG2yfas8guaOGpMkW0YTarC9OO00OqhkbGT8NVM0pMsNTp9CEJsUA25a9rMJbQ== 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 4bSGkP0WrnzcXt; Wed, 25 Jun 2025 22:31:09 +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 55PMV9tk059030; Wed, 25 Jun 2025 22:31:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PMV9o8059027; Wed, 25 Jun 2025 22:31:09 GMT (envelope-from git) Date: Wed, 25 Jun 2025 22:31:09 GMT Message-Id: <202506252231.55PMV9o8059027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5286b96c56ff - main - md: Use a larger buffer for the ident string List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5286b96c56ff5aa3c1cee824ab8564f0ffffc381 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5286b96c56ff5aa3c1cee824ab8564f0ffffc381 commit 5286b96c56ff5aa3c1cee824ab8564f0ffffc381 Author: Mark Johnston AuthorDate: 2025-06-25 21:12:33 +0000 Commit: Mark Johnston CommitDate: 2025-06-25 21:20:45 +0000 md: Use a larger buffer for the ident string With the old size, the string could easily be truncated, resulting in non-unique identifiers. PR: 287679 Reported by: Phil Krylov Reviewed by: kib MFC after: 2 weeks --- sys/dev/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 5d4f91d05917..800684e9e63b 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -256,7 +256,7 @@ struct md_s { unsigned opencount; unsigned fwheads; unsigned fwsectors; - char ident[32]; + char ident[DISK_IDENT_SIZE]; unsigned flags; char name[20]; struct proc *procp; From nobody Wed Jun 25 23:22:05 2025 X-Original-To: dev-commits-src-main@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 4bSHs95tq2z5ygtv; Wed, 25 Jun 2025 23:22: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 4bSHs94j7fz3dNx; Wed, 25 Jun 2025 23:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750893725; 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=AKM5GnFBnq+ZukNW4LgMhTUSBIpTIzljr9f0tbguk94=; b=TdDz7VoA2674Iu/PFeU7PKUSfqnWNZ14X/sBr69dEAV4VVBy1+tM1K0DefLDuy6RvhaC0a MiZvrMrLu6HcxSPLzent2MBFo6blJ8Qmiqa9dVg52OW2BuHesXRo92rAljv6iOrpGaqFD9 pnO7RTmi/bEd+ClKnjCkaf92huEuEVjWi11nJSmLVY/OpN7LHCFfK3JtP+C9Kp7/zUjMWn yaKtp0MU6G3KMBnEzLPD0QjJqQf1xsXcy3ABnGKDbFFimXshlFl5RnQktvjuGxQ8zLG2TH 6oACOZPiUeYaUd3A96KrKTQ619Fnh9s1lYdcLVnRcl6aESmuZj0Q948ZnjHEmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750893725; 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=AKM5GnFBnq+ZukNW4LgMhTUSBIpTIzljr9f0tbguk94=; b=GvMWxBu+gYP+O5T1U4LUL3H+V6fo76y1peSQtanDcN86Z7vRgjQ8he4FOWIsekdzfVyadC Cf6OKbZ5JbzNrRUQy1GQ1/xWt4W1ZHln5uRuHUTYZgSCbtW6wzrx9kF9mV8pNGIFkr4O5y 13htpwR/IpPRyuPdnlfqotBmV9w31Cx5zeJGbrLbWy04w88Iy8OZNnBh2tS94wLXl3LuLP szFeqBrfVD2D8ohP+QV/YP9EbQB5uo2B8GXM50HDi3LdoxqCJXZFkogoXAfHCuskwCVPcY /R7L0icv/hLmvcQDDGQttzE0Qc9ESPQheMUK2K8ayoTw7ilhec2EH6MYu025JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750893725; a=rsa-sha256; cv=none; b=kFmOQ7BySKEnGZZ2AiWC94grmfwuDQdBYFxNqv98Eee62HlMYKp89KHTQOFFFRCR72BofI ZlIOxieDY6MnrS+jxciPWMpHzBmI9pUDBgAsIUHHcsMTlPkx+xMO8Wi1wIdAl5owYKX5e7 z10Z7hqLR3gg0+VNSYTaVV2dubz3OygNvgdU7/kTWFrUYaUfMlao7/3FT7OTrvj8eSs9eg GQn9Q5Xwy3ESR9HS5FFOUKI6TvGaQX8KBYbf8M90t7aRLNSej0bjK/3cp1pdxSSc/+g5Jo CcBIa6EY39QDmp0eOgJGmBKxqKmiPUKbZOnNYDwAYDNYnUERqtdidX/H9P/URw== 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 4bSHs93prczfTn; Wed, 25 Jun 2025 23:22:05 +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 55PNM5pX054297; Wed, 25 Jun 2025 23:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PNM5jc054294; Wed, 25 Jun 2025 23:22:05 GMT (envelope-from git) Date: Wed, 25 Jun 2025 23:22:05 GMT Message-Id: <202506252322.55PNM5jc054294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: daf2a1380291 - main - MK_FORTH: Allow removing loader.4th w/ delete-old List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: daf2a138029118f4febde5874609a4a65fdec4dc Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=daf2a138029118f4febde5874609a4a65fdec4dc commit daf2a138029118f4febde5874609a4a65fdec4dc Author: Alexander Ziaee AuthorDate: 2025-06-25 23:13:18 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 23:13:18 +0000 MK_FORTH: Allow removing loader.4th w/ delete-old The lua loader is quite mature, and /boot is getting a bit cluttered. Allow removing the Forth loader with `make delete-old` if WITHOUT_FORTH is set, instead of the previous behavior of only removing the doc. MFC: no, I think this is a breaking change Approved by: kevans (src) Reviewed by: kevans (UPDATING note tweaked since) Discussed with: imp, tsoome (thanks!) Differential Revision: https://reviews.freebsd.org/D50708 --- UPDATING | 4 ++++ tools/build/mk/OptionalObsoleteFiles.inc | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/UPDATING b/UPDATING index 80f9318d85d6..fb4f1234a62f 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250625: + "make delete-old" will now remove the Forth bootloader entirely + if the system is built with WITHOUT_FORTH. + 20250614: MIT KRB5 (MIT Kerberos5) has been imported into 15-CURRENT. To and install MIT KRB5, add WITH_MITKRB5=yes to /etc/src.conf. This diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 75007ae6a37b..24db68e5f288 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1992,6 +1992,32 @@ OLD_FILES+=usr/share/man/man8/fdcontrol.8.gz .endif .if ${MK_FORTH} == no +OLD_FILES+=boot/beastie.4th +OLD_FILES+=boot/brand-fbsd.4th +OLD_FILES+=boot/brand.4th +OLD_FILES+=boot/check-password.4th +OLD_FILES+=boot/color.4th +OLD_FILES+=boot/delay.4th +OLD_FILES+=boot/efi.4th +OLD_FILES+=boot/frames.4th +OLD_FILES+=boot/loader_4th +OLD_FILES+=boot/loader_4th.efi +OLD_FILES+=boot/loader_4th.efi.old +OLD_FILES+=boot/loader_4th.old +OLD_FILES+=boot/loader.4th +OLD_FILES+=boot/logo-beastie.4th +OLD_FILES+=boot/logo-beastiebw.4th +OLD_FILES+=boot/logo-fbsdbw.4th +OLD_FILES+=boot/logo-orb.4th +OLD_FILES+=boot/logo-orbbw.4th +OLD_FILES+=boot/menu-commands.4th +OLD_FILES+=boot/menu.4th +OLD_FILES+=boot/menusets.4th +OLD_FILES+=boot/screen.4th +OLD_FILES+=boot/shortcuts.4th +OLD_FILES+=boot/support.4th +OLD_LIBS+=boot/userboot_4th.so +OLD_FILES+=boot/version.4th OLD_FILES+=usr/share/man/man8/beastie.4th.8.gz OLD_FILES+=usr/share/man/man8/brand.4th.8.gz OLD_FILES+=usr/share/man/man8/check-password.4th.8.gz From nobody Wed Jun 25 23:22:07 2025 X-Original-To: dev-commits-src-main@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 4bSHsD0RKjz5yh7S; Wed, 25 Jun 2025 23:22: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 4bSHsC5wYSz3dZT; Wed, 25 Jun 2025 23:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750893727; 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=seemH4BY77ia3JVrYugUDqcgfHjHa6H6Nn8+686kPSc=; b=Emf0l2vi8uMAbD5oKtgpshxvkUoakI7Yli3H8UaeRwaIElUShVdC45b3+b72ekVNuoV4oj ICSsyVH1tD2aoPxOx3VNBHdFQe9O1FKIBovz8FLmQ9yJnFSTtWX1WhPw8twM0CRJssfSgb ND2OuOJvsmfVdVOVk+u6vnpFG/yfw9eLEsXvM5EaToAS8WdysGN/Hy1SttXHQ96LZNJCaK PRDs2o2wkIrgg2CP/OxPjDAb7DWv4rB5KPRJzEyCfsAw4TNwRU5DSKZox4LQZJF978wqvc Q0IlBLTJ6idM7WBxXm1Q/fm+TbKsJ4iqRdhYsfaAqcpVBIybtXmkjeWR3jI+cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750893727; 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=seemH4BY77ia3JVrYugUDqcgfHjHa6H6Nn8+686kPSc=; b=L8MTklUOvLK5E/aAnpC6WQwr1+ke1WXtCMpueE950wiD2FJL5Ga7/QI6LUYkb0k+jLS6fg cX9Q00rjje8vl4kaaXtUeE0E3TsacGLqhTXiWYhW7G6jNzcRlsbtYZAiMwecsPA+hyfSQo Kr1x0tjfuH32S23o0rQnVelTTsM/ti8rZEXQ5kI3a5MXGo59sWmXko1l6hDk/T3w/c17+J PrkymbWJ5Fdnd+B/5fTjtIIh4RO/k7ch/rz2m3ZC8DjYgJNvEgdtTDu1KRSNn9WWfsrGIt 7Mf5nTByP/2mCo8wh2hiZ94T7VnF9d5QZkx4H+RolGpAPiVdCM4XKoE0eTp/1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750893727; a=rsa-sha256; cv=none; b=JirI0ZfxIQX2YruFY+0HMSDJ4RvN8ZNCsnZmd2ODq7d452J/cR2Q/zP0RLsx6U7GUaZts5 1bjiNK7iVes/jJg5OhEEM4qAJbADq1YP63tulD9NuH+mEOcVQztDpRVoRPaVsez0oWtL2C Hgg7kbuj8Cu9RaGB7iOqc12sSf9JO2j7zsYPwKxf3I0ML51IGzQz6uAGdlcOVsk0Mm+jBs m822bpwFTNUVrx1IpUyLtmOhpM61i461EmfuHsZiXnWmOl3U3KM6ZtjVQ0hP4ls7+VwfDH VpNA/WIu1yYBHnpIUVXFd25toXUhXyvZqd3vAfTTiQGztx9Ei45DcLFkFWxiZA== 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 4bSHsC5XG9zfWs; Wed, 25 Jun 2025 23:22: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 55PNM7kY054367; Wed, 25 Jun 2025 23:22:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PNM7dS054364; Wed, 25 Jun 2025 23:22:07 GMT (envelope-from git) Date: Wed, 25 Jun 2025 23:22:07 GMT Message-Id: <202506252322.55PNM7dS054364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: dca2ab32e831 - main - pf.4/pfsync.4: Separate sysctl/tunables >> SYNOPSIS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dca2ab32e831dd5cedab182da8c5c51aaa828967 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=dca2ab32e831dd5cedab182da8c5c51aaa828967 commit dca2ab32e831dd5cedab182da8c5c51aaa828967 Author: Alexander Ziaee AuthorDate: 2025-06-25 23:19:14 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 23:19:55 +0000 pf.4/pfsync.4: Separate sysctl/tunables >> SYNOPSIS MFC after: 3 days Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D50856 --- share/man/man4/pf.4 | 37 ++++++++++++++++++++++++++++++++++--- share/man/man4/pfsync.4 | 30 ++++++++++++++++++++++++------ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index d17a80bc9512..eca7914472d6 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -35,6 +35,19 @@ .Sh SYNOPSIS .Cd "device pf" .Cd "options PF_DEFAULT_TO_DROP" +.Pp +In +.Xr loader.conf 5 : +.Cd net.pf.states_hashsize +.Cd net.pf.source_nodes_hashsize +.Cd net.pf.rule_tag_hashsize +.Cd net.pf.udpendpoint_hashsize +.Cd net.pf.default_to_drop +.Pp +In +.Xr sysctl.conf 5 : +.Cd net.pf.request_maxcount +.Cd net.pf.filter_local .Sh DESCRIPTION Packet filtering takes place in the kernel. A pseudo-device, @@ -74,10 +87,28 @@ separated by characters, similar to how file system hierarchies are laid out. The final component of the anchor path is the anchor under which operations will be performed. -.Sh SYSCTL VARIABLES AND LOADER TUNABLES -The following +.Sh SYSCTL VARIABLES +The following variables can be entered at the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va net.pf.filter_local +This tells +.Nm +to also filter on the loopback output hook. +This is typically used to allow redirect rules to adjust the source address. +.It Va net.pf.request_maxcount +The maximum number of items in a single ioctl call. +.El +.Sh LOADER TUNABLES +The following tunables can be entered at the .Xr loader 8 -tunables are available. +prompt, or set in +.Xr loader.conf 5 : .Bl -tag -width indent .It Va net.pf.states_hashsize Size of hash table that stores states. diff --git a/share/man/man4/pfsync.4 b/share/man/man4/pfsync.4 index 472a1c05ec5a..cc9c350ea875 100644 --- a/share/man/man4/pfsync.4 +++ b/share/man/man4/pfsync.4 @@ -32,6 +32,14 @@ .Nd packet filter state table synchronisation interface .Sh SYNOPSIS .Cd "device pfsync" +.Pp +In +.Xr loader.conf 5 : +.Cd net.pfsync.pfsync_buckets +.Pp +In +.Xr sysctl.conf 5 : +.Cd net.pfsync.carp_demotion_factor .Sh DESCRIPTION The .Nm @@ -155,12 +163,14 @@ Compatibility with FreeBSD 13.1 has been verified. .It Cm 1400 FreeBSD release 14.0. .El -.Pp -.Nm -has the following -.Xr sysctl 8 -tunables: -.Bl -tag -width ".Va net.pfsync" +.Sh SYSCTL VARIABLES +The following variables can be entered at the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width indent .It Va net.pfsync.carp_demotion_factor Value added to .Va net.inet.carp.demotion @@ -171,6 +181,14 @@ See .Xr carp 4 for more information. Default value is 240. +.El +.Sh LOADER TUNABLES +The following tunable may be set in +.Xr loader.conf 5 +or at the +.Xr loader 8 +prompt: +.Bl -tag -width indent .It Va net.pfsync.pfsync_buckets The number of .Nm From nobody Wed Jun 25 23:22:06 2025 X-Original-To: dev-commits-src-main@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 4bSHsC03sxz5ygtw; Wed, 25 Jun 2025 23:22: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 4bSHsB5JQPz3dWv; Wed, 25 Jun 2025 23:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750893726; 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=jhQl/C7I407ZCJwMmPr5Q+s4ilE1d+Ggahuc+iAn5ww=; b=J3lfbwTF+st5vcANxr0n+Y0BZrk/4yHWDCgDRC7dXwHICx0ubi7t5KIZ1dXprx4FJbWgtF iNSj8fI3oxjDDk/Z6upAvqr68l66RWz/dwwDeo0SCWAYnx8tg6qy+paQCgZhn8KYkVM+Jx H3B6rw+iJ2q2S6T/nMi9BRR9lAxKN7jaP5WtLfMsAwEQdyM/mjuIwySjWt+5/f8JzluJef tpRuHbxflvB4nDpUp3vgvLye0twwO1X0LwKSWxSGMJ7uJs46LLemIUVld9fO7dqfZcjRYM MKXnkmupLfJWb8w1oAF0zp9k4lZkkdvIvVfRPhylkLx8gfwQZZpU/kY2egrOaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750893726; 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=jhQl/C7I407ZCJwMmPr5Q+s4ilE1d+Ggahuc+iAn5ww=; b=ucnnB07qWe17GZMejLn8boVbxYaC9gXfGaZ9HtqbC4zXRjbndkNg4+JwoGhgWMnYEywU+L QV21frkonYagtMjqJ12yyTEMj25KrAh2eeyk8Epa8+/eo37fVHOnbIygMo9q7m+kZWpZs+ yiLz9D2MtvgSHD7la19TJKWVKr4iuV8sRMcSWxkbopyTOc9rYLGLRgTzd8a8JgC1IbDNNx fY2xS9Q5uSwaIifcJsBQ4mdvkez4xhWsRWNqksIeHQnEgbeQIfuMYp36VN7BMEPjy7GWjF PtOFYi8/iuljoIJpEHx+Vo7jmW04wPtYazDU+nCdKtYyvlSVgdbKJsDjW03bYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750893726; a=rsa-sha256; cv=none; b=UWmrNse2sj9IDhWhOV7R1BHg0S9Zv41h6giYOUM64hLVuU4OTTtiZlS/BBjGz54962xac8 k+WAi9Tcq3PDwHOrgHxOB6yAAmjkKYyu5SPPSxoFrYrlIobpVnTsBDuS2DV0zwd58AQK8U yN6hM9NJjZ+8FeBsUnx5FFMvNpfjT55SSJn0enzX/+Ml7C6LnW8oPpSbo6hgT8mWQghj6A PvnnpAPSjw+wxk2lDrewzh+lhinsyNeClqayeYahAxCi8QCt8vL3zurGZty7kjM3VJ90eF b08jSiCEgzZaZm76m6pYsJ8vwmXiNGSWOabA5JVhpvoYMKGRQxu0rtL9Q17kWw== 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 4bSHsB4ZhZzfTp; Wed, 25 Jun 2025 23:22: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 55PNM6HC054330; Wed, 25 Jun 2025 23:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PNM6vG054327; Wed, 25 Jun 2025 23:22:06 GMT (envelope-from git) Date: Wed, 25 Jun 2025 23:22:06 GMT Message-Id: <202506252322.55PNM6vG054327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: d16b1904d1ee - main - pf.4/pf.conf.5: Remove unused sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d16b1904d1eefaa0aecb8a317b79254d14ec49c7 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=d16b1904d1eefaa0aecb8a317b79254d14ec49c7 commit d16b1904d1eefaa0aecb8a317b79254d14ec49c7 Author: Alexander Ziaee AuthorDate: 2025-06-25 23:17:59 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 23:19:42 +0000 pf.4/pf.conf.5: Remove unused sysctl "We never actually added the sysctl. The limit was implemented, and the sysctl to tune it was documented but never added (so the limit is there, but is always 16 and cannot be changed)." ~kp MFC after: 3 days Fixes: 339a1977c324 (pf: Add a systl to limit work) Reported by: kp Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D50859 --- share/man/man4/pf.4 | 5 ----- share/man/man5/pf.conf.5 | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 9ab46558a2d6..d17a80bc9512 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -104,11 +104,6 @@ to also filter on the loopback output hook. This is typically used to allow redirect rules to adjust the source address. .It Va net.pf.request_maxcount The maximum number of items in a single ioctl call. -.It Va net.pf.rdr_srcport_rewrite_tries -The maximum number of times to try and find a free source port when handling -redirects. -Such rules are typically applied to external traffic, so an exhaustive search -may be too expensive. .El .Pp Read only diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 3bdba4958aea..49c81f51294c 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -1479,11 +1479,7 @@ A .Ar rdr-to opion may cause the source port to be modified if doing so avoids a conflict with an existing connection. -A random source port in the range 50001-65535 is chosen in this case; to -avoid excessive CPU consumption, the number of searches for a free port is -limited by the -.Va net.pf.rdqr_srcport_rewrite_tries -sysctl. +A random source port in the range 50001-65535 is chosen in this case. Port numbers are never translated with a .Ar binat-to option. From nobody Thu Jun 26 02:59:09 2025 X-Original-To: dev-commits-src-main@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 4bSNgd4Wnfz5yvWv; Thu, 26 Jun 2025 02:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSNgd2w2kz3Lkq; Thu, 26 Jun 2025 02:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750906749; 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=lUHcKoIJr95F2SifLtLVzNqZwqbf98AHB5l6UZUMB0k=; b=RUwTSTn6vk5ilW8LxEi7dbmGecx9++LzuK2JKaduZGLBWakVCQaeDrBNG+SmQ3VernyZnU 3X2N9Rll5B4EjHEKYCnwxTPyuX2J4whmvYcE/p6vIY8x7fwCfTXskNC/0OfXSte5R2miZk /0DTxD5AoNzRYloA8RGxKqWd3soxFj10kefrzQaLkcqOGrcMdJY61sMR+oUUWU9CNVuA/T A5NKhaaNnhekkc02iHF4pSjUjLknaFvoVxiMTiJbxTeSMbtJLs/6lv/nnRGLXk2p+kyf8x 5h0Bj19VkqRW01FQgBPSVbTb3nmmrh7Z2sJROunjBAPpd8WauuDduWcx5Yc77g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750906749; 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=lUHcKoIJr95F2SifLtLVzNqZwqbf98AHB5l6UZUMB0k=; b=gIRm95tY8NLfIvKSl5dcjfjjN5cL5xLzwjZSs5SI6PCoTXws1onWilM9v8MDRHhxUk5Nxj /eyaSbOYBIECicfOixRUsvdtMOmP06l06jZz4LLzUc46kUUw+EDeK1dXXv4rPgEpB2UCw1 mdWGIL60GsQqjfzCKMfruK5LgC2EtqoG27SuiwmtHY/9sVixi6R3uByrR3sOYtbTpEMGh2 Umfd/oqdB0DHCilWrhxdDim2QLVbNBIqDsi1Vzo3hujZs6m4rUT8Mn79kQJ2Ey0RG6DRwn c6MRI9YAJNGwXz+zlpWQoLNhardX912jvmO038BpdwnTcu7rmhSE+0V3X6fH8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750906749; a=rsa-sha256; cv=none; b=yJdh34bcSOIw+6XDFemaKeNxEIszclPCBiqJTBt3j+HYJf3Vjp+NXfcoy0rjzuQCzXw4xa qcWVW/BkWYQ1HXEgQfkt35p5faS6VEdfOpCrqEoThySh6z6SM1K7KeCVJF0KcHEAibEPvs MUjrdhec5h5bEO8PRqjEQB4ZfmDS4EdzGpy49SaJOnDXjZ3L8wHLXHTiMRqOQzTAaURDh7 R2eZhKUflG+ZAZgOHpDhqNTw1Pj3V8ek1uxhLgE0A+ouCMHxwe9tEk+kAj9dTvn0tPCcX2 sitqYJlsLNlxyMTh5C2UPah9Yslgtkn0LkH8ylodl7b45GDLT47a9+GGvPC3Ag== 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 4bSNgd2NGyzlm4; Thu, 26 Jun 2025 02:59:09 +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 55Q2x9Zo052985; Thu, 26 Jun 2025 02:59:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q2x9Pc052982; Thu, 26 Jun 2025 02:59:09 GMT (envelope-from git) Date: Thu, 26 Jun 2025 02:59:09 GMT Message-Id: <202506260259.55Q2x9Pc052982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: d15d610fac97 - main - kern: wg: add support for removing Allowed-IPs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d15d610fac97df4fefed3f14b31dcfbdcec65bf9 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d15d610fac97df4fefed3f14b31dcfbdcec65bf9 commit d15d610fac97df4fefed3f14b31dcfbdcec65bf9 Author: Kyle Evans AuthorDate: 2025-06-26 02:57:02 +0000 Commit: Kyle Evans CommitDate: 2025-06-26 02:58:22 +0000 kern: wg: add support for removing Allowed-IPs This was recently added to Linux to improve incremental update support, as you could previously add Allowed-IPs but not remove without replacing the whole set (and thus, potentially disrupting existing traffic). Removal is incredibly straightforward; we'll find it in p_aips first to ensure that it's actually valid for this peer, then we'll delete it from the radix tree before we remove the corresponding p_aips entry. Reviewed by: Jason A. Donenfeld, jhb Differential Revision: https://reviews.freebsd.org/D50448 --- sys/dev/wg/if_wg.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++- sys/dev/wg/if_wg.h | 6 +++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 78e02da92333..6ad3c44dc8ff 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -314,6 +314,8 @@ static void wg_timers_run_zero_key_material(void *); static void wg_timers_run_persistent_keepalive(void *); static int wg_aip_add(struct wg_softc *, struct wg_peer *, sa_family_t, const void *, uint8_t); +static int wg_aip_del(struct wg_softc *, struct wg_peer *, sa_family_t, + const void *, uint8_t); static struct wg_peer *wg_aip_lookup(struct wg_softc *, sa_family_t, void *); static void wg_aip_remove_all(struct wg_softc *, struct wg_peer *); static struct wg_peer *wg_peer_create(struct wg_softc *, @@ -608,6 +610,58 @@ wg_aip_add(struct wg_softc *sc, struct wg_peer *peer, sa_family_t af, return (ret); } +static int +wg_aip_del(struct wg_softc *sc, struct wg_peer *peer, sa_family_t af, + const void *baddr, uint8_t cidr) +{ + struct radix_node_head *root = NULL; + struct radix_node *dnode __diagused, *node; + struct wg_aip *aip, addr; + int ret = 0; + + /* + * We need to be sure that all padding is cleared, as it is above when + * new AllowedIPs are added, since we want to do a direct comparison. + */ + memset(&addr, 0, sizeof(addr)); + addr.a_af = af; + + ret = wg_aip_addrinfo(&addr, baddr, cidr); + if (ret != 0) + return (ret); + + root = af == AF_INET ? sc->sc_aip4 : sc->sc_aip6; + + MPASS(root != NULL); + RADIX_NODE_HEAD_LOCK(root); + + node = root->rnh_lookup(&addr.a_addr, &addr.a_mask, &root->rh); + if (node == NULL) { + RADIX_NODE_HEAD_UNLOCK(root); + return (0); + } + + aip = (struct wg_aip *)node; + if (aip->a_peer != peer) { + /* + * They could have specified an allowed-ip that belonged to a + * different peer, in which case our job is done because the + * AllowedIP has been removed. + */ + RADIX_NODE_HEAD_UNLOCK(root); + return (0); + } + + dnode = root->rnh_deladdr(&aip->a_addr, &aip->a_mask, &root->rh); + MPASS(dnode == node); + RADIX_NODE_HEAD_UNLOCK(root); + + LIST_REMOVE(aip, a_entry); + peer->p_aips_num--; + free(aip, M_WG); + return (0); +} + static struct wg_peer * wg_aip_lookup(struct wg_softc *sc, sa_family_t af, void *a) { @@ -2479,11 +2533,19 @@ wg_peer_add(struct wg_softc *sc, const nvlist_t *nvl) aipl = nvlist_get_nvlist_array(nvl, "allowed-ips", &allowedip_count); for (size_t idx = 0; idx < allowedip_count; idx++) { sa_family_t ipaf; + int ipflags; if (!nvlist_exists_number(aipl[idx], "cidr")) continue; ipaf = AF_UNSPEC; + ipflags = 0; + if (nvlist_exists_number(aipl[idx], "flags")) + ipflags = nvlist_get_number(aipl[idx], "flags"); + if ((ipflags & ~WGALLOWEDIP_VALID_FLAGS) != 0) { + err = EOPNOTSUPP; + goto out; + } cidr = nvlist_get_number(aipl[idx], "cidr"); if (nvlist_exists_binary(aipl[idx], "ipv4")) { addr = nvlist_get_binary(aipl[idx], "ipv4", &size); @@ -2506,7 +2568,13 @@ wg_peer_add(struct wg_softc *sc, const nvlist_t *nvl) } MPASS(ipaf != AF_UNSPEC); - if ((err = wg_aip_add(sc, peer, ipaf, addr, cidr)) != 0) + if ((ipflags & WGALLOWEDIP_REMOVE_ME) != 0) { + err = wg_aip_del(sc, peer, ipaf, addr, cidr); + } else { + err = wg_aip_add(sc, peer, ipaf, addr, cidr); + } + + if (err != 0) goto out; } } diff --git a/sys/dev/wg/if_wg.h b/sys/dev/wg/if_wg.h index f00b7f676319..801eaf38141d 100644 --- a/sys/dev/wg/if_wg.h +++ b/sys/dev/wg/if_wg.h @@ -32,4 +32,10 @@ struct wg_data_io { #define SIOCSWG _IOWR('i', 210, struct wg_data_io) #define SIOCGWG _IOWR('i', 211, struct wg_data_io) + +/* Keep these in sync with wireguard-tools:containers.h */ +#define WGALLOWEDIP_REMOVE_ME 0x0001 + +#define WGALLOWEDIP_VALID_FLAGS WGALLOWEDIP_REMOVE_ME + #endif /* __IF_WG_H__ */ From nobody Thu Jun 26 02:59:11 2025 X-Original-To: dev-commits-src-main@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 4bSNgg5m5qz5yvb1; Thu, 26 Jun 2025 02:59:11 +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 4bSNgg3lRhz3Lhg; Thu, 26 Jun 2025 02:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750906751; 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=rr2XEI2/5ZEc93xXkLZfp+J6V19pkXufDddpbZrHvDI=; b=piG2BOjibW++ymUkZgFvTCxF+wTFYlesh2TGifxRiRF4VS4f3h0M6Sj6Z55ORjLdtQy67n mfS+gsV/yPn3v2udBI3dhUNteMtRn7nMdyPOJ46OfljmtgK+Tikh3NM3rIs1tfbm0znZmX AnXioWJ5n2ZFR7HKc58Y+1F+dLRkj6lcuoGzQCvAJtyo4lKKcV6XYOHgpU8yfjF/es2yqn 7aDGubaVxQ6sqYYEGTpsJH8kHFEr9/gLOSpMX2CzI7QaCESD0ODeczAbyQFQCLE5Tb19sR GojVPbv27cv9/rOjEb9mYFCd16ie9nY7KFC//ZwAJpB/M77NvxUcr1bvQ2aV9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750906751; 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=rr2XEI2/5ZEc93xXkLZfp+J6V19pkXufDddpbZrHvDI=; b=VaPzuBXM7n3+5vVI6X/XdRSZxxBdzAWlS4G1RYm9NAkEAey7oXwvsgGqVot3t/Ux9vfZxp OusVdxMl4O/Lc8BUH8mV4oWZnCsaNyziOZz+90EC50ukuOp+0nzpnS419x7Aomj4j1cylD vgKBECtBQBmbNRhbJ6JnaQ7u/eYlmJGHphvvAQTEnDItlVN87C9ftQjk3YHt3cHZSG6p24 4b+Fhx/0zbBY3zpAC7U/4d8svi8jdiZ4Ong8gjSrf9OSxK+e6bkqei7QhnZkgukrckKkOj RBf+IBDGdFJJZm+TgCsk6diBVK+otnXQXcywvx01nFt1kuFeqvDbZjtQ7p2KDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750906751; a=rsa-sha256; cv=none; b=mdBtl7DbQW2XjQxk5yLrtsZuwiGgBVJtFEFP0q6ktuGnidgYcSeAUx2Rd9rJRJXa1OUkJD NS8MQKdUafrz9BPVdAUx4lXQNiZuMj9tapf8Qaqkdg2OgovZI7bj/u7qTZBIl8W9wadBCm /tx/zVpKeBjl2syyRnj/qOD3YfragkDHP9ftzpw0EZVAywA/zixcQ4nhFBPXWx0kCx9bKr 2cAfyWYI8BeyKamakfl57jRqUO108I21shhe7bAmfzTNLMAN23rAlPr7iLd2X/qRHSpaA3 I8DUg8KX+uOk2yBqrS2N5gQMDJmsQKdLEWuwKzipQwhVHzyqKOq8WUSGhmyS8A== 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 4bSNgg3FsMzlm6; Thu, 26 Jun 2025 02:59:11 +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 55Q2xBVj053058; Thu, 26 Jun 2025 02:59:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q2xBHg053055; Thu, 26 Jun 2025 02:59:11 GMT (envelope-from git) Date: Thu, 26 Jun 2025 02:59:11 GMT Message-Id: <202506260259.55Q2xBHg053055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 716b6667b65b - main - tests: extend wireguard test to cover incremental allowed-ips updates List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 716b6667b65b50c15900be9f88cc67f2326872b4 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=716b6667b65b50c15900be9f88cc67f2326872b4 commit 716b6667b65b50c15900be9f88cc67f2326872b4 Author: Kyle Evans AuthorDate: 2025-06-26 02:57:03 +0000 Commit: Kyle Evans CommitDate: 2025-06-26 02:58:26 +0000 tests: extend wireguard test to cover incremental allowed-ips updates New +/- syntax in wg(8) allows us to add or remove just a single allowed-ip rather than forcing replacement or weird tricks to do an atomic removal. Ensure that it works now that we've added kernel support for it. Reviewed by: ivy Differential Revision: https://reviews.freebsd.org/D50449 --- tests/sys/net/if_wg.sh | 205 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) diff --git a/tests/sys/net/if_wg.sh b/tests/sys/net/if_wg.sh index 6d2f56dc8f2e..1f51d86c8efa 100644 --- a/tests/sys/net/if_wg.sh +++ b/tests/sys/net/if_wg.sh @@ -417,6 +417,208 @@ wg_vnet_parent_routing_cleanup() vnet_cleanup } +# The kernel should now allow removing a single allowed-ip without having to +# replace the whole list. We can't really test the atomicity of it all that +# easily, but we'll trust that it worked right if just that addr/mask is gone. +atf_test_case "wg_allowedip_incremental" "cleanup" +wg_allowedip_incremental_head() +{ + atf_set descr "Add/remove allowed-ips from a peer with the +/- incremental syntax" + atf_set require.user root +} + +wg_allowedip_incremental_body() +{ + local pri1 pri2 pub1 pub2 wg1 + local tunnel1 tunnel2 tunnel3 + + kldload -n if_wg || atf_skip "This test requires if_wg and could not load it" + + pri1=$(wg genkey) + pri2=$(wg genkey) + pub2=$(echo "$pri2" | wg pubkey) + + tunnel1=169.254.0.1 + tunnel2=169.254.0.2 + tunnel3=169.254.0.3 + + vnet_mkjail wgtest1 + + wg1=$(jexec wgtest1 ifconfig wg create) + echo "$pri1" | jexec wgtest1 wg set $wg1 private-key /dev/stdin + pub1=$(jexec wgtest1 wg show $wg1 public-key) + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "${tunnel1}/32,${tunnel2}/32" + + atf_check -o save:wg.allowed jexec wgtest1 wg show $wg1 allowed-ips + atf_check grep -q "${tunnel1}/32" wg.allowed + atf_check grep -q "${tunnel2}/32" wg.allowed + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "-${tunnel2}/32" + + atf_check -o save:wg-2.allowed jexec wgtest1 wg show $wg1 allowed-ips + atf_check grep -q "${tunnel1}/32" wg-2.allowed + atf_check -s not-exit:0 grep -q "${tunnel2}/32" wg-2.allowed + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "+${tunnel2}/32" + + atf_check -o save:wg-3.allowed jexec wgtest1 wg show $wg1 allowed-ips + atf_check grep -q "${tunnel1}/32" wg-3.allowed + atf_check grep -q "${tunnel2}/32" wg-3.allowed + + # Now attempt to add the address yet again to confirm that it's not + # harmful. + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "+${tunnel2}/32" + + atf_check -o save:wg-4.allowed -x \ + "jexec wgtest1 wg show $wg1 allowed-ips | cut -f2 | tr ' ' '\n'" + atf_check -o match:"2 wg-4.allowed$" wc -l wg-4.allowed + + # Finally, let's try removing an address that we never had at all and + # confirm that we still have our two addresses. + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "-${tunnel3}/32" + + atf_check -o save:wg-5.allowed -x \ + "jexec wgtest1 wg show $wg1 allowed-ips | cut -f2 | tr ' ' '\n'" + atf_check cmp -s wg-4.allowed wg-5.allowed +} + +wg_allowedip_incremental_cleanup() +{ + vnet_cleanup +} + +atf_test_case "wg_allowedip_incremental_inet6" "cleanup" +wg_allowedip_incremental_inet6_head() +{ + atf_set descr "Add/remove IPv6 allowed-ips from a peer with the +/- incremental syntax" + atf_set require.user root +} + +wg_allowedip_incremental_inet6_body() +{ + local pri1 pri2 pub1 pub2 wg1 + local tunnel1 tunnel2 + + kldload -n if_wg || atf_skip "This test requires if_wg and could not load it" + + pri1=$(wg genkey) + pri2=$(wg genkey) + pub2=$(echo "$pri2" | wg pubkey) + + tunnel1=2001:db8:1::1 + tunnel2=2001:db8:1::2 + + vnet_mkjail wgtest1 + + wg1=$(jexec wgtest1 ifconfig wg create) + echo "$pri1" | jexec wgtest1 wg set $wg1 private-key /dev/stdin + pub1=$(jexec wgtest1 wg show $wg1 public-key) + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "${tunnel1}/128" + atf_check -o save:wg.allowed jexec wgtest1 wg show $wg1 allowed-ips + atf_check grep -q "${tunnel1}/128" wg.allowed + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "+${tunnel2}/128" + atf_check -o save:wg-2.allowed jexec wgtest1 wg show $wg1 allowed-ips + atf_check grep -q "${tunnel1}/128" wg-2.allowed + atf_check grep -q "${tunnel2}/128" wg-2.allowed + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "-${tunnel1}/128" + atf_check -o save:wg-3.allowed jexec wgtest1 wg show $wg1 allowed-ips + atf_check -s not-exit:0 grep -q "${tunnel1}/128" wg-3.allowed + atf_check grep -q "${tunnel2}/128" wg-3.allowed +} + +wg_allowedip_incremental_inet6_cleanup() +{ + vnet_cleanup +} + + +atf_test_case "wg_allowedip_incremental_stealing" "cleanup" +wg_allowedip_incremental_stealing_head() +{ + atf_set descr "Add/remove allowed-ips from a peer with the +/- incremental syntax to steal" + atf_set require.user root +} + +wg_allowedip_incremental_stealing_body() +{ + local pri1 pri2 pri3 pub1 pub2 pub3 wg1 + local regex2 regex3 + local tunnel1 tunnel2 + + kldload -n if_wg || atf_skip "This test requires if_wg and could not load it" + + pri1=$(wg genkey) + pri2=$(wg genkey) + pri3=$(wg genkey) + pub2=$(echo "$pri2" | wg pubkey) + pub3=$(echo "$pri3" | wg pubkey) + + regex2=$(echo "$pub2" | sed -e 's/[+]/[+]/g') + regex3=$(echo "$pub3" | sed -e 's/[+]/[+]/g') + + tunnel1=169.254.0.1 + tunnel2=169.254.0.2 + tunnel3=169.254.0.3 + + vnet_mkjail wgtest1 + + wg1=$(jexec wgtest1 ifconfig wg create) + echo "$pri1" | jexec wgtest1 wg set $wg1 private-key /dev/stdin + pub1=$(jexec wgtest1 wg show $wg1 public-key) + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "${tunnel1}/32,${tunnel2}/32" + + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub3 \ + allowed-ips "${tunnel3}/32" + + # First, confirm that the negative syntax doesn't do anything because + # we have the wrong peer. + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "-${tunnel3}/32" + + atf_check -o save:wg.allowed jexec wgtest1 wg show $wg1 allowed-ips + atf_check grep -Eq "^${regex3}.+${tunnel3}/32" wg.allowed + + # Next, steal it with an incremental move and check that it moved. + atf_check -s exit:0 \ + jexec wgtest1 wg set $wg1 peer $pub2 \ + allowed-ips "+${tunnel3}/32" + + atf_check -o save:wg-2.allowed jexec wgtest1 wg show $wg1 allowed-ips + + atf_check grep -Eq "^${regex2}.+${tunnel3}/32" wg-2.allowed + atf_check grep -Evq "^${regex3}.+${tunnel3}/32" wg-2.allowed +} + +wg_allowedip_incremental_stealing_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "wg_basic" @@ -425,4 +627,7 @@ atf_init_test_cases() atf_add_test_case "wg_key_peerdev_shared" atf_add_test_case "wg_key_peerdev_makeshared" atf_add_test_case "wg_vnet_parent_routing" + atf_add_test_case "wg_allowedip_incremental" + atf_add_test_case "wg_allowedip_incremental_inet6" + atf_add_test_case "wg_allowedip_incremental_stealing" } From nobody Thu Jun 26 03:40:55 2025 X-Original-To: dev-commits-src-main@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 4bSPbs1Jp1z5yxwp; Thu, 26 Jun 2025 03:40:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSPbs08KHz3ph6; Thu, 26 Jun 2025 03:40:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750909257; 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: in-reply-to:in-reply-to:references:references; bh=6DlgJZYPbM8C8chPdNtOzEwgnWilnzwXVCckhtRVIg4=; b=NS5cMEnHTwACiozBqCgQVFXXBfuMdRLPfRFOQUOMR62y7nB3ZHfRt/xGMbjr7p5bBf2RRc PeoRnErQOQ20zt1vAqEv8+O5+RCOGIkKxJt/cHDfspUw7rWmO8jC7uivXeUgcEYhdy724Q TT6umI1jtZTkTEWzQJCy2utPyBiAWYgKmhxaO7Ck3urwEtLPsYGyKyb/pkBKgPZyB7y4h2 FWpuy6mEZrWhUxiSMqIkbSjutfALboi2OZMPlyOnF3aysDdKkYOSMxj7AMWWSvFsXhFsF8 viRJC9ZExgsOS0BRNizgB9hu4/Hd445GSh388QCZwdU3tlyOB4nxRsHwmQA30A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750909257; 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: in-reply-to:in-reply-to:references:references; bh=6DlgJZYPbM8C8chPdNtOzEwgnWilnzwXVCckhtRVIg4=; b=mNdgfA8MsOomw5ldfpWGkehUYS8Uj7fBEjGOaLwSFXdQX+T1pmMqc9M2Cw2qVgpjgolHCc gPJm1idReyMcpk7T8qu8FS7FUF7omaHySehfboWCH+iIU6OvEbZw2Wz1KeMt/pzhP7oo/R FT6l1JN2bAgt4HpE1mSMo0GDSx0BJuW1uOatcTcWtEYGhuv00ATVgfJHv7B1LBhfBJIMz9 QhQKEeoBxyuKzk5Jht4TBINcknKiKT1pSMD+6HYhDrj3wZ/cse7Ac/v8izRBv9XVdIwYrn euuFbRvbhGsUGMk9VveixJzCwN50xyaIPjBl1s6MO2U8HD3jbGCWlydi2UXtVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750909257; a=rsa-sha256; cv=none; b=fSh8qVHs9KixVR0j2KHueF4XAmx8HiQebfhS/KiKXQbWfpLsYrdDp89BKxIIOTl2WS4uZU PgLNPx1heoHOtBaWhPiXLD/ZKLprUVW/q4sBmPmevALPTJ5eMSFEnk+uoCLuQbuW+4noc1 8z1mcITTvk0+qv4Y6SgEpSITQ+QQ7qpzk4zMHtkM3s++1i83coYuQ1lhWUG8vMHE3B+cjo pHsryNdpPWtjDmgfmV3AfRrUmF9nSpD+tOjC+xLvUdC87icFHE76Y3AqFttk0gVG3+u1cg EthnkgmqAZyQjRMp4RRmkKMAiV4cW0XA7zQa9I8NwziR/xYwgVJrG/i/CyiB8A== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bSPbr4NN1zJqp; Thu, 26 Jun 2025 03:40:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <8a1614aa-c6a2-4ad0-9ebb-55407acc7c48@FreeBSD.org> Date: Wed, 25 Jun 2025 22:40:55 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f6d9e22982a1 - main - wg: ipc: add allowed-ip flags support for FreeBSD From: Kyle Evans To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506260259.55Q2xAsd053022@gitrepo.freebsd.org> Content-Language: en-US In-Reply-To: <202506260259.55Q2xAsd053022@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/25/25 21:59, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f6d9e22982a1d0354c0199e94ebdb4474eaa74b9 > > commit f6d9e22982a1d0354c0199e94ebdb4474eaa74b9 > Author: Kyle Evans > AuthorDate: 2025-06-26 02:57:03 +0000 > Commit: Kyle Evans > CommitDate: 2025-06-26 02:58:25 +0000 > > wg: ipc: add allowed-ip flags support for FreeBSD > > For $reasons, we can't rely on flags in wireguard-tools for the kernel > side of WireGuard. Provide a mapping function that uses flags from the > kernel that we're building against and fail the operation if we made it > to the end without turning some wg(8) flag off. > > Signed-off-by: Kyle Evans > > Reviewed by: ivy (previous version), Jason A. Donenfeld, jhb > Differential Revision: https://reviews.freebsd.org/D50450 I forgot to fix the commit message here before pushing, sorry. The mapping function got dropped in the final version, and we instead just assume definitions that match wg(8) on the kernel side (WGALLOWEDIP_REMOVE_ME). I've fixed the message in the branch I've pushed towards wireguard-tools for upstream consideration, not that that really helps us here. Thanks, Kyle Evans From nobody Thu Jun 26 04:50:25 2025 X-Original-To: dev-commits-src-main@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 4bSR8J5M2Hz602hV; Thu, 26 Jun 2025 04:50:40 +0000 (UTC) (envelope-from wschnr@googlemail.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSR8J2lGSz3fqd; Thu, 26 Jun 2025 04:50:40 +0000 (UTC) (envelope-from wschnr@googlemail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3a54700a463so343187f8f.1; Wed, 25 Jun 2025 21:50:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750913438; x=1751518238; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BiTwoYGBCEEMjgn+FURFm11xrJu6mF+svYDdAOhy/I8=; b=JkUQ/J2skIQo4hl1NXX+ssVk50lU5hTPkTiUPHkWE2qqjJuFj3I7WqkTtWG+IBE/Jv Mk8DnCuo+3K8EMeEDo9Sj98sRWCdZcSrqGpqklIJQknpvy0fvLr9+kPRRVnlFnOxlc/9 LxVA0OsJ5MgsHHat2MOPNs1cS//0CrSuxKDCRlL5+zZd4G0aDshOYVFkPt4H9CFgizwA rHByCOBCZ8OukggZgvhiJQdiWgpJ3KwoP8En7Ra4i3oSV/vQToNT9coih9vznOrh4RRz UE10mKKyZu6RIwpa60sKhqcO18v/RwC0/jsSx6NTBznWoaC3u6mAHjxNeL5cR9Rjxp8G Y39w== X-Forwarded-Encrypted: i=1; AJvYcCUrsjSksFqQjM1kSw5MfwFLjH5FtbyL+wI5+ez0sdo4iawu4bFkMebXF/lD5lNyAGr5ZJOYXKYWADqT3fOzrE9W52fU@freebsd.org, AJvYcCWJGQo63JK2ifqANDSz1yl0hrDtVI7uTKfKstHDHpHIcXPjIoNxHhOxxSaD2YVi1HysZ/sWdQJe9vyS3xqZTY9KpzWMl9U=@freebsd.org X-Gm-Message-State: AOJu0YwdSXE8MwbfxFDc+xxPjztEouT60o+uBj0vbAu4AfeMqR6PIU6l rnXr3USn2Ptd23kKiNsq9c1oUIfSaUdl2DWYsfYE39/qZdh2SMBKeJH9HR63HiQGmBS554jfFNx dqBfOTHqqdmBsVlJKiM6TN68FWRMxLRnyb3sW X-Gm-Gg: ASbGnctLBD9FgVwob7ACKBOqZdA80ekYtDYffAsp5WxhTKwzFqzKgRFhRGlOw5w6nvs /F+kLEea4Vhxoaky81B7n1mOqmOgNjN1ovXw82mVoGYlI/QvttX87XNYwPKUOedPIp/DE3GdsTk Oe8bf7EObTLFng5psBD3rSORSwp0jP4MgsDl86OZevg877zJ1St03mqg== X-Google-Smtp-Source: AGHT+IE2vbD6CgroEpyETbT5QL3qDAtTtyClk3TUOqJa/A46xl7FqeuBvnDj13iwaqAVLPCardJY4rFyafZV6HgPZqg= X-Received: by 2002:a05:6000:4904:b0:3a5:3993:3427 with SMTP id ffacd0b85a97d-3a6f3131147mr1375582f8f.26.1750913437497; Wed, 25 Jun 2025 21:50:37 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506251753.55PHrCSR034187@gitrepo.freebsd.org> In-Reply-To: <202506251753.55PHrCSR034187@gitrepo.freebsd.org> From: Wolfram Schneider Date: Thu, 26 Jun 2025 06:50:25 +0200 X-Gm-Features: Ac12FXzGzSPueQBTmXJeo1mJV0xgcOQsktX7950WgVk78-4b0KKJAqX2QT8hHF0 Message-ID: Subject: Re: git: 4c07abdbacf4 - main - mandoc: Vendor import of upstream at 2025-06-13 To: Alexander Ziaee Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4bSR8J2lGSz3fqd X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Wed, 25 Jun 2025 at 19:53, Alexander Ziaee wrote: > > The branch main has been updated by ziaee: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4c07abdbacf49e4ba749b8720916d8cd340a50b8 > > commit 4c07abdbacf49e4ba749b8720916d8cd340a50b8 > Merge: 7ed1628066ea 7a0bec970311 > Author: Alexander Ziaee > AuthorDate: 2025-06-25 17:50:25 +0000 > Commit: Alexander Ziaee > CommitDate: 2025-06-25 17:52:14 +0000 > > mandoc: Vendor import of upstream at 2025-06-13 > > Interesting changes: > + Lb is now part of SNYOPSIS, the LIBRARY section is deprecated > + Ft now takes multiple args, and no longer should be quoted > + Fix a segfaut on malformed Tg markup > > contrib/mandoc/mandocdb.c | 27 ++++++++-- > contrib/mandoc/mdoc.7 | 109 +++++++++++++++++++++++------------------ > contrib/mandoc/mdoc_macro.c | 7 ++- > contrib/mandoc/mdoc_validate.c | 37 +++++++++++--- > 4 files changed, 117 insertions(+), 63 deletions(-) You didn't updated the VERSION in src/contrib/mandoc/Makefile The codebase is no longer a stock 1.14.6 -Wolfram -- Wolfram Schneider https://wolfram.schneider.org From nobody Thu Jun 26 05:24:17 2025 X-Original-To: dev-commits-src-main@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 4bSRv52tjjz604dY; Thu, 26 Jun 2025 05:24: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 4bSRv52HTvz3xnH; Thu, 26 Jun 2025 05:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750915457; 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=R4O31nrrQIjo2+PRvnmMiFju7Vz9fU6YGMw6KfstwH4=; b=nBA9y1nKyUFNNXdnA32TIH2TB0zy+M5sfLj/zMDyP6Ba64q6wrR6yCNg8xXHBmLlgLKpvA ifGsE6Uwe+lccdFFTHdBpoChwAXeLa2aIShYu0aLUWprtV87cUETENAQ5MzohQhp5Mw5eJ 5OhLn9t/H1hTF7LN9C5EWhg7q1LfOsKtmej6g3N9ZJXrC3G60fPFs6nCSDLm7UvjQewvRC gbDx477H2Of1NoM9XLC3BMy21u9scOZIYGHqikj0mpIPyTl+bcx9EoVD/yuGqiO9wZEvyx U0tiFOZkF98I8iD9JhZqwyBgVMdF7wPLEjXLt8Skn3IysDGWTcbwKvdfAyleng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750915457; 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=R4O31nrrQIjo2+PRvnmMiFju7Vz9fU6YGMw6KfstwH4=; b=TvEQhFzm1lAuoUhQTHAr28VIJnhALwwSr8NLJVUcKrNAFTqyIt1GcHOZxLmJdjvrDBFr1K l3WYX4TTWE2ln26KJmIOL7CEhgdNOf13oiNM5FA2KsId/9wFhUGbis3o2R7kynB8B4YXBx 2Ca/0Zsb/JVvzlk5ZXBYbX+18kUyOgjlWI+A7UBt5FIGccC09AYfOlslsFA/l208i0s97x xMoD1UMuaM9JuMFE8mKtY/Iwp7lcwzSOFeG3nSkosx78RisJ1h+kcwQursV22o+dw4ZD9D pcJ/y4ToIfQBGBqhjwwiQIx/+u86WRMnqmhNkIcDc5nMFpR9dUMkJWxD2TCnXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750915457; a=rsa-sha256; cv=none; b=Q6qWCpFykWtwgB1DpzQOU78DeyK8p6XTrAGEq8wWQQyQLnvJb4SFHAo7Brajj4fdXa5k3h W/zJFSToCbC62Tkm9RY1/mQdWBlOYrXYxdVhK2KmfoOHXDhli+Ku9fArMZRM7wqxGitdtE i3U9apmSyQZdMaIKKxuOWGD57It87E+LWEcFTyX5PCr/QDJRY7wmtI2A9fY2+NtBIfJvb/ vvFcD/rx3RigUdPvKUsxGvr8Bc6l/WHXQkqgucRNdTL8C8vU9iL8Yz4u+6n59yx7eCJbM6 xlo8svvOaMwnXn1sXN/a5Z+ZxEgGHCCfNceU2fvDFY99JE1yu1sYDuchXRos9Q== 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 4bSRv51gM5zqCm; Thu, 26 Jun 2025 05:24: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 55Q5OHAi035041; Thu, 26 Jun 2025 05:24:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q5OHao035038; Thu, 26 Jun 2025 05:24:17 GMT (envelope-from git) Date: Thu, 26 Jun 2025 05:24:17 GMT Message-Id: <202506260524.55Q5OHao035038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 905541dd6ba4 - main - boot: Update the test generation script for serial and rootfs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 905541dd6ba4e94b4aa67d8a0eae6a5eb07f20a0 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=905541dd6ba4e94b4aa67d8a0eae6a5eb07f20a0 commit 905541dd6ba4e94b4aa67d8a0eae6a5eb07f20a0 Author: Warner Losh AuthorDate: 2025-06-26 05:21:48 +0000 Commit: Warner Losh CommitDate: 2025-06-26 05:23:44 +0000 boot: Update the test generation script for serial and rootfs Update the script to include serial port config, serial console and the proper root filesystem. This works for amd64 + ufs, but might need a slight refactor for aarch64 and/or zfs. Sponsored by: Netflix --- tools/boot/full-test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/boot/full-test.sh b/tools/boot/full-test.sh index 0a1a6fad4ef3..1160861316dc 100644 --- a/tools/boot/full-test.sh +++ b/tools/boot/full-test.sh @@ -208,6 +208,10 @@ autoboot_delay=2 zfs_load="YES" boot_verbose=yes kern.cfg.order="acpi,fdt" +boot_serial="YES" +hw.uart.console="io:1016,br:115200" +vfs.root.mountfrom="ufs:/dev/ufs/root" +vfs.root.mountfrom.options="rw" EOF } From nobody Thu Jun 26 05:54:03 2025 X-Original-To: dev-commits-src-main@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 4bSSYg2gncz606Hw; Thu, 26 Jun 2025 05:54:15 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSSYg24MVz3HDJ; Thu, 26 Jun 2025 05:54:15 +0000 (UTC) (envelope-from olivier@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750917255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=latC5g9Z36OyvGdhJEn13KynnKvpGU91Ejq7bttls30=; b=b9haaCwucdw1vCEn6G9d8X+IzNACRxjjG7bo6Sr3fo6gmhgQugLRPpjZ12skA2xdudwtQF eNWJQgYVhZlnJcNtxUGlDwI2RnjpxbiVmLfFRLtR5nNg0JhGLADxyAMA4UFIEeux6czhaL Rquw3iGozNUEkI4prtcLn3CRH8FlAMIrU9OFbA2s7WuhnWbynKpm4EkyaGcFcnFvi/BG4t 54i9lRpNWgnl3DOGCiuqBdmc/gPMY6Q+0XgSuIlNZCx2WTlfsoLy36MgLr2M4qqO9zBBLr SvEc/w0pJRL3OeY5bwrFn5k/W4i65XYCjgWgNYF7JS5mPoeEkZZg1zTtjbryNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750917255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=latC5g9Z36OyvGdhJEn13KynnKvpGU91Ejq7bttls30=; b=a8eL3kth0tP2+ypBULZYStVnzDO4uaRwiANrR7JZGDKjUfx/R/R8Bf2ybKIsNnshpAFfyF PSxwDZgD0Ze/ngx9O+zARRr0J6jYQe7fCzNHS2Mpnjy1Y/PfjeDDy22CB+OGhS4Bic9We0 AHKdX8fryMWorpWlFBHxLW0XqTQIn1Vr8WPM33uGa8yvCqg/xHCyL0BDB0AYjFa/1gHRAm wVA+RD3xQ+HDQNkkxMdrw7TuhkIJvKd6m25uH9AY8gOBxpsdQqZlacTPHoClZvQYMay3Fr OvsjokSBbhfp7+UZOArB2pLK1J0F7iWfOkE/2e873GZuDaMZ9Gj1XpLr19v42A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750917255; a=rsa-sha256; cv=none; b=HTMSgR8n3WXB0G0rG17iPxmmVZrx+W4S5nj6c/6ltCbh4Y5o0YGvT8puKEQkeLSsz88HVw DkFGCVtm/nefX/xsj4mZRrEemGgeoz/FIXg5za7t3ErmL6laClwFLBA+6R+/I/kEu4EOSG 8T56KR7CC/UiiV0qsbHEz0WSjVc7gHkWdfXf+2JAtwtPOQ47zSjDM4w8cHoOJzumhDhIzE z5wp7RHLEANljlBuNOeXbP+uZTEXixckbM4hLbKlqr3iMclOSreOmtryskbFZRQ1WFMplQ 5dHYVRoesoyvKhawDip4OhKNfoTBs72J+W/iYm2ulzv9yuudHx3Ku0vpIPiDAA== Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: olivier/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bSSYg1M6kzN5R; Thu, 26 Jun 2025 05:54:15 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-4a745fc9bafso19481261cf.1; Wed, 25 Jun 2025 22:54:15 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCU16V7gE2WRPhzSEXH1s6IT+c6rXVeoZCPl0a5s/YJQu5pTOX0YBdco11kwDTCAe3xzNv7iCvmWwb7gFD6ADkj97faj@freebsd.org, AJvYcCVhrEs3RdOOAIUXewiTxehjpQIFDdwRt8n6YP7+UTu1KVd/euIB1ZOdJgVE22slDLEBD5l6an9Laq7lQQEoiJUXx03fPlI=@freebsd.org X-Gm-Message-State: AOJu0YwoJ3MWmo2W7Pufedj9WMfFao2SlXIYVnz+ROQVpVyf2CBiVKIa KK8xfzaIuMo/9JX6/tzowu0cp5Op1UA8hfzNImIGdI2uCSlseVS+RywwZ9/6jM/HA+XF+APqgAh ONBq3+ndYpQk4IhywdQFO+6f7eiTEZ3o= X-Google-Smtp-Source: AGHT+IG+MLUrOHf4gkWPmNZSMV3tui2aVvqBJTS1X1Vu/494l8m2L2vcRYo1Gk3dDYmBIN3TpWmYKdLeoi2UxdnDy28= X-Received: by 2002:a05:620a:430c:b0:7d3:e648:5f5 with SMTP id af79cd13be357-7d43bb7ec9fmr305413085a.1.1750917254677; Wed, 25 Jun 2025 22:54:14 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506151602.55FG2SHe047772@gitrepo.freebsd.org> In-Reply-To: <202506151602.55FG2SHe047772@gitrepo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Thu, 26 Jun 2025 07:54:03 +0200 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXyAhSsOJrmksHCU1eB3cnNwMQqtzC-8Exvg2ABmR9yGzWRlin8-3ZhsT_w Message-ID: Subject: Re: git: 5c1ba994a8bc - main - Add a regression test for a libtpool bug To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000ff0aa206387330ac" --000000000000ff0aa206387330ac Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Alan, On Sun, Jun 15, 2025 at 6:02=E2=80=AFPM Alan Somers w= rote: > The branch main has been updated by asomers: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D5c1ba994a8bcb6676ea3d1bb21b072b= 90e2d3ae9 > > commit 5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9 > Author: Alan Somers > AuthorDate: 2024-05-07 17:48:33 +0000 > Commit: Alan Somers > CommitDate: 2025-06-15 16:01:37 +0000 > > Add a regression test for a libtpool bug > > > It seems this commit is the cause of preventing all my (freshly installed) ZFS systems from booting than stop with: Mounting local filesystems:. ld-elf.so.1: Shared object "libtpool.so.2" not found, required by "zfs" Because liptpool.so.2 isn=E2=80=99t no more in /lib (belong to the / datase= t), but in another dataset (/usr/lib) but it needs to use zfs to mount this one. Could the added include in its Makefile modified the installed directory of libtpool.so.2 ? Here is the bisect script used: #!/bin/sh set -eu WRKDIR=3D/tmp/bisec mkdir -p $WRKDIR/lib $WRKDIR/usr/lib $WRKDIR/usr/include make -C cddl/lib/libtpool make -C cddl/lib/libtpool install DESTDIR=3D$WRKDIR if [ -f $WRKDIR/lib/libtpool.so.2 ]; then rm -rf $WRKDIR exit 0 else rm -rf $WRKDIR exit 1 fi And my bisect session pointed me to this commit. git bisect start HEAD 9ce5410b9094 -- git bisect run /tmp/bisec.libtpool.sh git bisect reset Regards, Olivier --000000000000ff0aa206387330ac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Alan,
=


On Sun, Jun 15, 2025 at 6:02=E2=80=AFPM Alan Somers <= ;asomers@freebsd.o= rg> wrote:
https://cgit.= FreeBSD.org/src/commit/?id=3D5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9
commit 5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9
Author:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2024-05-07 17:48:33 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.org>
CommitDate: 2025-06-15 16:01:37 +0000

=C2=A0 =C2=A0 Add a regression test for a libtpool bug



It seems this commit is the c= ause of preventing all my (freshly installed) ZFS systems from booting than= stop with:

Mounting local filesystems:.=
ld-elf.so.1: Shared object "libtpool.so.2" not found, require= d by "zfs"

Because liptpool.so= .2 isn=E2=80=99t no more in /lib (belong to the / dataset), but in another = dataset (/usr/lib) but it needs to use zfs to mount this one.
Could the added include<src.opts.mk> in its Makefile modified the ins= talled directory of=C2=A0libtpool.so.2 ?

Here is the bisect script used:

#!/bin/sh
set -euWRKDIR=3D/tmp/bisec
mkdir -p $WRKDIR/lib $WRKDIR/usr/lib $WRKDIR/usr/in= clude
make -C cddl/lib/libtpool
make -C cddl/lib/libtpool install DES= TDIR=3D$WRKDIR
if [ -f $WRKDIR/lib/libtpool.so.2 ]; then
=C2=A0 =C2= =A0 rm -rf $WRKDIR
=C2=A0 =C2=A0 exit 0
else
=C2=A0 =C2=A0 rm -rf = $WRKDIR
=C2=A0 =C2=A0 exit 1
fi

= And my bisect session pointed me to this commit.
git bisect = start HEAD 9ce5410b9094 --
git bisect run /tmp/bisec.libtpool.sh
git bisect reset

Regards,
Olivier
--000000000000ff0aa206387330ac-- From nobody Thu Jun 26 06:28:27 2025 X-Original-To: dev-commits-src-main@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 4bSTK74BF8z607vr; Thu, 26 Jun 2025 06:28: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 4bSTK72hZTz3cvl; Thu, 26 Jun 2025 06:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750919307; 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=/nTn2z7558axVJhEpL4+iBNfWAHXZGf5H4kAm7nsL9E=; b=SUjg1ZptmPLrFeC06kRFhL0KEXhUn2QXVBlRC9eqdPXXb5Vmu1Y9Jrm+bd9f9fNo3gBv5V 7y1GUoK8B0AGy3WNPjkHKDI5vs9is4rRVpmmW3zhI9gxZsAYZWfbF6CT337FjRtZcp0Mrh VGQCf7XHFnJ0X8JvqSioy+RwzsZEi7vlKyHm1aI1fqIGx9eD37a8ob3L5lAfuNMKgZ/i5U tO7Q6z2rqfpze5NdUoRJSt5UST5E7gN1UddwIv1WyS2vL6ZeQfvw+UrJMOWTMf73L6elU5 eKCyZxW89WmRp+GuVKnQgYYiqhKEtZQkQBPqjCIHGBeRwOjOl/pUel7ZwWxr+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750919307; 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=/nTn2z7558axVJhEpL4+iBNfWAHXZGf5H4kAm7nsL9E=; b=sQfDV34+gCGb+tlYJOS/60sTHiFiRIAyb1C2NIpWf7RNaJ366TbtB3BWAq93PtHCtiY6pv YLms82TWbN/gM46nJNhcR+QYlZFnVBCp7j6sCJeJMqF6SeLKOmhBStFWvjxHBBjYLXd51W 0tXV5sTQEI+9+/XL4VXMIrUrRLCze/eDRoynbTQ6z+tuNnm6q26YFHo3muPkhOYFKAgG/b opLLy6U+PHZ1MXbaU9n6trpe/UaizlY6SRyAsfaYj8T+2mAhyQg67h/HpNhTmIEFRaZ4fP sBmcrlAVOWOOqZeYBXOC9W9VmTsKFGqHg/OkF9omAXMTv+eMxK5Z4w/SnYQQnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750919307; a=rsa-sha256; cv=none; b=SIHZ3NhR2q4Pdhmw769SaBUWUk0vwXUgsU/DWmN0acFdTKirhFxhqIsZXSlBz7PbF8uP+o tTDZ2rKYdjohhlujyDnv4RGDfFjPKXaOn4JrJJCpvdwr6ZwkkwcCq4ZaTXj0ZIUbd1dszH AKur3f0o4wHTqoRAqh4A1ZAQMB3VwBZukH0aT1FE9Ltjfaftd2DW6KiGz85FpGyUiPWe3N 8rXCc01M61yL/UzsohS4RGlOQm1kMnA4k24HMqpzy9JKAvf25yJ+YJCSWFh5Cfs8oGDmSy V2FzaNCSVrpbJETwZewyPpKzaf84b3tepvrHm870RCNrUK2B894VPcGDAEtyvg== 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 4bSTK72HxYzs4J; Thu, 26 Jun 2025 06: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 55Q6SRuf048405; Thu, 26 Jun 2025 06: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 55Q6SRus048402; Thu, 26 Jun 2025 06:28:27 GMT (envelope-from git) Date: Thu, 26 Jun 2025 06:28:27 GMT Message-Id: <202506260628.55Q6SRus048402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 44d6f4b314ad - main - pctrie: use one lookup function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44d6f4b314ad39502d21854b6d1db8fee4ffeafe Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=44d6f4b314ad39502d21854b6d1db8fee4ffeafe commit 44d6f4b314ad39502d21854b6d1db8fee4ffeafe Author: Doug Moore AuthorDate: 2025-06-26 06:27:21 +0000 Commit: Doug Moore CommitDate: 2025-06-26 06:27:21 +0000 pctrie: use one lookup function Several of the functions that implement pctries have their own loops for walking down the trie searching for an exact match. Change them all to use _pctrie_lookup_node for that. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D50839 --- sys/kern/subr_pctrie.c | 400 ++++++++++++++++++++----------------------------- 1 file changed, 163 insertions(+), 237 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index e8098c6052e3..194e96ced471 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -267,6 +267,111 @@ pctrie_node_size(void) return (sizeof(struct pctrie_node)); } +/* + * Return the value associated with the node, if the node is a leaf that matches + * the index; otherwise NULL. + */ +static __always_inline uint64_t * +pctrie_match_value(struct pctrie_node *node, uint64_t index) +{ + uint64_t *m; + + if (!pctrie_isleaf(node) || (m = pctrie_toval(node)) == NULL || + *m != index) + m = NULL; + return (m); +} + +/* + * Returns the last node examined in the search for the index, and sets the + * parent of that node. + */ +static __always_inline struct pctrie_node * +_pctrie_lookup_node(struct pctrie *ptree, struct pctrie_node *node, + uint64_t index, struct pctrie_node **parent_out, + smr_t smr, enum pctrie_access access) +{ + struct pctrie_node *parent; + int slot; + + parent = node; + if (parent == NULL) + node = pctrie_root_load(ptree, smr, access); + + /* + * Climb the search path to find the lowest node from which to start the + * search for a value matching 'index'. + */ + while (parent != NULL) { + KASSERT(access == PCTRIE_SMR || !powerof2(parent->pn_popmap), + ("%s: freed node in iter path", __func__)); + node = parent; + if (!pctrie_keybarr(node, index, &slot)) + break; + parent = pctrie_parent(node); + } + + /* Seek a node that matches index. */ + while (!pctrie_isleaf(node) && !pctrie_keybarr(node, index, &slot)) { + parent = node; + KASSERT(access == PCTRIE_SMR || !powerof2(parent->pn_popmap), + ("%s: freed node in iter path", __func__)); + node = pctrie_node_load(&node->pn_child[slot], smr, access); + } + *parent_out = parent; + return (node); +} + +/* + * Returns the value stored at the index, assuming access is externally + * synchronized by a lock. + * + * If the index is not present, NULL is returned. + */ +uint64_t * +pctrie_lookup(struct pctrie *ptree, uint64_t index) +{ + struct pctrie_node *node, *parent; + + node = _pctrie_lookup_node(ptree, NULL, index, &parent, NULL, + PCTRIE_LOCKED); + return (pctrie_match_value(node, index)); +} + +/* + * Returns the value stored at the index without requiring an external lock. + * + * If the index is not present, NULL is returned. + */ +uint64_t * +pctrie_lookup_unlocked(struct pctrie *ptree, uint64_t index, smr_t smr) +{ + struct pctrie_node *node, *parent; + uint64_t *res; + + smr_enter(smr); + node = _pctrie_lookup_node(ptree, NULL, index, &parent, smr, + PCTRIE_SMR); + res = pctrie_match_value(node, index); + smr_exit(smr); + return (res); +} + +/* + * Returns the value stored at a given index value, possibly NULL, assuming + * access is externally synchronized by a lock. + */ +uint64_t * +pctrie_iter_lookup(struct pctrie_iter *it, uint64_t index) +{ + struct pctrie_node *node; + + node = _pctrie_lookup_node(it->ptree, it->node, index, &it->node, + NULL, PCTRIE_LOCKED); + it->index = index; + return (pctrie_match_value(node, index)); +} + /* * Look for where to insert the key-value pair into the trie. Complete the * insertion if it replaces a null leaf. Return the insertion location if the @@ -276,45 +381,26 @@ pctrie_node_size(void) * pctrie_lookup(). */ static __always_inline void * -pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val, - struct pctrie_node **parent_out, uint64_t **found_out) +_pctrie_insert_lookup(struct pctrie *ptree, struct pctrie_node *parent, + uint64_t *val, struct pctrie_node **parent_out, uint64_t **found_out) { - uint64_t index; - struct pctrie_node *node, *parent; - int slot; - - index = *val; + struct pctrie_node *node; - /* - * The owner of record for root is not really important because it - * will never be used. - */ - node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); - parent = NULL; - for (;;) { - if (pctrie_isleaf(node)) { - if (node == PCTRIE_NULL) { - if (parent == NULL) - pctrie_node_store(pctrie_root(ptree), - pctrie_toleaf(val), PCTRIE_LOCKED); - else - pctrie_addnode(parent, index, - pctrie_toleaf(val), PCTRIE_LOCKED); - *parent_out = parent; - return (NULL); - } - if (*pctrie_toval(node) == index) { - *found_out = pctrie_toval(node); - *parent_out = parent; - return (NULL); - } - break; - } - if (pctrie_keybarr(node, index, &slot)) - break; - parent = node; - node = pctrie_node_load(&node->pn_child[slot], NULL, - PCTRIE_LOCKED); + node = _pctrie_lookup_node(ptree, parent, *val, parent_out, NULL, + PCTRIE_LOCKED); + *found_out = NULL; + if (node == PCTRIE_NULL) { + if (*parent_out == NULL) + pctrie_node_store(pctrie_root(ptree), + pctrie_toleaf(val), PCTRIE_LOCKED); + else + pctrie_addnode(*parent_out, *val, + pctrie_toleaf(val), PCTRIE_LOCKED); + return (NULL); + } + if (__predict_false(pctrie_match_value(node, *val) != NULL)) { + *found_out = pctrie_toval(node); + return (NULL); } /* @@ -322,12 +408,11 @@ pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val, * children 'node' and 'val'. Return the place that points to 'node' * now, and will point to to the new branching node later. */ - *parent_out = parent; - return ((parent == NULL) ? pctrie_root(ptree): &parent->pn_child[slot]); + return (pctrie_child(ptree, *parent_out, *val)); } /* - * Wrap pctrie_insert_lookup_compound to implement a strict insertion. Panic + * Wrap _pctrie_insert_lookup to implement a strict insertion. Panic * if the key already exists, and do not look for neighboring entries. */ void * @@ -337,9 +422,7 @@ pctrie_insert_lookup_strict(struct pctrie *ptree, uint64_t *val, void *parentp; uint64_t *found; - found = NULL; - parentp = pctrie_insert_lookup_compound(ptree, val, parent_out, - &found); + parentp = _pctrie_insert_lookup(ptree, NULL, val, parent_out, &found); if (__predict_false(found != NULL)) panic("%s: key %jx is already present", __func__, (uintmax_t)*val); @@ -347,16 +430,34 @@ pctrie_insert_lookup_strict(struct pctrie *ptree, uint64_t *val, } /* - * Wrap pctrie_insert_lookup_compound to implement find-or-insert. Do not look + * Wrap _pctrie_insert_lookup to implement find-or-insert. Do not look * for neighboring entries. */ void * pctrie_insert_lookup(struct pctrie *ptree, uint64_t *val, struct pctrie_node **parent_out, uint64_t **found_out) { - *found_out = NULL; - return (pctrie_insert_lookup_compound(ptree, val, parent_out, - found_out)); + return (_pctrie_insert_lookup(ptree, NULL, val, parent_out, found_out)); +} + +/* + * Insert the val in the trie, starting search with iterator. Return a pointer + * to indicate where a new node must be allocated to complete insertion. + * Assumes access is externally synchronized by a lock. + */ +void * +pctrie_iter_insert_lookup(struct pctrie_iter *it, uint64_t *val) +{ + void *res; + uint64_t *found; + + it->index = *val; + res = _pctrie_insert_lookup(it->ptree, it->node, val, &it->node, + &found); + if (__predict_false(found != NULL)) + panic("%s: key %jx is already present", __func__, + (uintmax_t)it->index); + return (res); } /* @@ -416,156 +517,6 @@ pctrie_insert_node(uint64_t *val, struct pctrie_node *parent, void *parentp, pctrie_node_store(parentp, child, PCTRIE_LOCKED); } -/* - * Return the value associated with the node, if the node is a leaf that matches - * the index; otherwise NULL. - */ -static __always_inline uint64_t * -pctrie_match_value(struct pctrie_node *node, uint64_t index) -{ - uint64_t *m; - - if (!pctrie_isleaf(node) || (m = pctrie_toval(node)) == NULL || - *m != index) - m = NULL; - return (m); -} - -/* - * Returns the value stored at the index. If the index is not present, - * NULL is returned. - */ -static __always_inline uint64_t * -_pctrie_lookup(struct pctrie *ptree, uint64_t index, smr_t smr, - enum pctrie_access access) -{ - struct pctrie_node *node; - int slot; - - node = pctrie_root_load(ptree, smr, access); - /* Seek a node that matches index. */ - while (!pctrie_isleaf(node) && !pctrie_keybarr(node, index, &slot)) - node = pctrie_node_load(&node->pn_child[slot], smr, access); - return (pctrie_match_value(node, index)); -} - -/* - * Returns the value stored at the index, assuming access is externally - * synchronized by a lock. - * - * If the index is not present, NULL is returned. - */ -uint64_t * -pctrie_lookup(struct pctrie *ptree, uint64_t index) -{ - return (_pctrie_lookup(ptree, index, NULL, PCTRIE_LOCKED)); -} - -/* - * Returns the value stored at the index without requiring an external lock. - * - * If the index is not present, NULL is returned. - */ -uint64_t * -pctrie_lookup_unlocked(struct pctrie *ptree, uint64_t index, smr_t smr) -{ - uint64_t *res; - - smr_enter(smr); - res = _pctrie_lookup(ptree, index, smr, PCTRIE_SMR); - smr_exit(smr); - return (res); -} - -/* - * Returns the last node examined in the search for the index, and sets the - * parent of that node. - */ -static __always_inline struct pctrie_node * -_pctrie_lookup_node(struct pctrie *ptree, struct pctrie_node *node, - uint64_t index, struct pctrie_node **parent_out, - smr_t smr, enum pctrie_access access) -{ - struct pctrie_node *parent; - int slot; - - parent = node; - if (parent == NULL) - node = pctrie_root_load(ptree, smr, access); - - /* - * Climb the search path to find the lowest node from which to start the - * search for a value matching 'index'. - */ - while (parent != NULL) { - KASSERT(access == PCTRIE_SMR || !powerof2(parent->pn_popmap), - ("%s: freed node in iter path", __func__)); - node = parent; - if (!pctrie_keybarr(node, index, &slot)) - break; - parent = pctrie_parent(node); - } - - /* Seek a node that matches index. */ - while (!pctrie_isleaf(node) && !pctrie_keybarr(node, index, &slot)) { - parent = node; - KASSERT(access == PCTRIE_SMR || !powerof2(parent->pn_popmap), - ("%s: freed node in iter path", __func__)); - node = pctrie_node_load(&node->pn_child[slot], smr, access); - } - *parent_out = parent; - return (node); -} - -/* - * Returns the value stored at a given index value, possibly NULL, assuming - * access is externally synchronized by a lock. - */ -uint64_t * -pctrie_iter_lookup(struct pctrie_iter *it, uint64_t index) -{ - struct pctrie_node *node; - - node = _pctrie_lookup_node(it->ptree, it->node, index, &it->node, - NULL, PCTRIE_LOCKED); - it->index = index; - return (pctrie_match_value(node, index)); -} - -/* - * Insert the val in the trie, starting search with iterator. Return a pointer - * to indicate where a new node must be allocated to complete insertion. - * Assumes access is externally synchronized by a lock. - */ -void * -pctrie_iter_insert_lookup(struct pctrie_iter *it, uint64_t *val) -{ - struct pctrie_node *node; - - node = _pctrie_lookup_node(it->ptree, it->node, *val, &it->node, - NULL, PCTRIE_LOCKED); - it->index = *val; - if (node == PCTRIE_NULL) { - if (it->node == NULL) - pctrie_node_store(pctrie_root(it->ptree), - pctrie_toleaf(val), PCTRIE_LOCKED); - else - pctrie_addnode(it->node, it->index, - pctrie_toleaf(val), PCTRIE_LOCKED); - return (NULL); - } - if (__predict_false(pctrie_match_value(node, it->index) != NULL)) - panic("%s: key %jx is already present", __func__, - (uintmax_t)it->index); - - /* - * 'node' must be replaced in the tree with a new branch node, with - * children 'node' and 'val'. Return the place that points to 'node' - * now, and will point to to the new branching node later. - */ - return (pctrie_child(it->ptree, it->node, it->index)); -} - /* * Returns the value stored at a fixed offset from the current index value, * possibly NULL. @@ -966,20 +917,14 @@ uint64_t * pctrie_remove_lookup(struct pctrie *ptree, uint64_t index, struct pctrie_node **freenode) { - struct pctrie_node *child, *node; + struct pctrie_node *node, *parent; uint64_t *m; - int slot; - node = NULL; - child = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); - while (!pctrie_isleaf(child)) { - node = child; - slot = pctrie_slot(node, index); - child = pctrie_node_load(&node->pn_child[slot], NULL, - PCTRIE_LOCKED); - } - if ((m = pctrie_match_value(child, index)) != NULL) - pctrie_remove(ptree, node, index, freenode); + node = _pctrie_lookup_node(ptree, NULL, index, &parent, NULL, + PCTRIE_LOCKED); + m = pctrie_match_value(node, index); + if (m != NULL) + pctrie_remove(ptree, parent, index, freenode); else *freenode = NULL; return (m); @@ -1117,36 +1062,17 @@ pctrie_reclaim_begin_cb(struct pctrie_node **pnode, struct pctrie *ptree, uint64_t * pctrie_replace(struct pctrie *ptree, uint64_t *newval) { - struct pctrie_node *leaf, *parent, *node; + struct pctrie_node *node, *parent; uint64_t *m; - uint64_t index; - int slot; - leaf = pctrie_toleaf(newval); - index = *newval; - node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); - parent = NULL; - for (;;) { - if (pctrie_isleaf(node)) { - if ((m = pctrie_toval(node)) != NULL && *m == index) { - if (parent == NULL) - pctrie_node_store(pctrie_root(ptree), - leaf, PCTRIE_LOCKED); - else - pctrie_node_store( - &parent->pn_child[slot], leaf, - PCTRIE_LOCKED); - return (m); - } - break; - } - if (pctrie_keybarr(node, index, &slot)) - break; - parent = node; - node = pctrie_node_load(&node->pn_child[slot], NULL, - PCTRIE_LOCKED); - } - panic("%s: original replacing value not found", __func__); + node = _pctrie_lookup_node(ptree, NULL, *newval, &parent, NULL, + PCTRIE_LOCKED); + m = pctrie_match_value(node, *newval); + if (m == NULL) + panic("%s: original replacing value not found", __func__); + pctrie_node_store(pctrie_child(ptree, parent, *newval), + pctrie_toleaf(newval), PCTRIE_LOCKED); + return (m); } #ifdef DDB From nobody Thu Jun 26 07:05:08 2025 X-Original-To: dev-commits-src-main@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 4bSV7T0z31z609km; Thu, 26 Jun 2025 07:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSV7T0GyMz3yvS; Thu, 26 Jun 2025 07:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750921509; 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=b7pQwvucrC25ULrzAkENBVSAsPcIu+u+ZdZ4MW4n/FQ=; b=ngTWaJm0lCsu7L5MykLv5bJs9y/bXRDMC9PRQhzZVk5XXmeFjHhCx0Krku5D+XBkBk36zP Nf8tnXwSl5y8aD+agKEmqdn6h3JV1PPgURIjxtCXBszEoqwrNDg2KLrD8gTmFk9JYS9v2n JhHbL0Z+YBdUTbGY3Z8474i8xzHrpunmJmLDWuHKJ0Vfve1o1fetD3Lum7MbaRnyddOYwX NTXQhHvNyt+Jpmn7I8/4dbPNz3uZMowpsF+xwHjWiRmwnE4Etwi62SyQ7KnKUTVX9lV2vl VBsUgaxufuS2JVM1pT2zCfjRJqfIP12fwMPJu2KQAG8868z1iXS5iyhmEonGFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750921509; 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=b7pQwvucrC25ULrzAkENBVSAsPcIu+u+ZdZ4MW4n/FQ=; b=yQJppfSLnTIoKVGmsgBvCY1fFNuTrbgegg8eYUN3ZdUiOVxOEbX8QZf7rHCoqkekHd32No EzSeR5IZXnYgrhi3vyb+dvK2GuO12guoeXTElPT4Fu0c96/Bb+hasNsN6d2+LuWV9UR5um EJIbzxzoOsL14a27QCLKo5IMzLga8oK1tchn/2HFLdVNgZCOqLEzcG9lwC/bkBOqVJpJwb fDXbDtK12PdGryGyY7KWWhO7d5iXH74U75ks6NbuzozYl43Gb/l5iFxpWCIFRquoscg25F vB/CmdgqOfR+9bK1ikuN02UKV8h8+6Ryi9ichbIwcgfI3IyYvwhYaxjLPfdr4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750921509; a=rsa-sha256; cv=none; b=a2lp6sfdDx2+ZC8A+A87yD0S+hm1Ns4+VAF16d2ljezPVRXBt0d+LijjmBn7Vm+V3QeRPe 96qMb00hSDpSkzMbsvaS3Nr4ARwXFkywXjql122cBEF+dhek4u2+npgzgxcTGcjZx6uHsW P24rsMJJQRMaXhI+n0oR5VFM+FyAQoEaSmvLccLuYdjNxMr8xJh5GEZLr5WNf4Y+TC8v9y nWgOfuCF8jxXT4K7C/Tqd4IemD7B0HsWVBOBmUwQUr5lPPJHxx0kHNJ/K446MaqQIZl9uM Fdo3Rmh+UuP5CPiEKKLGGSKm8VKdZ5WZD1ZW6kiF0QsCIDZhPItHKpE8MBA/ag== 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 4bSV7S6hlbzsTf; Thu, 26 Jun 2025 07:05:08 +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 55Q758aU023064; Thu, 26 Jun 2025 07:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q7580o023061; Thu, 26 Jun 2025 07:05:08 GMT (envelope-from git) Date: Thu, 26 Jun 2025 07:05:08 GMT Message-Id: <202506260705.55Q7580o023061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 0f5c86ddb025 - main - libyaml: import libyaml vendor version 0.2.5 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f5c86ddb0257f4b7620f1d8e898289be30b19bf Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0f5c86ddb0257f4b7620f1d8e898289be30b19bf commit 0f5c86ddb0257f4b7620f1d8e898289be30b19bf Merge: 44d6f4b314ad 5f99da5545eb Author: Baptiste Daroussin AuthorDate: 2025-06-26 06:57:37 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 07:02:31 +0000 libyaml: import libyaml vendor version 0.2.5 The yaml parser used in nuageinit is too incomplete, import libyaml in order to be able to use as a complete parser for nuageinit. contrib/libyaml/.appveyor.yml | 29 + contrib/libyaml/.github/workflows/main.yml | 59 + contrib/libyaml/.gitignore | 46 + contrib/libyaml/.indent.pro | 1 + contrib/libyaml/.makefile | 63 + contrib/libyaml/.travis.yml | 28 + contrib/libyaml/CMakeLists.txt | 160 + contrib/libyaml/Changes | 372 ++ contrib/libyaml/License | 20 + contrib/libyaml/Makefile.am | 54 + contrib/libyaml/ReadMe.md | 46 + contrib/libyaml/announcement.msg | 89 + contrib/libyaml/bootstrap | 3 + contrib/libyaml/configure.ac | 73 + contrib/libyaml/doc/doxygen.cfg | 222 ++ contrib/libyaml/docker/README.mkd | 17 + contrib/libyaml/docker/alpine-3.7 | 26 + contrib/libyaml/docker/fedora-25 | 26 + contrib/libyaml/docker/ubuntu-14.04 | 29 + contrib/libyaml/docker/ubuntu-16.04 | 24 + contrib/libyaml/examples/anchors.yaml | 10 + contrib/libyaml/examples/array.yaml | 2 + contrib/libyaml/examples/global-tag.yaml | 14 + contrib/libyaml/examples/json.yaml | 1 + contrib/libyaml/examples/mapping.yaml | 2 + contrib/libyaml/examples/numbers.yaml | 1 + contrib/libyaml/examples/strings.yaml | 7 + contrib/libyaml/examples/tags.yaml | 7 + contrib/libyaml/examples/yaml-version.yaml | 3 + contrib/libyaml/include/Makefile.am | 17 + contrib/libyaml/include/yaml.h | 1985 +++++++++++ ...terfuzz-testcase-minimized-5607885063061504.yml | 1 + contrib/libyaml/src/Makefile.am | 4 + contrib/libyaml/src/api.c | 1393 ++++++++ contrib/libyaml/src/dumper.c | 394 +++ contrib/libyaml/src/emitter.c | 2358 +++++++++++++ contrib/libyaml/src/loader.c | 544 +++ contrib/libyaml/src/parser.c | 1375 ++++++++ contrib/libyaml/src/reader.c | 469 +++ contrib/libyaml/src/scanner.c | 3598 ++++++++++++++++++++ contrib/libyaml/src/writer.c | 141 + contrib/libyaml/src/yaml_private.h | 684 ++++ contrib/libyaml/tests/CMakeLists.txt | 27 + contrib/libyaml/tests/Makefile.am | 9 + contrib/libyaml/tests/ReadMe.md | 63 + contrib/libyaml/tests/example-deconstructor-alt.c | 800 +++++ contrib/libyaml/tests/example-deconstructor.c | 1127 ++++++ contrib/libyaml/tests/example-reformatter-alt.c | 217 ++ contrib/libyaml/tests/example-reformatter.c | 202 ++ contrib/libyaml/tests/run-all-tests.sh | 29 + contrib/libyaml/tests/run-dumper.c | 314 ++ contrib/libyaml/tests/run-emitter-test-suite.c | 290 ++ contrib/libyaml/tests/run-emitter.c | 327 ++ contrib/libyaml/tests/run-loader.c | 63 + contrib/libyaml/tests/run-parser-test-suite.c | 189 + contrib/libyaml/tests/run-parser.c | 63 + contrib/libyaml/tests/run-scanner.c | 63 + contrib/libyaml/tests/test-reader.c | 354 ++ contrib/libyaml/tests/test-version.c | 29 + contrib/libyaml/yaml-0.1.pc.in | 10 + contrib/libyaml/yamlConfig.cmake.in | 16 + lib/Makefile | 1 + lib/libyaml/Makefile | 29 + share/mk/src.libnames.mk | 1 + 64 files changed, 18620 insertions(+) diff --cc contrib/libyaml/.appveyor.yml index 000000000000,36d706aecdf5..36d706aecdf5 mode 000000,100644..100644 --- a/contrib/libyaml/.appveyor.yml +++ b/contrib/libyaml/.appveyor.yml diff --cc contrib/libyaml/.github/workflows/main.yml index 000000000000,c2bdef471011..c2bdef471011 mode 000000,100644..100644 --- a/contrib/libyaml/.github/workflows/main.yml +++ b/contrib/libyaml/.github/workflows/main.yml diff --cc contrib/libyaml/.gitignore index 000000000000,000000000000..90840c8ac2de new file mode 100644 --- /dev/null +++ b/contrib/libyaml/.gitignore @@@ -1,0 -1,0 +1,46 @@@ ++*.BAK ++*.a ++*.cmake ++*.dll ++*.exe ++*.la ++*.lo ++*.log ++*.o ++*.pc ++*.so ++*.trs ++*~ ++.deps/ ++.libs/ ++/Testing/ ++/libtool ++CMakeCache.txt ++CMakeFiles/ ++GNUmakefile ++Makefile ++Makefile.in ++/aclocal.m4 ++/autom4te.cache ++/config ++config.h* ++/config.status ++/configure ++stamp-h1 ++!config/config.h.in ++/packaging/ ++/tests/run-dumper ++/tests/run-emitter ++/tests/run-emitter-test-suite ++/tests/run-loader ++/tests/run-parser ++/tests/run-parser-test-suite ++/tests/run-scanner ++/tests/example-deconstructor ++/tests/example-deconstructor-alt ++/tests/example-reformatter ++/tests/example-reformatter-alt ++/tests/run-test-suite ++/tests/test-reader ++/tests/test-version ++/dist/ diff --cc contrib/libyaml/.indent.pro index 000000000000,d647720f74d6..d647720f74d6 mode 000000,100644..100644 --- a/contrib/libyaml/.indent.pro +++ b/contrib/libyaml/.indent.pro diff --cc contrib/libyaml/.makefile index 000000000000,9d526a4d3983..9d526a4d3983 mode 000000,100644..100644 --- a/contrib/libyaml/.makefile +++ b/contrib/libyaml/.makefile diff --cc contrib/libyaml/.travis.yml index 000000000000,dca3bc73c4c5..dca3bc73c4c5 mode 000000,100644..100644 --- a/contrib/libyaml/.travis.yml +++ b/contrib/libyaml/.travis.yml diff --cc contrib/libyaml/CMakeLists.txt index 000000000000,4f811481779a..4f811481779a mode 000000,100644..100644 --- a/contrib/libyaml/CMakeLists.txt +++ b/contrib/libyaml/CMakeLists.txt diff --cc contrib/libyaml/Changes index 000000000000,e4b96edcbef7..e4b96edcbef7 mode 000000,100644..100644 --- a/contrib/libyaml/Changes +++ b/contrib/libyaml/Changes diff --cc contrib/libyaml/License index 000000000000,3d82c281ee8c..3d82c281ee8c mode 000000,100644..100644 --- a/contrib/libyaml/License +++ b/contrib/libyaml/License diff --cc contrib/libyaml/Makefile.am index 000000000000,551c74071f7a..551c74071f7a mode 000000,100644..100644 --- a/contrib/libyaml/Makefile.am +++ b/contrib/libyaml/Makefile.am diff --cc contrib/libyaml/ReadMe.md index 000000000000,2dfcc4476dcd..2dfcc4476dcd mode 000000,100644..100644 --- a/contrib/libyaml/ReadMe.md +++ b/contrib/libyaml/ReadMe.md diff --cc contrib/libyaml/announcement.msg index 000000000000,080a864b65d5..080a864b65d5 mode 000000,100644..100644 --- a/contrib/libyaml/announcement.msg +++ b/contrib/libyaml/announcement.msg diff --cc contrib/libyaml/bootstrap index 000000000000,1745838c5364..1745838c5364 mode 000000,100755..100755 --- a/contrib/libyaml/bootstrap +++ b/contrib/libyaml/bootstrap diff --cc contrib/libyaml/configure.ac index 000000000000,92426f04ec43..92426f04ec43 mode 000000,100644..100644 --- a/contrib/libyaml/configure.ac +++ b/contrib/libyaml/configure.ac diff --cc contrib/libyaml/doc/doxygen.cfg index 000000000000,a58bb177a4d2..a58bb177a4d2 mode 000000,100644..100644 --- a/contrib/libyaml/doc/doxygen.cfg +++ b/contrib/libyaml/doc/doxygen.cfg diff --cc contrib/libyaml/docker/README.mkd index 000000000000,71c13e17cb12..71c13e17cb12 mode 000000,100644..100644 --- a/contrib/libyaml/docker/README.mkd +++ b/contrib/libyaml/docker/README.mkd diff --cc contrib/libyaml/docker/alpine-3.7 index 000000000000,ac2d625beda9..ac2d625beda9 mode 000000,100644..100644 --- a/contrib/libyaml/docker/alpine-3.7 +++ b/contrib/libyaml/docker/alpine-3.7 diff --cc contrib/libyaml/docker/fedora-25 index 000000000000,36e58ab0186d..36e58ab0186d mode 000000,100644..100644 --- a/contrib/libyaml/docker/fedora-25 +++ b/contrib/libyaml/docker/fedora-25 diff --cc contrib/libyaml/docker/ubuntu-14.04 index 000000000000,6a2b1346fca1..6a2b1346fca1 mode 000000,100644..100644 --- a/contrib/libyaml/docker/ubuntu-14.04 +++ b/contrib/libyaml/docker/ubuntu-14.04 diff --cc contrib/libyaml/docker/ubuntu-16.04 index 000000000000,87b7afdfc20e..87b7afdfc20e mode 000000,100644..100644 --- a/contrib/libyaml/docker/ubuntu-16.04 +++ b/contrib/libyaml/docker/ubuntu-16.04 diff --cc contrib/libyaml/examples/anchors.yaml index 000000000000,875585317000..875585317000 mode 000000,100644..100644 --- a/contrib/libyaml/examples/anchors.yaml +++ b/contrib/libyaml/examples/anchors.yaml diff --cc contrib/libyaml/examples/array.yaml index 000000000000,18efd12efbde..18efd12efbde mode 000000,100644..100644 --- a/contrib/libyaml/examples/array.yaml +++ b/contrib/libyaml/examples/array.yaml diff --cc contrib/libyaml/examples/global-tag.yaml index 000000000000,1180757d81cb..1180757d81cb mode 000000,100644..100644 --- a/contrib/libyaml/examples/global-tag.yaml +++ b/contrib/libyaml/examples/global-tag.yaml diff --cc contrib/libyaml/examples/json.yaml index 000000000000,7822ddc8342f..7822ddc8342f mode 000000,100644..100644 --- a/contrib/libyaml/examples/json.yaml +++ b/contrib/libyaml/examples/json.yaml diff --cc contrib/libyaml/examples/mapping.yaml index 000000000000,53d256787c9f..53d256787c9f mode 000000,100644..100644 --- a/contrib/libyaml/examples/mapping.yaml +++ b/contrib/libyaml/examples/mapping.yaml diff --cc contrib/libyaml/examples/numbers.yaml index 000000000000,45d2bf01b2ff..45d2bf01b2ff mode 000000,100644..100644 --- a/contrib/libyaml/examples/numbers.yaml +++ b/contrib/libyaml/examples/numbers.yaml diff --cc contrib/libyaml/examples/strings.yaml index 000000000000,31b641f4f3cd..31b641f4f3cd mode 000000,100644..100644 --- a/contrib/libyaml/examples/strings.yaml +++ b/contrib/libyaml/examples/strings.yaml diff --cc contrib/libyaml/examples/tags.yaml index 000000000000,3d5a010ac0a6..3d5a010ac0a6 mode 000000,100644..100644 --- a/contrib/libyaml/examples/tags.yaml +++ b/contrib/libyaml/examples/tags.yaml diff --cc contrib/libyaml/examples/yaml-version.yaml index 000000000000,122b5082b6a7..122b5082b6a7 mode 000000,100644..100644 --- a/contrib/libyaml/examples/yaml-version.yaml +++ b/contrib/libyaml/examples/yaml-version.yaml diff --cc contrib/libyaml/include/Makefile.am index 000000000000,3882a2f63dd5..3882a2f63dd5 mode 000000,100644..100644 --- a/contrib/libyaml/include/Makefile.am +++ b/contrib/libyaml/include/Makefile.am diff --cc contrib/libyaml/include/yaml.h index 000000000000,89050e4f7dc6..89050e4f7dc6 mode 000000,100644..100644 --- a/contrib/libyaml/include/yaml.h +++ b/contrib/libyaml/include/yaml.h diff --cc contrib/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml index 000000000000,72e9492c1348..72e9492c1348 mode 000000,100644..100644 --- a/contrib/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +++ b/contrib/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml diff --cc contrib/libyaml/src/Makefile.am index 000000000000,24cf89d241dd..24cf89d241dd mode 000000,100644..100644 --- a/contrib/libyaml/src/Makefile.am +++ b/contrib/libyaml/src/Makefile.am diff --cc contrib/libyaml/src/api.c index 000000000000,16f88bd762aa..16f88bd762aa mode 000000,100644..100644 --- a/contrib/libyaml/src/api.c +++ b/contrib/libyaml/src/api.c diff --cc contrib/libyaml/src/dumper.c index 000000000000,1fe940b674da..1fe940b674da mode 000000,100644..100644 --- a/contrib/libyaml/src/dumper.c +++ b/contrib/libyaml/src/dumper.c diff --cc contrib/libyaml/src/emitter.c index 000000000000,609b28a4c6e1..609b28a4c6e1 mode 000000,100644..100644 --- a/contrib/libyaml/src/emitter.c +++ b/contrib/libyaml/src/emitter.c diff --cc contrib/libyaml/src/loader.c index 000000000000,dea8ac428c2a..dea8ac428c2a mode 000000,100644..100644 --- a/contrib/libyaml/src/loader.c +++ b/contrib/libyaml/src/loader.c diff --cc contrib/libyaml/src/parser.c index 000000000000,ec2f8d3e0551..ec2f8d3e0551 mode 000000,100644..100644 --- a/contrib/libyaml/src/parser.c +++ b/contrib/libyaml/src/parser.c diff --cc contrib/libyaml/src/reader.c index 000000000000,f3ac54c2517d..f3ac54c2517d mode 000000,100644..100644 --- a/contrib/libyaml/src/reader.c +++ b/contrib/libyaml/src/reader.c diff --cc contrib/libyaml/src/scanner.c index 000000000000,c6b498765646..c6b498765646 mode 000000,100644..100644 --- a/contrib/libyaml/src/scanner.c +++ b/contrib/libyaml/src/scanner.c diff --cc contrib/libyaml/src/writer.c index 000000000000,5d57f392f1eb..5d57f392f1eb mode 000000,100644..100644 --- a/contrib/libyaml/src/writer.c +++ b/contrib/libyaml/src/writer.c diff --cc contrib/libyaml/src/yaml_private.h index 000000000000,b3351c41655c..b3351c41655c mode 000000,100644..100644 --- a/contrib/libyaml/src/yaml_private.h +++ b/contrib/libyaml/src/yaml_private.h diff --cc contrib/libyaml/tests/CMakeLists.txt index 000000000000,be2ce399a6bf..be2ce399a6bf mode 000000,100644..100644 --- a/contrib/libyaml/tests/CMakeLists.txt +++ b/contrib/libyaml/tests/CMakeLists.txt diff --cc contrib/libyaml/tests/Makefile.am index 000000000000,9597b7fef3ef..9597b7fef3ef mode 000000,100644..100644 --- a/contrib/libyaml/tests/Makefile.am +++ b/contrib/libyaml/tests/Makefile.am diff --cc contrib/libyaml/tests/ReadMe.md index 000000000000,bf09447f53f3..bf09447f53f3 mode 000000,100644..100644 --- a/contrib/libyaml/tests/ReadMe.md +++ b/contrib/libyaml/tests/ReadMe.md diff --cc contrib/libyaml/tests/example-deconstructor-alt.c index 000000000000,b29c0777b09a..b29c0777b09a mode 000000,100644..100644 --- a/contrib/libyaml/tests/example-deconstructor-alt.c +++ b/contrib/libyaml/tests/example-deconstructor-alt.c diff --cc contrib/libyaml/tests/example-deconstructor.c index 000000000000,e048ee6bf0ad..e048ee6bf0ad mode 000000,100644..100644 --- a/contrib/libyaml/tests/example-deconstructor.c +++ b/contrib/libyaml/tests/example-deconstructor.c diff --cc contrib/libyaml/tests/example-reformatter-alt.c index 000000000000,e7d006e4a64a..e7d006e4a64a mode 000000,100644..100644 --- a/contrib/libyaml/tests/example-reformatter-alt.c +++ b/contrib/libyaml/tests/example-reformatter-alt.c diff --cc contrib/libyaml/tests/example-reformatter.c index 000000000000,08f860c4ef2f..08f860c4ef2f mode 000000,100644..100644 --- a/contrib/libyaml/tests/example-reformatter.c +++ b/contrib/libyaml/tests/example-reformatter.c diff --cc contrib/libyaml/tests/run-all-tests.sh index 000000000000,9c92741eca38..9c92741eca38 mode 000000,100755..100755 --- a/contrib/libyaml/tests/run-all-tests.sh +++ b/contrib/libyaml/tests/run-all-tests.sh diff --cc contrib/libyaml/tests/run-dumper.c index 000000000000,04c5beeafa57..04c5beeafa57 mode 000000,100644..100644 --- a/contrib/libyaml/tests/run-dumper.c +++ b/contrib/libyaml/tests/run-dumper.c diff --cc contrib/libyaml/tests/run-emitter-test-suite.c index 000000000000,ba0f163ad39f..ba0f163ad39f mode 000000,100644..100644 --- a/contrib/libyaml/tests/run-emitter-test-suite.c +++ b/contrib/libyaml/tests/run-emitter-test-suite.c diff --cc contrib/libyaml/tests/run-emitter.c index 000000000000,3ffe4754b23e..3ffe4754b23e mode 000000,100644..100644 --- a/contrib/libyaml/tests/run-emitter.c +++ b/contrib/libyaml/tests/run-emitter.c diff --cc contrib/libyaml/tests/run-loader.c index 000000000000,8c36b668ce20..8c36b668ce20 mode 000000,100644..100644 --- a/contrib/libyaml/tests/run-loader.c +++ b/contrib/libyaml/tests/run-loader.c diff --cc contrib/libyaml/tests/run-parser-test-suite.c index 000000000000,5bdd66238ddd..5bdd66238ddd mode 000000,100644..100644 --- a/contrib/libyaml/tests/run-parser-test-suite.c +++ b/contrib/libyaml/tests/run-parser-test-suite.c diff --cc contrib/libyaml/tests/run-parser.c index 000000000000,13031121ae49..13031121ae49 mode 000000,100644..100644 --- a/contrib/libyaml/tests/run-parser.c +++ b/contrib/libyaml/tests/run-parser.c diff --cc contrib/libyaml/tests/run-scanner.c index 000000000000,2c79e7ccf380..2c79e7ccf380 mode 000000,100644..100644 --- a/contrib/libyaml/tests/run-scanner.c +++ b/contrib/libyaml/tests/run-scanner.c diff --cc contrib/libyaml/tests/test-reader.c index 000000000000,40f8199e009f..40f8199e009f mode 000000,100644..100644 --- a/contrib/libyaml/tests/test-reader.c +++ b/contrib/libyaml/tests/test-reader.c diff --cc contrib/libyaml/tests/test-version.c index 000000000000,0c598377f95f..0c598377f95f mode 000000,100644..100644 --- a/contrib/libyaml/tests/test-version.c +++ b/contrib/libyaml/tests/test-version.c diff --cc contrib/libyaml/yaml-0.1.pc.in index 000000000000,70c80084dd42..70c80084dd42 mode 000000,100644..100644 --- a/contrib/libyaml/yaml-0.1.pc.in +++ b/contrib/libyaml/yaml-0.1.pc.in diff --cc contrib/libyaml/yamlConfig.cmake.in index 000000000000,dd3f8ee25285..dd3f8ee25285 mode 000000,100644..100644 --- a/contrib/libyaml/yamlConfig.cmake.in +++ b/contrib/libyaml/yamlConfig.cmake.in diff --cc lib/Makefile index fcb4bd95fecb,000000000000..3417e7b30cb4 mode 100644,000000..100644 --- a/lib/Makefile +++ b/lib/Makefile @@@ -1,242 -1,0 +1,243 @@@ +.include + +# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many +# of the other libraries. These are built first with a .WAIT between them +# and the main list to avoid needing a SUBDIR_DEPEND line on every library +# naming just these few items. + +SUBDIR_BOOTSTRAP= \ + csu \ + .WAIT \ + libc \ + libc_nonshared \ + libcompiler_rt \ + ${_libclang_rt} \ + libc++ \ + libc++experimental \ + libcxxrt \ + libder \ + libdiff \ + libelf \ + libssp \ + libssp_nonshared \ + libsys \ + msun + +# The main list; please keep these sorted alphabetically. +# The only exception is sqlite3: we place it at the start of the list since it +# takes a long time to build and starting it first improves parallelism. + +SUBDIR= ${SUBDIR_BOOTSTRAP} \ + .WAIT \ + libsqlite3 \ + geom \ + lib9p \ + libalias \ + libarchive \ + libauditd \ + libbegemot \ + libblocksruntime \ + libbsddialog \ + libbsdstat \ + libbsm \ + libbz2 \ + libcalendar \ + libcam \ + libcapsicum \ + libcasper \ + libcompat \ + libcrypt \ + libdevctl \ + libdevdctl \ + libdevinfo \ + libdevstat \ + libdl \ + libdwarf \ + libedit \ + libelftc \ + libevent1 \ + libexecinfo \ + libexpat \ + libfetch \ + libgcc_eh \ + libgcc_s \ + libgeom \ + libifconfig \ + libipsec \ + libiscsiutil \ + libjail \ + libkiconv \ + libkldelf \ + libkvm \ + liblua \ + liblzma \ + libmemstat \ + libmd \ + libmixer \ + libmt \ + lib80211 \ + libnetbsd \ + libnetmap \ + libnv \ + libnvmf \ + libopenbsd \ + libpam \ + libpathconv \ + libpcap \ + libpjdlog \ + libproc \ + libprocstat \ + libregex \ + librpcsvc \ + librss \ + librt \ + librtld_db \ + libsbuf \ + libsmb \ + libstdbuf \ + libstdthreads \ + libsysdecode \ + libtacplus \ + libthr \ + libthread_db \ + libucl \ + libufs \ + libugidfw \ + libulog \ + libutil \ + ${_libvgl} \ + libwrap \ + libxo \ + liby \ ++ libyaml \ + libz \ + libzstd \ + ncurses \ + nss_tacplus + +# Inter-library dependencies. When the makefile for a library contains LDADD +# libraries, those libraries should be listed as build order dependencies here. + +SUBDIR_DEPEND_geom= libufs +SUBDIR_DEPEND_googletest= libregex +SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd +SUBDIR_DEPEND_libauditdm= libbsm +SUBDIR_DEPEND_libbsddialog= ncurses +SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} +SUBDIR_DEPEND_libc++:= libcxxrt +# libssp_nonshared doesn't need to be linked into libc on every arch, but it is +# small enough to build that this bit of serialization is likely insignificant. +SUBDIR_DEPEND_libc= libsys libcompiler_rt libssp_nonshared +SUBDIR_DEPEND_libcam= libsbuf +SUBDIR_DEPEND_libcasper= libnv +SUBDIR_DEPEND_libcrypt= libmd +SUBDIR_DEPEND_libdevstat= libkvm +SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil +SUBDIR_DEPEND_libedit= ncurses +SUBDIR_DEPEND_libgeom= libexpat libsbuf +SUBDIR_DEPEND_librpcsec_gss= libgssapi +SUBDIR_DEPEND_libmagic= libz +SUBDIR_DEPEND_libmemstat= libkvm +SUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err} +SUBDIR_DEPEND_libpjdlog= libutil +SUBDIR_DEPEND_libprocstat= libkvm libutil +SUBDIR_DEPEND_libradius= libmd +SUBDIR_DEPEND_libsmb= libkiconv +# See comment above about libssp_nonshared +SUBDIR_DEPEND_libsys= libcompiler_rt libssp_nonshared +SUBDIR_DEPEND_libtacplus= libmd +SUBDIR_DEPEND_libulog= libmd +SUBDIR_DEPEND_libunbound= ${_libldns} +SUBDIR_DEPEND_liblzma= libthr +.if ${MK_OFED} != "no" +SUBDIR_DEPEND_libpcap= ofed +.endif +SUBDIR_DEPEND_nss_tacplus= libtacplus + +# NB: keep these sorted by MK_* knobs + +SUBDIR.${MK_BEARSSL}+= libbearssl libsecureboot +SUBDIR.${MK_BLACKLIST}+=libblacklist +SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp +SUBDIR.${MK_BSNMP}+= libbsnmp + +.if !defined(COMPAT_LIBCOMPAT) +.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \ + ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no" +SUBDIR+= clang +.endif +.endif + +SUBDIR.${MK_CUSE}+= libcuse +SUBDIR.${MK_TOOLCHAIN}+=libpe +SUBDIR.${MK_DIALOG}+= libdpv libfigpar +SUBDIR.${MK_FDT}+= libfdt +SUBDIR.${MK_FILE}+= libmagic +SUBDIR.${MK_GPIO}+= libgpio +SUBDIR.${MK_GSSAPI}+= libgssapi librpcsec_gss +SUBDIR.${MK_ICONV}+= libiconv_modules +.if ${MK_MITKRB5} == "no" +SUBDIR.${MK_KERBEROS_SUPPORT}+= libcom_err +.endif +SUBDIR.${MK_LDNS}+= libldns +SUBDIR.${MK_STATS}+= libstats + +# The libraries under libclang_rt can only be built by clang. +.if (${COMPILER_TYPE} == "clang" || make(clean) || make(cleandir)) && \ + ${MK_CLANG} != "no" +_libclang_rt= libclang_rt +.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all) +.error Requested build with sanitizers but cannot build runtime libraries! +.endif + +# This construct disables libefivar for 32-bit build. +.if ${MACHINE_CPUARCH} != "i386" +SUBDIR.${MK_EFI}+= libefivar +.endif +SUBDIR.${MK_GOOGLETEST}+= googletest +SUBDIR.${MK_NETGRAPH}+= libnetgraph +SUBDIR.${MK_NIS}+= libypclnt + +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_libvgl= libvgl +.endif + +.if ${MACHINE_CPUARCH} == "aarch64" +SUBDIR.${MK_PMC}+= libopencsd +.endif + +.if ${MACHINE_CPUARCH} == "amd64" +SUBDIR.${MK_PMC}+= libipt +.endif + +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \ + ${MACHINE_CPUARCH} == "riscv" +SUBDIR.${MK_BHYVE}+= libvmmapi +.endif + +.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm" +SUBDIR.${MK_OPENMP}+= libomp +.endif +.if ${MK_USB} != "no" +SUBDIR.${MK_OPENSSH}+= libcbor libfido2 +.endif +SUBDIR.${MK_OPENSSL}+= libmp +SUBDIR.${MK_PF}+= libpfctl +SUBDIR.${MK_PMC}+= libpmc libpmcstat +SUBDIR.${MK_RADIUS_SUPPORT}+= libradius +SUBDIR.${MK_SENDMAIL}+= libmilter libsm libsmdb libsmutil +SUBDIR.${MK_TELNET}+= libtelnet +SUBDIR.${MK_TESTS_SUPPORT}+= atf +SUBDIR.${MK_TESTS_SUPPORT}+= liblutok +SUBDIR.${MK_TESTS}+= tests +SUBDIR.${MK_UNBOUND}+= libunbound +SUBDIR.${MK_USB}+= libusbhid libusb +SUBDIR.${MK_OFED}+= ofed +SUBDIR.${MK_VERIEXEC}+= libveriexec +SUBDIR.${MK_ZFS}+= libbe + +.if !make(install) +SUBDIR_PARALLEL= +.endif + +.include diff --cc lib/libyaml/Makefile index 000000000000,000000000000..6acd34f178a9 new file mode 100644 --- /dev/null +++ b/lib/libyaml/Makefile @@@ -1,0 -1,0 +1,29 @@@ ++LIBYAML_DIR= ${SRCTOP}/contrib/libyaml ++ ++PACKAGE=lib${LIB} ++LIB= yaml ++PRIVATELIB= true ++SHLIB_MAJOR= 1 ++SRCS= api.c \ ++ dumper.c \ ++ emitter.c \ ++ loader.c \ ++ parser.c \ ++ reader.c \ ++ scanner.c \ ++ writer.c ++ ++.PATH: ${LIBYAML_DIR}/src \ ++ ${LIBYAML_DIR}/include ++ ++INCS= yaml.h ++ ++WARNS?= 1 ++CFLAGS+= -I${LIBYAML_DIR}/include \ ++ -I${LIBYAML_DIR}/src \ ++ -DYAML_VERSION_STRING=\"0.2.5\" \ ++ -DYAML_VERSION_MAJOR=0 \ ++ -DYAML_VERSION_MINOR=2 \ ++ -DYAML_VERSION_PATCH=5 ++ ++.include diff --cc share/mk/src.libnames.mk index c5ff899ac9dc,000000000000..f21d519160d2 mode 100644,000000..100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@@ -1,917 -1,0 +1,918 @@@ +# +# The include file define library names suitable +# for INTERNALLIB and PRIVATELIB definition + +.if !target(____) +.error src.libnames.mk cannot be included directly. +.endif + +.if !target(____) +____: .NOTMAIN + +.include + +_PRIVATELIBS= \ + atf_c \ + atf_cxx \ + auditd \ + bsddialog \ + bsdstat \ + cbor \ + devdctl \ + event1 \ + fido2 \ + gmock \ + gtest \ + gmock_main \ + gtest_main \ + heimipcc \ + heimipcs \ + kldelf \ + ldns \ + sqlite3 \ + ssh \ + ucl \ + unbound \ ++ yaml \ + zstd + +# Let projects based on FreeBSD append to _PRIVATELIBS +# by maintaining their own LOCAL_PRIVATELIBS list. +_PRIVATELIBS+= ${LOCAL_PRIVATELIBS} + +_INTERNALLIBS= \ + amu \ + apputils \ + bsnmptools \ + c_nossp_pic \ + cron \ + der \ + diff \ + elftc \ + fdt \ + fifolog \ + ifconfig \ + ipf \ + iscsiutil \ + kadmin_common \ + kprop_util \ + krb5apputils \ + krb5ss \ + lpr \ + lua \ + lutok \ + netbsd \ + ntp \ + ntpevent \ + nvmf \ + openbsd \ + opts \ + parse \ + pe \ + pfctl \ + pkgecc \ + pmcstat \ + sl \ + sm \ + smdb \ + smutil \ + telnet \ + vers \ + wpaap \ + wpacommon \ + wpacrypto \ + wpadrivers \ + wpaeap_common \ + wpaeap_peer \ + wpaeap_server \ + wpaeapol_auth \ + wpaeapol_supp \ + wpal2_packet \ + wpapasn \ + wparadius \ + wparsn_supp \ + wpatls \ + wpautils \ + wpawps + +# Let projects based on FreeBSD append to _INTERNALLIBS +# by maintaining their own LOCAL_INTERNALLIBS list. +_INTERNALLIBS+= ${LOCAL_INTERNALLIBS} + +_LIBRARIES= \ + ${_PRIVATELIBS} \ + ${_INTERNALLIBS} \ + ${LOCAL_LIBRARIES} \ + 80211 \ + 9p \ + alias \ + archive \ + asn1 \ + avl \ + BlocksRuntime \ + be \ + begemot \ + bluetooth \ + bsdxml \ + bsm \ + bsnmp \ + bz2 \ + c \ + c_pic \ + calendar \ + cam \ + casper \ + cap_dns \ + cap_fileargs \ + cap_grp \ + cap_net \ + cap_netdb \ + cap_pwd \ + cap_sysctl \ + cap_syslog \ + com_err \ + compiler_rt \ + crypt \ + crypto \ + ctf \ + cuse \ + cxxrt \ + devctl \ + devdctl \ + devinfo \ + devstat \ + dialog \ + dl \ + dpv \ + dtrace \ + dwarf \ + edit \ + efivar \ + elf \ + execinfo \ + fetch \ + figpar \ + formw \ + geom \ + gpio \ + gssapi \ + gssapi_krb5 \ + gssrpc \ + hdb \ + heimbase \ + heimntlm \ + heimsqlite \ + hx509 \ + icp \ + ipsec \ + ipt \ + jail \ + k5crypto \ + kadm5 \ + kadmin_common \ + kafs5 \ + kdb5 \ + kdc \ + kiconv \ + krad \ + krb5 \ + krb5profile \ + krb5support \ + kvm \ + l \ + lzma \ + m \ + magic \ + md \ + memstat \ + mp \ + mt \ + ncursesw \ + netgraph \ + netmap \ + ngatm \ + nv \ + nvpair \ + opencsd \ + pam \ + panel \ + panelw \ + pcap \ + pcsclite \ + pjdlog \ + pmc \ + proc \ + procstat \ + pthread \ + radius \ + regex \ + roken \ + rpcsec_gss \ + rpcsvc \ + rt \ + rtld_db \ + sbuf \ + sdp \ + sm \ + smb \ + spl \ + ssl \ + ssp_nonshared \ + stats \ + stdthreads \ + supcplusplus \ + sys \ + sysdecode \ + tacplus \ + termcapw \ + tinfow \ + tpool \ + ufs \ + ugidfw \ + ulog \ + umem \ + usb \ + usbhid \ + util \ + uutil \ + verto \ + vmmapi \ + wind \ + wrap \ + xo \ + y \ + ypclnt \ + z \ + zdb \ + zfs_core \ + zfs \ + zfsbootenv \ + zpool \ + zutil + +.if ${MK_KERBEROS} != "no" && ${MK_MITKRB5} != "no" +_LIBRARIES+= \ + kadm5clnt_mit \ + kadm5srv_mit +.else +_LIBRARIES+= \ + kadm5clnt \ + kadm5srv +.endif + *** 656 LINES SKIPPED *** From nobody Thu Jun 26 07:15:44 2025 X-Original-To: dev-commits-src-main@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 4bSVMj1q9hz60BHf; Thu, 26 Jun 2025 07:15: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 4bSVMj1T9tz42wn; Thu, 26 Jun 2025 07:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750922145; 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=U1q8RLcZpKcrWTHGvwCBnvJcKNN4efNmyCYM7tK+5A8=; b=ATpBMg2CHL7FnczhtbEds37iAO4QE8LF+BNETE/vcxlBhic6lqORYUd6Oo077cT+YqZABj RQmVRaRrOw0rZ6+ZRJET0/B1sfoH9vGKlyA51zc8NngJc8geNp9T1klvgR/B9hvrabXP6n pdT21OrFmDeLs6qMuAlZKJPeANUVlMESkxcVEsIXZ+Hmf4WAgqqPv3k2VqnZyIT/ZZlMLu 4VSKFehKKiXfb4lJRy3aDaDzZ16LxhSdZR/zFwp+rU0zdiZuqBraYQg/w49uIl17EN23s8 TYP/7+4Jbo7V7ky69YYqUP9Lo4ZjGsp/ePyUZuEu+QaL16BBFcCDJAj41bJ5Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750922145; 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=U1q8RLcZpKcrWTHGvwCBnvJcKNN4efNmyCYM7tK+5A8=; b=rKrkOs3hOQ9lQ3aUZ6+F1lEhWJE9e7lUJz2Ri4nY9ZjGTNIMHs49rCJ0KZCuIrgwsUv2wL Kdx4p0flPObS5WQlhPX80vJfz0ZcuaaAcsaqVAbMV64RhPdsI8/nIqJ9gPHfvDK6ZrgS7o qyGIt7GCu9m91rIIYxfPST2jopYlGZ6xkYLYl33iR8Bj1wS6IVywCvd0VVu0JslA9rlF7x Qhl69JR0gTKQFTFTBbrwMA4S/GiJR8FwuA7KjUKRd7u3cW8R/iohM8pJ+sWTGhbTjIHzI4 /7GSyFKchz4JDrx822HDdFUc+E03vuPpigz0tCEfRagOeushe3eZ90ZhkyxhMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750922145; a=rsa-sha256; cv=none; b=erFmd3wjtJ2Rq8QDhqyFSQJINPx0PPX5K0tPCgYywVOHUp9atMdTeFgjWu/eSClhtQ9E3s +tXqZggsxxN0Ru2Whn8htxrDTpq3R+t30O39SQ31sEHUfe/Z2sSKQSNWX9BfihFgsZjewe TbChbpUNSg8eQ9vw22KLq4ipduu8tibOXOHU/KxCWhcAUQhJgh+LwMUbs8Zt5jfT/BXB/y FjqkkkRjh9WWrcso+x2EnLRcbHzosc10L4qvJocX/OmJgrpxkLVy7sAv4j6nbNK5vo6fTf dLDtgY/bGEZHAj/Gul0RzUeqiCH/IoI5up5hzPtJXdcKX5YZ3OvNm5h0Vrtscw== 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 4bSVMj13TfzsmD; Thu, 26 Jun 2025 07:15: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 55Q7FjMm042553; Thu, 26 Jun 2025 07:15:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q7Fi6F042551; Thu, 26 Jun 2025 07:15:44 GMT (envelope-from git) Date: Thu, 26 Jun 2025 07:15:44 GMT Message-Id: <202506260715.55Q7Fi6F042551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 2bc180ef045e - main - lyaml: vendor import lua bindings for libyaml List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bc180ef045e5911cce0cea1c2a139cffd2b577a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2bc180ef045e5911cce0cea1c2a139cffd2b577a commit 2bc180ef045e5911cce0cea1c2a139cffd2b577a Merge: 0f5c86ddb025 95286bbb7907 Author: Baptiste Daroussin AuthorDate: 2025-06-26 07:12:41 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 07:15:08 +0000 lyaml: vendor import lua bindings for libyaml contrib/lyaml/.gitignore | 9 + contrib/lyaml/.luacov | 8 + contrib/lyaml/AUTHORS | 6 + contrib/lyaml/LICENSE | 27 + contrib/lyaml/NEWS.md | 352 ++++++++++++ contrib/lyaml/README.md | 232 ++++++++ contrib/lyaml/build-aux/config.ld.in | 34 ++ contrib/lyaml/build-aux/luke | 672 ++++++++++++++++++++++ contrib/lyaml/doc/index.html | 97 ++++ contrib/lyaml/doc/ldoc.css | 303 ++++++++++ contrib/lyaml/doc/modules/lyaml.explicit.html | 267 +++++++++ contrib/lyaml/doc/modules/lyaml.functional.html | 236 ++++++++ contrib/lyaml/doc/modules/lyaml.html | 224 ++++++++ contrib/lyaml/doc/modules/lyaml.implicit.html | 533 +++++++++++++++++ contrib/lyaml/ext/yaml/emitter.c | 459 +++++++++++++++ contrib/lyaml/ext/yaml/lyaml.h | 161 ++++++ contrib/lyaml/ext/yaml/parser.c | 410 +++++++++++++ contrib/lyaml/ext/yaml/scanner.c | 340 +++++++++++ contrib/lyaml/ext/yaml/yaml.c | 66 +++ contrib/lyaml/lib/lyaml/explicit.lua | 120 ++++ contrib/lyaml/lib/lyaml/functional.lua | 87 +++ contrib/lyaml/lib/lyaml/implicit.lua | 283 +++++++++ contrib/lyaml/lib/lyaml/init.lua | 534 +++++++++++++++++ contrib/lyaml/lukefile | 47 ++ contrib/lyaml/lyaml-6.2.8-1.rockspec | 59 ++ contrib/lyaml/spec/ext_yaml_emitter_spec.yaml | 239 ++++++++ contrib/lyaml/spec/ext_yaml_parser_spec.yaml | 391 +++++++++++++ contrib/lyaml/spec/ext_yaml_scanner_spec.yaml | 380 ++++++++++++ contrib/lyaml/spec/lib_lyaml_functional_spec.yaml | 121 ++++ contrib/lyaml/spec/lib_lyaml_spec.yaml | 343 +++++++++++ contrib/lyaml/spec/spec_helper.lua | 277 +++++++++ libexec/flua/Makefile | 1 + libexec/flua/liblyaml/Makefile | 22 + 33 files changed, 7340 insertions(+) diff --cc contrib/lyaml/.gitignore index 000000000000,000000000000..19d7cbb6dd7d new file mode 100644 --- /dev/null +++ b/contrib/lyaml/.gitignore @@@ -1,0 -1,0 +1,9 @@@ ++*~ ++*.o ++*.so ++*.src.rock ++/ChangeLog ++/build-aux/config.ld ++/luacov.*.out ++/lyaml-*.tar.gz ++/TAGS diff --cc contrib/lyaml/.luacov index 000000000000,0aa52d25e0ea..0aa52d25e0ea mode 000000,100644..100644 --- a/contrib/lyaml/.luacov +++ b/contrib/lyaml/.luacov diff --cc contrib/lyaml/AUTHORS index 000000000000,1eb673371bf7..1eb673371bf7 mode 000000,100644..100644 --- a/contrib/lyaml/AUTHORS +++ b/contrib/lyaml/AUTHORS diff --cc contrib/lyaml/LICENSE index 000000000000,402e64dfec29..402e64dfec29 mode 000000,100644..100644 --- a/contrib/lyaml/LICENSE +++ b/contrib/lyaml/LICENSE diff --cc contrib/lyaml/NEWS.md index 000000000000,32611d83671a..32611d83671a mode 000000,100644..100644 --- a/contrib/lyaml/NEWS.md +++ b/contrib/lyaml/NEWS.md diff --cc contrib/lyaml/README.md index 000000000000,000000000000..d1e96845ddfa new file mode 100644 --- /dev/null +++ b/contrib/lyaml/README.md @@@ -1,0 -1,0 +1,232 @@@ ++LYAML ++===== ++ ++Copyright (C) 2013-2022 Gary V. Vaughan ++ ++[![License](https://img.shields.io/:license-mit-blue.svg)](https://mit-license.org) ++[![workflow status](https://github.com/gvvaughan/lyaml/actions/workflows/spec.yml/badge.svg?branch=release-v6.2.8)](https://github.com/gvvaughan/lyaml/actions) ++[![codecov.io](https://codecov.io/github/gvvaughan/lyaml/coverage.svg?branch=release-v6.2.8)](https://codecov.io/github/gvvaughan/lyaml?branch=release-v6.2.8) ++ ++[LibYAML] binding for [Lua], with a fast C implementation ++for converting between [%YAML 1.1][yaml11] and [Lua] tables, ++and a low-level [YAML] event parser for implementing more ++intricate [YAML] document loading. ++ ++Usage ++----- ++ ++### High Level API ++ ++These functions quickly convert back and forth between Lua tables ++and [%YAML 1.1][yaml11] format strings. ++ ++```lua ++local lyaml = require "lyaml" ++local t = lyaml.load (YAML-STRING, [OPTS-TABLE]) ++local yamlstr = lyaml.dump (LUA-TABLE, [OPTS-TABLE]) ++local null = lyaml.null () ++``` ++ ++#### `lyaml.load` ++ ++`lyaml.load` accepts a YAML string for parsing. If the YAML string contains ++multiple documents, only the first document will be returned by default. To ++return multiple documents as a table, set `all = true` in the second ++argument OPTS-TABLE. ++ ++```lua ++lyaml.load("foo: bar") ++--> { foo = "bar" } ++ ++lyaml.load("foo: bar", { all = true }) ++--> { { foo = "bar" } } ++ ++multi_doc_yaml = [[ ++--- ++one ++... ++--- ++two ++... ++]] ++ ++lyaml.load(multi_doc_yaml) ++--> "one" ++ ++lyaml.load(multi_doc_yaml, { all = true }) ++--> { "one", "two" } ++``` ++ ++You can supply an alternative function for converting implicit plain ++scalar values in the `implicit_scalar` field of the OPTS-TABLE argument; ++otherwise a default is composed from the functions in the `lyaml.implicit` ++module. ++ ++You can also supply an alternative table for coverting explicitly tagged ++scalar values in the `explicit_scalar` field of the OPTS-TABLE argument; ++otherwise all supported tags are parsed by default using the functions ++from the `lyaml.explicit` module. ++ ++#### `lyaml.dump` ++ ++`lyaml.dump` accepts a table of values to dump. Each value in the table ++represents a single YAML document. To dump a table of lua values this means ++the table must be wrapped in another table (the outer table represents the ++YAML documents, the inner table is the single document table to dump). ++ ++```lua ++lyaml.dump({ { foo = "bar" } }) ++--> --- ++--> foo: bar ++--> ... ++ ++lyaml.dump({ "one", "two" }) ++--> --- one ++--> ... ++--> --- two ++--> ... ++``` ++ ++If you need to round-trip load a dumped document, and you used a custom ++function for converting implicit scalars, then you should pass that same ++function in the `implicit_scalar` field of the OPTS-TABLE argument to ++`lyaml.dump` so that it can quote strings that might otherwise be ++implicitly converted on reload. ++ ++#### Nil Values ++ ++[Lua] tables treat `nil` valued keys as if they were not there, ++where [YAML] explicitly supports `null` values (and keys!). Lyaml ++will retain [YAML] `null` values as `lyaml.null ()` by default, ++though it is straight forward to wrap the low level APIs to use `nil`, ++subject to the usual caveats of how nil values work in [Lua] tables. ++ ++ ++### Low Level APIs ++ ++```lua ++local emitter = require ("yaml").emitter () ++ ++emitter.emit {type = "STREAM_START"} ++for _, event in ipairs (event_list) do ++ emitter.emit (event) ++end ++str = emitter.emit {type = "STREAM_END"} ++``` ++ ++The `yaml.emitter` function returns an emitter object that has a ++single emit function, which you call with event tables, the last ++`STREAM_END` event returns a string formatted as a [YAML 1.1][yaml11] ++document. ++ ++```lua ++local iter = require ("yaml").scanner (YAML-STRING) ++ ++for token_table in iter () do ++ -- process token table ++end ++``` ++ ++Each time the iterator returned by `scanner` is called, it returns ++a table describing the next token of YAML-STRING. See LibYAML's ++[yaml.h] for details of the contents and semantics of the various ++tokens produced by `yaml_parser_scan`, the underlying call made by ++the iterator. ++ ++[LibYAML] implements a fast parser in C using `yaml_parser_scan`, which ++is also bound to lyaml, and easier to use than the token API above: ++ ++```lua ++local iter = require ("yaml").parser (YAML-STRING) ++ ++for event_table in iter () do ++ -- process event table ++end ++``` ++ ++Each time the iterator returned by `parser` is called, it returns ++a table describing the next event from the "Parse" process of the ++"Parse, Compose, Construct" processing model described in the ++[YAML 1.1][yaml11] specification using [LibYAML]. ++ ++Implementing the remaining "Compose" and "Construct" processes in ++[Lua] is left as an exercise for the reader -- though, unlike the ++high-level API, `lyaml.parser` exposes all details of the input ++stream events, such as line and column numbers. ++ ++ ++Installation ++------------ ++ ++There's no need to download an [lyaml] release, or clone the git repo, ++unless you want to modify the code. If you use [LuaRocks], you can ++use it to install the latest release from its repository: ++ ++ luarocks --server=http://rocks.moonscript.org install lyaml ++ ++Or from the rockspec in a release tarball: ++ ++ luarocks make lyaml-?-1.rockspec ++ ++To install current git master from [GitHub][lyaml] (for testing): ++ ++ luarocks install http://raw.github.com/gvvaughan/lyaml/master/lyaml-git-1.rockspec ++ ++To install without [LuaRocks], clone the sources from the ++[repository][lyaml], and then run the following commands: ++ ++```sh ++cd lyaml ++build-aux/luke LYAML_DIR=LIBYAML-INSTALL-PREFIX ++sudo build-aux/luke PREFIX=LYAML-INSTALL-PREFIX install ++specl -v1freport spec/*_spec.yaml ++``` ++ ++The dependencies are listed in the dependencies entry of the file ++[rockspec][L15]. ++ ++ ++Bug reports and code contributions ++---------------------------------- ++ ++This library is maintained by its users. ++ ++Please make bug reports and suggestions as [GitHub Issues][issues]. ++Pull requests are especially appreciated. ++ ++But first, please check that your issue has not already been reported by ++someone else, and that it is not already fixed by [master][lyaml] in ++preparation for the next release (see Installation section above for how ++to temporarily install master with [LuaRocks][]). ++ ++There is no strict coding style, but please bear in mind the following ++points when proposing changes: ++ ++0. Follow existing code. There are a lot of useful patterns and avoided ++ traps there. ++ ++1. 3-character indentation using SPACES in Lua sources: It makes rogue ++ TABs easier to see, and lines up nicely with 'if' and 'end' keywords. ++ ++2. Simple strings are easiest to type using single-quote delimiters, ++ saving double-quotes for where a string contains apostrophes. ++ ++3. Save horizontal space by only using SPACEs where the parser requires ++ them. ++ ++4. Use vertical space to separate out compound statements to help the ++ coverage reports discover untested lines. ++ ++5. Prefer explicit string function calls over object methods, to mitigate ++ issues with monkey-patching in caller environment. ++ ++ ++[issues]: http://github.com/gvvaughas/lyaml/issues ++[libyaml]: http://pyyaml.org/wiki/LibYAML ++[lua]: http://www.lua.org ++[luarocks]: http://www.luarocks.org ++[lyaml]: http://github.com/gvvaughan/lyaml ++[L15]: http://github.com/gvvaughan/lyaml/blob/master/lyaml-git-1.rockspec#L15 ++[yaml.h]: http://pyyaml.org/browser/libyaml/branches/stable/include/yaml.h ++[yaml]: http://yaml.org ++[yaml11]: http://yaml.org/spec/1.1/ diff --cc contrib/lyaml/build-aux/config.ld.in index 000000000000,0d55b9e94c30..0d55b9e94c30 mode 000000,100644..100644 --- a/contrib/lyaml/build-aux/config.ld.in +++ b/contrib/lyaml/build-aux/config.ld.in diff --cc contrib/lyaml/build-aux/luke index 000000000000,3d61f784cbca..3d61f784cbca mode 000000,100755..100755 --- a/contrib/lyaml/build-aux/luke +++ b/contrib/lyaml/build-aux/luke diff --cc contrib/lyaml/doc/index.html index 000000000000,bf7a957f51bd..bf7a957f51bd mode 000000,100644..100644 --- a/contrib/lyaml/doc/index.html +++ b/contrib/lyaml/doc/index.html diff --cc contrib/lyaml/doc/ldoc.css index 000000000000,52c4ad2bd8a2..52c4ad2bd8a2 mode 000000,100644..100644 --- a/contrib/lyaml/doc/ldoc.css +++ b/contrib/lyaml/doc/ldoc.css diff --cc contrib/lyaml/doc/modules/lyaml.explicit.html index 000000000000,2667c4e006b2..2667c4e006b2 mode 000000,100644..100644 --- a/contrib/lyaml/doc/modules/lyaml.explicit.html +++ b/contrib/lyaml/doc/modules/lyaml.explicit.html diff --cc contrib/lyaml/doc/modules/lyaml.functional.html index 000000000000,b003a961ff28..b003a961ff28 mode 000000,100644..100644 --- a/contrib/lyaml/doc/modules/lyaml.functional.html +++ b/contrib/lyaml/doc/modules/lyaml.functional.html diff --cc contrib/lyaml/doc/modules/lyaml.html index 000000000000,2deb6a4b6be7..2deb6a4b6be7 mode 000000,100644..100644 --- a/contrib/lyaml/doc/modules/lyaml.html +++ b/contrib/lyaml/doc/modules/lyaml.html diff --cc contrib/lyaml/doc/modules/lyaml.implicit.html index 000000000000,935579f705c6..935579f705c6 mode 000000,100644..100644 --- a/contrib/lyaml/doc/modules/lyaml.implicit.html +++ b/contrib/lyaml/doc/modules/lyaml.implicit.html diff --cc contrib/lyaml/ext/yaml/emitter.c index 000000000000,b71fd14f4c1d..b71fd14f4c1d mode 000000,100644..100644 --- a/contrib/lyaml/ext/yaml/emitter.c +++ b/contrib/lyaml/ext/yaml/emitter.c diff --cc contrib/lyaml/ext/yaml/lyaml.h index 000000000000,9892a48ea4c4..9892a48ea4c4 mode 000000,100644..100644 --- a/contrib/lyaml/ext/yaml/lyaml.h +++ b/contrib/lyaml/ext/yaml/lyaml.h diff --cc contrib/lyaml/ext/yaml/parser.c index 000000000000,3136abd49045..3136abd49045 mode 000000,100644..100644 --- a/contrib/lyaml/ext/yaml/parser.c +++ b/contrib/lyaml/ext/yaml/parser.c diff --cc contrib/lyaml/ext/yaml/scanner.c index 000000000000,6d7276517f42..6d7276517f42 mode 000000,100644..100644 --- a/contrib/lyaml/ext/yaml/scanner.c +++ b/contrib/lyaml/ext/yaml/scanner.c diff --cc contrib/lyaml/ext/yaml/yaml.c index 000000000000,54478610134f..54478610134f mode 000000,100644..100644 --- a/contrib/lyaml/ext/yaml/yaml.c +++ b/contrib/lyaml/ext/yaml/yaml.c diff --cc contrib/lyaml/lib/lyaml/explicit.lua index 000000000000,98a38331ead6..98a38331ead6 mode 000000,100644..100644 --- a/contrib/lyaml/lib/lyaml/explicit.lua +++ b/contrib/lyaml/lib/lyaml/explicit.lua diff --cc contrib/lyaml/lib/lyaml/functional.lua index 000000000000,556e9489505a..556e9489505a mode 000000,100644..100644 --- a/contrib/lyaml/lib/lyaml/functional.lua +++ b/contrib/lyaml/lib/lyaml/functional.lua diff --cc contrib/lyaml/lib/lyaml/implicit.lua index 000000000000,fe58025b560d..fe58025b560d mode 000000,100644..100644 --- a/contrib/lyaml/lib/lyaml/implicit.lua +++ b/contrib/lyaml/lib/lyaml/implicit.lua diff --cc contrib/lyaml/lib/lyaml/init.lua index 000000000000,95e4036ea7c9..95e4036ea7c9 mode 000000,100644..100644 --- a/contrib/lyaml/lib/lyaml/init.lua +++ b/contrib/lyaml/lib/lyaml/init.lua diff --cc contrib/lyaml/lukefile index 000000000000,318281fd78e7..318281fd78e7 mode 000000,100644..100644 --- a/contrib/lyaml/lukefile +++ b/contrib/lyaml/lukefile diff --cc contrib/lyaml/lyaml-6.2.8-1.rockspec index 000000000000,dce9e45a56cf..dce9e45a56cf mode 000000,100644..100644 --- a/contrib/lyaml/lyaml-6.2.8-1.rockspec +++ b/contrib/lyaml/lyaml-6.2.8-1.rockspec diff --cc contrib/lyaml/spec/ext_yaml_emitter_spec.yaml index 000000000000,385d58f7de3c..385d58f7de3c mode 000000,100644..100644 --- a/contrib/lyaml/spec/ext_yaml_emitter_spec.yaml +++ b/contrib/lyaml/spec/ext_yaml_emitter_spec.yaml diff --cc contrib/lyaml/spec/ext_yaml_parser_spec.yaml index 000000000000,2438c42188e0..2438c42188e0 mode 000000,100644..100644 --- a/contrib/lyaml/spec/ext_yaml_parser_spec.yaml +++ b/contrib/lyaml/spec/ext_yaml_parser_spec.yaml diff --cc contrib/lyaml/spec/ext_yaml_scanner_spec.yaml index 000000000000,4d8e633d2cc2..4d8e633d2cc2 mode 000000,100644..100644 --- a/contrib/lyaml/spec/ext_yaml_scanner_spec.yaml +++ b/contrib/lyaml/spec/ext_yaml_scanner_spec.yaml diff --cc contrib/lyaml/spec/lib_lyaml_functional_spec.yaml index 000000000000,cfd8676f0176..cfd8676f0176 mode 000000,100644..100644 --- a/contrib/lyaml/spec/lib_lyaml_functional_spec.yaml +++ b/contrib/lyaml/spec/lib_lyaml_functional_spec.yaml diff --cc contrib/lyaml/spec/lib_lyaml_spec.yaml index 000000000000,f6c7e1ef4bed..f6c7e1ef4bed mode 000000,100644..100644 --- a/contrib/lyaml/spec/lib_lyaml_spec.yaml +++ b/contrib/lyaml/spec/lib_lyaml_spec.yaml diff --cc contrib/lyaml/spec/spec_helper.lua index 000000000000,1ba7a3a7559f..1ba7a3a7559f mode 000000,100644..100644 --- a/contrib/lyaml/spec/spec_helper.lua +++ b/contrib/lyaml/spec/spec_helper.lua diff --cc libexec/flua/Makefile index 770f05bf2938,000000000000..86d27c0653d4 mode 100644,000000..100644 --- a/libexec/flua/Makefile +++ b/libexec/flua/Makefile @@@ -1,38 -1,0 +1,39 @@@ +.include + +SUBDIR+= libfreebsd +SUBDIR+= libhash +SUBDIR+= libjail +SUBDIR+= libucl ++SUBDIR+= liblyaml + +LUASRC?= ${SRCTOP}/contrib/lua/src +.PATH: ${LUASRC} + +PROG= flua +WARNS?= 3 + +CWARNFLAGS.gcc+= -Wno-format-nonliteral + +LIBADD= lua + +# Entry point +SRCS+= lua.c + +# FreeBSD Extensions +.PATH: ${.CURDIR}/modules +SRCS+= linit_flua.c +SRCS+= lfs.c lposix.c lfbsd.c + +CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC} +CFLAGS+= -DLUA_PROGNAME="\"${PROG}\"" + +# readline bits; these aren't needed if we're building a bootstrap flua, as we +# don't expect that one to see any REPL usage. +.if !defined(BOOTSTRAPPING) +CFLAGS+= -DLUA_USE_READLINE +CFLAGS+= -I${SRCTOP}/lib/libedit -I${SRCTOP}/contrib/libedit +LIBADD+= edit +LDFLAGS+= -Wl,-E +.endif + +.include diff --cc libexec/flua/liblyaml/Makefile index 000000000000,000000000000..e7a89d09bb9e new file mode 100644 --- /dev/null +++ b/libexec/flua/liblyaml/Makefile @@@ -1,0 -1,0 +1,22 @@@ ++SHLIB_NAME= yaml.so ++ ++WARNS= 1 ++LYAMLSRC?= ${SRCTOP}/contrib/lyaml ++.PATH: ${LYAMLSRC}/ext/yaml ${LYAMLSRC}/lib/lyaml ++SRCS= emitter.c \ ++ parser.c \ ++ scanner.c \ ++ yaml.c ++CFLAGS+= \ ++ -I${LYAMLSRC}/ext/yaml \ ++ -I${SRCTOP}/contrib/libyaml/include \ ++ -DVERSION=\"6.2.8\" ++LIBADD+= yaml ++ ++FILES= explicit.lua \ ++ functional.lua \ ++ implicit.lua \ ++ init.lua ++FILESDIR= ${SHAREDIR}/flua/lyaml ++ ++.include From nobody Thu Jun 26 07:24:34 2025 X-Original-To: dev-commits-src-main@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 4bSVYt4GRvz60BK1; Thu, 26 Jun 2025 07:24:34 +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 4bSVYt3GV5z45qr; Thu, 26 Jun 2025 07:24:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750922674; 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=UIeY91iowmmyhZnGv9LPDsbklE1uWhod0bN/CRajHX8=; b=pWYpFDROdsCWz5mvw7kq7hsvb3JgP2Wmi9IeL/rs9tT3XT6QJJawFfX+n9rl4Oo2vZRH80 ohqbGnSlsiu6IuzoAUsBJ2wP2GvH3PURgA/ciaTxZfxhXpG5L7vzHKl5ukN7XYRbMo6riW 05Zr9rSfxLNwzkHMlkqZRWYA240aatJDEXuzNLAjIsDOTHlja3FSJUoskJqhPNoXlkrokT xBjDcpfJw4hPYY28X1DohwAOWytFedmQ6THg4GN9d052x2v6S5YqAE8czIsbjPgLluOfU0 vBqfIzmcaNytGeKu4eHKrdEe3VIVcvOxOS5uhXaUuVHxA0lNTfOzpCgDgpVbqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750922674; 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=UIeY91iowmmyhZnGv9LPDsbklE1uWhod0bN/CRajHX8=; b=kdsYyPYIPziZzVkRt7zv6RhtGIv12o7puna4CFJD/RDbmfaVPyUOHb6euGyIrWwzAnHimu o2gh1v8SNhj5ylokZ8GaZHS8XTxKt1AVe4+fJkJEW4X4Mr8OIAlsQqrpKLKhwHyredz6pz 9zmEdrXD05iG07q/RSvIGPi9I9x0+VbQcaJsHgevIT/LT7RjVJqo0TPCUnhIf0QDsfXXN3 1NIj5gAoq70j5fxOjTfcj3LiHJyfEP8X3wv8pp8j1b9L7WkP30TeaYvrduKOwfoH1hEVuy gJWGVFY7yxw8NoLkvpdCxoDfWEEi/8I/zqBqqKOsLP1WKgKLMtDxTNCoHKeP1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750922674; a=rsa-sha256; cv=none; b=Id9afyViHSrwndm3VJRNcE5XEDHFe7E06T+/UqR9j0OJmcrmgeOU7HR22ThK8x1R6VDCOC iTlMib8ED0GhUCmQpUQgpQFExUw40GvQOhjeEEdylCoo7xPeD364skObcswwzZs5Ammmza qjpXiqNY9igqtfr0XbELPfTJvMk165oAWpyLultgYAB7yP0gFe8oRrx1sWkPQRAX44lw6X Oq3Pjdhl4GLRcPfjzSBi9K4A33f1Apzr36ChjCZhNgcCj33oK8Gve/Gux7Vj5depPfoO7s bBaFCA9hN/7ZKQAkCOVfd70ITusrWYH1mOEmb1gPo1DBYgcMZCW7ZGlXWaH8nQ== 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 4bSVYt2qKcztNR; Thu, 26 Jun 2025 07:24:34 +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 55Q7OYsa060519; Thu, 26 Jun 2025 07:24:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q7OYwH060516; Thu, 26 Jun 2025 07:24:34 GMT (envelope-from git) Date: Thu, 26 Jun 2025 07:24:34 GMT Message-Id: <202506260724.55Q7OYwH060516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 40dafa08b2e7 - main - nuageinit: use lyaml to parse yaml files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40dafa08b2e7a04d2662b601ef89b48132c1b6c1 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=40dafa08b2e7a04d2662b601ef89b48132c1b6c1 commit 40dafa08b2e7a04d2662b601ef89b48132c1b6c1 Author: Baptiste Daroussin AuthorDate: 2025-06-26 06:49:07 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 07:24:15 +0000 nuageinit: use lyaml to parse yaml files This fixes case where vendors or cloudinit consumers are using all features from yaml. KDE is using reference for its CI for example. lima-vm uses syntax for which our previous yaml.lua has bug in the parser (https://github.com/lima-vm/lima/issues/1508) --- ObsoleteFiles.inc | 3 + libexec/nuageinit/Makefile | 2 +- libexec/nuageinit/nuageinit | 6 +- libexec/nuageinit/tests/nuageinit.sh | 9 +- libexec/nuageinit/yaml.lua | 587 ----------------------------------- 5 files changed, 13 insertions(+), 594 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index cab8949b635b..1f17d54bdf08 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250626: replace yaml.lua with lyaml +OLD_FILES+=usr/share/flua/yaml.lua + # 20250623: fscandir() renamed to fdscandir() OLD_FILES+=usr/share/man/man3/fscandir.3.gz OLD_FILES+=usr/share/man/man3/fscandir_b.3.gz diff --git a/libexec/nuageinit/Makefile b/libexec/nuageinit/Makefile index a4d8e0de5777..755ecb7ff418 100644 --- a/libexec/nuageinit/Makefile +++ b/libexec/nuageinit/Makefile @@ -1,6 +1,6 @@ PACKAGE= nuageinit SCRIPTS= nuageinit -FILES= nuage.lua yaml.lua +FILES= nuage.lua FILESDIR= ${SHAREDIR}/flua MAN= nuageinit.7 diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 1550440940df..5af1b84c1848 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -6,7 +6,7 @@ local nuage = require("nuage") local ucl = require("ucl") -local yaml = require("yaml") +local yaml = require("lyaml") local sys_stat = require("posix.sys.stat") if #arg ~= 2 then @@ -408,7 +408,7 @@ elseif citype == "nocloud" then if err then nuage.err("error parsing nocloud meta-data: " .. err) end - local obj = yaml.eval(f:read("*a")) + local obj = yaml.load(f:read("*a")) f:close() if not obj then nuage.err("error parsing nocloud meta-data") @@ -466,7 +466,7 @@ if line == "#cloud-config" then } f = io.open(ni_path .. "/" .. ud) - local obj = yaml.eval(f:read("*a")) + local obj = yaml.load(f:read("*a")) f:close() if not obj then nuage.err("error parsing cloud-config file: " .. ud) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index f344e7f6c710..44830f67e4c8 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -477,6 +477,7 @@ EOF MIIBxwIBAAJhAKD0YSHy73nUgysO13XsJmd4fHiFyQ+00R7VVu2iV9Qco ... -----END RSA PRIVATE KEY----- + " atf_check -o inline:"${_expected}" cat ${PWD}/etc/ssh/ssh_host_rsa_key _expected="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEAoPRhIfLvedSDKw7Xd ...\n" @@ -484,7 +485,9 @@ MIIBxwIBAAJhAKD0YSHy73nUgysO13XsJmd4fHiFyQ+00R7VVu2iV9Qco _expected="-----BEGIN OPENSSH PRIVATE KEY----- blabla ... ------END OPENSSH PRIVATE KEY-----\n" +-----END OPENSSH PRIVATE KEY----- + +" atf_check -o inline:"${_expected}" cat ${PWD}/etc/ssh/ssh_host_ed25519_key _expected="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+MH4E8KO32N5CXRvXVqvyZVl0+6ue4DobdhU0FqFd+\n" atf_check -o inline:"${_expected}" cat ${PWD}/etc/ssh/ssh_host_ed25519_key.pub @@ -728,7 +731,7 @@ config2_userdata_runcmd_body() runcmd: EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > media/nuageinit/user_data << 'EOF' #cloud-config runcmd: @@ -767,7 +770,7 @@ config2_userdata_packages_body() packages: EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet cat > media/nuageinit/user_data << 'EOF' #cloud-config packages: diff --git a/libexec/nuageinit/yaml.lua b/libexec/nuageinit/yaml.lua deleted file mode 100644 index 2cd50c29a469..000000000000 --- a/libexec/nuageinit/yaml.lua +++ /dev/null @@ -1,587 +0,0 @@ ---- --- SPDX-License-Identifier: MIT --- --- Copyright (c) 2017 Dominic Letz dominicletz@exosite.com - -local table_print_value -table_print_value = function(value, indent, done) - indent = indent or 0 - done = done or {} - if type(value) == "table" and not done [value] then - done [value] = true - - local list = {} - for key in pairs (value) do - list[#list + 1] = key - end - table.sort(list, function(a, b) return tostring(a) < tostring(b) end) - local last = list[#list] - - local rep = "{\n" - local comma - for _, key in ipairs (list) do - if key == last then - comma = '' - else - comma = ',' - end - local keyRep - if type(key) == "number" then - keyRep = key - else - keyRep = string.format("%q", tostring(key)) - end - rep = rep .. string.format( - "%s[%s] = %s%s\n", - string.rep(" ", indent + 2), - keyRep, - table_print_value(value[key], indent + 2, done), - comma - ) - end - - rep = rep .. string.rep(" ", indent) -- indent it - rep = rep .. "}" - - done[value] = false - return rep - elseif type(value) == "string" then - return string.format("%q", value) - else - return tostring(value) - end -end - -local table_print = function(tt) - print('return '..table_print_value(tt)) -end - -local table_clone = function(t) - local clone = {} - for k,v in pairs(t) do - clone[k] = v - end - return clone -end - -local string_trim = function(s, what) - what = what or " " - return s:gsub("^[" .. what .. "]*(.-)["..what.."]*$", "%1") -end - -local push = function(stack, item) - stack[#stack + 1] = item -end - -local pop = function(stack) - local item = stack[#stack] - stack[#stack] = nil - return item -end - -local context = function (str) - if type(str) ~= "string" then - return "" - end - - str = str:sub(0,25):gsub("\n","\\n"):gsub("\"","\\\""); - return ", near \"" .. str .. "\"" -end - -local Parser = {} -function Parser.new (self, tokens) - self.tokens = tokens - self.parse_stack = {} - self.refs = {} - self.current = 0 - return self -end - -local exports = {version = "1.2"} - -local word = function(w) return "^("..w..")([%s$%c])" end - -local tokens = { - {"comment", "^#[^\n]*"}, - {"indent", "^\n( *)"}, - {"space", "^ +"}, - {"true", word("enabled"), const = true, value = true}, - {"true", word("true"), const = true, value = true}, - {"true", word("yes"), const = true, value = true}, - {"true", word("on"), const = true, value = true}, - {"false", word("disabled"), const = true, value = false}, - {"false", word("false"), const = true, value = false}, - {"false", word("no"), const = true, value = false}, - {"false", word("off"), const = true, value = false}, - {"null", word("null"), const = true, value = nil}, - {"null", word("Null"), const = true, value = nil}, - {"null", word("NULL"), const = true, value = nil}, - {"null", word("~"), const = true, value = nil}, - {"id", "^\"([^\"]-)\" *(:[%s%c])"}, - {"id", "^'([^']-)' *(:[%s%c])"}, - {"string", "^\"([^\"]-)\"", force_text = true}, - {"string", "^'([^']-)'", force_text = true}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d):(%d%d)%s+(%-?%d%d?):(%d%d)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d):(%d%d)%s+(%-?%d%d?)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d):(%d%d)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)"}, - {"doc", "^%-%-%-[^%c]*"}, - {",", "^,"}, - {"string", "^%b{} *[^,%c]+", noinline = true}, - {"{", "^{"}, - {"}", "^}"}, - {"string", "^%b[] *[^,%c]+", noinline = true}, - {"[", "^%["}, - {"]", "^%]"}, - {"-", "^%-", noinline = true}, - {":", "^:"}, - {"pipe", "^(|)(%d*[+%-]?)", sep = "\n"}, - {"pipe", "^(>)(%d*[+%-]?)", sep = " "}, - {"id", "^([%w][%w %-_]*)(:[%s%c])"}, - {"string", "^[^%c]+", noinline = true}, - {"string", "^[^,%]}%c ]+"} -}; -exports.tokenize = function (str) - local token - local row = 0 - local ignore - local indents = 0 - local lastIndents - local stack = {} - local indentAmount = 0 - local inline = false - str = str:gsub("\r\n","\010") - - while #str > 0 do - for i in ipairs(tokens) do - local captures = {} - if not inline or tokens[i].noinline == nil then - captures = {str:match(tokens[i][2])} - end - - if #captures > 0 then - captures.input = str:sub(0, 25) - token = table_clone(tokens[i]) - token[2] = captures - local str2 = str:gsub(tokens[i][2], "", 1) - token.raw = str:sub(1, #str - #str2) - str = str2 - - if token[1] == "{" or token[1] == "[" then - inline = true - elseif token.const then - -- Since word pattern contains last char we're re-adding it - str = token[2][2] .. str - token.raw = token.raw:sub(1, #token.raw - #token[2][2]) - elseif token[1] == "id" then - -- Since id pattern contains last semi-colon we're re-adding it - str = token[2][2] .. str - token.raw = token.raw:sub(1, #token.raw - #token[2][2]) - -- Trim - token[2][1] = string_trim(token[2][1]) - elseif token[1] == "string" then - -- Finding numbers - local snip = token[2][1] - if not token.force_text then - if snip:match("^(-?%d+%.%d+)$") or snip:match("^(-?%d+)$") then - token[1] = "number" - end - end - - elseif token[1] == "comment" then - ignore = true; - elseif token[1] == "indent" then - row = row + 1 - inline = false - lastIndents = indents - if indentAmount == 0 then - indentAmount = #token[2][1] - end - - if indentAmount ~= 0 then - indents = (#token[2][1] / indentAmount); - else - indents = 0 - end - - if indents == lastIndents then - ignore = true; - elseif indents > lastIndents + 2 then - error("SyntaxError: invalid indentation, got " .. tostring(indents) - .. " instead of " .. tostring(lastIndents) .. context(token[2].input)) - elseif indents > lastIndents + 1 then - push(stack, token) - elseif indents < lastIndents then - local input = token[2].input - token = {"dedent", {"", input = ""}} - token.input = input - while lastIndents > indents + 1 do - lastIndents = lastIndents - 1 - push(stack, token) - end - end - end -- if token[1] == XXX - token.row = row - break - end -- if #captures > 0 - end - - if not ignore then - if token then - push(stack, token) - token = nil - else - error("SyntaxError " .. context(str)) - end - end - - ignore = false; - end - - return stack -end - -Parser.peek = function (self, offset) - offset = offset or 1 - return self.tokens[offset + self.current] -end - -Parser.advance = function (self) - self.current = self.current + 1 - return self.tokens[self.current] -end - -Parser.advanceValue = function (self) - return self:advance()[2][1] -end - -Parser.accept = function (self, type) - if self:peekType(type) then - return self:advance() - end -end - -Parser.expect = function (self, type, msg) - return self:accept(type) or - error(msg .. context(self:peek()[1].input)) -end - -Parser.expectDedent = function (self, msg) - return self:accept("dedent") or (self:peek() == nil) or - error(msg .. context(self:peek()[2].input)) -end - -Parser.peekType = function (self, val, offset) - return self:peek(offset) and self:peek(offset)[1] == val -end - -Parser.ignore = function (self, items) - local advanced - repeat - advanced = false - for _,v in pairs(items) do - if self:peekType(v) then - self:advance() - advanced = true - end - end - until advanced == false -end - -Parser.ignoreSpace = function (self) - self:ignore{"space"} -end - -Parser.ignoreWhitespace = function (self) - self:ignore{"space", "indent", "dedent"} -end - -Parser.parse = function (self) - - local ref = nil - if self:peekType("string") and not self:peek().force_text then - local char = self:peek()[2][1]:sub(1,1) - if char == "&" then - ref = self:peek()[2][1]:sub(2) - self:advanceValue() - self:ignoreSpace() - elseif char == "*" then - ref = self:peek()[2][1]:sub(2) - return self.refs[ref] - end - end - - local result - local c = { - indent = self:accept("indent") and 1 or 0, - token = self:peek() - } - push(self.parse_stack, c) - - if c.token[1] == "doc" then - result = self:parseDoc() - elseif c.token[1] == "-" then - result = self:parseList() - elseif c.token[1] == "{" then - result = self:parseInlineHash() - elseif c.token[1] == "[" then - result = self:parseInlineList() - elseif c.token[1] == "id" then - result = self:parseHash() - elseif c.token[1] == "string" then - result = self:parseString("\n") - elseif c.token[1] == "timestamp" then - result = self:parseTimestamp() - elseif c.token[1] == "number" then - result = tonumber(self:advanceValue()) - elseif c.token[1] == "pipe" then - result = self:parsePipe() - elseif c.token.const == true then - self:advanceValue(); - result = c.token.value - else - error("ParseError: unexpected token '" .. c.token[1] .. "'" .. context(c.token.input)) - end - - pop(self.parse_stack) - while c.indent > 0 do - c.indent = c.indent - 1 - local term = "term "..c.token[1]..": '"..c.token[2][1].."'" - self:expectDedent("last ".. term .." is not properly dedented") - end - - if ref then - self.refs[ref] = result - end - return result -end - -Parser.parseDoc = function (self) - self:accept("doc") - return self:parse() -end - -Parser.inline = function (self) - local current = self:peek(0) - if not current then - return {}, 0 - end - - local inline = {} - local i = 0 - - while self:peek(i) and not self:peekType("indent", i) and current.row == self:peek(i).row do - inline[self:peek(i)[1]] = true - i = i - 1 - end - return inline, -i -end - -Parser.isInline = function (self) - local _, i = self:inline() - return i > 0 -end - -Parser.parent = function(self, level) - level = level or 1 - return self.parse_stack[#self.parse_stack - level] -end - -Parser.parentType = function(self, type, level) - return self:parent(level) and self:parent(level).token[1] == type -end - -Parser.parseString = function (self) - if self:isInline() then - local result = self:advanceValue() - - --[[ - - a: this looks - flowing: but is - no: string - --]] - local types = self:inline() - if types["id"] and types["-"] then - if not self:peekType("indent") or not self:peekType("indent", 2) then - return result - end - end - - --[[ - a: 1 - b: this is - a flowing string - example - c: 3 - --]] - if self:peekType("indent") then - self:expect("indent", "text block needs to start with indent") - local addtl = self:accept("indent") - - result = result .. "\n" .. self:parseTextBlock("\n") - - self:expectDedent("text block ending dedent missing") - if addtl then - self:expectDedent("text block ending dedent missing") - end - end - return result - else - --[[ - a: 1 - b: - this is also - a flowing string - example - c: 3 - --]] - return self:parseTextBlock("\n") - end -end - -Parser.parsePipe = function (self) - local pipe = self:expect("pipe") - self:expect("indent", "text block needs to start with indent") - local result = self:parseTextBlock(pipe.sep) - self:expectDedent("text block ending dedent missing") - return result -end - -Parser.parseTextBlock = function (self, sep) - local token = self:advance() - local result = string_trim(token.raw, "\n") - local indents = 0 - while self:peek() ~= nil and ( indents > 0 or not self:peekType("dedent") ) do - local newtoken = self:advance() - while token.row < newtoken.row do - result = result .. sep - token.row = token.row + 1 - end - if newtoken[1] == "indent" then - indents = indents + 1 - elseif newtoken[1] == "dedent" then - indents = indents - 1 - else - result = result .. string_trim(newtoken.raw, "\n") - end - end - return result -end - -Parser.parseHash = function (self, hash) - hash = hash or {} - local indents = 0 - - if self:isInline() then - local id = self:advanceValue() - self:expect(":", "expected semi-colon after id") - self:ignoreSpace() - if self:accept("indent") then - indents = indents + 1 - hash[id] = self:parse() - else - hash[id] = self:parse() - if self:accept("indent") then - indents = indents + 1 - end - end - self:ignoreSpace(); - end - - while self:peekType("id") do - local id = self:advanceValue() - self:expect(":","expected semi-colon after id") - self:ignoreSpace() - hash[id] = self:parse() - self:ignoreSpace(); - end - - while indents > 0 do - self:expectDedent("expected dedent") - indents = indents - 1 - end - - return hash -end - -Parser.parseInlineHash = function (self) - local id - local hash = {} - local i = 0 - - self:accept("{") - while not self:accept("}") do - self:ignoreSpace() - if i > 0 then - self:expect(",","expected comma") - end - - self:ignoreWhitespace() - if self:peekType("id") then - id = self:advanceValue() - if id then - self:expect(":","expected semi-colon after id") - self:ignoreSpace() - hash[id] = self:parse() - self:ignoreWhitespace() - end - end - - i = i + 1 - end - return hash -end - -Parser.parseList = function (self) - local list = {} - while self:accept("-") do - self:ignoreSpace() - list[#list + 1] = self:parse() - - self:ignoreSpace() - end - return list -end - -Parser.parseInlineList = function (self) - local list = {} - local i = 0 - self:accept("[") - while not self:accept("]") do - self:ignoreSpace() - if i > 0 then - self:expect(",","expected comma") - end - - self:ignoreSpace() - list[#list + 1] = self:parse() - self:ignoreSpace() - i = i + 1 - end - - return list -end - -Parser.parseTimestamp = function (self) - local capture = self:advance()[2] - - return os.time{ - year = capture[1], - month = capture[2], - day = capture[3], - hour = capture[4] or 0, - min = capture[5] or 0, - sec = capture[6] or 0, - isdst = false, - } - os.time{year=1970, month=1, day=1, hour=8} -end - -exports.eval = function (str) - return Parser:new(exports.tokenize(str)):parse() -end - -exports.dump = table_print - -return exports From nobody Thu Jun 26 07:26:24 2025 X-Original-To: dev-commits-src-main@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 4bSVc06KwHz60Bvk; Thu, 26 Jun 2025 07:26: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 4bSVc05Wtbz46s9; Thu, 26 Jun 2025 07:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750922784; 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=JNKY/p4tWSTudRm9aftKrpRIPFpe9yzwwYX98+I5rPU=; b=nc930oioS/KwiWiv5WlGyInzEyEkaqFufdR7qbifoixZoNMwH423xSiNs5TiSa1W1oYM2O vq3wUkfqSixCA+g1A1tfIqmtz4qOGSeM4AqlVplVIDrfyAofzRYL8pykihToqQ5KIK8SAH FEE/PVhdEnyTYSGvtsMi/GqpH+GypAE/Bc2VS/ZFitMcqTZdT1OjDyGo5Lp5MNkS3p4l/d GLHMzG3fWCUX/meLycKcBj4BVix81lXySF6CznYT7f1IJzdjsMlIbLWsCwC9MldD7jntqL mKJqKlo5CqE6T7pmZ4Y+icApd9CE7WWwD4awvgMCOTRWvJ1ofl2EA67Abev/2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750922784; 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=JNKY/p4tWSTudRm9aftKrpRIPFpe9yzwwYX98+I5rPU=; b=PHu0rMRf/ayopEv3jLSXqlHy43dmdHsQU5cor55n9PyQTq/5xvvukmVnlh/XQ4AiBj+2Ws qPhXyUgZvsXVDu+/AoEh/zsm7zg7wvBK/IZq0Zzb6fJasUGP6bSnF22tXNt7Yw/n4VN2gY CWuir7b5H/F+4YPuMnbGz0jXjuP3ZwtzM2QENua6I/Hj82jbh8tJuZTge+6nklHkDtRjvH mhG+RsgPUChGKooHg1CCItH9GAlw7dRTFMyHOJ942OpWJUfCFsHEz7ZzLH43TjKv6KwyKg RW+364P+8+tIaEyCUTqR4Wkpcay1rqcx74yf8YPJooSAeWJovco0m1i/8TBN8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750922784; a=rsa-sha256; cv=none; b=Ick6JzCiS6QfrFuTKFMKn5Z0OnvgeV0cN5uvPdNus20X2+6DLXR9lsATl7OzfVDibPSNMI bt+kGF3F2f7x3JJBA0eiyVNgknu/kUgTwrtxrZjXb9o6e3lppZQn/TvmyTXJUG3cKCpLhk zjrxuuwYLmKVLAIlwJ0mgfzXDY7XswZfr11BNRgB4LSjEVRODh/XJBMDzTd/aPX+P4kg8h fcvGHCnzZFlaPeYvqeYvQ8vbu85CEKcXuvo3uFyRsxw05kYJ1EqJSZ3BJN/oW6mjwBJlfQ JuQVRb9ZmTPBZeSybJK+3HU+llWkKVxPXA3JJoS1U7X/IPKYNCrddKNPanRr9w== 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 4bSVc04fhBztdY; Thu, 26 Jun 2025 07:26: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 55Q7QO3I061181; Thu, 26 Jun 2025 07:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q7QO0v061178; Thu, 26 Jun 2025 07:26:24 GMT (envelope-from git) Date: Thu, 26 Jun 2025 07:26:24 GMT Message-Id: <202506260726.55Q7QO0v061178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: dba00b1c6bc1 - main - nuageinit: launch post network script with postnet citype List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dba00b1c6bc1bb9753bf0a554eab04077e85e214 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=dba00b1c6bc1bb9753bf0a554eab04077e85e214 commit dba00b1c6bc1bb9753bf0a554eab04077e85e214 Author: Sebastien Baylocq AuthorDate: 2025-06-25 15:20:50 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 07:26:11 +0000 nuageinit: launch post network script with postnet citype Sponsored by: OVHCloud --- libexec/rc/rc.d/nuageinit_post_net | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/nuageinit_post_net b/libexec/rc/rc.d/nuageinit_post_net index bea4c5e37c5f..6d2591a603af 100755 --- a/libexec/rc/rc.d/nuageinit_post_net +++ b/libexec/rc/rc.d/nuageinit_post_net @@ -16,8 +16,8 @@ rcvar="nuageinit_enable" execute_post_net() { - test -f /var/cache/nuageinit/post_network_config || return - /usr/libexec/nuageinit /var/cache/nuageinit/post_network_config | tee -a /var/log/nuageinit.log + test -f /var/cache/nuageinit/user_data -o -f /var/cache/nuageinit/user-data || return + /usr/libexec/nuageinit /var/cache/nuageinit/ postnet | tee -a /var/log/nuageinit.log } # Share the same config as nuageinit From nobody Thu Jun 26 07:38:03 2025 X-Original-To: dev-commits-src-main@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 4bSVsR6BcCz60CMq; Thu, 26 Jun 2025 07:38: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 4bSVsR5LXfz4Dfp; Thu, 26 Jun 2025 07:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750923483; 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=ykb1s8grkOftDvt0nSyY13dxgJ/42spYbr4R3H9l83U=; b=ppRqr7eF6c2vOPawFqg0VSGGhtmeJJfJZw40WRbiRWL3PlNvre0hPeLF0SCNLRlEuxOpMB Mx5OTncGegSTURboH9WyAMab4hMbqT2IlkWaUqOQdPR13bFLZZmCHYzPhNtEduka9Mh3av /zcO/g9NSoKO78y6bGW4XjNTsQvMWL3OylFfTxYe+nH8n6DAPEHGF9BTYSLFT7zeaN1qEY hQZLoLx3FSra2fmVWFQp46wAJX7aBTI3tIHfUvPDUzFaFvpBB1GO5mddWRRK2uweXwkzti +Bq4bjPZE5B4/GY43/RUgz/D7aNra1bG2dJ8fw6heAscVlBVEFLD2pbME/BP7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750923483; 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=ykb1s8grkOftDvt0nSyY13dxgJ/42spYbr4R3H9l83U=; b=Wa9Wqx8bL7qHA10jN/x5e5Mk/d7dON71dw8uq+I9Sb/B0MCMkkevR+/V9uIxaj95vn+I2Y beteIQbRGqQi7h+XQMM87YoF1vnB6ruaWs75V7gWexnwxZduVkmr3W6Qny3ezHVnlBhogi nu1sysLwQx39UTJlaeqd6ZFvw0eflWENz8U+IuEgQhfQslDofKSTh9n8sDN+FFXUJNODBA LbqbMHCi0T8L6HY/zjwtQ42LXspyjAnRSUqgDnnmsKJs4MX8/ieaX40CFuP0VkyWJ3bnBs lA7/qVpLmukhMaVxJ0FyKT/uSEjwuY3w0zvM9N4xFCH3+/NzO36I+KQY/qx+ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750923483; a=rsa-sha256; cv=none; b=coCZeHtU5/4SaqoVzBmlIiFNz+ssc/SqknmTKx4PI6I/B9AcQ2p4uvCCVwXsgx38KCPv9y 1NhHbsuKcgj9coNWziBz83ZrJioU/cI7+JUwforgJy7E1MThoH7PEhrZj/1P9pxxjH/woO ONHHPB0QznpbtoYLD7r12ku+Sb3gtCiD0i+GyyS8qD3eIMX7ZSCznwHciwLszDbFl++yR6 eImAUzyR9Z8Ehz0fu4hg2ZQVR8nVmqVBdkoHlDalFXZPYEv9fB2cAzFjnuRAFiEw4K9IM1 rWO/p9Fmd4V7K4rCUq4HhZw4s+4HifAe65mty/3CNps1MMOKfiV1ExBsnzTmMg== 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 4bSVsR4g22zsnD; Thu, 26 Jun 2025 07:38: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 55Q7c39J080164; Thu, 26 Jun 2025 07:38:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q7c3qG080161; Thu, 26 Jun 2025 07:38:03 GMT (envelope-from git) Date: Thu, 26 Jun 2025 07:38:03 GMT Message-Id: <202506260738.55Q7c3qG080161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 62e0f12f5104 - main - scandir: Propagate errors from readdir(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 62e0f12f5104585b7346fee183e5c667b39ddbad Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=62e0f12f5104585b7346fee183e5c667b39ddbad commit 62e0f12f5104585b7346fee183e5c667b39ddbad Author: Dag-Erling Smørgrav AuthorDate: 2025-06-26 07:37:00 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-26 07:37:00 +0000 scandir: Propagate errors from readdir(). Currently, if `readdir()` fails, `scandir()` simply returns a partial result (or a null result if it fails before any entries were selected). There is no way within the current API design to return both a partial result and an error indicator, so err on the side of caution: if an error occurs, discard any partial result and return the error instead. MFC after: 1 week Reported by: Maxim Suhanov Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51046 --- lib/libc/gen/scandir.3 | 32 +++++++++++++++++++- lib/libc/gen/scandir.c | 12 ++++++-- lib/libc/tests/gen/scandir_test.c | 63 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3 index 9ced9fa4ef9d..3da4500cefb9 100644 --- a/lib/libc/gen/scandir.3 +++ b/lib/libc/gen/scandir.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 20, 2025 +.Dd June 25, 2025 .Dt SCANDIR 3 .Os .Sh NAME @@ -215,6 +215,36 @@ cannot allocate enough memory to hold all the directory entries, they return \-1 and set .Va errno to an appropriate value. +.Sh ERRORS +The +.Fn scandir , +.Fn scandirat , +.Fn scandir_b , +and +.Fn scandirat_b +functions may fail and set +.Va errno +for any of the errors specified for the +.Xr opendir 3 , +.Xr malloc 3 , +.Xr readdir 3 , +and +.Xr closedir 3 +functions. +.Pp +The +.Fn fdscandir +and +.Fn fdscandir_b +functions may fail and set +.Va errno +for any of the errors specified for the +.Xr fdopendir 3 , +.Xr malloc 3 , +.Xr readdir 3 , +and +.Xr closedir 3 +functions. .Sh SEE ALSO .Xr openat 2 , .Xr directory 3 , diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 134c88713d39..56d77c29bd07 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -81,7 +81,7 @@ scandir_dirp(DIR *dirp, struct dirent ***namelist, if (names == NULL) return (-1); - while ((d = readdir(dirp)) != NULL) { + while (errno = 0, (d = readdir(dirp)) != NULL) { if (select != NULL && !SELECT(d)) continue; /* just selected names */ /* @@ -108,6 +108,13 @@ scandir_dirp(DIR *dirp, struct dirent ***namelist, } names[numitems++] = p; } + /* + * Since we can't simultaneously return both -1 and a count, we + * must either suppress the error or discard the partial result. + * The latter seems the lesser of two evils. + */ + if (errno != 0) + goto fail; if (numitems && dcomp != NULL) #ifdef I_AM_SCANDIR_B qsort_b(names, numitems, sizeof(struct dirent *), (void*)dcomp); @@ -120,7 +127,8 @@ scandir_dirp(DIR *dirp, struct dirent ***namelist, fail: serrno = errno; - free(p); + if (numitems == 0 || names[numitems - 1] != p) + free(p); while (numitems > 0) free(names[--numitems]); free(names); diff --git a/lib/libc/tests/gen/scandir_test.c b/lib/libc/tests/gen/scandir_test.c index 9a9940aca881..f7b52b5e3616 100644 --- a/lib/libc/tests/gen/scandir_test.c +++ b/lib/libc/tests/gen/scandir_test.c @@ -7,7 +7,9 @@ #include #include +#include #include +#include #include #include @@ -124,11 +126,72 @@ ATF_TC_BODY(scandir_none, tc) free(namelist); } +/* + * Test that scandir() propagates errors from readdir(): we create a + * directory with enough entries that it can't be read in a single + * getdirentries() call, then abuse the selection callback to close the + * file descriptor scandir() is using after the first call, causing the + * next one to fail, and verify that readdir() returns an error instead of + * a partial result. We make two passes, one in which nothing was + * selected before the error occurred, and one in which everything was. + */ +static int scandir_error_count; +static int scandir_error_fd; +static int scandir_error_select_return; + +static int +scandir_error_select(const struct dirent *ent __unused) +{ + if (scandir_error_count++ == 0) + close(scandir_error_fd); + return (scandir_error_select_return); +} + +ATF_TC(scandir_error); +ATF_TC_HEAD(scandir_error, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that scandir() propagates errors from readdir()"); +} +ATF_TC_BODY(scandir_error, tc) +{ + char path[16]; + struct dirent **namelist = NULL; + int fd, i, ret; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + for (i = 0; i < 1024; i++) { + snprintf(path, sizeof(path), "dir/%04x", i); + ATF_REQUIRE_EQ(0, symlink(path + 4, path)); + } + + /* first pass, select nothing */ + ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + scandir_error_count = 0; + scandir_error_fd = fd; + scandir_error_select_return = 0; + ret = fdscandir(fd, &namelist, scandir_error_select, NULL); + ATF_CHECK_EQ(-1, ret); + ATF_CHECK_ERRNO(EBADF, ret < 0); + ATF_CHECK_EQ(NULL, namelist); + + /* second pass, select everything */ + ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + scandir_error_count = 0; + scandir_error_fd = fd; + scandir_error_select_return = 1; + ret = fdscandir(fd, &namelist, scandir_error_select, NULL); + ATF_CHECK_EQ(-1, ret); + ATF_CHECK_ERRNO(EBADF, ret < 0); + ATF_CHECK_EQ(NULL, namelist); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, scandir_test); ATF_TP_ADD_TC(tp, fdscandir_test); ATF_TP_ADD_TC(tp, scandirat_test); ATF_TP_ADD_TC(tp, scandir_none); + ATF_TP_ADD_TC(tp, scandir_error); return (atf_no_error()); } From nobody Thu Jun 26 07:38:04 2025 X-Original-To: dev-commits-src-main@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 4bSVsT0XLSz60BxW; Thu, 26 Jun 2025 07:38: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 4bSVsS5XYdz4Ddf; Thu, 26 Jun 2025 07:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750923484; 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=6dAwRfIQ2p0U36vn1HdcwfnWQaPCo2dCTDIYbd7ifg8=; b=KWC6h7Eb0CThCMGBfUMpRFqLa6soL2y6/wg6Hu1g+es/q9dd1mpObFVJe4ftSZhCBxPrLf r8Obfztz5oXF/ge+FNopVrXLQ0fxFGCZ6TQ9aN/0Gzjm7oWWCAnvh1l2JMZRuZEXNT0DFF LoTx+FkHAsb+cEV80TZyndyrbv+JPh32oPx/UFIYep2WyUbO5AGsQnDgh18zCO3Fl1jUOy 8/pE6WO4FL/VHTyCj008s+ZWgysLrj+a3nWeqHhIekn5bW/zJOxJ98l7RwSOae3XpX8vyd 9654wqj460pd46eJZxB8Hi0+zPzdNMKbCcDy/dbirqQJWm7vgsv5PEuXPcE7Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750923484; 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=6dAwRfIQ2p0U36vn1HdcwfnWQaPCo2dCTDIYbd7ifg8=; b=FWYQs/6EVxuif/cCLhB2WJt8cxCrhHJieWw84HciwfH72StWHrOs7StdM2yITa187MUCFT mp3Rjw++2Uf8lk38ZzzCeegNRbAQfS0u/PoP0LjaN7sNXNMwpcT83KcrAk5aPWdQmEOCNS hhBPZFZjQa11rvGomCm86gg5jx36s0IX0n2sU7RT9/Ogpl2vLY1m74P3FnC9p7xaSoRclZ C2TFGJgla+GILcMud70UA54RzaGHO80npNPhifcF0LzDNX76cOS2mfFe7/Fd0zywJ+gpvL qqGNnSlKl1pW5ADl60rASBfy8gnHXYX1NneCFXRdVviUWDGd7KfBLQ+Oxybo3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750923484; a=rsa-sha256; cv=none; b=EGIA5gh5tfNZI1kEPJ/eDJjzctDopw7O3wZxHAjBq5LpJk4j6ObItiLbgOql/+zoDaCfcr 5sGuQJ/TpqUdLX+XX2xkdFLas1AeHtNMXQQDH5e23zTa6iVIlYmqWkG3M2UA+y0DJ8SZwH Irn3IRoSov4kUA4psZXlo1c8h5SIcF/ZwUpHWe3sSfhlrD3DxT9EGatm/t+LMsuG5AZQ/J IIJ9w0Aq2O49a6UBYE6ydxoOApcJV/fH7OCcQJRNPBsuIdlSCc1yUOwRCKsY9WDj85Gu/V +WowA6Z2slvaNwrupOpVDanUr/hMdazln4VNPFBtzdeK4yn6pQPw38RhQNE0oQ== 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 4bSVsS4y72zsnG; Thu, 26 Jun 2025 07:38: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 55Q7c4KA080200; Thu, 26 Jun 2025 07:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q7c4mu080197; Thu, 26 Jun 2025 07:38:04 GMT (envelope-from git) Date: Thu, 26 Jun 2025 07:38:04 GMT Message-Id: <202506260738.55Q7c4mu080197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 8ebc0768663b - main - scandir: Code cleanup. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8ebc0768663b0ea9f78a0b8cffb93ee1684a9b08 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8ebc0768663b0ea9f78a0b8cffb93ee1684a9b08 commit 8ebc0768663b0ea9f78a0b8cffb93ee1684a9b08 Author: Dag-Erling Smørgrav AuthorDate: 2025-06-26 07:37:06 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-26 07:37:06 +0000 scandir: Code cleanup. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51050 --- lib/libc/gen/scandir.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 56d77c29bd07..8e62fe980868 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -69,8 +69,8 @@ scandir_dirp_b(DIR *dirp, struct dirent ***namelist, select_block select, dcomp_block dcomp) #else scandir_dirp(DIR *dirp, struct dirent ***namelist, - int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, - const struct dirent **)) + int (*select)(const struct dirent *), + int (*dcomp)(const struct dirent **, const struct dirent **)) #endif { struct dirent *d, *p = NULL, **names = NULL, **names2; @@ -100,7 +100,7 @@ scandir_dirp(DIR *dirp, struct dirent ***namelist, * realloc the maximum size. */ if (numitems >= arraysz) { - arraysz = arraysz ? arraysz * 2 : 32; + arraysz = arraysz * 2; names2 = reallocarray(names, arraysz, sizeof(*names)); if (names2 == NULL) goto fail; @@ -115,13 +115,15 @@ scandir_dirp(DIR *dirp, struct dirent ***namelist, */ if (errno != 0) goto fail; - if (numitems && dcomp != NULL) + if (numitems > 0 && dcomp != NULL) { #ifdef I_AM_SCANDIR_B - qsort_b(names, numitems, sizeof(struct dirent *), (void*)dcomp); + qsort_b(names, numitems, sizeof(struct dirent *), + (void *)dcomp); #else qsort_r(names, numitems, sizeof(struct dirent *), scandir_thunk_cmp, &dcomp); #endif + } *namelist = names; return (numitems); @@ -142,8 +144,8 @@ scandir_b(const char *dirname, struct dirent ***namelist, select_block select, dcomp_block dcomp) #else scandir(const char *dirname, struct dirent ***namelist, - int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, - const struct dirent **)) + int (*select)(const struct dirent *), + int (*dcomp)(const struct dirent **, const struct dirent **)) #endif { DIR *dirp; @@ -171,8 +173,8 @@ fdscandir_b(int dirfd, struct dirent ***namelist, select_block select, dcomp_block dcomp) #else fdscandir(int dirfd, struct dirent ***namelist, - int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, - const struct dirent **)) + int (*select)(const struct dirent *), + int (*dcomp)(const struct dirent **, const struct dirent **)) #endif { DIR *dirp; @@ -200,8 +202,8 @@ scandirat_b(int dirfd, const char *dirname, struct dirent ***namelist, select_block select, dcomp_block dcomp) #else scandirat(int dirfd, const char *dirname, struct dirent ***namelist, - int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, - const struct dirent **)) + int (*select)(const struct dirent *), + int (*dcomp)(const struct dirent **, const struct dirent **)) #endif { int fd, ret, serrno; From nobody Thu Jun 26 09:22:26 2025 X-Original-To: dev-commits-src-main@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 4bSY9v0XMSz60JTF; Thu, 26 Jun 2025 09:22: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 4bSY9t2wSSz3Zrs; Thu, 26 Jun 2025 09:22:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750929746; 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=3WaEvNXdKYClqCs9B2Ffd+ovfUXrqnbMr76JMgBXhMI=; b=t5dKR65sPil7L62UXe/TlGUSvqu+LmlVcL6pMugpOTcY325roPiRi4/MfCcVgDht68jAAa v8LtPIgg1N92ZLu7rUEwTnfyAD5WgkilF96+/BUXcxsomJFGCGwg7Hhfxkz31UGVj4Cyiz UBJq96xpkwe5ggSrWPGyaVP6H9mDCIEmTsbOifX0aLkWiiuE2SzEDCPxfxJh3G4yzutLQQ fQOwqy1gDyYDUaN4YhOZFY8mjqV3c6nEvRzM4ps+fwrBnZa74URwuhi+4fmdNpK3WwjkrI iMJKg/HcsqOR/pRtWjQMfn2qtHyZotfxtGX9dCLSmgN/84H/LO7lzB1i/D9/WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750929746; 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=3WaEvNXdKYClqCs9B2Ffd+ovfUXrqnbMr76JMgBXhMI=; b=UsLbOAdLSI6sW3aHRgVy+qZaiVROn7p+PJDrmAuVs8h8pAXYF1724gt9GBiCPcZfA838y4 LBw1kVjvc7mcFo5qiHiLzFfBKgPDMRVYE8EpznhhPV0U6Ul1Ka4Qv2vujph3n03x8X4rgb MUkGnuOUHoZ0kqUtSJsYGhkP1vXxCJhhjzjQW5Hg0oKpqln7UfGwGAQGhYAwtKpVx90BeW Zoz4sK6GisalDS8w4wJ5rhTjDzLuG0tmSMTdK8NSeSYmAVyKRy5HYilVl1R70kOH4q9SKt PQe3Rp+QN0zgiMz1pXGkdM/vihYWYogstxoUyV0KnrFGWp3SlnrN1l12XUH0Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750929746; a=rsa-sha256; cv=none; b=JGzMbq74QXb53ocY0qwbVuuOGOSArwM/MIaEV7o1odbT70QQdMMuIp/g3hgUw0h6PklZ3X xwFd4J2o+9XAR9Onj3Vg7eweTWevYK8VLHAPV8XG/svXpNJu2GlHtC2zjCmEyQEs/nq9jP kBGp+CW27uhbOFCIOuWiJ3hGurisQrWx3WyCuQs7/sHCdHUn7Xlz6P0QUSWdKdiCiN6kVP lh2Z/rNufWevfwdMYuzOiObU48cofWaeGOPT7ReWUrgHrHmxSg9hq9x3+ac886+63wojNc mz6+m6CeFq7Z8+SVLyQ+nU38O4FdHYtO7/xZSN1os1UwB1f3T1k15Qq1vLedYQ== 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 4bSY9t1h4TzxWp; Thu, 26 Jun 2025 09:22: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 55Q9MQJS085047; Thu, 26 Jun 2025 09:22:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q9MQW9085032; Thu, 26 Jun 2025 09:22:26 GMT (envelope-from git) Date: Thu, 26 Jun 2025 09:22:26 GMT Message-Id: <202506260922.55Q9MQW9085032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ronald Klop Subject: git: 1ee33e3a578c - main - swapon: parse md.eli device for encrypted swapfile from fstab List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ronald X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ee33e3a578c35ff0e8ef5db87a8005f1f99546a Auto-Submitted: auto-generated The branch main has been updated by ronald: URL: https://cgit.FreeBSD.org/src/commit/?id=1ee33e3a578c35ff0e8ef5db87a8005f1f99546a commit 1ee33e3a578c35ff0e8ef5db87a8005f1f99546a Author: Ronald Klop AuthorDate: 2025-02-06 21:50:46 +0000 Commit: Ronald Klop CommitDate: 2025-06-26 09:22:01 +0000 swapon: parse md.eli device for encrypted swapfile from fstab Summary: Although fstab(5) suggests usage of md(4) and an .eli suffix in the same paragraph, the combination did not work. This patch adds a bit of parsing, creates the md device and then passes that device to the *_geli function. Add unit tests. PR: 186252 Approved by: delphij MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D48874 --- etc/mtree/BSD.tests.dist | 2 + sbin/swapon/Makefile | 5 ++ sbin/swapon/swapon.c | 50 ++++++++--- sbin/swapon/tests/Makefile | 5 ++ sbin/swapon/tests/swapon_test.sh | 181 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 233 insertions(+), 10 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 183c88038742..b3b2b61da143 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -513,6 +513,8 @@ .. savecore .. + swapon + .. sysctl .. .. diff --git a/sbin/swapon/Makefile b/sbin/swapon/Makefile index ef87c9668dd7..0c034338a533 100644 --- a/sbin/swapon/Makefile +++ b/sbin/swapon/Makefile @@ -8,4 +8,9 @@ MLINKS+=swapon.8 swapctl.8 LIBADD= util +.include + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index a09f2598e2ac..3dff4df5e63f 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -54,6 +54,8 @@ #include #include +#define DOT_ELI ".eli" + static void usage(void) __dead2; static const char *swap_on_off(const char *, int, char *); static const char *swap_on_off_geli(const char *, char *, int); @@ -230,15 +232,18 @@ swap_on_off(const char *name, int doingall, char *mntops) (fnmatch(_PATH_DEV MD_NAME "[0-9]*", name, 0) == 0 || fnmatch(MD_NAME "[0-9]*", name, 0) == 0 || strncmp(_PATH_DEV MD_NAME, name, - sizeof(_PATH_DEV) + sizeof(MD_NAME)) == 0 || - strncmp(MD_NAME, name, sizeof(MD_NAME)) == 0)) + sizeof(_PATH_DEV MD_NAME)) == 0 || + strncmp(MD_NAME, name, sizeof(MD_NAME)) == 0 || + strncmp(_PATH_DEV MD_NAME DOT_ELI, name, + sizeof(_PATH_DEV MD_NAME DOT_ELI)) == 0 || + strncmp(MD_NAME DOT_ELI, name, sizeof(MD_NAME DOT_ELI)) == 0)) return (swap_on_off_md(name, mntops, doingall)); basebuf = strdup(name); base = basename(basebuf); /* Swap on encrypted device by GEOM_ELI. */ - if (fnmatch("*.eli", base, 0) == 0) { + if (fnmatch("*" DOT_ELI, base, 0) == 0) { free(basebuf); return (swap_on_off_geli(name, mntops, doingall)); } @@ -327,6 +332,8 @@ swap_on_geli_args(const char *mntops) return (NULL); } Tflag = " -T "; + } else if ((p = strstr(token, "file=")) == token) { + /* ignore known option */ } else if (strcmp(token, "late") == 0) { /* ignore known option */ } else if (strcmp(token, "noauto") == 0) { @@ -416,24 +423,38 @@ swap_on_off_md(const char *name, char *mntops, int doingall) char *p, *vnodefile; size_t linelen; u_long ul; + const char *suffix; + char *devbuf, *dname; + int name_len; fd = -1; sfd = NULL; - if (strlen(name) == (sizeof(MD_NAME) - 1)) + devbuf = strdup(name); + name_len = strlen(name) - strlen(DOT_ELI); + if (name_len > 0 && strcmp(suffix = &name[name_len], DOT_ELI) == 0) { + suffix++; + devbuf[name_len] = '\0'; + } else + suffix = NULL; + /* dname will be name without /dev/ prefix and .eli suffix */ + dname = basename(devbuf); + if (strlen(dname) == (sizeof(MD_NAME) - 1)) mdunit = -1; else { errno = 0; - ul = strtoul(name + 2, &p, 10); + ul = strtoul(dname + 2, &p, 10); if (errno == 0) { if (*p != '\0' || ul > INT_MAX) errno = EINVAL; } if (errno) { - warn("Bad device unit: %s", name); + warn("Bad device unit: %s", dname); + free(devbuf); return (NULL); } mdunit = (int)ul; } + free(devbuf); vnodefile = NULL; if ((p = strstr(mntops, "file=")) != NULL) { @@ -573,10 +594,19 @@ swap_on_off_md(const char *name, char *mntops, int doingall) } } } - snprintf(mdpath, sizeof(mdpath), "%s%s%d", _PATH_DEV, - MD_NAME, mdunit); - mdpath[sizeof(mdpath) - 1] = '\0'; - ret = swap_on_off_sfile(mdpath, doingall); + + if (suffix != NULL && strcmp("eli", suffix) == 0) { + /* Swap on encrypted device by GEOM_ELI. */ + snprintf(mdpath, sizeof(mdpath), "%s%s%d" DOT_ELI, _PATH_DEV, + MD_NAME, mdunit); + mdpath[sizeof(mdpath) - 1] = '\0'; + ret = swap_on_off_geli(mdpath, mntops, doingall); + } else { + snprintf(mdpath, sizeof(mdpath), "%s%s%d", _PATH_DEV, + MD_NAME, mdunit); + mdpath[sizeof(mdpath) - 1] = '\0'; + ret = swap_on_off_sfile(mdpath, doingall); + } if (which_prog == SWAPOFF) { if (ret != NULL) { diff --git a/sbin/swapon/tests/Makefile b/sbin/swapon/tests/Makefile new file mode 100644 index 000000000000..aa0c9cf202d6 --- /dev/null +++ b/sbin/swapon/tests/Makefile @@ -0,0 +1,5 @@ +ATF_TESTS_SH= swapon_test + +TEST_METADATA.swapon_test+= required_user="root" + +.include diff --git a/sbin/swapon/tests/swapon_test.sh b/sbin/swapon/tests/swapon_test.sh new file mode 100755 index 000000000000..3c4286cd6815 --- /dev/null +++ b/sbin/swapon/tests/swapon_test.sh @@ -0,0 +1,181 @@ +# Copyright (c) 2025 Ronald Klop +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# + +atf_test_case attach_mdX cleanup +attach_mdX_head() +{ + atf_set "descr" "mdX device should attach" +} +attach_mdX_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md3 none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3 as swap device" -x "swapon -F fstab.out -a" +} +attach_mdX_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_mdX cleanup +attach_dev_mdX_head() +{ + atf_set "descr" "/dev/mdX device should attach" +} +attach_dev_mdX_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md3 none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3 as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_mdX_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_md cleanup +attach_md_head() +{ + atf_set "descr" "mdX device should attach" +} +attach_md_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0 as swap device" -x "swapon -F fstab.out -a" +} +attach_md_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_md cleanup +attach_dev_md_head() +{ + atf_set "descr" "/dev/md device should attach" +} +attach_dev_md_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0 as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_md_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_mdX_eli cleanup +attach_mdX_eli_head() +{ + atf_set "descr" "mdX.eli device should attach" +} +attach_mdX_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md3.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_mdX_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_mdX_eli cleanup +attach_dev_mdX_eli_head() +{ + atf_set "descr" "/dev/mdX.eli device should attach" +} +attach_dev_mdX_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md3.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_mdX_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_md_eli cleanup +attach_md_eli_head() +{ + atf_set "descr" "md.eli device should attach" +} +attach_md_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_md_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_md_eli cleanup +attach_dev_md_eli_head() +{ + atf_set "descr" "/dev/md.eli device should attach" +} +attach_dev_md_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_md_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_init_test_cases() +{ + atf_add_test_case attach_mdX + atf_add_test_case attach_dev_mdX + atf_add_test_case attach_md + atf_add_test_case attach_dev_md + + atf_add_test_case attach_mdX_eli + atf_add_test_case attach_dev_mdX_eli + atf_add_test_case attach_md_eli + atf_add_test_case attach_dev_md_eli +} From nobody Thu Jun 26 11:20:34 2025 X-Original-To: dev-commits-src-main@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 4bSbpG1sHyz60QX6; Thu, 26 Jun 2025 11:20:38 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSbpG1bkgz3JVR; Thu, 26 Jun 2025 11:20:38 +0000 (UTC) (envelope-from gbe@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750936838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Uz1DH291IeiKGHMopfDy0t6jl3xiJj1Nsv4b2reHbeA=; b=f8e6QffL5Xo6HPDo8Aj/m5TMbkwOwtlKPglDwrVVBB4x8WI3FdDAREP4CofSLztlDkgXBD P2A6ma7ViRKswKSmQxrI0PkZyRkJ5WNiwBf3Mwt/Vha9e+QIoSkT7TLGzPgSvQ+rDI2w+2 4oNuerIliAoxt+FqElFgsape4dKmgdv6fhzm7D9iXsh4yvreECkd1QTushFCTv1BpEN5uo /HeoANT4ctvExNZY6bR0IwK1MuLg3LVYZJGB94GtvDLfofKH7M6LaC/vGOLQNTIj2sJ7LM FLDEEnC9almi39mWF5lq8AbzpM/94yGXImcXaa6m9S0RZgxK4Nf/hI2+FKez+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750936838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Uz1DH291IeiKGHMopfDy0t6jl3xiJj1Nsv4b2reHbeA=; b=C+MNE8+GKvQN+QjVYtGrgZdJLHm1G/qYKFdn42+dG55C4s2gf7hLCX41WfX6mehpApxkEU lMq8oXIjcis6AIGR6zQv44pSP4Sx/WzbJvLRarDyPtVPuM0MiVGbbBqYwlsFW17lkrePIN c1WBtiky0Yr+5MIdmU9iRNwlGo4KpA1Y5w07NtE141UF7fEQHDDgyJZ+Z+aXVlqLueu02g mW8dIJjTMziHBRsksGtREnqHNlYR2b9ARF2x3eGvggpZcsF4PdJUiwWvntKdmGZbQNq6rv TrfFlEzNcuT7r/ztIItTmCQp1vz65DD9AWUz7g9nORELAQUNn9q2mhrafSATTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750936838; a=rsa-sha256; cv=none; b=L17pvGpmgVb14zKd84RW1TDjv0DbKxG9D/IAhI7aIPB9in5JT2T86cJvO9Yb7q+XyVkhGs H73UDvG6siWzGjEc3TdY1wRfx0cg4Zu1pwJ+iopiHMojVnQJVLBHCfg1bV0c8Yq/VXudwD MjCiR6aiLLeHP1UUyZONoXwIWbtItqD8aA9H5TpaWAV2NCH4wbOa73CTLqfnpbs2ZP4Dhn xzHi+lWYESoDUgzQYHfqsTAhq7CCiManZA8pgXAR60yPhNIOz/EQLludEiZ/di2YyNtK31 +7eSJrDJWrpYM0CrQqGeEsqi3luAs1zjyqygQXgA8vuFPuL+zQM3voBb5mrTeA== Received: from localhost (p4fd8b8c9.dip0.t-ipconnect.de [79.216.184.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bSbpF3Qy0zl95; Thu, 26 Jun 2025 11:20:37 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Date: Thu, 26 Jun 2025 13:20:34 +0200 From: Gordon Bergling To: Baptiste Daroussin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 0f5c86ddb025 - main - libyaml: import libyaml vendor version 0.2.5 Message-ID: References: <202506260705.55Q7580o023061@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hzrBVIImQuW1ziHm" Content-Disposition: inline In-Reply-To: <202506260705.55Q7580o023061@gitrepo.freebsd.org> X-Url: X-Operating-System: Darwin 24.5.0 arm64 X-Host-Uptime: 13:18 up 36 days, 19:37, 3 users, load averages: 8.38 4.05 2.56 --hzrBVIImQuW1ziHm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Bapt, I am getting a buildworld error on both amd64 and aarch64. [...] =3D=3D=3D> usr.sbin/rtsold (includes) =3D=3D=3D> usr.bin/what (includes) =3D=3D=3D> lib/libthr/tests (includes) install: /build/storage/freebsd/src/current/amd64.amd64/tmp/usr/include/pri= vate/yaml: No such file or directory [...] It is a NO_CLEAN=3Dyes build. Is there maybe something missing from the vendor import? --Gordon On Thu, Jun 26, 2025 at 07:05:08AM +0000, Baptiste Daroussin wrote: > The branch main has been updated by bapt: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D0f5c86ddb0257f4b7620f1d8e8= 98289be30b19bf >=20 > commit 0f5c86ddb0257f4b7620f1d8e898289be30b19bf > Merge: 44d6f4b314ad 5f99da5545eb > Author: Baptiste Daroussin > AuthorDate: 2025-06-26 06:57:37 +0000 > Commit: Baptiste Daroussin > CommitDate: 2025-06-26 07:02:31 +0000 >=20 > libyaml: import libyaml vendor version 0.2.5 > =20 > The yaml parser used in nuageinit is too incomplete, import libyaml > in order to be able to use as a complete parser for nuageinit. >=20 > contrib/libyaml/.appveyor.yml | 29 + > contrib/libyaml/.github/workflows/main.yml | 59 + > contrib/libyaml/.gitignore | 46 + > contrib/libyaml/.indent.pro | 1 + > contrib/libyaml/.makefile | 63 + > contrib/libyaml/.travis.yml | 28 + > contrib/libyaml/CMakeLists.txt | 160 + > contrib/libyaml/Changes | 372 ++ > contrib/libyaml/License | 20 + > contrib/libyaml/Makefile.am | 54 + > contrib/libyaml/ReadMe.md | 46 + > contrib/libyaml/announcement.msg | 89 + > contrib/libyaml/bootstrap | 3 + > contrib/libyaml/configure.ac | 73 + > contrib/libyaml/doc/doxygen.cfg | 222 ++ > contrib/libyaml/docker/README.mkd | 17 + > contrib/libyaml/docker/alpine-3.7 | 26 + > contrib/libyaml/docker/fedora-25 | 26 + > contrib/libyaml/docker/ubuntu-14.04 | 29 + > contrib/libyaml/docker/ubuntu-16.04 | 24 + > contrib/libyaml/examples/anchors.yaml | 10 + > contrib/libyaml/examples/array.yaml | 2 + > contrib/libyaml/examples/global-tag.yaml | 14 + > contrib/libyaml/examples/json.yaml | 1 + > contrib/libyaml/examples/mapping.yaml | 2 + > contrib/libyaml/examples/numbers.yaml | 1 + > contrib/libyaml/examples/strings.yaml | 7 + > contrib/libyaml/examples/tags.yaml | 7 + > contrib/libyaml/examples/yaml-version.yaml | 3 + > contrib/libyaml/include/Makefile.am | 17 + > contrib/libyaml/include/yaml.h | 1985 +++++++++++ > ...terfuzz-testcase-minimized-5607885063061504.yml | 1 + > contrib/libyaml/src/Makefile.am | 4 + > contrib/libyaml/src/api.c | 1393 ++++++++ > contrib/libyaml/src/dumper.c | 394 +++ > contrib/libyaml/src/emitter.c | 2358 +++++++++++++ > contrib/libyaml/src/loader.c | 544 +++ > contrib/libyaml/src/parser.c | 1375 ++++++++ > contrib/libyaml/src/reader.c | 469 +++ > contrib/libyaml/src/scanner.c | 3598 ++++++++++++++= ++++++ > contrib/libyaml/src/writer.c | 141 + > contrib/libyaml/src/yaml_private.h | 684 ++++ > contrib/libyaml/tests/CMakeLists.txt | 27 + > contrib/libyaml/tests/Makefile.am | 9 + > contrib/libyaml/tests/ReadMe.md | 63 + > contrib/libyaml/tests/example-deconstructor-alt.c | 800 +++++ > contrib/libyaml/tests/example-deconstructor.c | 1127 ++++++ > contrib/libyaml/tests/example-reformatter-alt.c | 217 ++ > contrib/libyaml/tests/example-reformatter.c | 202 ++ > contrib/libyaml/tests/run-all-tests.sh | 29 + > contrib/libyaml/tests/run-dumper.c | 314 ++ > contrib/libyaml/tests/run-emitter-test-suite.c | 290 ++ > contrib/libyaml/tests/run-emitter.c | 327 ++ > contrib/libyaml/tests/run-loader.c | 63 + > contrib/libyaml/tests/run-parser-test-suite.c | 189 + > contrib/libyaml/tests/run-parser.c | 63 + > contrib/libyaml/tests/run-scanner.c | 63 + > contrib/libyaml/tests/test-reader.c | 354 ++ > contrib/libyaml/tests/test-version.c | 29 + > contrib/libyaml/yaml-0.1.pc.in | 10 + > contrib/libyaml/yamlConfig.cmake.in | 16 + > lib/Makefile | 1 + > lib/libyaml/Makefile | 29 + > share/mk/src.libnames.mk | 1 + > 64 files changed, 18620 insertions(+) >=20 > diff --cc contrib/libyaml/.appveyor.yml > index 000000000000,36d706aecdf5..36d706aecdf5 > mode 000000,100644..100644 > --- a/contrib/libyaml/.appveyor.yml > +++ b/contrib/libyaml/.appveyor.yml > diff --cc contrib/libyaml/.github/workflows/main.yml > index 000000000000,c2bdef471011..c2bdef471011 > mode 000000,100644..100644 > --- a/contrib/libyaml/.github/workflows/main.yml > +++ b/contrib/libyaml/.github/workflows/main.yml > diff --cc contrib/libyaml/.gitignore > index 000000000000,000000000000..90840c8ac2de > new file mode 100644 > --- /dev/null > +++ b/contrib/libyaml/.gitignore > @@@ -1,0 -1,0 +1,46 @@@ > ++*.BAK > ++*.a > ++*.cmake > ++*.dll > ++*.exe > ++*.la > ++*.lo > ++*.log > ++*.o > ++*.pc > ++*.so > ++*.trs > ++*~ > ++.deps/ > ++.libs/ > ++/Testing/ > ++/libtool > ++CMakeCache.txt > ++CMakeFiles/ > ++GNUmakefile > ++Makefile > ++Makefile.in > ++/aclocal.m4 > ++/autom4te.cache > ++/config > ++config.h* > ++/config.status > ++/configure > ++stamp-h1 > ++!config/config.h.in > ++/packaging/ > ++/tests/run-dumper > ++/tests/run-emitter > ++/tests/run-emitter-test-suite > ++/tests/run-loader > ++/tests/run-parser > ++/tests/run-parser-test-suite > ++/tests/run-scanner > ++/tests/example-deconstructor > ++/tests/example-deconstructor-alt > ++/tests/example-reformatter > ++/tests/example-reformatter-alt > ++/tests/run-test-suite > ++/tests/test-reader > ++/tests/test-version > ++/dist/ > diff --cc contrib/libyaml/.indent.pro > index 000000000000,d647720f74d6..d647720f74d6 > mode 000000,100644..100644 > --- a/contrib/libyaml/.indent.pro > +++ b/contrib/libyaml/.indent.pro > diff --cc contrib/libyaml/.makefile > index 000000000000,9d526a4d3983..9d526a4d3983 > mode 000000,100644..100644 > --- a/contrib/libyaml/.makefile > +++ b/contrib/libyaml/.makefile > diff --cc contrib/libyaml/.travis.yml > index 000000000000,dca3bc73c4c5..dca3bc73c4c5 > mode 000000,100644..100644 > --- a/contrib/libyaml/.travis.yml > +++ b/contrib/libyaml/.travis.yml > diff --cc contrib/libyaml/CMakeLists.txt > index 000000000000,4f811481779a..4f811481779a > mode 000000,100644..100644 > --- a/contrib/libyaml/CMakeLists.txt > +++ b/contrib/libyaml/CMakeLists.txt > diff --cc contrib/libyaml/Changes > index 000000000000,e4b96edcbef7..e4b96edcbef7 > mode 000000,100644..100644 > --- a/contrib/libyaml/Changes > +++ b/contrib/libyaml/Changes > diff --cc contrib/libyaml/License > index 000000000000,3d82c281ee8c..3d82c281ee8c > mode 000000,100644..100644 > --- a/contrib/libyaml/License > +++ b/contrib/libyaml/License > diff --cc contrib/libyaml/Makefile.am > index 000000000000,551c74071f7a..551c74071f7a > mode 000000,100644..100644 > --- a/contrib/libyaml/Makefile.am > +++ b/contrib/libyaml/Makefile.am > diff --cc contrib/libyaml/ReadMe.md > index 000000000000,2dfcc4476dcd..2dfcc4476dcd > mode 000000,100644..100644 > --- a/contrib/libyaml/ReadMe.md > +++ b/contrib/libyaml/ReadMe.md > diff --cc contrib/libyaml/announcement.msg > index 000000000000,080a864b65d5..080a864b65d5 > mode 000000,100644..100644 > --- a/contrib/libyaml/announcement.msg > +++ b/contrib/libyaml/announcement.msg > diff --cc contrib/libyaml/bootstrap > index 000000000000,1745838c5364..1745838c5364 > mode 000000,100755..100755 > --- a/contrib/libyaml/bootstrap > +++ b/contrib/libyaml/bootstrap > diff --cc contrib/libyaml/configure.ac > index 000000000000,92426f04ec43..92426f04ec43 > mode 000000,100644..100644 > --- a/contrib/libyaml/configure.ac > +++ b/contrib/libyaml/configure.ac > diff --cc contrib/libyaml/doc/doxygen.cfg > index 000000000000,a58bb177a4d2..a58bb177a4d2 > mode 000000,100644..100644 > --- a/contrib/libyaml/doc/doxygen.cfg > +++ b/contrib/libyaml/doc/doxygen.cfg > diff --cc contrib/libyaml/docker/README.mkd > index 000000000000,71c13e17cb12..71c13e17cb12 > mode 000000,100644..100644 > --- a/contrib/libyaml/docker/README.mkd > +++ b/contrib/libyaml/docker/README.mkd > diff --cc contrib/libyaml/docker/alpine-3.7 > index 000000000000,ac2d625beda9..ac2d625beda9 > mode 000000,100644..100644 > --- a/contrib/libyaml/docker/alpine-3.7 > +++ b/contrib/libyaml/docker/alpine-3.7 > diff --cc contrib/libyaml/docker/fedora-25 > index 000000000000,36e58ab0186d..36e58ab0186d > mode 000000,100644..100644 > --- a/contrib/libyaml/docker/fedora-25 > +++ b/contrib/libyaml/docker/fedora-25 > diff --cc contrib/libyaml/docker/ubuntu-14.04 > index 000000000000,6a2b1346fca1..6a2b1346fca1 > mode 000000,100644..100644 > --- a/contrib/libyaml/docker/ubuntu-14.04 > +++ b/contrib/libyaml/docker/ubuntu-14.04 > diff --cc contrib/libyaml/docker/ubuntu-16.04 > index 000000000000,87b7afdfc20e..87b7afdfc20e > mode 000000,100644..100644 > --- a/contrib/libyaml/docker/ubuntu-16.04 > +++ b/contrib/libyaml/docker/ubuntu-16.04 > diff --cc contrib/libyaml/examples/anchors.yaml > index 000000000000,875585317000..875585317000 > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/anchors.yaml > +++ b/contrib/libyaml/examples/anchors.yaml > diff --cc contrib/libyaml/examples/array.yaml > index 000000000000,18efd12efbde..18efd12efbde > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/array.yaml > +++ b/contrib/libyaml/examples/array.yaml > diff --cc contrib/libyaml/examples/global-tag.yaml > index 000000000000,1180757d81cb..1180757d81cb > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/global-tag.yaml > +++ b/contrib/libyaml/examples/global-tag.yaml > diff --cc contrib/libyaml/examples/json.yaml > index 000000000000,7822ddc8342f..7822ddc8342f > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/json.yaml > +++ b/contrib/libyaml/examples/json.yaml > diff --cc contrib/libyaml/examples/mapping.yaml > index 000000000000,53d256787c9f..53d256787c9f > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/mapping.yaml > +++ b/contrib/libyaml/examples/mapping.yaml > diff --cc contrib/libyaml/examples/numbers.yaml > index 000000000000,45d2bf01b2ff..45d2bf01b2ff > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/numbers.yaml > +++ b/contrib/libyaml/examples/numbers.yaml > diff --cc contrib/libyaml/examples/strings.yaml > index 000000000000,31b641f4f3cd..31b641f4f3cd > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/strings.yaml > +++ b/contrib/libyaml/examples/strings.yaml > diff --cc contrib/libyaml/examples/tags.yaml > index 000000000000,3d5a010ac0a6..3d5a010ac0a6 > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/tags.yaml > +++ b/contrib/libyaml/examples/tags.yaml > diff --cc contrib/libyaml/examples/yaml-version.yaml > index 000000000000,122b5082b6a7..122b5082b6a7 > mode 000000,100644..100644 > --- a/contrib/libyaml/examples/yaml-version.yaml > +++ b/contrib/libyaml/examples/yaml-version.yaml > diff --cc contrib/libyaml/include/Makefile.am > index 000000000000,3882a2f63dd5..3882a2f63dd5 > mode 000000,100644..100644 > --- a/contrib/libyaml/include/Makefile.am > +++ b/contrib/libyaml/include/Makefile.am > diff --cc contrib/libyaml/include/yaml.h > index 000000000000,89050e4f7dc6..89050e4f7dc6 > mode 000000,100644..100644 > --- a/contrib/libyaml/include/yaml.h > +++ b/contrib/libyaml/include/yaml.h > diff --cc contrib/libyaml/regression-inputs/clusterfuzz-testcase-minimize= d-5607885063061504.yml > index 000000000000,72e9492c1348..72e9492c1348 > mode 000000,100644..100644 > --- a/contrib/libyaml/regression-inputs/clusterfuzz-testcase-minimized-56= 07885063061504.yml > +++ b/contrib/libyaml/regression-inputs/clusterfuzz-testcase-minimized-56= 07885063061504.yml > diff --cc contrib/libyaml/src/Makefile.am > index 000000000000,24cf89d241dd..24cf89d241dd > mode 000000,100644..100644 > --- a/contrib/libyaml/src/Makefile.am > +++ b/contrib/libyaml/src/Makefile.am > diff --cc contrib/libyaml/src/api.c > index 000000000000,16f88bd762aa..16f88bd762aa > mode 000000,100644..100644 > --- a/contrib/libyaml/src/api.c > +++ b/contrib/libyaml/src/api.c > diff --cc contrib/libyaml/src/dumper.c > index 000000000000,1fe940b674da..1fe940b674da > mode 000000,100644..100644 > --- a/contrib/libyaml/src/dumper.c > +++ b/contrib/libyaml/src/dumper.c > diff --cc contrib/libyaml/src/emitter.c > index 000000000000,609b28a4c6e1..609b28a4c6e1 > mode 000000,100644..100644 > --- a/contrib/libyaml/src/emitter.c > +++ b/contrib/libyaml/src/emitter.c > diff --cc contrib/libyaml/src/loader.c > index 000000000000,dea8ac428c2a..dea8ac428c2a > mode 000000,100644..100644 > --- a/contrib/libyaml/src/loader.c > +++ b/contrib/libyaml/src/loader.c > diff --cc contrib/libyaml/src/parser.c > index 000000000000,ec2f8d3e0551..ec2f8d3e0551 > mode 000000,100644..100644 > --- a/contrib/libyaml/src/parser.c > +++ b/contrib/libyaml/src/parser.c > diff --cc contrib/libyaml/src/reader.c > index 000000000000,f3ac54c2517d..f3ac54c2517d > mode 000000,100644..100644 > --- a/contrib/libyaml/src/reader.c > +++ b/contrib/libyaml/src/reader.c > diff --cc contrib/libyaml/src/scanner.c > index 000000000000,c6b498765646..c6b498765646 > mode 000000,100644..100644 > --- a/contrib/libyaml/src/scanner.c > +++ b/contrib/libyaml/src/scanner.c > diff --cc contrib/libyaml/src/writer.c > index 000000000000,5d57f392f1eb..5d57f392f1eb > mode 000000,100644..100644 > --- a/contrib/libyaml/src/writer.c > +++ b/contrib/libyaml/src/writer.c > diff --cc contrib/libyaml/src/yaml_private.h > index 000000000000,b3351c41655c..b3351c41655c > mode 000000,100644..100644 > --- a/contrib/libyaml/src/yaml_private.h > +++ b/contrib/libyaml/src/yaml_private.h > diff --cc contrib/libyaml/tests/CMakeLists.txt > index 000000000000,be2ce399a6bf..be2ce399a6bf > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/CMakeLists.txt > +++ b/contrib/libyaml/tests/CMakeLists.txt > diff --cc contrib/libyaml/tests/Makefile.am > index 000000000000,9597b7fef3ef..9597b7fef3ef > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/Makefile.am > +++ b/contrib/libyaml/tests/Makefile.am > diff --cc contrib/libyaml/tests/ReadMe.md > index 000000000000,bf09447f53f3..bf09447f53f3 > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/ReadMe.md > +++ b/contrib/libyaml/tests/ReadMe.md > diff --cc contrib/libyaml/tests/example-deconstructor-alt.c > index 000000000000,b29c0777b09a..b29c0777b09a > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/example-deconstructor-alt.c > +++ b/contrib/libyaml/tests/example-deconstructor-alt.c > diff --cc contrib/libyaml/tests/example-deconstructor.c > index 000000000000,e048ee6bf0ad..e048ee6bf0ad > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/example-deconstructor.c > +++ b/contrib/libyaml/tests/example-deconstructor.c > diff --cc contrib/libyaml/tests/example-reformatter-alt.c > index 000000000000,e7d006e4a64a..e7d006e4a64a > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/example-reformatter-alt.c > +++ b/contrib/libyaml/tests/example-reformatter-alt.c > diff --cc contrib/libyaml/tests/example-reformatter.c > index 000000000000,08f860c4ef2f..08f860c4ef2f > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/example-reformatter.c > +++ b/contrib/libyaml/tests/example-reformatter.c > diff --cc contrib/libyaml/tests/run-all-tests.sh > index 000000000000,9c92741eca38..9c92741eca38 > mode 000000,100755..100755 > --- a/contrib/libyaml/tests/run-all-tests.sh > +++ b/contrib/libyaml/tests/run-all-tests.sh > diff --cc contrib/libyaml/tests/run-dumper.c > index 000000000000,04c5beeafa57..04c5beeafa57 > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/run-dumper.c > +++ b/contrib/libyaml/tests/run-dumper.c > diff --cc contrib/libyaml/tests/run-emitter-test-suite.c > index 000000000000,ba0f163ad39f..ba0f163ad39f > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/run-emitter-test-suite.c > +++ b/contrib/libyaml/tests/run-emitter-test-suite.c > diff --cc contrib/libyaml/tests/run-emitter.c > index 000000000000,3ffe4754b23e..3ffe4754b23e > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/run-emitter.c > +++ b/contrib/libyaml/tests/run-emitter.c > diff --cc contrib/libyaml/tests/run-loader.c > index 000000000000,8c36b668ce20..8c36b668ce20 > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/run-loader.c > +++ b/contrib/libyaml/tests/run-loader.c > diff --cc contrib/libyaml/tests/run-parser-test-suite.c > index 000000000000,5bdd66238ddd..5bdd66238ddd > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/run-parser-test-suite.c > +++ b/contrib/libyaml/tests/run-parser-test-suite.c > diff --cc contrib/libyaml/tests/run-parser.c > index 000000000000,13031121ae49..13031121ae49 > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/run-parser.c > +++ b/contrib/libyaml/tests/run-parser.c > diff --cc contrib/libyaml/tests/run-scanner.c > index 000000000000,2c79e7ccf380..2c79e7ccf380 > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/run-scanner.c > +++ b/contrib/libyaml/tests/run-scanner.c > diff --cc contrib/libyaml/tests/test-reader.c > index 000000000000,40f8199e009f..40f8199e009f > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/test-reader.c > +++ b/contrib/libyaml/tests/test-reader.c > diff --cc contrib/libyaml/tests/test-version.c > index 000000000000,0c598377f95f..0c598377f95f > mode 000000,100644..100644 > --- a/contrib/libyaml/tests/test-version.c > +++ b/contrib/libyaml/tests/test-version.c > diff --cc contrib/libyaml/yaml-0.1.pc.in > index 000000000000,70c80084dd42..70c80084dd42 > mode 000000,100644..100644 > --- a/contrib/libyaml/yaml-0.1.pc.in > +++ b/contrib/libyaml/yaml-0.1.pc.in > diff --cc contrib/libyaml/yamlConfig.cmake.in > index 000000000000,dd3f8ee25285..dd3f8ee25285 > mode 000000,100644..100644 > --- a/contrib/libyaml/yamlConfig.cmake.in > +++ b/contrib/libyaml/yamlConfig.cmake.in > diff --cc lib/Makefile > index fcb4bd95fecb,000000000000..3417e7b30cb4 > mode 100644,000000..100644 > --- a/lib/Makefile > +++ b/lib/Makefile > @@@ -1,242 -1,0 +1,243 @@@ > +.include > + > +# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used = by many > +# of the other libraries. These are built first with a .WAIT between t= hem > +# and the main list to avoid needing a SUBDIR_DEPEND line on every libr= ary > +# naming just these few items. > + > +SUBDIR_BOOTSTRAP=3D \ > + csu \ > + .WAIT \ > + libc \ > + libc_nonshared \ > + libcompiler_rt \ > + ${_libclang_rt} \ > + libc++ \ > + libc++experimental \ > + libcxxrt \ > + libder \ > + libdiff \ > + libelf \ > + libssp \ > + libssp_nonshared \ > + libsys \ > + msun > + > +# The main list; please keep these sorted alphabetically. > +# The only exception is sqlite3: we place it at the start of the list s= ince it > +# takes a long time to build and starting it first improves parallelism. > + > +SUBDIR=3D ${SUBDIR_BOOTSTRAP} \ > + .WAIT \ > + libsqlite3 \ > + geom \ > + lib9p \ > + libalias \ > + libarchive \ > + libauditd \ > + libbegemot \ > + libblocksruntime \ > + libbsddialog \ > + libbsdstat \ > + libbsm \ > + libbz2 \ > + libcalendar \ > + libcam \ > + libcapsicum \ > + libcasper \ > + libcompat \ > + libcrypt \ > + libdevctl \ > + libdevdctl \ > + libdevinfo \ > + libdevstat \ > + libdl \ > + libdwarf \ > + libedit \ > + libelftc \ > + libevent1 \ > + libexecinfo \ > + libexpat \ > + libfetch \ > + libgcc_eh \ > + libgcc_s \ > + libgeom \ > + libifconfig \ > + libipsec \ > + libiscsiutil \ > + libjail \ > + libkiconv \ > + libkldelf \ > + libkvm \ > + liblua \ > + liblzma \ > + libmemstat \ > + libmd \ > + libmixer \ > + libmt \ > + lib80211 \ > + libnetbsd \ > + libnetmap \ > + libnv \ > + libnvmf \ > + libopenbsd \ > + libpam \ > + libpathconv \ > + libpcap \ > + libpjdlog \ > + libproc \ > + libprocstat \ > + libregex \ > + librpcsvc \ > + librss \ > + librt \ > + librtld_db \ > + libsbuf \ > + libsmb \ > + libstdbuf \ > + libstdthreads \ > + libsysdecode \ > + libtacplus \ > + libthr \ > + libthread_db \ > + libucl \ > + libufs \ > + libugidfw \ > + libulog \ > + libutil \ > + ${_libvgl} \ > + libwrap \ > + libxo \ > + liby \ > ++ libyaml \ > + libz \ > + libzstd \ > + ncurses \ > + nss_tacplus > + > +# Inter-library dependencies. When the makefile for a library contains= LDADD > +# libraries, those libraries should be listed as build order dependenci= es here. > + > +SUBDIR_DEPEND_geom=3D libufs > +SUBDIR_DEPEND_googletest=3D libregex > +SUBDIR_DEPEND_libarchive=3D libz libbz2 libexpat liblzma libmd libzstd > +SUBDIR_DEPEND_libauditdm=3D libbsm > +SUBDIR_DEPEND_libbsddialog=3D ncurses > +SUBDIR_DEPEND_libbsnmp=3D ${_libnetgraph} > +SUBDIR_DEPEND_libc++:=3D libcxxrt > +# libssp_nonshared doesn't need to be linked into libc on every arch, b= ut it is > +# small enough to build that this bit of serialization is likely insign= ificant. > +SUBDIR_DEPEND_libc=3D libsys libcompiler_rt libssp_nonshared > +SUBDIR_DEPEND_libcam=3D libsbuf > +SUBDIR_DEPEND_libcasper=3D libnv > +SUBDIR_DEPEND_libcrypt=3D libmd > +SUBDIR_DEPEND_libdevstat=3D libkvm > +SUBDIR_DEPEND_libdpv=3D libfigpar ncurses libutil > +SUBDIR_DEPEND_libedit=3D ncurses > +SUBDIR_DEPEND_libgeom=3D libexpat libsbuf > +SUBDIR_DEPEND_librpcsec_gss=3D libgssapi > +SUBDIR_DEPEND_libmagic=3D libz > +SUBDIR_DEPEND_libmemstat=3D libkvm > +SUBDIR_DEPEND_libpam=3D libcrypt ${_libradius} librpcsvc libtacplus lib= util ${_libypclnt} ${_libcom_err} > +SUBDIR_DEPEND_libpjdlog=3D libutil > +SUBDIR_DEPEND_libprocstat=3D libkvm libutil > +SUBDIR_DEPEND_libradius=3D libmd > +SUBDIR_DEPEND_libsmb=3D libkiconv > +# See comment above about libssp_nonshared > +SUBDIR_DEPEND_libsys=3D libcompiler_rt libssp_nonshared > +SUBDIR_DEPEND_libtacplus=3D libmd > +SUBDIR_DEPEND_libulog=3D libmd > +SUBDIR_DEPEND_libunbound=3D ${_libldns} > +SUBDIR_DEPEND_liblzma=3D libthr > +.if ${MK_OFED} !=3D "no" > +SUBDIR_DEPEND_libpcap=3D ofed > +.endif > +SUBDIR_DEPEND_nss_tacplus=3D libtacplus > + > +# NB: keep these sorted by MK_* knobs > + > +SUBDIR.${MK_BEARSSL}+=3D libbearssl libsecureboot > +SUBDIR.${MK_BLACKLIST}+=3Dlibblacklist > +SUBDIR.${MK_BLUETOOTH}+=3Dlibbluetooth libsdp > +SUBDIR.${MK_BSNMP}+=3D libbsnmp > + > +.if !defined(COMPAT_LIBCOMPAT) > +.if ${MK_CLANG} !=3D "no" || ${MK_LLD} !=3D "no" || \ > + ${MK_LLDB} !=3D "no" || ${MK_LLVM_BINUTILS} !=3D "no" > +SUBDIR+=3D clang > +.endif > +.endif > + > +SUBDIR.${MK_CUSE}+=3D libcuse > +SUBDIR.${MK_TOOLCHAIN}+=3Dlibpe > +SUBDIR.${MK_DIALOG}+=3D libdpv libfigpar > +SUBDIR.${MK_FDT}+=3D libfdt > +SUBDIR.${MK_FILE}+=3D libmagic > +SUBDIR.${MK_GPIO}+=3D libgpio > +SUBDIR.${MK_GSSAPI}+=3D libgssapi librpcsec_gss > +SUBDIR.${MK_ICONV}+=3D libiconv_modules > +.if ${MK_MITKRB5} =3D=3D "no" > +SUBDIR.${MK_KERBEROS_SUPPORT}+=3D libcom_err > +.endif > +SUBDIR.${MK_LDNS}+=3D libldns > +SUBDIR.${MK_STATS}+=3D libstats > + > +# The libraries under libclang_rt can only be built by clang. > +.if (${COMPILER_TYPE} =3D=3D "clang" || make(clean) || make(cleandir)) = && \ > + ${MK_CLANG} !=3D "no" > +_libclang_rt=3D libclang_rt > +.elif (${MK_ASAN} !=3D "no" || ${MK_UBSAN} !=3D "no") && make(all) > +.error Requested build with sanitizers but cannot build runtime librari= es! > +.endif > + > +# This construct disables libefivar for 32-bit build. > +.if ${MACHINE_CPUARCH} !=3D "i386" > +SUBDIR.${MK_EFI}+=3D libefivar > +.endif > +SUBDIR.${MK_GOOGLETEST}+=3D googletest > +SUBDIR.${MK_NETGRAPH}+=3D libnetgraph > +SUBDIR.${MK_NIS}+=3D libypclnt > + > +.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "amd6= 4" > +_libvgl=3D libvgl > +.endif > + > +.if ${MACHINE_CPUARCH} =3D=3D "aarch64" > +SUBDIR.${MK_PMC}+=3D libopencsd > +.endif > + > +.if ${MACHINE_CPUARCH} =3D=3D "amd64" > +SUBDIR.${MK_PMC}+=3D libipt > +.endif > + > +.if ${MACHINE_CPUARCH} =3D=3D "amd64" || ${MACHINE_CPUARCH} =3D=3D "aar= ch64" || \ > + ${MACHINE_CPUARCH} =3D=3D "riscv" > +SUBDIR.${MK_BHYVE}+=3D libvmmapi > +.endif > + > +.if ${MACHINE_ARCH} !=3D "powerpc" && ${MACHINE_CPUARCH} !=3D "arm" > +SUBDIR.${MK_OPENMP}+=3D libomp > +.endif > +.if ${MK_USB} !=3D "no" > +SUBDIR.${MK_OPENSSH}+=3D libcbor libfido2 > +.endif > +SUBDIR.${MK_OPENSSL}+=3D libmp > +SUBDIR.${MK_PF}+=3D libpfctl > +SUBDIR.${MK_PMC}+=3D libpmc libpmcstat > +SUBDIR.${MK_RADIUS_SUPPORT}+=3D libradius > +SUBDIR.${MK_SENDMAIL}+=3D libmilter libsm libsmdb libsmutil > +SUBDIR.${MK_TELNET}+=3D libtelnet > +SUBDIR.${MK_TESTS_SUPPORT}+=3D atf > +SUBDIR.${MK_TESTS_SUPPORT}+=3D liblutok > +SUBDIR.${MK_TESTS}+=3D tests > +SUBDIR.${MK_UNBOUND}+=3D libunbound > +SUBDIR.${MK_USB}+=3D libusbhid libusb > +SUBDIR.${MK_OFED}+=3D ofed > +SUBDIR.${MK_VERIEXEC}+=3D libveriexec > +SUBDIR.${MK_ZFS}+=3D libbe > + > +.if !make(install) > +SUBDIR_PARALLEL=3D > +.endif > + > +.include > diff --cc lib/libyaml/Makefile > index 000000000000,000000000000..6acd34f178a9 > new file mode 100644 > --- /dev/null > +++ b/lib/libyaml/Makefile > @@@ -1,0 -1,0 +1,29 @@@ > ++LIBYAML_DIR=3D ${SRCTOP}/contrib/libyaml > ++ > ++PACKAGE=3Dlib${LIB} > ++LIB=3D yaml > ++PRIVATELIB=3D true > ++SHLIB_MAJOR=3D 1 > ++SRCS=3D api.c \ > ++ dumper.c \ > ++ emitter.c \ > ++ loader.c \ > ++ parser.c \ > ++ reader.c \ > ++ scanner.c \ > ++ writer.c > ++ > ++.PATH: ${LIBYAML_DIR}/src \ > ++ ${LIBYAML_DIR}/include > ++ > ++INCS=3D yaml.h > ++ > ++WARNS?=3D 1 > ++CFLAGS+=3D -I${LIBYAML_DIR}/include \ > ++ -I${LIBYAML_DIR}/src \ > ++ -DYAML_VERSION_STRING=3D\"0.2.5\" \ > ++ -DYAML_VERSION_MAJOR=3D0 \ > ++ -DYAML_VERSION_MINOR=3D2 \ > ++ -DYAML_VERSION_PATCH=3D5 > ++ > ++.include > diff --cc share/mk/src.libnames.mk > index c5ff899ac9dc,000000000000..f21d519160d2 > mode 100644,000000..100644 > --- a/share/mk/src.libnames.mk > +++ b/share/mk/src.libnames.mk > @@@ -1,917 -1,0 +1,918 @@@ > +# > +# The include file define library names suitable > +# for INTERNALLIB and PRIVATELIB definition > + > +.if !target(____) > +.error src.libnames.mk cannot be included directly. > +.endif > + > +.if !target(____) > +____: .NOTMAIN > + > +.include > + > +_PRIVATELIBS=3D \ > + atf_c \ > + atf_cxx \ > + auditd \ > + bsddialog \ > + bsdstat \ > + cbor \ > + devdctl \ > + event1 \ > + fido2 \ > + gmock \ > + gtest \ > + gmock_main \ > + gtest_main \ > + heimipcc \ > + heimipcs \ > + kldelf \ > + ldns \ > + sqlite3 \ > + ssh \ > + ucl \ > + unbound \ > ++ yaml \ > + zstd > + > +# Let projects based on FreeBSD append to _PRIVATELIBS > +# by maintaining their own LOCAL_PRIVATELIBS list. > +_PRIVATELIBS+=3D ${LOCAL_PRIVATELIBS} > + > +_INTERNALLIBS=3D \ > + amu \ > + apputils \ > + bsnmptools \ > + c_nossp_pic \ > + cron \ > + der \ > + diff \ > + elftc \ > + fdt \ > + fifolog \ > + ifconfig \ > + ipf \ > + iscsiutil \ > + kadmin_common \ > + kprop_util \ > + krb5apputils \ > + krb5ss \ > + lpr \ > + lua \ > + lutok \ > + netbsd \ > + ntp \ > + ntpevent \ > + nvmf \ > + openbsd \ > + opts \ > + parse \ > + pe \ > + pfctl \ > + pkgecc \ > + pmcstat \ > + sl \ > + sm \ > + smdb \ > + smutil \ > + telnet \ > + vers \ > + wpaap \ > + wpacommon \ > + wpacrypto \ > + wpadrivers \ > + wpaeap_common \ > + wpaeap_peer \ > + wpaeap_server \ > + wpaeapol_auth \ > + wpaeapol_supp \ > + wpal2_packet \ > + wpapasn \ > + wparadius \ > + wparsn_supp \ > + wpatls \ > + wpautils \ > + wpawps > + > +# Let projects based on FreeBSD append to _INTERNALLIBS > +# by maintaining their own LOCAL_INTERNALLIBS list. > +_INTERNALLIBS+=3D ${LOCAL_INTERNALLIBS} > + > +_LIBRARIES=3D \ > + ${_PRIVATELIBS} \ > + ${_INTERNALLIBS} \ > + ${LOCAL_LIBRARIES} \ > + 80211 \ > + 9p \ > + alias \ > + archive \ > + asn1 \ > + avl \ > + BlocksRuntime \ > + be \ > + begemot \ > + bluetooth \ > + bsdxml \ > + bsm \ > + bsnmp \ > + bz2 \ > + c \ > + c_pic \ > + calendar \ > + cam \ > + casper \ > + cap_dns \ > + cap_fileargs \ > + cap_grp \ > + cap_net \ > + cap_netdb \ > + cap_pwd \ > + cap_sysctl \ > + cap_syslog \ > + com_err \ > + compiler_rt \ > + crypt \ > + crypto \ > + ctf \ > + cuse \ > + cxxrt \ > + devctl \ > + devdctl \ > + devinfo \ > + devstat \ > + dialog \ > + dl \ > + dpv \ > + dtrace \ > + dwarf \ > + edit \ > + efivar \ > + elf \ > + execinfo \ > + fetch \ > + figpar \ > + formw \ > + geom \ > + gpio \ > + gssapi \ > + gssapi_krb5 \ > + gssrpc \ > + hdb \ > + heimbase \ > + heimntlm \ > + heimsqlite \ > + hx509 \ > + icp \ > + ipsec \ > + ipt \ > + jail \ > + k5crypto \ > + kadm5 \ > + kadmin_common \ > + kafs5 \ > + kdb5 \ > + kdc \ > + kiconv \ > + krad \ > + krb5 \ > + krb5profile \ > + krb5support \ > + kvm \ > + l \ > + lzma \ > + m \ > + magic \ > + md \ > + memstat \ > + mp \ > + mt \ > + ncursesw \ > + netgraph \ > + netmap \ > + ngatm \ > + nv \ > + nvpair \ > + opencsd \ > + pam \ > + panel \ > + panelw \ > + pcap \ > + pcsclite \ > + pjdlog \ > + pmc \ > + proc \ > + procstat \ > + pthread \ > + radius \ > + regex \ > + roken \ > + rpcsec_gss \ > + rpcsvc \ > + rt \ > + rtld_db \ > + sbuf \ > + sdp \ > + sm \ > + smb \ > + spl \ > + ssl \ > + ssp_nonshared \ > + stats \ > + stdthreads \ > + supcplusplus \ > + sys \ > + sysdecode \ > + tacplus \ > + termcapw \ > + tinfow \ > + tpool \ > + ufs \ > + ugidfw \ > + ulog \ > + umem \ > + usb \ > + usbhid \ > + util \ > + uutil \ > + verto \ > + vmmapi \ > + wind \ > + wrap \ > + xo \ > + y \ > + ypclnt \ > + z \ > + zdb \ > + zfs_core \ > + zfs \ > + zfsbootenv \ > + zpool \ > + zutil > + > +.if ${MK_KERBEROS} !=3D "no" && ${MK_MITKRB5} !=3D "no" > +_LIBRARIES+=3D \ > + kadm5clnt_mit \ > + kadm5srv_mit > +.else > +_LIBRARIES+=3D \ > + kadm5clnt \ > + kadm5srv > +.endif > + > *** 656 LINES SKIPPED *** >=20 --hzrBVIImQuW1ziHm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAmhdLQEACgkQOQX2V8rP 09zvbwgAgNLUrvJjNMlK1UE5h4ceokIctT1GsG31DbUa8k1bj3v1NIMh59a2FOo2 jv9yKs/MtGLrC4F2bQ+UyCTLw5OB3DeAKGhMgK6FtwzkvlyWo6PbVkBqd79VhDjv 0xhC+5wkhhqq0ZM7sbGm0x0qFR0HiD+qGoGZUKI2ihsA3l8qpEVjw2rbggU7LNTp Z8EO0ELamDARyLMIoLrfsExF4toAnlPrsBl1dJGRhtLanYuYRImNskem39gFZglv sZT9ZSMPF2SBwsuvvNiWrBBXsiPN/rYfkBB0gfAklrAS8kFDJuNpGs3qSK/pHZfb E3YnESdQi8SmfoUv30cd8Gt9lIDUAA== =a4Nq -----END PGP SIGNATURE----- --hzrBVIImQuW1ziHm-- From nobody Thu Jun 26 11:47:49 2025 X-Original-To: dev-commits-src-main@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 4bScPd4MMQz60SBw; Thu, 26 Jun 2025 11:47: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 4bScPd3FJXz3hfD; Thu, 26 Jun 2025 11:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750938469; 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=uUewuTN+TNEo+38RAV24Lc2L7Fw9A33hEIAKCrnJtJo=; b=pZ2qGbRhIWC5pfRsQ0yOPZDv6d6RdcIa+ClT3MCIeggx3/o3t0HhVCJhWKHOfmgsm0gYVw q5RmpWD0KHf5AKdpPFNtymsrrPO1+CETbLLlPt9lfVoj15bDNVvCJRTeOmBFeansNlabl7 diE5RYDYeq+iIueyMfPDvQ3PcHPaDKxIFTvnYXSfwqM2kqz4nXpnwmHaZ4X8sh6JCZpzfw 34e3EDuwSDqzuUguhTsURFTBxrEpLLJVdITAzujLQafiGbT7b7ji4ltFaExJe9Y1LpeT3+ rOibfIckknh8bi6D7oOPxkFJ672jj5l5HxWf1YdebgGHyE/50Z/G6aty9AXDGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750938469; 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=uUewuTN+TNEo+38RAV24Lc2L7Fw9A33hEIAKCrnJtJo=; b=gQSOisVslEcw8+dp0Qq/XmYEnj1VGd2DV01L1SxyB07HVbc979uDen0aoHHDjRlLRQ+oq/ MvOrVsAO9IIZFWap0DSwJmU09JsteeQrLw5CwZvLxxPcsNorNQv7Gcsj64h+LHnKKI57I3 FrwMBe5qhPrVoE6weEQKFnav4ysitgSIjksR9aU1SuU85c+iWEy2x+1x4xpqmiHLFwVbEz ZJi+jRWeEGoojUv8t/En2U1IIEl+Cd3KiSMlk6YiHwAZH7b1DAVmdE7VcSjbb+jQ5OJIuH yekI9LPP/E2cFiRAZuihuAoY9Vo0WnJYxZ4Tj8gUr2ljdZpIex+JN0gOwNpwSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750938469; a=rsa-sha256; cv=none; b=JvVRq4Wc4RYedVNuuzQatWb6EGWb/3QCXsYVygvXMUF6P+2zbYpgMtOk16AcAXjWpmsuIZ iAWWviPMrZ1VIr6cmaeBWfuKB9VNLrYEdoSMeYQHA7KuIV0dsE5tLNmeAw0FN7jRv6yB2V 1o2ZzjfvHFJTOBKi9dRfDcWX3VCaAlIBHFfJaohOnnrvoptkoBWgMqFj//ayOiadH5rwur fBJ2XHGPI55BbzZc4K9PwnkAKjT5lfHKyjvEg10TG6LGaomslIA/Reif1C8KlfL+s6nH4u 9dP/snmXi5Ku6zPj8PNyU9nQote+8if4fzZq/glPpZBNVI8uppCRBruzAwiL/w== 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 4bScPd26QBz11xg; Thu, 26 Jun 2025 11:47: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 55QBlnN2059741; Thu, 26 Jun 2025 11:47:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QBln0e059738; Thu, 26 Jun 2025 11:47:49 GMT (envelope-from git) Date: Thu, 26 Jun 2025 11:47:49 GMT Message-Id: <202506261147.55QBln0e059738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 442472e1b72a - main - libyaml: add missing mtree entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 442472e1b72a8b540df3fe038ed96615fc0abd68 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=442472e1b72a8b540df3fe038ed96615fc0abd68 commit 442472e1b72a8b540df3fe038ed96615fc0abd68 Author: Baptiste Daroussin AuthorDate: 2025-06-26 11:31:12 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 11:47:37 +0000 libyaml: add missing mtree entry --- etc/mtree/BSD.usr.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index a6b5e4bed274..97b555e50dc1 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -30,6 +30,8 @@ .. ucl .. + yaml + .. zstd .. .. From nobody Thu Jun 26 11:47:50 2025 X-Original-To: dev-commits-src-main@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 4bScPf4rH6z60SjJ; Thu, 26 Jun 2025 11:47: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 4bScPf2yBzz3hbp; Thu, 26 Jun 2025 11:47:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750938470; 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=6nmTXCRTEuYNT6dqV0IP4rmDIsuLWGaXzJVOWj9r7Sw=; b=m5F7GfnCM1y2o3PSdjVQtnTXrlSwERp2xwbGdLT9skXLhVZ/NbouZ52QQwSI1aw678mhuY ohcPUcxwmnSRFp8dU6ecnzwVFX6I6Hqb7+iP8w5M90qtU/dk9/xDzxGd43sCAODrndHEH3 e5vzGsWCL2/NwyJKHIX6o+g+Shosgykpc8dqv5kJ887PRkCjygcJlDx1ziWoD4iuG1APPf NiB+G4/3DtKoBzdwPIvJHdLgZQFoETHh5ODJCvpWvkZvC9fU4mJ891YR4bdfqZwwOqZPdv tz/wEABIwp+7lfB/EGRYxAjHpvHdm7nZke7IAbFYBmTizm+1IuQIVTvVnsvJXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750938470; 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=6nmTXCRTEuYNT6dqV0IP4rmDIsuLWGaXzJVOWj9r7Sw=; b=Pg3byRvoWa7WPX3Rgo4+e114TbbuyRDbjma2+U8/GqR6LmLS/2AdMI9U4570W0gWcAcIpn CfoaYQRNJQ5EVnlZhv0BgatnstISXqzR2f2/9FQo9/1bq6/PasnHdKRLe9KbhMdlaHwRw+ 1cQ4OnGh0vz2nVmSm4s8nri11yQNRRDT+HrYox2wWGcItddHCJw87D7qmoWlQhEpDqqbJy NSmc5muI+cbemwkHGe1otL88iT4r7UbsV0jIdjlrwo5rm+fxoiQilKybo5R52K9zaC9p0H mKsB5aRlMC/nfuXDu8E4qdYaWN4y6ESv0TzGd9lic5sRiZptbpNap8HYj97iLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750938470; a=rsa-sha256; cv=none; b=eSVEAkSmVF+IQYRfmj1NRQd/LJ81hzQ//2lYYvnLIAc7ocXsracSSB5HHF3ctbosyUg61t 3IS4Ghl9v5TyoHVChRcxhkhxVL2tPiaFu7fWYmAsoyK+TwTflCwX83Xtsx55RykxVmOcH5 FSy0Gcnaw66nQ0T45z1i36qlNPB5mHjJbsAPkXU5CXax5vuCgQpJzp10NN4fxXbk48iAHW wKZzhYJJH0qf1/lAKA+FGANSdb7ZpxQXtTH33orhZo28ygHicIqhQa+J+koMKk7nMjo6fn +wzp4xY5QMngnUZrGMX8scN0FDC3uC/4VvLhtH0rmggf37RTkFYwTFuwT6+fgA== 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 4bScPf24mcz12HL; Thu, 26 Jun 2025 11:47: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 55QBloew059786; Thu, 26 Jun 2025 11:47:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QBlo6r059781; Thu, 26 Jun 2025 11:47:50 GMT (envelope-from git) Date: Thu, 26 Jun 2025 11:47:50 GMT Message-Id: <202506261147.55QBlo6r059781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 19a7ea3cc4de - main - nuageinit: implement write_files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19a7ea3cc4de5af80e2913fda70bd65ad72835c0 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=19a7ea3cc4de5af80e2913fda70bd65ad72835c0 commit 19a7ea3cc4de5af80e2913fda70bd65ad72835c0 Author: Baptiste Daroussin AuthorDate: 2025-06-26 11:32:07 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 11:47:37 +0000 nuageinit: implement write_files write_files is a list of files that should be created at the first boot each file content can be either plain text or encoded in base64 (note that cloudinit specify that gzip is supported, but we do not support it yet.) All other specifier from cloudinit should work: by default all files will juste overwrite exesiting files except if "append" is set to true, permissions, ownership can be specified. The files are create before packages are being installed and user created. if "defer" is set to true then the file is being created after packages installation and package manupulation. This feature is requested for KDE's CI. --- libexec/nuageinit/nuage.lua | 88 +++++++++++++++++++++++++++++++++++- libexec/nuageinit/nuageinit | 25 +++++++++- libexec/nuageinit/nuageinit.7 | 38 +++++++++++++++- libexec/nuageinit/tests/Makefile | 1 + libexec/nuageinit/tests/addfile.lua | 71 +++++++++++++++++++++++++++++ libexec/nuageinit/tests/nuage.sh | 10 +++- libexec/nuageinit/tests/nuageinit.sh | 37 ++++++++++++++- 7 files changed, 264 insertions(+), 6 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index deb441ee25ba..cdc0fc6cf2a7 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -7,6 +7,39 @@ local unistd = require("posix.unistd") local sys_stat = require("posix.sys.stat") local lfs = require("lfs") +local function decode_base64(input) + local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' + input = string.gsub(input, '[^'..b..'=]', '') + + local result = {} + local bits = '' + + -- convert all characters in bits + for i = 1, #input do + local x = input:sub(i, i) + if x == '=' then + break + end + local f = b:find(x) - 1 + for j = 6, 1, -1 do + bits = bits .. (f % 2^j - f % 2^(j-1) > 0 and '1' or '0') + end + end + + for i = 1, #bits, 8 do + local byte = bits:sub(i, i + 7) + if #byte == 8 then + local c = 0 + for j = 1, 8 do + c = c + (byte:sub(j, j) == '1' and 2^(8 - j) or 0) + end + table.insert(result, string.char(c)) + end + end + + return table.concat(result) +end + local function warnmsg(str, prepend) if not str then return @@ -441,6 +474,58 @@ local function upgrade_packages() return run_pkg_cmd("upgrade") end +local function addfile(file, defer) + if type(file) ~= "table" then + return false, "Invalid object" + end + if defer and not file.defer then + return true + end + if not defer and file.defer then + return true + end + if not file.path then + return false, "No path provided for the file to write" + end + local content = nil + if file.content then + if file.encoding then + if file.encoding == "b64" or file.encoding == "base64" then + content = decode_base64(file.content) + else + return false, "Unsupported encoding: " .. file.encoding + end + else + content = file.content + end + end + local mode = "w" + if file.append then + mode = "a" + end + + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + if not root then + root = "" + end + local filepath = root .. file.path + local f = assert(io.open(filepath, mode)) + if content then + f:write(content) + end + f:close() + if file.permissions then + -- convert from octal to decimal + local perm = tonumber(file.permissions, 8) + sys_stat.chmod(file.path, perm) + end + if file.owner then + local owner, group = string.match(file.owner, "([^:]+):([^:]+)") + unistd.chown(file.path, owner, group) + end + return true +end + local n = { warn = warnmsg, err = errmsg, @@ -456,7 +541,8 @@ local n = { install_package = install_package, update_packages = update_packages, upgrade_packages = upgrade_packages, - addsudo = addsudo + addsudo = addsudo, + addfile = addfile } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 5af1b84c1848..84133d4373c5 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -188,6 +188,25 @@ local function install_packages(packages) end end +local function write_files(files, defer) + if not files then + return + end + for n, file in pairs(files) do + local r, errstr = nuage.addfile(file, defer) + if not r then + nuage.warn("Skipping write_files entry number " .. n .. ": " .. errstr) + end + end +end + +local function write_files_not_defered(obj) + write_files(obj.write_files, false) +end + +local function write_files_defered(obj) + write_files(obj.write_files, true) +end -- Set network configuration from user_data local function network_config(obj) if obj.network == nil then return end @@ -456,13 +475,15 @@ if line == "#cloud-config" then ssh_authorized_keys, network_config, ssh_pwauth, - runcmd + runcmd, + write_files_not_defered, } local post_network_calls = { packages, users, - chpasswd + chpasswd, + write_files_defered, } f = io.open(ni_path .. "/" .. ud) diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 index 1d2f83fe62e0..3bb440ebac95 100644 --- a/libexec/nuageinit/nuageinit.7 +++ b/libexec/nuageinit/nuageinit.7 @@ -2,7 +2,7 @@ .\" .\" Copyright (c) 2025 Baptiste Daroussin .\" -.Dd June 16, 2025 +.Dd June 26, 2025 .Dt NUAGEINIT 7 .Os .Sh NAME @@ -239,6 +239,42 @@ where x is a number, then the password is considered encrypted, otherwise the password is considered plaintext. .El .El +.It Ic write_files +An array of objects representing files to be created at first boot. +The files are being created before the installation of any packages +and the creation of the users. +The only mandatory field is: +.Ic path . +It accepts the following keys for each objects: +.Bl -tag -width "permissions" +.It Ic content +The content to be written to the file. +If this key is not existing then an empty file will be created. +.It Ic encoding +Specifiy the encoding used for content. +If not specified, then plain text is considered. +Only +.Ar b64 +and +.Ar base64 +are supported for now. +.It Ic path +The path of the file to be created. +.Pq Note intermerdiary directories will not be created . +.It Ic permissions +A string representing the permission of the file in octal. +.It Ic owner +A string representing the owner, two forms are possible: +.Ar user +or +.Ar user:group . +.It Ic append +A boolean to specify the content should be appended to the file if the file +exists. +.It Ic defer +A boolean to specify that the files should be created after the packages are +installed and the users are created. +.El .El .Sh EXAMPLES Here is an example of a YAML configuration for diff --git a/libexec/nuageinit/tests/Makefile b/libexec/nuageinit/tests/Makefile index bb2f0d7c747e..c69bc28a4c86 100644 --- a/libexec/nuageinit/tests/Makefile +++ b/libexec/nuageinit/tests/Makefile @@ -16,5 +16,6 @@ ${PACKAGE}FILES+= dirname.lua ${PACKAGE}FILES+= err.lua ${PACKAGE}FILES+= sethostname.lua ${PACKAGE}FILES+= warn.lua +${PACKAGE}FILES+= addfile.lua .include diff --git a/libexec/nuageinit/tests/addfile.lua b/libexec/nuageinit/tests/addfile.lua new file mode 100644 index 000000000000..98d020e557c0 --- /dev/null +++ b/libexec/nuageinit/tests/addfile.lua @@ -0,0 +1,71 @@ +#!/bin/libexec/flua + +local n = require("nuage") +local lfs = require("lfs") + +local f = { + content = "plop" +} + +local r, err = n.addfile(f, false) +if r or err ~= "No path provided for the file to write" then + n.err("addfile should not accept a file to write without a path") +end + +local function addfile_and_getres(file) + local r, err = n.addfile(file, false) + if not r then + n.err(err) + end + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + if not root then + root = "" + end + local filepath = root .. file.path + local resf = assert(io.open(filepath, "r")) + local str = resf:read("*all") + resf:close() + return str +end + +-- simple file +f.path="/tmp/testnuage" +local str = addfile_and_getres(f) +if str ~= f.content then + n.err("Invalid file content") +end + +-- the file is overwriten +f.content = "test" + +str = addfile_and_getres(f) +if str ~= f.content then + n.err("Invalid file content, not overwritten") +end + +-- try to append now +f.content = "more" +f.append = true + +str = addfile_and_getres(f) +if str ~= "test" .. f.content then + n.err("Invalid file content, not appended") +end + +-- base64 +f.content = "YmxhCg==" +f.encoding = "base64" +f.append = false + +str = addfile_and_getres(f) +if str ~= "bla\n" then + n.err("Invalid file content, base64 decode") +end + +-- b64 +f.encoding = "b64" +str = addfile_and_getres(f) +if str ~= "bla\n" then + n.err("Invalid file content, b64 decode") + print("==>" .. str .. "<==") +end diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index f2753d6d91e6..56651c8c5bb7 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -1,5 +1,5 @@ #- -# Copyright (c) 2022 Baptiste Daroussin +# Copyright (c) 2022-2025 Baptiste Daroussin # # SPDX-License-Identifier: BSD-2-Clause # @@ -11,6 +11,7 @@ atf_test_case addsshkey atf_test_case adduser atf_test_case adduser_passwd atf_test_case addgroup +atf_test_case addfile sethostname_body() { @@ -73,6 +74,12 @@ addgroup_body() atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group } +addfile_body() +{ + mkdir tmp + atf_check /usr/libexec/flua $(atf_get_srcdir)/addfile.lua +} + atf_init_test_cases() { atf_add_test_case sethostname @@ -80,4 +87,5 @@ atf_init_test_cases() atf_add_test_case adduser atf_add_test_case adduser_passwd atf_add_test_case addgroup + atf_add_test_case addfile } diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 44830f67e4c8..639c87181f95 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -1,5 +1,5 @@ #- -# Copyright (c) 2022 Baptiste Daroussin +# Copyright (c) 2022-2025 Baptiste Daroussin # # SPDX-License-Identifier: BSD-2-Clause # @@ -29,6 +29,7 @@ atf_test_case config2_userdata_update_packages atf_test_case config2_userdata_upgrade_packages atf_test_case config2_userdata_shebang atf_test_case config2_userdata_fqdn_and_hostname +atf_test_case config2_userdata_write_files setup_test_adduser() { @@ -847,6 +848,39 @@ EOF fi } +config2_userdata_write_files_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data < To: Gordon Bergling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0f5c86ddb025 - main - libyaml: import libyaml vendor version 0.2.5 Message-ID: References: <202506260705.55Q7580o023061@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu 26 Jun 13:20, Gordon Bergling wrote: > Hi Bapt, Hello > > I am getting a buildworld error on both amd64 and aarch64. > > [...] > ===> usr.sbin/rtsold (includes) > ===> usr.bin/what (includes) > ===> lib/libthr/tests (includes) > install: /build/storage/freebsd/src/current/amd64.amd64/tmp/usr/include/private/yaml: No such file or directory > [...] > > It is a NO_CLEAN=yes build. > > Is there maybe something missing from the vendor import? Should be fixed by: 442472e1b72a8b540df3fe038ed96615fc0abd68 Sorry about that. Best regards, Bapt From nobody Thu Jun 26 11:59:51 2025 X-Original-To: dev-commits-src-main@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 4bScgh36CSz60TXR; Thu, 26 Jun 2025 12:00:00 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [IPv6:2a0c:5a00:149::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bScgg6vCfz3nwf; Thu, 26 Jun 2025 11:59:59 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1uUlGh-00Gg16-Rt; Thu, 26 Jun 2025 13:59:51 +0200 Received: from [10.9.9.128] (helo=rmmprod06.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1uUlGh-0005G5-DM; Thu, 26 Jun 2025 13:59:51 +0200 Received: from mail by rmmprod06.runbox with local (Exim 4.86_2) (envelope-from ) id 1uUlGh-00009Z-CB; Thu, 26 Jun 2025 13:59:51 +0200 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Received: from [Authenticated alias (960477)] by runbox.com with http (RMM6); Thu, 26 Jun 2025 11:59:51 GMT From: "Alexander Ziaee" To: "Wolfram Schneider" , "Alexander Ziaee" CC: "src-committers" , "dev-commits-src-all" , "dev-commits-src-main" , "brooks" , "imp" , "bapt" Subject: Re: git: 4c07abdbacf4 - main - mandoc: Vendor import of upstream at 2025-06-13 Date: Thu, 26 Jun 2025 11:59:51 +0000 (UTC) X-RMM-Aliasid: 960477 X-Mailer: RMM6 In-Reply-To: Message-Id: X-Rspamd-Queue-Id: 4bScgg6vCfz3nwf X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:50304, ipnet:2a0c:5a00::/29, country:NO] On 2025-06-26 00:50 -04:00 EDT, "Wolfram Schneider" wro= te: > On Wed, 25 Jun 2025 at 19:53, Alexander Ziaee wrote: >> >> The branch main has been updated by ziaee: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D4c07abdbacf49e4ba749b8720= 916d8cd340a50b8 >> >> commit 4c07abdbacf49e4ba749b8720916d8cd340a50b8 >> Merge: 7ed1628066ea 7a0bec970311 >> Author: Alexander Ziaee >> AuthorDate: 2025-06-25 17:50:25 +0000 >> Commit: Alexander Ziaee >> CommitDate: 2025-06-25 17:52:14 +0000 >> >> mandoc: Vendor import of upstream at 2025-06-13 >> >> Interesting changes: >> + Lb is now part of SNYOPSIS, the LIBRARY section is deprecated >> + Ft now takes multiple args, and no longer should be quoted >> + Fix a segfaut on malformed Tg markup >> >> contrib/mandoc/mandocdb.c | 27 ++++++++-- >> contrib/mandoc/mdoc.7 | 109 +++++++++++++++++++++++-----------= ------- >> contrib/mandoc/mdoc_macro.c | 7 ++- >> contrib/mandoc/mdoc_validate.c | 37 +++++++++++--- >> 4 files changed, 117 insertions(+), 63 deletions(-) >=20 > You didn't updated the VERSION in src/contrib/mandoc/Makefile > The codebase is no longer a stock 1.14.6 Thanks! What should I bump it to? Looking at the log for the Makefile, it s= eems no one has updated the version string for a snapshot so far. Best, Alex= From nobody Thu Jun 26 12:11:02 2025 X-Original-To: dev-commits-src-main@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 4bScwQ6SLnz60TT7; Thu, 26 Jun 2025 12:11: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 4bScwQ1vYDz3s2c; Thu, 26 Jun 2025 12:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750939862; 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=c9pijDMvtgs8kOFuRyutCCejMakk9Rkxkv5m2XV42KU=; b=y3z7xiFC/b+1vwc+Qx6NnWd+plcEzlIhpljnDaR228W7qPOMsZQpelyQv7ZmD5zBd4EcHw a0AvB7hJAMsbvdSdg2MwkZkPx/EzBD4WG08LBvZ+mVsCDMQ8il3k7lJfNzojoAOdobBOkn 3q5NMwcOVB6UyFhiQpH/d9nBJbdsIdXP1kcV+LlEkkRbV4LG/w0U5qHtHZ84ar1kW4CTS/ PkpZ711gm9PIGaTvkpoNOWkzL0ABN5tLN2YecMG36jEg7RG/uZtzMIlDVHLKQIteTK0Wf1 07XE12lBUsqhHVvBqCdCoT/omY0xFIWgu6c1R216aUxmA3e0OxfAbgKDRRGIfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750939862; 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=c9pijDMvtgs8kOFuRyutCCejMakk9Rkxkv5m2XV42KU=; b=NqhoRicFWBr29j9z81WHEBtXA0Bg8LxYx8iGrYnDhhvRDWzP4Sf8kSQ66Qi9u27rOx9jQc kMr7m6VXOIyj4C0M8XWjisfrSipBZSOzgI2PKF6ShEIznclCF9H7SNtbzGqCYmcFEHRkbK KRhNk04t1QUm5KrvbewmLwNy9OjDvYauHXCEt7PtqLeNuEB1lm7/djKlBNMvmCPH/bnQYE ZBg0XB15qrCF5CtO8hcAxc33AWmySYMHo+OUCpkcLPnaxxmj3dAFYibKM0ebcB3JfHZfs2 nQ3LBVHxuiZh83LZkNG/NYg0uUJlChkK8P4XzgGFT2guS1zLPTqUMPbmnb4+2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750939862; a=rsa-sha256; cv=none; b=h6CkY/0tI7NoqrSoJJ5TitQMDwx3d481vSLI7+KMhsiyVQwGYTudjAbyWC6AiW0AvPE6/Q GQ4l2MMm3TOm7eqTdnbLFXCiHBg5iGEn/BAojMbeD2axuX773Vaair/yKFph/+T7VWlCY9 Teruv5rjdigBIO8zsH7Fu/dntyZyl+4ZmH5ZVhEVhFCSLCTeqJTZ5E59M2PN3xnZa+OsRc oBZyZ7qSMWip7/gCZe9Se4xhGav6pp5tZEBXUtIawoKScy4C8on5WGvppnnBrFc83DrJZ/ qy5YzYMQQ/WMVIcaud1IOMDi+w6HBJYGp7DiRJY9vizPydTV3MAVbcM3PxoKpA== 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 4bScwQ1Jfwz12XN; Thu, 26 Jun 2025 12:11: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 55QCB2Vu007200; Thu, 26 Jun 2025 12:11:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QCB2o0007197; Thu, 26 Jun 2025 12:11:02 GMT (envelope-from git) Date: Thu, 26 Jun 2025 12:11:02 GMT Message-Id: <202506261211.55QCB2o0007197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0804e60df19b - main - ftpd: Provide an option to turn off FTP anonymous usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0804e60df19b393c37238596c9f37a0b8972a7da Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0804e60df19b393c37238596c9f37a0b8972a7da commit 0804e60df19b393c37238596c9f37a0b8972a7da Author: joyu liaonull AuthorDate: 2025-06-26 12:07:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-26 12:10:14 +0000 ftpd: Provide an option to turn off FTP anonymous usage ftpd provides the -n option to disable anonymous FTP access, meaning the username 'ftp' cannot log in to the FTP server without a password stored in the password database. This feature helps prevent users who lack the background knowledge of how this special username 'ftp' conventionally works in FTP from mistakenly creating an account with the username 'ftp,' assuming it behaves like other usernames that require a password to log in to the FTP server, which it does not. Differential Revision: https://reviews.freebsd.org/D46547 --- libexec/ftpd/ftpd.8 | 12 ++++++++++-- libexec/ftpd/ftpd.c | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8 index 3474c379fbc7..96db4753209e 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 9, 2023 +.Dd June 26, 2025 .Dt FTPD 8 .Os .Sh NAME @@ -33,7 +33,8 @@ .Nd Internet File Transfer Protocol server .Sh SYNOPSIS .Nm -.Op Fl 468ABDdEhMmOoRrSUvW +.Op Fl 468BDdEhMmOoRrSUvW +.Bq Fl A | Fl n .Op Fl l Op Fl l .Op Fl a Ar address .Op Fl P Ar port @@ -147,6 +148,13 @@ Permit anonymous users to overwrite or modify existing files if allowed by file system permissions. By default, anonymous users cannot modify existing files; in particular, files to upload will be created under a unique name. +.It Fl n +Disable anonymous FTP access. +The +.Fl n +option is mutually exclusive with the +.Fl A +option. .It Fl O Put server in write-only mode for anonymous users only. RETR is disabled for anonymous users, preventing anonymous downloads. diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index f3a1105f6437..751d77b218b7 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -106,6 +106,7 @@ int logging; int restricted_data_ports = 1; int paranoid = 1; /* be extra careful about security */ int anon_only = 0; /* Only anonymous ftp allowed */ +int noanon = 0; /* disable anonymous ftp */ int assumeutf8 = 0; /* Assume that server file names are in UTF-8 */ int guest; int dochroot; @@ -269,7 +270,7 @@ main(int argc, char *argv[], char **envp) openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP); while ((ch = getopt(argc, argv, - "468a:ABdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) { + "468a:ABdDEhlmMnoOp:P:rRSt:T:u:UvW")) != -1) { switch (ch) { case '4': family = (family == AF_INET6) ? AF_UNSPEC : AF_INET; @@ -327,6 +328,10 @@ main(int argc, char *argv[], char **envp) noguestmkd = 1; break; + case 'n': + noanon = 1; + break; + case 'o': noretr = 1; break; @@ -396,6 +401,11 @@ main(int argc, char *argv[], char **envp) } } + if (noanon && anon_only) { + syslog(LOG_ERR, "-n and -A are mutually exclusive"); + exit(1); + } + /* handle filesize limit gracefully */ sa.sa_handler = SIG_IGN; (void)sigaction(SIGXFSZ, &sa, NULL); @@ -995,7 +1005,8 @@ user(char *name) #else pw = sgetpwnam("ftp"); #endif - if (strcmp(name, "ftp") == 0 || strcmp(name, "anonymous") == 0) { + if (!noanon && + (strcmp(name, "ftp") == 0 || strcmp(name, "anonymous") == 0)) { if (checkuser(_PATH_FTPUSERS, "ftp", 0, NULL, &ecode) || (ecode != 0 && ecode != ENOENT)) reply(530, "User %s access denied.", name); From nobody Thu Jun 26 12:15:43 2025 X-Original-To: dev-commits-src-main@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 4bSd1q4CrCz60TxJ; Thu, 26 Jun 2025 12:15: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 4bSd1q3Jt5z3tpf; Thu, 26 Jun 2025 12:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750940143; 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=i/8ndyb1oTm2FvyuHuq1BcT5cqh9acsngCfCmQ6xPDk=; b=GEtlaD8aPCP6a6gLC/EGhltvbOjve+xl9cIC8QFxFQAHtf8/kq4V1RSghpHp9DgqetuX1i 7iiBwm5/2XuPuJ8IxmEOPnLzveL8VjieAoT/tRgFyTZU/hbS2AOVFtU8QHVUB/blyYsO0b CrgXXpRjW6Xx1oKtqkWF5vnlEE0qQgpRdzbzz9L+P1zbTFE7XyS7rOZDv1ucQ9057fb3I3 zYmP23Pxgdj54o7EQjShL8t6nxjXjfUfQ5weNkkQ05dVJVBYhcyECYImlc4ZgregJ/3FnJ 4I90zQVb75HMlC/I5FgQ1SImN9NdEK2b0Ct6l56wgjt3OpnJSVb1rTxIG4NF9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750940143; 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=i/8ndyb1oTm2FvyuHuq1BcT5cqh9acsngCfCmQ6xPDk=; b=kxZj9DgGC6/h8CFtzolpKr06RVvCjUgBpkmXmT8kkIg2gvbCZw2TqEpGOEtu4C7taqOpR2 P2w4Z1+/u7AmPBWAq6JakhqnNYzwoCXXPsJU7WZmeC1N8J9eQshxTPZphcB7B5MFTVtZH0 2+M7RJBJp6dM7ULSlAPCg3nSWCtN1rljxvvMwc+bAxT2spc8l1+4xtP5zXjvtmWg1jettK BGPVKHnQYzmCu6X9z4Qs5scURL8ekb1SChcH62j2Bmcib+wrW0dzV10d2+T1kIlpFPKd2/ WWRsChI6XUUouQfsMCBwhJ7dIJSvzMemLMPKPxcL8QZwBKRTiFbP7htNkGys6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750940143; a=rsa-sha256; cv=none; b=pD8jGTNpCcmITNgEhxCTRnykpqpKi6cG5wpeIIQE7V1ZyWQYnaeWQxpN3xsPgfH6A/hI1D XP1AEv74DpY28PSPj2a+3iXRIgHMzxjQUQ8Pi5ysH/4JhBlLD1+XzIl3cFOTNlrcxTsBnw wWTWgMjGE2lkvQ7JuxzWIo/OeuyAEf6/kCeH9ItrQtAvB2gJgdaIXhYJWDOQPRE+FHWXu+ ynCLpM/JCR8AoYr4+ipWgR5k9HPw7aJu6cRK47lhBCe4FrYUaTr5cliH+D33ifj4gwuf+M vvuxTMJ9e6qOd6N0f78mEO5lJTStBd4dbBanmQykBYzPSEMovsWj7DbMpT3atQ== 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 4bSd1q2rJNz12dw; Thu, 26 Jun 2025 12:15: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 55QCFhIP015981; Thu, 26 Jun 2025 12:15:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QCFhqu015978; Thu, 26 Jun 2025 12:15:43 GMT (envelope-from git) Date: Thu, 26 Jun 2025 12:15:43 GMT Message-Id: <202506261215.55QCFhqu015978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: ea4384ec0a8c - main - mailmap: Add Joyu Liao List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ea4384ec0a8c25a73c7e91423c612c6ef62aba0e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ea4384ec0a8c25a73c7e91423c612c6ef62aba0e commit ea4384ec0a8c25a73c7e91423c612c6ef62aba0e Author: Dag-Erling Smørgrav AuthorDate: 2025-06-26 12:13:21 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-26 12:13:21 +0000 mailmap: Add Joyu Liao Their name and email address got mangled by a tool bug in my last commit. Adding them here so they will be displayed correctly. Fixes: 0804e60df19b393c37238596c9f37a0b8972a7da --- .mailmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index f54f321b17e3..c546d84e41f2 100644 --- a/.mailmap +++ b/.mailmap @@ -19,3 +19,5 @@ Sumit Saxena Ganael LAPLANCHE +Joyu Liao +Joyu Liao From nobody Thu Jun 26 12:34:54 2025 X-Original-To: dev-commits-src-main@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 4bSdRy5FZ0z60WD5; Thu, 26 Jun 2025 12:34: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 4bSdRy4Ps8z42ls; Thu, 26 Jun 2025 12:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750941294; 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=Kdff85XT8wGyeGgSwMUoezQGK1taNhpgFRFifK+SKcA=; b=WNU4gNN9LFDQBFc6ZIDpggKJgZkIQl34r3GOHKkEa3m40K/IRmEt49dBG8XwE5D2k7GMvB nFHiwu6qNdNurPgKa0i4yN8ZjX50q3bNfIEFZ3FcWmkq5qV+9UREyHBkpClFxCOGXkLwfq GhWefsjy8xnROpMIF3IUT3f6LNcSIktJ6u2wv2wvVNwBDv/6StAjzp+r6mZM16FIWRapmd ciK87P2CAUygtalMDrY0BpjwTHIU8pgaFV+wUn+YEyihoI5kzxO9DmH1LLkZ/Y8ANLZ2K/ kUW5HSXYaXLFB7FjJ+8FGIj2Z5J5R9hML+RZXfWtMCHNHvUyk1/FX8WwrbURwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750941294; 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=Kdff85XT8wGyeGgSwMUoezQGK1taNhpgFRFifK+SKcA=; b=xNa3dl7vyYofX8GhdXGJmZ+vDuglQ+qzmxF2RD6tr40fwVE28AQG98cjiKWPGpm4RECZJ9 gVjGd0bFez4PKSkIVsly88E0pfOPi7dKs8XAKYdfxjLh0WxGmmw3r4MV00rmd1UAB95yt2 pf1mzNqIfrsWnhuoQlubaJq/D5yxNFWHVl98DdwHwzWxnGkIEpUCUnltD/MjEAE3/gWiP4 mY0EKqvFQZopkkvkp4xjAETjlBG6cooxZRBZQy0hkZcYTqd7dRmeOhfgDTgvGrGalT8u05 CLHsuZWceYg0Sm/LzxC8TXE5hZD7PHCpJWiNLXE2fQL3rkyKlp+i3OaIHUpbag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750941294; a=rsa-sha256; cv=none; b=FU79llWkhKrlif7xcAT1U9KnpWYeZNF1/Siq4fvqPLeZ51CUuznG9MIN2FZpBlC3hiSai+ stgXoNdAVmAEftikfWnQXiOOm+lV/XA+tcwSCPx666cXL01xD9LlFP8aBSnBh3l4pUhA77 cAH0a2Es2CCwvpIhySifB4eU52Lx75UttsUvjWM/XnReFzIhHvKJgm21qFfmcERdLjYh48 GB9nFKBpd/7+Fw7np2cV4C07CQ0mko2ZDUiZfpKbGfae/78R32he88eLTxZso7S0uuzJkB 77xPb17gVTSRbyvFjCE2SOJafdC0OLohIsy+e8SF15IgkFtSk3EAPkC7/L1y2Q== 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 4bSdRy3wYQz13Yh; Thu, 26 Jun 2025 12:34: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 55QCYs6P052905; Thu, 26 Jun 2025 12:34:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QCYsYS052902; Thu, 26 Jun 2025 12:34:54 GMT (envelope-from git) Date: Thu, 26 Jun 2025 12:34:54 GMT Message-Id: <202506261234.55QCYsYS052902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d9a4c24df1c4 - main - nuageinit: write_files fix typo breaking tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9a4c24df1c438e7cd561396e57937be3b105135 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d9a4c24df1c438e7cd561396e57937be3b105135 commit d9a4c24df1c438e7cd561396e57937be3b105135 Author: Baptiste Daroussin AuthorDate: 2025-06-26 12:25:12 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 12:34:51 +0000 nuageinit: write_files fix typo breaking tests --- libexec/nuageinit/nuage.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index cdc0fc6cf2a7..8f46f97dc83c 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -517,11 +517,11 @@ local function addfile(file, defer) if file.permissions then -- convert from octal to decimal local perm = tonumber(file.permissions, 8) - sys_stat.chmod(file.path, perm) + sys_stat.chmod(filepath, perm) end if file.owner then local owner, group = string.match(file.owner, "([^:]+):([^:]+)") - unistd.chown(file.path, owner, group) + unistd.chown(filepath, owner, group) end return true end From nobody Thu Jun 26 12:34:55 2025 X-Original-To: dev-commits-src-main@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 4bSdRz6XkFz60W9R; Thu, 26 Jun 2025 12:34: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 4bSdRz4zXvz42r3; Thu, 26 Jun 2025 12:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750941295; 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=r41/qApozJX+Okuw6QORN09l+4RRZvUZmvUuQkBq8eY=; b=LDBzS1URL4D2hevZfxoy3QbpSKv0z/mjTD4V+ueXo25HzsUBPwoQfZW14xeKLq6vQpuM2V V6Ndega1MCwjAF43an0VQcOUuECHuD/m5n6MlslKbfE8sJ+Wy5ob+o4HU4sJX50cMGcNoe kY7wlMCh1J7JiYj2jEEFaoY7i4qCuTTrl7EaaUGdBe1lgC0DTlXFEnnp9Bz/VsX2i9tVug nIFqk7vnJwYJDY1FJIiimfGGcHRYHIt26mIBQUzFrBQXC+8F/yrnElo7PBPc269xZfBBXb T3fTMrwfIOb5lvJTUQIeNPMQIEIlkMPtPB7Ia/6AhO8uLx3PglwFysJhcczWoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750941295; 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=r41/qApozJX+Okuw6QORN09l+4RRZvUZmvUuQkBq8eY=; b=Wow+qyWrpqGmSKvpakz2a0mGGTXHo9OI9b/1RCLJbSWVmH5KwVwAzc4PwXktcr/xrBBLfS GAX2u+6fYxUCFriTS8RZ8aYR0UpynQeT4RdxWT1zIR7YFwN/3JShMZ68TxNZIcD0H9Zb+i ThixZng88SUtXRXmeJVVAhyvpsZ3rDIZcGBdc5mBC6Ck6IyNNINmLU5SaJInsDMLP+vwft NTWem9nstBOJT38gJezstAJOBUrtUwo8C4kbvtCxq1eVeImtRR8bjFsc84Jh0iyTQ5tc8a xhIi+GhwnIwsav+RBsnWZ53XvcXn9M06khxHl+60aR5L8GYnVU6FW0J474gjiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750941295; a=rsa-sha256; cv=none; b=NnUIW+/FwLV8mC+WSYvQquhu5/qle0kInoCB8eTLd1byH6fS4evsy1drsgcF8x7FeqbkD9 X2ZwyH3Ag8gGPX1u1v8CFD4oT69RCQ/zP3yEibppByZHv1Dm/f+BixUD/l3OQTkQK77qZk GEvlr4fVnUBAfN6yW/xdzbIO+dwchwz60ooLpUTi+opb7xPakxIZ9KaNHcsNq6m4K27ZlH bTLRsmzE8rNt4s3x49oNMVbhruzIXo869piOawOUNhYhsfbUST3rghslowKpalyod+PSx7 KeeYSojRzdITAivlcFmBCBlq6Cc4y91iq52q+E+8XGKLv0sw/pRTsca4J2aC6A== 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 4bSdRz4Xg9z13Yj; Thu, 26 Jun 2025 12:34: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 55QCYtqW052939; Thu, 26 Jun 2025 12:34:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QCYtcl052936; Thu, 26 Jun 2025 12:34:55 GMT (envelope-from git) Date: Thu, 26 Jun 2025 12:34:55 GMT Message-Id: <202506261234.55QCYtcl052936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 3969965c7f15 - main - nuageinit: fix setting owner when only the user is set List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3969965c7f156f0fe3e1dc8799362375cb53208a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3969965c7f156f0fe3e1dc8799362375cb53208a commit 3969965c7f156f0fe3e1dc8799362375cb53208a Author: Baptiste Daroussin AuthorDate: 2025-06-26 12:29:05 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 12:34:51 +0000 nuageinit: fix setting owner when only the user is set --- libexec/nuageinit/nuage.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 8f46f97dc83c..8d75f86272a7 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -521,6 +521,9 @@ local function addfile(file, defer) end if file.owner then local owner, group = string.match(file.owner, "([^:]+):([^:]+)") + if not owner then + owner = file.owner + end unistd.chown(filepath, owner, group) end return true From nobody Thu Jun 26 12:34:56 2025 X-Original-To: dev-commits-src-main@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 4bSdS15g7Cz60W10; Thu, 26 Jun 2025 12:34: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 4bSdS110xzz42yY; Thu, 26 Jun 2025 12:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750941297; 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=ZDL7SjBX1FaOtNcW28vG2xkV6GzP3Yd36kinU7fbUOU=; b=Kioq0LIAe5kx6NJRpJXszBLmUv9ObmNsTVclTcQcwFNh2arkLsYh/1GDuebXb2MVimsSTY JGwke9yXBZLHuSG6lHc7RZwzF7v9KnNWMzyFa8YM0TojaYmr4VRTkX1sPIAuObgwL8euzZ 1kiSRFtKaZ8wOYZQe4IJ795KlhfraZfZeWpO2AYZPWNDQEswDWY55advpAkv/PLW0rAoBx UaWojq+iez63O6xOw6PwvWoxCF7VVf29cIxu31SCpc4nai8fyNdDjEigceeTeamAS96o+Z oBH/wPvAJ3G9tWvjSf42TD2huleuBupp9aT0SCaZanZmq3JF2Lb3xieFJ5OYrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750941297; 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=ZDL7SjBX1FaOtNcW28vG2xkV6GzP3Yd36kinU7fbUOU=; b=PjDaBZD2hIlYtbTnSHA6XBdVjHan8xPdDFoeILEwVa+T65Pwb8G0aCF9rqzNRtKI5v1TJ4 fQWBpe2FCwSgTaq3Rl85UwSgv0QBtn4yhlSzIfqGekyY2KQ81YENWnO2nOoY48SoGWk3Mx rDoHEpkmqNihmKyktSZKYjMUCCYzJ8DZYOceoer9heY0ZnD+AMbbMc1B5REbnLkJ/nnFj5 SXVSAXu4POga20eCgARA1CwmoaWH4277BzZYUUsykjd1vRmwN2G3zVYhAlFN+jDfBZe9zP WJL9CiFW4TLQaYuMIrZfaHTISm+b6UdZRC0Kvrov6SANy602FNGaS84NdN7lHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750941297; a=rsa-sha256; cv=none; b=Xmu7ZjsEZZtacdaj708M+63NtdI1BPY8/MfWnZPc1Ziubq2U1oHwiNT9kCoPfObWK6HNLe kyTNKTzIDMJtBga3R3cifxIVETl18Oxx6ibbzwcezIrSfAUlkODi2LVINTpaooIDAwlSq+ f6BYPELieIvX1APt2djj3fe2EvCx74hou8n0xK2EjeC7+EXQq2VW+c1+ox+b60bOm2R4BF y4F3agsjHyRaqkywaaO5HQLsPbknogqMpOIRr6nUB7LdWJJhxCKYgq1zsCltDprK/2AaZu DXx7Wkdh7jdp6ErW5FkYv1Ijm4ShXzl/+ccC8xhnUXiP29EKSdebZnq9Gb6Mig== 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 4bSdS05q2nz13Wk; Thu, 26 Jun 2025 12:34: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 55QCYuhE052974; Thu, 26 Jun 2025 12:34:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QCYuKP052971; Thu, 26 Jun 2025 12:34:56 GMT (envelope-from git) Date: Thu, 26 Jun 2025 12:34:56 GMT Message-Id: <202506261234.55QCYuKP052971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: b56d2195f124 - main - nuageinit: enhance sudo support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b56d2195f124d48ce54369d179aa1d4663e5e64a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b56d2195f124d48ce54369d179aa1d4663e5e64a commit b56d2195f124d48ce54369d179aa1d4663e5e64a Author: Baptiste Daroussin AuthorDate: 2025-06-26 12:32:27 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-26 12:34:51 +0000 nuageinit: enhance sudo support from the cloudinit specification sudo rules can be a string or an array of string --- libexec/nuageinit/nuage.lua | 8 +++++++- libexec/nuageinit/nuageinit.7 | 2 +- libexec/nuageinit/tests/nuageinit.sh | 8 +++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 8d75f86272a7..11958e8b5cc2 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -287,7 +287,13 @@ local function addsudo(pwd) warnmsg("impossible to open " .. sudoers) return end - f:write(pwd.name .. " " .. pwd.sudo .. "\n") + if type(pwd.sudo) == "string" then + f:write(pwd.name .. " " .. pwd.sudo .. "\n") + elseif type(pwd.sudo) == "table" then + for _, str in ipairs(pwd.sudo) do + f:write(pwd.name .. " " .. str .. "\n") + end + end f:close() if chmodsudoers then sys_stat.chmod(sudoers, 416) diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 index 3bb440ebac95..327ce160e151 100644 --- a/libexec/nuageinit/nuageinit.7 +++ b/libexec/nuageinit/nuageinit.7 @@ -211,7 +211,7 @@ The list of other groups the user should belong to. .It Ic locked Boolean to determine if the user account should be locked. .It Ic sudo -An entry which should be appended to +A string or an array of strings which which should be appended to .Pa /usr/local/etc/sudoers.d/90-nuageinit-users .El .Pp diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 639c87181f95..849f1c258b62 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -121,6 +121,10 @@ users: sudo: ALL=(ALL) NOPASSWD:ALL groups: users passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ + - name: bla + sudo: + - "ALL=(ALL) NOPASSWD:/usr/sbin/pw" + - "ALL=(ALL) ALL" EOF atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet @@ -131,17 +135,19 @@ admingroup:*:1001:root,sys cloud-users:*:1002: freebsd:*:1003: foobar:*:1004: +bla:*:1005: EOF cat > expectedpasswd << 'EOF' root:*:0:0::0:0:Charlie &:/root:/bin/sh sys:*:1:0::0:0:Sys:/home/sys:/bin/sh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh +bla::1003:1005::0:0:bla User:/home/bla:/bin/sh EOF sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" "${PWD}"/etc/master.passwd atf_check -o file:expectedpasswd cat "${PWD}"/etc/master.passwd atf_check -o file:expectedgroup cat "${PWD}"/etc/group - atf_check -o inline:"foobar ALL=(ALL) NOPASSWD:ALL\n" cat ${PWD}/usr/local/etc/sudoers.d/90-nuageinit-users + atf_check -o inline:"foobar ALL=(ALL) NOPASSWD:ALL\nbla ALL=(ALL) NOPASSWD:/usr/sbin/pw\nbla ALL=(ALL) ALL\n" cat ${PWD}/usr/local/etc/sudoers.d/90-nuageinit-users } nocloud_network_head() From nobody Thu Jun 26 12:38:17 2025 X-Original-To: dev-commits-src-main@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 4bSdXB6d7Tz60WMk; Thu, 26 Jun 2025 12:38:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSdXB1xKWz44cw; Thu, 26 Jun 2025 12:38:34 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-ade58ef47c0so210789366b.1; Thu, 26 Jun 2025 05:38:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750941512; x=1751546312; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7Ejvph/pIiZaewIrOcpgkqDJOCMlcOJH4WmPHf8sJ+M=; b=uvQM+MVlVQm1JV8kedtOv+y/9ukiLPd/TLuB2PUOF2qzSZxHpKrh0kPOfn9PrtxpnN 2TiQYLUsVRMkS0rBLytBdjBV0+cnGECihfa2o8DdeDwak2RBV17dj+eTTWDC5Yd/qsY1 tmM+dAASgT7Kh1XdeLoNlUwEIj38VbNL3LIBBUkZZASJDhQXwuOb2ojiU2zmDouDrjM7 RlVcmjSPa2A2R7ZNhgzSMpMv+pGd8V4MfGAoKN2EqIxgNSerzAjvqEQNK8I+RAQ6ttVg wQyU/39E4j2viVbpucSuzJGdCpwsOfuEI1cYkfhNhVX+3QhHN55MEdL82Swf1e7jL22P yCTQ== X-Forwarded-Encrypted: i=1; AJvYcCWIonpqAlmZ0u6aDYf7ICe/pAM8AHdfO2b3ALCPeo9poj9eCMmYHWlEHeJjwRpXxp6cVwdn5x78KzV0UKwYKgQ6WKHT4ds=@freebsd.org, AJvYcCWjr41IKEljXFlpGQMYd92m/CG7/FO0D8Ly1AaGQnqTYLRIUYQSejXsPF2x/4ww8wjOGymVmCbOgrZV+Rb9sIcXIL/F@freebsd.org X-Gm-Message-State: AOJu0Yw4+iwGMZg22Ie6NLVgt0hrr8xHIXLiH/+lVLnfvimGH52OBKVK w4a3gnoMqN6jsLzhJplago8B94FYz0u4L/M+bFxOyIaI7RWx5ORIVlO5MTtJyjg7vKn7/kuHRZJ uxkIaEbEKaqdcbMZr1TLRMVgmYOSlzbXTWXjH X-Gm-Gg: ASbGncu5k4sYPe6PFY4a7EWyc0yvfzE/2y+4cKlrLQGvz0g4irMQh6F41vaukNUg6is za1vy0UmX/B9AhOtbWT4FKJOo2zfKfri3wfQZGqR/bhlP+IW043mEhGzsUYk3EnyM8pJD7YDBHM LhxINONlYNyWNdfajJOwftqQjuLp/2jpidJSk0Kj+sVVpZTPRYARLX7g== X-Google-Smtp-Source: AGHT+IHGE46ssEacanpR6FepLyLU7UoKV/oZF2OmX9vWpMwWsY4kk6K9eeWZ/Cwov45X+ztmlkoNvCdHWFR6OjvLra8= X-Received: by 2002:a17:906:f588:b0:ae0:d409:5f19 with SMTP id a640c23a62f3a-ae0d40969c5mr317367166b.2.1750941510995; Thu, 26 Jun 2025 05:38:30 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506151602.55FG2SHe047772@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Thu, 26 Jun 2025 06:38:17 -0600 X-Gm-Features: Ac12FXwN-3_Lj3QofW2OYUdUwkuR39CnMxsZCLwheKl8fPa4mduH9jhx_LrL0w4 Message-ID: Subject: Re: git: 5c1ba994a8bc - main - Add a regression test for a libtpool bug To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000c9131f063878d69d" X-Rspamd-Queue-Id: 4bSdXB1xKWz44cw X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] --000000000000c9131f063878d69d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 25, 2025 at 11:54=E2=80=AFPM Olivier Cochard-Labb=C3=A9 wrote: > Hi Alan, > > > On Sun, Jun 15, 2025 at 6:02=E2=80=AFPM Alan Somers = wrote: > >> The branch main has been updated by asomers: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3D5c1ba994a8bcb6676ea3d1bb21b072= b90e2d3ae9 >> >> commit 5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9 >> Author: Alan Somers >> AuthorDate: 2024-05-07 17:48:33 +0000 >> Commit: Alan Somers >> CommitDate: 2025-06-15 16:01:37 +0000 >> >> Add a regression test for a libtpool bug >> >> >> > It seems this commit is the cause of preventing all my (freshly installed= ) > ZFS systems from booting than stop with: > > Mounting local filesystems:. > ld-elf.so.1: Shared object "libtpool.so.2" not found, required by "zfs" > > Because liptpool.so.2 isn=E2=80=99t no more in /lib (belong to the / data= set), but > in another dataset (/usr/lib) but it needs to use zfs to mount this one. > > Could the added include in its Makefile modified the > installed directory of libtpool.so.2 ? > > Here is the bisect script used: > > #!/bin/sh > set -eu > WRKDIR=3D/tmp/bisec > mkdir -p $WRKDIR/lib $WRKDIR/usr/lib $WRKDIR/usr/include > make -C cddl/lib/libtpool > make -C cddl/lib/libtpool install DESTDIR=3D$WRKDIR > if [ -f $WRKDIR/lib/libtpool.so.2 ]; then > rm -rf $WRKDIR > exit 0 > else > rm -rf $WRKDIR > exit 1 > fi > > And my bisect session pointed me to this commit. > git bisect start HEAD 9ce5410b9094 -- > git bisect run /tmp/bisec.libtpool.sh > git bisect reset > > Regards, > Olivier > Wow! That change was definitely not intended. And I"m very sorry for the breakage. Could you please try this patch? diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index cab8949b635b..aa8883cf9b7c 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250626: For 11 days 15.0-CURRENT installed libtpool to the wrong location +MOVED_LIBS+=3Dusr/lib/libtpool.so.2 + # 20250623: fscandir() renamed to fdscandir() OLD_FILES+=3Dusr/share/man/man3/fscandir.3.gz OLD_FILES+=3Dusr/share/man/man3/fscandir_b.3.gz diff --git a/cddl/lib/libtpool/Makefile b/cddl/lib/libtpool/Makefile index 3ab625dd306b..e14eea509708 100644 --- a/cddl/lib/libtpool/Makefile +++ b/cddl/lib/libtpool/Makefile @@ -3,6 +3,7 @@ LIB=3D tpool +SHLIBDIR?=3D /lib LIBADD=3D spl PACKAGE=3D libzfs --000000000000c9131f063878d69d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jun 25, 2025 at 11:54=E2=80=AFPM Oliv= ier Cochard-Labb=C3=A9 <olivier@f= reebsd.org> wrote:
Hi Alan,


On Sun, Jun 15, 2= 025 at 6:02=E2=80=AFPM Alan Somers <asomers@freebsd.org> wrote:
The branch main has been updated by= asomers:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9
commit 5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9
Author:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2024-05-07 17:48:33 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.org>
CommitDate: 2025-06-15 16:01:37 +0000

=C2=A0 =C2=A0 Add a regression test for a libtpool bug



It seems this commit is the cause of preventing all m= y (freshly installed) ZFS systems from booting than stop with:

Mounting local filesyste= ms:.
ld-elf.so.1: Shared object "libtpool.so.2" not found, req= uired by "zfs"

Because liptpool.so.2 isn=E2=80=99t no more in /lib (belong to = the / dataset), but in another dataset (/usr/lib) but it needs to use zfs t= o mount this one.

Could the added include<src.opts.mk> in its Makefile modified the installed directory = of=C2=A0libtpool.so.2 ?

Here is the bisect script used:

#!/bin/sh
set -eu
WRKDIR=3D/tmp= /bisec
mkdir -p $WRKDIR/lib $WRKDIR/usr/lib $WRKDIR/usr/include
make = -C cddl/lib/libtpool
make -C cddl/lib/libtpool install DESTDIR=3D$WRKDIR=
if [ -f $WRKDIR/lib/libtpool.so.2 ]; then
=C2=A0 =C2=A0 rm -rf $WRKD= IR
=C2=A0 =C2=A0 exit 0
else
=C2=A0 =C2=A0 rm -rf $WRKDIR
=C2= =A0 =C2=A0 exit 1
fi

And my bisect session pointed me to this commit.
git bisect start HEAD 9c= e5410b9094 --
git bisect run /tmp/bisec.libtpool.sh
git bisect reset

Regards,
Olivier

Wow!=C2=A0 That change was definitely n= ot intended.=C2=A0 And I"m very sorry for the breakage.=C2=A0 Could yo= u please try this patch?

diff --git a/ObsoleteFile= s.inc b/ObsoleteFiles.inc
index cab8949b635b..aa8883cf9b7c 100644
---= a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -51,6 +51,9 @@
=C2= =A0# =C2=A0 xargs -n1 | sort | uniq -d;
=C2=A0# done
=C2=A0
+# 202= 50626: For 11 days 15.0-CURRENT installed libtpool to the wrong location+MOVED_LIBS+=3Dusr/lib/libtpool.so.2
+
=C2=A0# 20250623: fscandir() = renamed to fdscandir()
=C2=A0OLD_FILES+=3Dusr/share/man/man3/fscandir.3.= gz
=C2=A0OLD_FILES+=3Dusr/share/man/man3/fscandir_b.3.gz
diff --git a= /cddl/lib/libtpool/Makefile b/cddl/lib/libtpool/Makefile
index 3ab625dd3= 06b..e14eea509708 100644
--- a/cddl/lib/libtpool/Makefile
+++ b/cddl/= lib/libtpool/Makefile
@@ -3,6 +3,7 @@
=C2=A0
=C2=A0
=C2=A0LIB= =3D =C2=A0 tpool
+SHLIBDIR?=3D =C2=A0 =C2=A0 =C2=A0/lib
=C2=A0LIBADD= =3D =C2=A0 =C2=A0 =C2=A0 =C2=A0spl
=C2=A0PACKAGE=3D =C2=A0 =C2=A0 =C2=A0= libzfs

--000000000000c9131f063878d69d-- From nobody Thu Jun 26 13:11:41 2025 X-Original-To: dev-commits-src-main@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 4bSfGP48vRz60XgM; Thu, 26 Jun 2025 13:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSfGP3RtZz3J4T; Thu, 26 Jun 2025 13:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943501; 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=0Gguj+2hHDtz86Io93xyF6D6IdFe3d/P2pEnSq73U6g=; b=xXLe4Z5Oa5HqNzDClgcCgArsZk/RJepagJJjoHM/n4HHtmafhpWbCJRMgJ4G8xQ069Adjg 7ESHZOD9GVX9j5zP+IY+k2fY9ENADPoW8ZtsZiU2TM6N2oj55f61Ocu2P1n/STgfART5Sc ZMeQqGJicVr6Ce9FgPjW493L3VA7xSPWX6AduiHo228NDKl36o2JfWPbtqrKE73J1jxvra FdX2zNXaIKo1dIMeuo0B+A15vZrO5tIgzdASDOlpDTiZR8GRFbXT8gdBus3ihxQ/X56vw0 6xtoI/wJhCkiwRIMHQwLZT8cNbq5AEBfUfrLMnh4w6jwnOrTqFV0ZlAxSUiyyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943501; 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=0Gguj+2hHDtz86Io93xyF6D6IdFe3d/P2pEnSq73U6g=; b=E2KMw40AlH0jyxJ1psc4CrH0+WDE8bzsZblFg4roi9/DWthDd3KqR5EKlvCCYugW2KUtF/ dmy7xWEPdd0ECZm4//TqLkJmtw4S3gTppFsE/5Q0dIQ0njjsFpTuvsd0jGSG2ImFqOGw8b AjzGxFGUDkbUldYQ8CV9j/wPcDXGbEG4lzQDYu0TFaa81OUUWU1a4+mZs5WCHmysABQE+k m6F/6GI6nD/r3ebmgYwMBPtn6yDqGhB3jLcLGPdd/UD6DNFzHVQLtdEVmdVysyOZn1X4RW epBHPQONhqQA8kegoYKyHMZCsjJd6hYkuAjX4ccogHMyF2TJXhFyrOaTGS8IlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943501; a=rsa-sha256; cv=none; b=CvxNQMRzcguo6b5WCuqiWeMvW3AarTm4TlpA45A5FqltreOPjXxvaPxBYqJHI+4PhNE6s9 P8oZHmpKkQcAuxho9LE9xzMHYGCfOf9KI2n6zHFNkHxBDkRHW06wYtDau0eO60fWCjrkQ9 czbMZEHLvumATBAyyUNiPTozIvhYZ03FSPqcDQCaP1TIR2epJVWFucnQCt5A4eaBnmV+e1 jboJ1B840ZvD4Rf8cqxTlGWL/gv8pzakhOkA+wCOQ8H7kcakpQ1jyP71kBEyusnGTS9ei1 Y+BfTerc0bzd3U3GQ2BRzbBkO85YsXv8jwEg15/dmIE5xfLt5tbyEO5vcA2sZw== 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 4bSfGP319Vz14CM; Thu, 26 Jun 2025 13:11: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 55QDBfKi022465; Thu, 26 Jun 2025 13:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDBfZ4022462; Thu, 26 Jun 2025 13:11:41 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:11:41 GMT Message-Id: <202506261311.55QDBfZ4022462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 230ae7a67665 - main - pfctl: fails to handle nested 'load anchor' properly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 230ae7a67665522bada6608dc495e5ce68546b4f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=230ae7a67665522bada6608dc495e5ce68546b4f commit 230ae7a67665522bada6608dc495e5ce68546b4f Author: Kristof Provost AuthorDate: 2025-06-18 13:24:28 +0000 Commit: Kristof Provost CommitDate: 2025-06-26 13:11:00 +0000 pfctl: fails to handle nested 'load anchor' properly [ + yet another 'anchor name vs. path mix up in load anchor (parse.y) ] OK bluhm@ Obtained from: OpenBSD, sashan , ab40201610 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 4 ++-- sbin/pfctl/pfctl.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 0af53e2692d7..1bd8e2bb55ad 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1205,7 +1205,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto loadrule : LOAD ANCHOR string FROM string { struct loadanchors *loadanchor; - if (strlen(pf->anchor->name) + 1 + + if (strlen(pf->anchor->path) + 1 + strlen($3) >= MAXPATHLEN) { yyerror("anchorname %s too long, max %u\n", $3, MAXPATHLEN - 1); @@ -1220,7 +1220,7 @@ loadrule : LOAD ANCHOR string FROM string { err(1, "loadrule: malloc"); if (pf->anchor->name[0]) snprintf(loadanchor->anchorname, MAXPATHLEN, - "%s/%s", pf->anchor->name, $3); + "%s/%s", pf->anchor->path, $3); else strlcpy(loadanchor->anchorname, $3, MAXPATHLEN); if ((loadanchor->filename = strdup($5)) == NULL) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index cd4e2ae82aae..15766eb9b704 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2384,17 +2384,17 @@ pfctl_rules(int dev, char *filename, int opts, int optimize, if (check_commit_altq(dev, opts) != 0) ERRX("errors in altq config"); - /* process "load anchor" directives */ - if (!anchorname[0]) + if (trans == NULL) { + /* process "load anchor" directives */ if (pfctl_load_anchors(dev, &pf, t) == -1) ERRX("load anchors"); - if (trans == NULL && (opts & PF_OPT_NOACTION) == 0) { - if (!anchorname[0]) - if (pfctl_load_options(&pf)) + if ((opts & PF_OPT_NOACTION) == 0) { + if (!anchorname[0] && pfctl_load_options(&pf)) goto _error; - if (pfctl_trans(dev, t, DIOCXCOMMIT, osize)) - ERR("DIOCXCOMMIT"); + if (pfctl_trans(dev, t, DIOCXCOMMIT, osize)) + ERR("DIOCXCOMMIT"); + } } free(path); return (0); From nobody Thu Jun 26 13:11:42 2025 X-Original-To: dev-commits-src-main@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 4bSfGR0tVKz60Y4m; Thu, 26 Jun 2025 13:11: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 4bSfGQ4PmWz3J1s; Thu, 26 Jun 2025 13:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943502; 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=EIGwYszdr57U4w0o63ahmpDTuO8fp5OTfgrm2UYRFnw=; b=RnJbMWTcWr2PuMKDo61hLTVefCzsU0MYixnGQx5VmwO1YI+JfR5clFaiPQuqnqn4Obu1gg qf0bovbB1l46RENgBVxWfhp5BBJ89d7x8fh7F7me8oZelIaJXLkXYgsZHGHREXZNBmrhgR MB8EGsmbTmaFj8Vv/0UQFCN7O1qWsPW4CKAwLTnXn/CNy8vZWrYbLoGMosEBJOdEBi4ulR IkQGdr8HFB4+O7o+kUhbjT4T4jZiUKivAnxhgnhPjfRtMCBLid36IaUnaQc0P6lJjeg8AY AkiNzEREkdCdV0Wuhy6SrJBqwTIAMbDB/jMViMEQ//9xzD+96Yl9S6TnZ5axcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943502; 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=EIGwYszdr57U4w0o63ahmpDTuO8fp5OTfgrm2UYRFnw=; b=oQFdkEDF2jTGGf8avszztRID4I5YAU8G7OMik66raP5As+CDpqCTvMdNVIHBTpknR7MA7Y TS/60Ap0OP+W6gISrjmUNKA+EnVknFcKpzl3444H3V6RbfI1TlgxiDE/ZnBnVujdLFBD3F t1CSyfRk+ru7AhtwRKZEzd9VaiXJB2Ba8Vp/WZvseiEuTmSRSt9bkrdMg5i4szmuIGJ/7W MRPF4/luTBrSnHqRHqt8ll78QAJt9A/1fhbcm7MsHmfLbxWLx6noUR9Qfz4V4ojyJiA6tr Ux47VPdgARtVmlPgsIl3pKdPG8LyFlE4xP3ycLcsYh/4giJ22LWLHkjhIe9xBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943502; a=rsa-sha256; cv=none; b=bqtdTeyD+KnIHwBeLesUmODjR9YGn+B29qnaphe0McnKcHC1Mw07hdRfphZTEWSHzxNOYq nVVl11RxVmxBK71oxZAELTQ/t1veWGsbTCWOb3QTeHMBV6NmkAdyC52O7SSqH+HxIQNPC0 b/7LA11hhFP1O68M+VwbugJDtfsabn7ET018ywL/227z+a38SLekr1zFBCQbyuFFDnQrFN oIJlZprYc5+gIDGWbZ3WtXBCNdDartDy/6ZeVLjq5nGX4EexUXGm4t0U3n4x2N6BfbUKUr vnIIAbr6GfalowlQdMydm26t98feHEoxGqe/s9y3i6igI22dL1q2bmkPhFHp7g== 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 4bSfGQ3jt7z14JM; Thu, 26 Jun 2025 13:11: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 55QDBgJw022506; Thu, 26 Jun 2025 13:11:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDBgDI022503; Thu, 26 Jun 2025 13:11:42 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:11:42 GMT Message-Id: <202506261311.55QDBgDI022503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a62c14538100 - main - pf: drop neighbor discovery packets with the wrong hop limit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a62c145381001b830cdd1e4781ecb5462c880d77 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a62c145381001b830cdd1e4781ecb5462c880d77 commit a62c145381001b830cdd1e4781ecb5462c880d77 Author: Kristof Provost AuthorDate: 2025-06-18 16:28:57 +0000 Commit: Kristof Provost CommitDate: 2025-06-26 13:11:00 +0000 pf: drop neighbor discovery packets with the wrong hop limit RFC 4861 requires that all neighbor discovery packets have 255 in their IPv6 header hop limit field. Let pf drop neighbor solicitation, neighbor advertisement, router solicitation, router advertisement, and redirect ICMP6 packets that do not comply. This enforces that bogus packets cannot be routed when pf is enabled. OK mpi@ sashan@ benno@ Obtained from: OpenBSD, bluhm , 441055dec2 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index c162b3dd8b3c..25525092efdb 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -10220,6 +10220,14 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, case ND_NEIGHBOR_SOLICIT: case ND_NEIGHBOR_ADVERT: icmp_hlen = sizeof(struct nd_neighbor_solicit); + /* FALLTHROUGH */ + case ND_ROUTER_SOLICIT: + case ND_ROUTER_ADVERT: + case ND_REDIRECT: + if (pd->ttl != 255) { + REASON_SET(reason, PFRES_NORM); + return (PF_DROP); + } break; } if (icmp_hlen > sizeof(struct icmp6_hdr) && From nobody Thu Jun 26 13:11:43 2025 X-Original-To: dev-commits-src-main@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 4bSfGS3MGNz60Y55; Thu, 26 Jun 2025 13:11:44 +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 4bSfGS00slz3J6P; Thu, 26 Jun 2025 13:11:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943504; 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=zkntgcxHBIpy4jtlKodIhn89Ugk3rQocod5QtiL4miI=; b=XCvV+XsIGeSYZXjUX3zULSaBYy0ugMZM++184GCBIuoZLfQ/2la+0EN5vQYxn2jbpsvbDI jpC7KlvP/Ci8Rl8mv0SLysuhN/rIN5pAha8gPKu6D1QUfbo5LhieZRgW7kMkfVroeFCWGx qCd+UogUEdOF2U6ZhrykzyAnuf73FslQ5jvKvdFOW6Xq35/6KuSCzvKnoAvwibBOnTLQ9B IdOpkLrGnyjhkPOBInuyGa01WjUiMNSgdotdzCL7rUNLAxOKeUSNUsW2GGHsOl6nq++bOF yGXfqP6uU/KaMXVnevL/bMjR47/+vICv2u+NeXHqKq91DosoT3G5lPc6g6uxpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943504; 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=zkntgcxHBIpy4jtlKodIhn89Ugk3rQocod5QtiL4miI=; b=K/ruWdCfYrHw9/IxYK1tK86yj1ebUSZ2H5vu846eNK2ud8a64b1+sCKj7tM+BRokoJlUQc MI+JzK8Ld5aHyokFn6oEg/w8yICguP65Xf1MBCVOni72bTFO93fcQgwPBEP3A7BMdc0bh8 HIEfwJE0nogcHVtNPmgQvJYnwDD72dp+ELb0PQgCVzDeA8yVo0t4f6GneV7bcNZpgUrzGn kqlxpzmuQTFkcoLRPAr3l3IoBz/qYWMz3S8bboBnHV060XPQw4LFM9m11gYgPJVoM+V5sa QN8hHGVEHje2h2RASeEHeLA3ItzhNk7GfaDhtBlUmaVVCSBXxfPUL5h5YrDyWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943504; a=rsa-sha256; cv=none; b=u8m6Fhp9T7gFebtXLKzzB9rDx1x+iWdC7g4g92swAQwIQWyJ6LORr159TK7W/YIW+gNSaz 4+COQPXwKaV4ZRpFl1TAu3grK39fv8RTx8cUAW/B/3nP6tviEfskRtds7F+DMDmPu8xhV8 QnEBibY4CGUQyUtjFm6v2XC9DrGWbN6Nqdqjz0hiJQB62isilNteA4XT+BZji19FRsI3wy DwU1MlmxkIaYXSeW1CLc11Xy7SXAJsUOoaRJ4dGnCB5A4h2WVqTkT9X2a7c/i5oFsQ++g4 I8OziK4hs8yy6NN4wRAhOJPrv5FTAV9wV6E//9Y90DimeqqBUYO6e4XAz4sZkg== 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 4bSfGR4hmCz14JN; Thu, 26 Jun 2025 13:11: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 55QDBhMm022539; Thu, 26 Jun 2025 13:11:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDBhdh022536; Thu, 26 Jun 2025 13:11:43 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:11:43 GMT Message-Id: <202506261311.55QDBhdh022536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9ab84b78caaf - main - pf: disallow IPv6 routing header by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ab84b78caaf1e167f99139965520ccf7752461b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ab84b78caaf1e167f99139965520ccf7752461b commit 9ab84b78caaf1e167f99139965520ccf7752461b Author: Kristof Provost AuthorDate: 2025-06-19 09:56:10 +0000 Commit: Kristof Provost CommitDate: 2025-06-26 13:11:00 +0000 pf: disallow IPv6 routing header by default pf drops IPv4 packets with any options by default. For IPv6 the same is already done for options header. Add the routing extension header to the list that need "allow-opts" to pass. OK sashan@ visa@ Obtained from: OpenBSD, bluhm , bfcbb272c6 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 25525092efdb..521969001f92 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9829,9 +9829,11 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) pd->proto = h->ip6_nxt; for (hdr_cnt = 0; hdr_cnt < PF_HDR_LIMIT; hdr_cnt++) { switch (pd->proto) { + case IPPROTO_ROUTING: case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: pd->badopts++; + break; } switch (pd->proto) { case IPPROTO_FRAGMENT: From nobody Thu Jun 26 13:11:44 2025 X-Original-To: dev-commits-src-main@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 4bSfGT6rCRz60Y0k; Thu, 26 Jun 2025 13:11: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 4bSfGS6Lc1z3JCc; Thu, 26 Jun 2025 13:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943504; 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=iG95itZ48kO8xAxHEP4xX5QBHe+Qp/aEgyhJbvYiG6Y=; b=dV80oIlaIRdNoLCZp6IGYvc+BMJKW3F3PrQRbaG/Na6xOn0Dlfrt9kVhoogOKm71ZgONkQ YEmgqEQ3maYC2btXdEP59jxuznsgA2Atz3uWnUeHp4/XilenPlPsE2e3V8JVWUyRzfcGnX pzJ05rLkJise00bJct4qJxN/eqATeL9HEIKSOEE6kWmZCXRFM+Ni9W+EkYklGPaM3Lcgrh LIV/mYJMtPUe+83n05OvuxtT8p4il66/beS5ODMpY28VsrNkta5M0PayhZJFluXvKOif5n 2OVFk4TINzQH+Oat4/BAZITsTXxxFm9dJKLbI7sycZik5D9TVwMCnGtJBleZRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943504; 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=iG95itZ48kO8xAxHEP4xX5QBHe+Qp/aEgyhJbvYiG6Y=; b=inR572Uvqo1UoVGywL1IQO2qBEQvAPYF0ceciuagCD/5Lm+j8XI9CsKby6hfhw4JT+4Ju6 Nl7IeQyD4F+BVHCyaVy2bb5AK9zv1B9lJ09id1K9/6TSNJ6hGNyU5tQrRlAtVzbgqUPDFq j23arf2YTlaouX+bj0/jTbebk76pMYyjSQ5qFCzK6bPmU3U92yvagsRN2zmj1S3ojJoJrV 3UwX4iZU0soHmZdKGMbx7f7zhDt/FMOQWIVcY9FIefAX7yNdAXmfaiTSw9C2G6SKP74S3D VE4FGRhr+IIYgxPk+fHXB+wHiKtopHV4UzZ4Rz/J8OKzxXGeoGhgVEEF6EnE1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943504; a=rsa-sha256; cv=none; b=qnSXUKbKWx1VY07owyFS8YKaxOYLTIY2Q0coILFkE0qMpbSWwVT4eSmpjA2IC0q8uYPxlH 2BE6vDJ4AUMqt80mcTYXUpjJGl54d291qcWG7n5vJHYspxxqb0kXFmcxp+VhXbrY26Igrk /RRYjcNgH0/JHoScyIJQrYLAG+xmzvEymdyK7TF/+5pEOIsgWn2+5q7nWfdmd5KXwe0nOi XImcylLoHWRdxja+ASz3OLZYUVNeSH3O4cPJUFi5kM5hgw9UJzHhtHJVdhxqy27XsGHPt0 fXD0UmuS/80EH+3LtQSl5yiAEUO1eB9MyKP8rdCyulekkhaEOvb1dZfqRpIlww== 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 4bSfGS5bP9z14Bs; Thu, 26 Jun 2025 13:11: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 55QDBiXQ022573; Thu, 26 Jun 2025 13:11:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDBiGo022570; Thu, 26 Jun 2025 13:11:44 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:11:44 GMT Message-Id: <202506261311.55QDBiGo022570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 22e8dc82ff0c - main - pf: Use pf_send_icmp() consistently in pf_route() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22e8dc82ff0c244ed97f1a43ad35d71b11555d58 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=22e8dc82ff0c244ed97f1a43ad35d71b11555d58 commit 22e8dc82ff0c244ed97f1a43ad35d71b11555d58 Author: Kristof Provost AuthorDate: 2025-06-19 13:29:36 +0000 Commit: Kristof Provost CommitDate: 2025-06-26 13:11:01 +0000 pf: Use pf_send_icmp() consistently in pf_route() It sets the routing domain and other mbuf flags. In pf_route6() the bad packet counter and dup-to check were missing. OK visa@ Obtained from: OpenBSD, bluhm , 51a22f9bf3 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 521969001f92..cdf48fc4d60a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -327,7 +327,7 @@ int pf_change_icmp_af(struct mbuf *, int, sa_family_t); int pf_translate_icmp_af(int, void *); static void pf_send_icmp(struct mbuf *, u_int8_t, u_int8_t, - sa_family_t, struct pf_krule *, int); + int, sa_family_t, struct pf_krule *, int); static void pf_detach_state(struct pf_kstate *); static int pf_state_key_attach(struct pf_state_key *, struct pf_state_key *, struct pf_kstate *); @@ -4342,11 +4342,11 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, } else if (pd->proto != IPPROTO_ICMP && pd->af == AF_INET && r->return_icmp) pf_send_icmp(pd->m, r->return_icmp >> 8, - r->return_icmp & 255, pd->af, r, rtableid); + r->return_icmp & 255, 0, pd->af, r, rtableid); else if (pd->proto != IPPROTO_ICMPV6 && pd->af == AF_INET6 && r->return_icmp6) pf_send_icmp(pd->m, r->return_icmp6 >> 8, - r->return_icmp6 & 255, pd->af, r, rtableid); + r->return_icmp6 & 255, 0, pd->af, r, rtableid); } static int @@ -4403,8 +4403,8 @@ pf_send_challenge_ack(struct pf_pdesc *pd, struct pf_kstate *s, } static void -pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af, - struct pf_krule *r, int rtableid) +pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, int mtu, + sa_family_t af, struct pf_krule *r, int rtableid) { struct pf_send_entry *pfse; struct mbuf *m0; @@ -4469,6 +4469,7 @@ pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af, pfse->pfse_m = m0; pfse->icmpopts.type = type; pfse->icmpopts.code = code; + pfse->icmpopts.mtu = mtu; pf_send(pfse); } @@ -9083,14 +9084,11 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, s); } - icmp_error(m0, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0, - ifp->if_mtu); - SDT_PROBE1(pf, ip, route_to, drop, __LINE__); - goto done; - } else { - SDT_PROBE1(pf, ip, route_to, drop, __LINE__); - goto bad; + pf_send_icmp(m0, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, + ifp->if_mtu, pd->af, r, pd->act.rtableid); } + SDT_PROBE1(pf, ip, route_to, drop, __LINE__); + goto bad; } error = ip_fragment(ip, &m0, ifp->if_mtu, ifp->if_hwassist); @@ -9370,12 +9368,12 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, sizeof(struct ip6_hdr), s); } - icmp6_error(m0, ICMP6_PACKET_TOO_BIG, 0, ifp->if_mtu); - SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); - } else { - SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); - goto bad; + if (r->rt != PF_DUPTO) + pf_send_icmp(m0, ICMP6_PACKET_TOO_BIG, 0, + ifp->if_mtu, pd->af, r, pd->act.rtableid); } + SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); + goto bad; } done: From nobody Thu Jun 26 13:11:46 2025 X-Original-To: dev-commits-src-main@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 4bSfGW4KnSz60Y0l; Thu, 26 Jun 2025 13:11: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 4bSfGW1GTLz3J6w; Thu, 26 Jun 2025 13:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943507; 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=au5yGXPR+VCwioD1j28xQ9VsjVB6jvnGq2OyH3LU6Uk=; b=oM8tMMNjIuiNkuCt/hnkc7fF4iqEU40cufnVejDLMBHXdxYWgOmc+Ncg1t4UKTx70h4BtK qnZ6Xpv4UjxmcNMC9bfk44Zi0X4HoblBHBnDoxbhdMukraC4B//qZSx9CPOLHyZd8GFI4M fxnQoIbozELv1zRsSTws4XiKUDt+JQb8eAuAnFPcz3fzHlHxXpii/vKHjxHoDYJ+kSlWnw DF298WFv9WWpQdys83WY9wp0QngT+AgOCcugcBASZRDrtA7WL9LJs3Q4FDIvsbaH6ZZdF/ 6Jo5gqhYbNTWUQKYFfhTzXcWOrXSJlIofnJjbBjzl74e/YfMpWG5qqOs4zoqvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943507; 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=au5yGXPR+VCwioD1j28xQ9VsjVB6jvnGq2OyH3LU6Uk=; b=bsm5do6aRtPLzhmridxiDZoSP0gTKWCY6kzugcXuuE6d8RNnK72I1fPtCnyzp/f9IhnNi8 6pjdCXeR334CB5ZKvC7RKzHJVWxMfjDS69dtaj1mm7V2qyy65wMdM8MPvbaoIYQp4fXPNt McrQ++UuLxiG8Bn1dh2redPTxS4AYLnTuk66gqcM86d9WAb30Abk9cDfNs+W/TlAmKt008 L08/zIhFmS5OgGZYdEePTGM4a2LHcijIq0jh3GWv+f0ExpCxaUQhhpAHo3sdhkNqDEhkFv D0HFFFHpjrDd5KidqKCxeD3np1uqkPN2hXku9gDINjG0nN1MRdW7VoW0UuU1Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943507; a=rsa-sha256; cv=none; b=fNPjxmdkmZgDjqVEKzOtmhluIf1SO8nzftaPxHHyJ8GMWICxGsRxNibY1apIon2vz5bTij Yd5z/Brf62Hye7ACLL5Vx1rA7kb4otfdnVK6vicVOKHuicaEXpWHofgcvr+wL8l5xkkwxv nbQYgPOZKUwE3rTl7uZ1bsEKYNwOBP+fy8oIYxq+t5mfDp5hyIaACah0drY8sJnNESLX4q JsgAlrw4+LT0FIVVNfv8QzDMApehOXN6cKhKQzNhzZzQ3cinYa7QWcfOna66dEUbUdvzVh ETgHMXuhiDzHsWyaj+3yKJlOzUE9kleIwbQ1h+yoTu8d2YYKUd3mIK5zTUWWEw== 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 4bSfGW0B0Zz13G7; Thu, 26 Jun 2025 13:11: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 55QDBk6d022644; Thu, 26 Jun 2025 13:11:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDBkaH022641; Thu, 26 Jun 2025 13:11:46 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:11:46 GMT Message-Id: <202506261311.55QDBkaH022641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: fed2e93b0a00 - main - pf: fix regression in pflog output List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fed2e93b0a00b2110d25ffb13da235941a14c505 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fed2e93b0a00b2110d25ffb13da235941a14c505 commit fed2e93b0a00b2110d25ffb13da235941a14c505 Author: Kristof Provost AuthorDate: 2025-06-23 09:36:24 +0000 Commit: Kristof Provost CommitDate: 2025-06-26 13:11:01 +0000 pf: fix regression in pflog output pf_match_rule() must remember current anchor before descents towards leaf. it must restore anchor as it ascents towards root. Bug pointed out and fix also tested by Matthias Pitzl from genua. OK bluhm@ Obtained from: OpenBSD, sashan , 73e0536f0e Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a40e1744cbc8..6533b06c5d9d 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4665,9 +4665,9 @@ pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r) rv = pf_match_rule(ctx, &child->ruleset); if ((rv == PF_TEST_QUICK) || (rv == PF_TEST_FAIL)) { /* - * we either hit a rule qith quick action + * we either hit a rule with quick action * (more likely), or hit some runtime - * error (e.g. pool_get() faillure). + * error (e.g. pool_get() failure). */ break; } @@ -5512,6 +5512,8 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) { struct pf_krule_item *ri; struct pf_krule *r; + struct pf_krule *save_a; + struct pf_kruleset *save_aruleset; struct pf_pdesc *pd = ctx->pd; u_short transerror; @@ -5681,13 +5683,22 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) break; } } else { + save_a = ctx->a; + save_aruleset = ctx->aruleset; + ctx->a = r; /* remember anchor */ ctx->aruleset = ruleset; /* and its ruleset */ if (ctx->a->quick) ctx->test_status = PF_TEST_QUICK; + /* + * Note: we don't need to restore if we are not going + * to continue with ruleset evaluation. + */ if (pf_step_into_anchor(ctx, r) != PF_TEST_OK) { break; } + ctx->a = save_a; + ctx->aruleset = save_aruleset; } r = TAILQ_NEXT(r, entries); } From nobody Thu Jun 26 13:11:45 2025 X-Original-To: dev-commits-src-main@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 4bSfGV3Rs8z60YKR; Thu, 26 Jun 2025 13:11: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 4bSfGV039kz3JZ0; Thu, 26 Jun 2025 13:11:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943506; 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=FR2LEExL6itB8QoAxLsROiWdup8iVQYRkFrHedELz9k=; b=AGXtPOa0R4XZuGiK/Td3swpDN/MRd+vRTRnl0Ds7t1/wrk8UvWkFFvDoXDTqiA0/1R5oAD VJS/o2mC+NzyYC6HY+dlSPVerkTH7lBkwD2WVbNIMGbsK8PpTpzjFV76oypPfOEuUxrrgp R5pR5wnV1KPX/c/hNnEKYXx30GYiid0JT7BJzhFDHWR8sWCZvDchySsauG9pVTM52sYkga WFRkw5qpzsIGhT7Iwho9cB0KY9mB+D2/l80YkDZlTzK3XJtPYQFXLzdk+SueWU5QKHx1m4 EWfai3d9Mx/mSAbGoUlvo0IZjMpHTaK3/g8NoEU38PpwrtJMz/TO0cAgNNPbOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943506; 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=FR2LEExL6itB8QoAxLsROiWdup8iVQYRkFrHedELz9k=; b=fi7bfPEDsFhOREEXlcAQKCPDEeu3aMBk6jg0EkXrMkds5V4+hCZRS9xTPGuhB6Gz24Redk MD8Y8pelbzdguLX6bNE5Ll2fBtTjHxLcmSh4a+l3lGUBE2R1WVg6eV/MJZ9jR/izVDJxKJ aw3Ph+ecOSYmMfEx+FWyylktSdhmW0/xaTbvtOlWIGiYl2ZFUUyU+mzHuGHWP9YoFH0fPp mRHqsWI62w9edkAIxaYAZBPj7/Y4hQibVMzAmhx9sT+BM+3bzpdDuz/tBCXwajeV9V4JQl xS8YJXIa4piLmC/HlowVdJYBLrxz5AJ8ueaYl95ADmtEvxtHpMrsZhBa+zxmBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943506; a=rsa-sha256; cv=none; b=D4ZC0xMx+7IGeskn1XNDbUvd6TD4T/yMVs9X5DFFJIVG5msGpja18eKdwqm/PGo0P0viMQ z7De5Y4OUxhVJtjqZgpN3KbJ4zy8iR0//2LC7thZrCNtihki5D/pm26fLBavpiUwtWWVmQ O6rGHjF/v3fHJ9TWyQKDXzp05GtIgEWmXTe+7pDkAB5UdPBzVDR30EjAovXk1cjdeplfJ9 kRviRR5YKiTbrCU/nsLk9NDmbAJG1BmWc3Rr4x604TIYyb0gv5OZz9b0dOGD2732VGCXG0 FLiEHhcMeDXjFhvS5vWFKecOO4YjESOk5gjbuOm8VTPgIpHJ8FtfYisDlRr5Dw== 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 4bSfGT6bbxz14JQ; Thu, 26 Jun 2025 13:11: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 55QDBjqI022607; Thu, 26 Jun 2025 13:11:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDBjPa022604; Thu, 26 Jun 2025 13:11:45 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:11:45 GMT Message-Id: <202506261311.55QDBjPa022604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ad591caf2a70 - main - pf: decrement TTL in pf_route(6)() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad591caf2a70d6f3a5f1ba7aff182591afc0cc04 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ad591caf2a70d6f3a5f1ba7aff182591afc0cc04 commit ad591caf2a70d6f3a5f1ba7aff182591afc0cc04 Author: Kristof Provost AuthorDate: 2025-06-20 09:41:19 +0000 Commit: Kristof Provost CommitDate: 2025-06-26 13:11:01 +0000 pf: decrement TTL in pf_route(6)() When pf(4) forwards incoming packets with route-to or reply-to, decrement the time-to-live or hop-limit field to prevent routing loops. Sending an ICMP time exceeded error makes traceroute work. For outgoing packets ip_forward() has already done this. OK visa@ sashan@ Add a test case for the above, and fix the nat64 tests to account for the nat64 router now decrementing the TTL. Obtained from: OpenBSD, bluhm , 18421856bb Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 24 +++++++++++++++++++- tests/sys/netpfil/pf/nat64.py | 10 ++++----- tests/sys/netpfil/pf/route_to.sh | 47 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cdf48fc4d60a..a40e1744cbc8 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8949,7 +8949,18 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, dst->sin_len = sizeof(struct sockaddr_in); dst->sin_addr.s_addr = pd->act.rt_addr.v4.s_addr; - if (s != NULL){ + if (pd->dir == PF_IN) { + if (ip->ip_ttl <= IPTTLDEC) { + if (r->rt != PF_DUPTO) + pf_send_icmp(m0, ICMP_TIMXCEED, + ICMP_TIMXCEED_INTRANS, 0, pd->af, r, + pd->act.rtableid); + goto bad_locked; + } + ip->ip_ttl -= IPTTLDEC; + } + + if (s != NULL) { if (ifp == NULL && (pd->af != pd->naf)) { /* We're in the AFTO case. Do a route lookup. */ const struct nhop_object *nh; @@ -9231,6 +9242,17 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, dst.sin6_len = sizeof(dst); PF_ACPY((struct pf_addr *)&dst.sin6_addr, &pd->act.rt_addr, AF_INET6); + if (pd->dir == PF_IN) { + if (ip6->ip6_hlim <= IPV6_HLIMDEC) { + if (r->rt != PF_DUPTO) + pf_send_icmp(m0, ICMP6_TIME_EXCEEDED, + ICMP6_TIME_EXCEED_TRANSIT, 0, pd->af, r, + pd->act.rtableid); + goto bad_locked; + } + ip6->ip6_hlim -= IPV6_HLIMDEC; + } + if (s != NULL) { if (ifp == NULL && (pd->af != pd->naf)) { const struct nhop_object *nh; diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py index 32fd8f4245a1..adae2489ce5e 100644 --- a/tests/sys/netpfil/pf/nat64.py +++ b/tests/sys/netpfil/pf/nat64.py @@ -178,7 +178,7 @@ class TestNAT64(VnetTestTemplate): # Check the hop limit ip6 = reply.getlayer(sp.IPv6) - assert ip6.hlim == 62 + assert ip6.hlim == 61 @pytest.mark.require_user("root") @pytest.mark.require_progs(["scapy"]) @@ -236,7 +236,7 @@ class TestNAT64(VnetTestTemplate): ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") import scapy.all as sp - packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=1) \ + packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=2) \ / sp.TCP(sport=1111, dport=2222, flags="S") self.common_test_source_addr(packet) @@ -246,7 +246,7 @@ class TestNAT64(VnetTestTemplate): ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") import scapy.all as sp - packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=1) \ + packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=2) \ / sp.UDP(sport=1111, dport=2222) / sp.Raw("foo") self.common_test_source_addr(packet) @@ -256,7 +256,7 @@ class TestNAT64(VnetTestTemplate): ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") import scapy.all as sp - packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=1) \ + packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=2) \ / sp.SCTP(sport=1111, dport=2222) \ / sp.SCTPChunkInit(init_tag=1, n_in_streams=1, n_out_streams=1, a_rwnd=1500) self.common_test_source_addr(packet) @@ -267,7 +267,7 @@ class TestNAT64(VnetTestTemplate): ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") import scapy.all as sp - packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=1) \ + packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=2) \ / sp.ICMPv6EchoRequest() / sp.Raw("foo") reply = self.common_test_source_addr(packet) icmp = reply.getlayer(sp.ICMPv6EchoRequest) diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 0354d1f59306..5c0d355b8ea1 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -813,6 +813,52 @@ sticky_cleanup() pft_cleanup } +atf_test_case "ttl" "cleanup" +ttl_head() +{ + atf_set descr 'Ensure we decrement TTL on route-to' + atf_set require.user root +} + +ttl_body() +{ + pft_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + ifconfig ${epair_one}b 192.0.2.2/24 up + route add default 192.0.2.1 + + vnet_mkjail alcatraz ${epair_one}a ${epair_two}a + jexec alcatraz ifconfig ${epair_one}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair_two}a 198.51.100.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + vnet_mkjail singsing ${epair_two}b + jexec singsing ifconfig ${epair_two}b 198.51.100.2/24 up + jexec singsing route add default 198.51.100.1 + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 3 198.51.100.2 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass out" \ + "pass in route-to (${epair_two}a 198.51.100.2)" + + atf_check -s exit:0 -o ignore \ + ping -c 3 198.51.100.2 + + atf_check -s exit:2 -o ignore \ + ping -m 1 -c 3 198.51.100.2 +} + +ttl_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" @@ -830,4 +876,5 @@ atf_init_test_cases() atf_add_test_case "dummynet_frag" atf_add_test_case "dummynet_double" atf_add_test_case "sticky" + atf_add_test_case "ttl" } From nobody Thu Jun 26 13:11:47 2025 X-Original-To: dev-commits-src-main@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 4bSfGX3nhQz60YGt; Thu, 26 Jun 2025 13:11: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 4bSfGX19Rtz3J76; Thu, 26 Jun 2025 13:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943508; 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=cPrTcK6NXGd9eOV6V1jX0YjVAHs56wP39hfqRnSSofM=; b=LeJ7tKggpUpxOrZgiJAQ9ZqH8a7/4+RPUrPvtqGDBP2GLCB2EtXNt7XmnlxSUI2n6P45ym zmSEdXTOkX8Ipke45j95dv5lsx49IaMRm0uBAgWiBphvqFVBSCIMzOctM10SQv4PWD3uxk MAm5WOQbhL2/yEZ7sP5FQ6f5dDNVYV97WY+G8sMkrH4HbV6OCeYfgnqHdJp58Gyfk60Vhb 7/ZADMLnU5B3N87WcqynEOBSibtTxuB9Mh/J3rMPfWblZx00+c73tCzz1W9aW78+auSDKE PFVNhEXQvcBhhtdVJkySRyLCLPy5SZmyPNKxDas30Mv6YyLEHoP8MaRZQguMUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943508; 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=cPrTcK6NXGd9eOV6V1jX0YjVAHs56wP39hfqRnSSofM=; b=upoq93HDSzWbIJg6EjHgBmlaR43DfiLjbwb08E30oJFK1m8aZyQkai9bLQP+uFTHO6jV7s 20K2kmiNuwxA1F0rJeCV0Sl/IBgHXRM7ct14A8sJNyyB+f9YvNxqpfOmD/YhOQOypPL5XB Tkpam+ixfcg7ffxRAiJ/c4y4tnxW9o9v5W50lDMuoKeHeBw5XTSI3sl9uNYe+cu6O0T8lx 1M8iTZ+kRr6VqwoZNQ8plHIJKl5PNldLYEN1JHdeyNwVwS90J5TG67h3Hj+AUsowEJ4a4s QUyBAvaO4gvejrur4j3avIM4xye9HKifN7SNt79KVL28ItAYmrnkLZJSHlFdjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943508; a=rsa-sha256; cv=none; b=S1iaxO72+G+1aLNTaSZbLz7x4uI8yjygdQh85oarvl6ekN5iBgVFiVI04oSdStEb7dnRQX Dk3N18RssFRFsumEtfeQq1pZQpvus0hG7QGLlCyAD5hJaGwrqXjrprfLHimbY5257ZLAXx y/gUKUlTfA/ZqT8ggMbjBgfo2FsWti7cQakKOlF2KTYGxs4d57VoH0EJXU9qKspJXVCV9t IUyZouuZ2/NMxHFDJ4SICqPPuGc8sPjZSf9vx5OruSymPPGwMohf5HwKE5BF/hnaaQrabu 9b4Z7m2BWoZzlRP0Jq4lpL6qP36WeAVElt3TZIWsuifTALSr37w7IT3B0vf5IA== 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 4bSfGX0kHrz13wR; Thu, 26 Jun 2025 13:11: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 55QDBmZx022681; Thu, 26 Jun 2025 13:11:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDBlaR022678; Thu, 26 Jun 2025 13:11:47 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:11:47 GMT Message-Id: <202506261311.55QDBlaR022678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5c2d3093b27f - main - pfctl: Plug leak in error case of the common 'varset' implementations. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c2d3093b27fbea6501c2fb345a293bd4f524f75 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5c2d3093b27fbea6501c2fb345a293bd4f524f75 commit 5c2d3093b27fbea6501c2fb345a293bd4f524f75 Author: Kristof Provost AuthorDate: 2025-06-23 09:54:54 +0000 Commit: Kristof Provost CommitDate: 2025-06-26 13:11:01 +0000 pfctl: Plug leak in error case of the common 'varset' implementations. ok benno@ Obtained from: OpenBSD, krw , 16a0a9064f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 1bd8e2bb55ad..e0bd5ce4aee0 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -902,6 +902,8 @@ varset : STRING '=' varstring { if (isspace((unsigned char)*s)) { yyerror("macro name cannot contain " "whitespace"); + free($1); + free($3); YYERROR; } } From nobody Thu Jun 26 13:17:17 2025 X-Original-To: dev-commits-src-main@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 4bSfNt3M20z60YCd; Thu, 26 Jun 2025 13:17: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 4bSfNt22qlz3MF8; Thu, 26 Jun 2025 13:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943838; 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=VHQde2Edk6JE24drC0hHMqfrL82lHdtFVsILj/mt5zA=; b=EXUlb8t4ufqHlb6kM/eB4sUQHvTycRs5Ap6cZsFl63CfoI2Ktzyum7IM6qJTZGMp0hVo0J KrvP916wI+coaGFqPnHUpA9ecUUp/v8gvrprdzwWUtn5ElnN8yqE6V9clkNMI8Wza+I/Fq 0N+KSuU8RCvlmKikfplFg0+nZt8VX6xPla2dprRtX7hKZTxOZZobrMeK35/uNU0YQr0BXk 8ruY8uYd9lSvY4LzCo1oTIRCWu/afLbTsjIfC0+OwvBxfWHsDGILE0G3LxC+MT/fD6Iqsg KSJZMJzVDKLJsuXeJ+d34OFrfOu8GBAwlrOtUFum4UJSUULHmuECpmbEQaIEig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750943838; 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=VHQde2Edk6JE24drC0hHMqfrL82lHdtFVsILj/mt5zA=; b=qFUpYa2jU4i4rYjx7Nbccblz+kWXx/vt7Y7DKi0f04ywP9KBL4xBpHSVPx38x1dwGlLay/ VNqK9HkkXj5LxX4BavLljGCiI3DY0xwgSmuFojXZ/Xpb5qwFoiLGqoh1mXIZxIuixvDK+N ZCAzcL1fQ0zijDzclZA/TpjZgibrXlUUZoxCS6YO43w3oucaWsW71dBESm+9npiIlQDkYR Q4jAK9iT+9FijjFTEgZrrhhtWNkUd2WQAPsyZKEjlB1aaK5BJqeksU+QKxKXHFbVbUFTAl AcMxOb5DwYYu2qpCiE9FlFC7KMQpzNJpDwb2VfQLuEO+kNZ3TAmJjWVMUDrGkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750943838; a=rsa-sha256; cv=none; b=ooy93eBWFaUhEcJScbFb/wu+ftSdhkaIUcbo905JvVTT+tWF2hvKL4AMJJ83IvkCHT5Opn BjGI2pUknqYOgDIX3/2PCvAyHNiDQiUUCpwQLaeP+YakTCxpZ/lQqteFbYWEZ4DREypVfw 0HElxPQAl0UekCPQ8jJ38tEWQYcFgusgH6FvLDlCrc/d4SU4exk8JpT6dWlkw0ClIkGrxE nbhe2gqkxXuJ3piUKQ+aEtTcnNGI9fglvQit5DUffiV70W8fSS6EFP3ocPTN2VpfDbeTGe M7c3raMBRHpftM0Jr/34ifsXfLjMTlGcIknDijdoI2D8pFaYRGfYe8Jwz63uuw== 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 4bSfNt1Hrrz14Jq; Thu, 26 Jun 2025 13:17:18 +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 55QDHHLT029230; Thu, 26 Jun 2025 13:17:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDHHDt029227; Thu, 26 Jun 2025 13:17:17 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:17:17 GMT Message-Id: <202506261317.55QDHHDt029227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 8b4f237c5616 - main - tcp.4: fix typo for newcwv sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b4f237c561686a9d9188724adb03f660ae79480 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8b4f237c561686a9d9188724adb03f660ae79480 commit 8b4f237c561686a9d9188724adb03f660ae79480 Author: Peter Lei AuthorDate: 2025-06-26 13:14:27 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 13:16:54 +0000 tcp.4: fix typo for newcwv sysctl Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- share/man/man4/tcp.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 4c00c78bb2b1..536bd904d796 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 16, 2025 +.Dd June 26, 2025 .Dt TCP 4 .Os .Sh NAME @@ -784,7 +784,7 @@ The Maximum Segment Lifetime, in milliseconds, for a packet. The default value used for the TCP Maximum Segment Size .Pq Dq MSS for IPv4 when no advice to the contrary is received from MSS negotiation. -.It Va newcwd +.It Va newcwv Enable the New Congestion Window Validation mechanism as described in RFC 7661. This gently reduces the congestion window during periods, where TCP is application limited and the network bandwidth is not utilized completely. From nobody Thu Jun 26 13:23:47 2025 X-Original-To: dev-commits-src-main@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 4bSfXM4LZHz60YQ4; Thu, 26 Jun 2025 13:23: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 4bSfXM3rYVz3Pvt; Thu, 26 Jun 2025 13:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750944227; 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=qAldvDUKs/DiVaH5ec/8PrZN0u0qKIA6or4k0uhKNMU=; b=i6s3Ti6WzExMmuI6Wxtd81MufIWOTX/DOnamfQj5gDouvyPPIXAgNLvOoYc9KAORByIkBu ty81ChACPODAbDkBmfibPFFCNMCfN06OfaBykGRmWevIE+n88V+oqxvCsaaIF8zp0Mlb2V Q2kZRuxRMllg+hKTpaHi7rQjLXCGzWuCoKFFTaulH9OEj1fvOyCypv1f+PqPTCb+8OOWY/ 4yvMN0eGvovbEGinnAvC8bdeHoD7qDBBi5+3CHiChr9tjVaIFFYEqV76F8asXMmC9dnmvD jq4nHisfTb08dX0Cj4ZECTWwCUy7KGbAO53+Hi3+DeepYYHHnmAyM7nOI6JEjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750944227; 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=qAldvDUKs/DiVaH5ec/8PrZN0u0qKIA6or4k0uhKNMU=; b=HugvN/LW6ILMKdgJdyy89xH9E9eObyMdoWCmQKFXgV0H8OEy/jHUwAMpCqGX5Za7dONwFk ybmKuoEx7UDR9Mk/XexWxCSgE0W35b85xcUlGUH8cc91W5+r2Xskk0CQjoi/GIRdoWgfuv AGSOL7WUUaORe6Sucni9Yo8byPGL6cyv8VxaSJiIXz2sC45+Q+8NUIqVukwEz5Gir4R6UZ EtYbksaSc+NT8vqlCbjtZBHVocORuLjYkmYuovqo94vxqwPxiHn5Rv5gaO6m0adYTL5Xap 2eSne0GqzCELJYm753HVv0aPsSQkSN/2Y8bvVKowy8kl/7BFHx2hDPmPWur44w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750944227; a=rsa-sha256; cv=none; b=o8qsQLJkT5B5aaVLGATSTaXkZ3n0Ip2e8k/w0q9QgiyywDGS7YCQAj7H49/K6AwwYkReL6 1QCRps6l7J5QgWz1MiTCZfWXtlIOxhrfh8/ffm1uLBawOy3x8JHy+JGY8e/kzn3RgA/Joq R5k/z2b0ORvC7M3LJNF/2Fpi3vTNNAeJ/EMXUgdgr8mU6SKsQgaXqW+f/8XSGFGVAc2P0h rE8npecIRB5LPMyaGA5JnMxgfy5Yr8MmMjDq3XL/poB/5V7MXN5aA9ca5tRSzmw6dcozoM 6qupHUY79mDxWGjgiex+i9J3klm+5rwnWR5GvhpYNl6gjhxf76murdkfuDzrcg== 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 4bSfXM3NX4z14Y7; Thu, 26 Jun 2025 13:23: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 55QDNlVW046956; Thu, 26 Jun 2025 13:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QDNlIJ046953; Thu, 26 Jun 2025 13:23:47 GMT (envelope-from git) Date: Thu, 26 Jun 2025 13:23:47 GMT Message-Id: <202506261323.55QDNlIJ046953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 59b195d397a6 - main - tcp rack: move unused field from struct tcp_rack List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59b195d397a6c4e10c74c80b783a206e9c1013ec Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=59b195d397a6c4e10c74c80b783a206e9c1013ec commit 59b195d397a6c4e10c74c80b783a206e9c1013ec Author: Peter Lei AuthorDate: 2025-06-26 13:22:01 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 13:22:01 +0000 tcp rack: move unused field from struct tcp_rack Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/tcp_rack.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index 4374594a1d82..2393240489ac 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -614,7 +614,6 @@ struct rack_control { struct tcp_rack { /* First cache line 0x00 */ - TAILQ_ENTRY(tcp_rack) r_hpts; /* hptsi queue next Lock(b) */ int32_t(*r_substate) (struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, struct tcpopt *, int32_t, int32_t, uint32_t, int, int, uint8_t); /* Lock(a) */ From nobody Thu Jun 26 14:03:10 2025 X-Original-To: dev-commits-src-main@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 4bSgQ349pBz60bDv; Thu, 26 Jun 2025 14:03:23 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSgQ33WJdz3kjj; Thu, 26 Jun 2025 14:03:23 +0000 (UTC) (envelope-from olivier@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750946603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=srgtsAgXCDmzkuggnpPp4uFly7leerZYKC2GbjpLIAw=; b=Wl7+V0GKXpozQF666lzmiIGcRyF/tlHrzPB3SEO9hfYk4y6tVQ18LDrtGQL/oGZ+vtJ+Ni 3U/MseicOxb/caNc4A9S6lxUOVzGpqRy2cNtTvtJ4iXuRATYP85cTBIG5122eFjXZi8IY3 G1L15b0qNlQ1UTnCJM1zr1OLm8T2st2J0tcMSDcU157iASsd3xP/EsvpyCoNn7X9L5t5+U 66uO0vQ1crQywO1HWCkL7kOXwunHqr17UkGVZ9XFMwCAKAAp7DHa1hGvDPGR2JiqK7a+me U4Eotb/wQY6WvL3VEJ1la8p3rE6NMvnCLB8uappQN1JXlENG5mE1NjR6TCxBRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750946603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=srgtsAgXCDmzkuggnpPp4uFly7leerZYKC2GbjpLIAw=; b=Gu6PX5+zS4xAFtMHIWJldDnCfX8vPxy+iZ6oPhMbGBH2CiGZ0edeOlkd2ydk4/O6WqcivR 2LoRngY3O17dCUAjnWPROyrlLvlNqotwdw2TLQi5q/I4mZjFztGlLPgwW1cDFEX0sd+b2C /MyoNcXUsaiMhwpG1i3M30ShLTjNlx0hVWltMDkbsSqlO+Nnd+PFBoxC/db8+bUbBpg8W9 LlbsBK1o6BE7+S7itSPkbHa0vygiOZnO9qDEipi5+5xnLixvjKjp8/LDME1kS4tB3gxRjx coe2kje4tP9ZNc96Bwnw4rQBfpYGkR6+ea8JpE3HfNsYrVXWalSv1NsXdpKzgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750946603; a=rsa-sha256; cv=none; b=Xj4hUi/kTlgMDvbUxcgTeswxoRz4LNSJQfy3GDt6ZkVTi3Z+aCh6kTk55LBDQxcVuCzfC5 nkJrk0Ng9Xk/jWbcukWw9HNcZOyhtZDSVSzoMoJM5CPeR6cz58emMdby7KKHldZ8vO9wme VC4nqGIO6UUBcxIg6ink+kcoZwIA/G+oUxzVZygdQeUKGdGc6PH7djGSZ3fEIl/cSKWzJr E2qLLLgS8YjoncDvyz83Rk8MeccwUfGjgqmkfQR4powwCat1ML3bZwRp9iwWfd5CvqBsJD Ht1ZWOHePBs/XFFoYIkWwjfc8WnFjudvvamNjLbuV4L9mOCbVmSTBuexQWb2NA== Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: olivier/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bSgQ336cJzpVn; Thu, 26 Jun 2025 14:03:23 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7d21f21baf7so102860285a.0; Thu, 26 Jun 2025 07:03:23 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCU0fQX7+QYX1Lh6+BQ2oE8rSTYV0ouI7AOdSFtvJWJ6AfXwQ3cSqgy34ed/1SuqNorNz15QWStIjKm/iNQUoBSQ1fuV@freebsd.org, AJvYcCV5j8T2VOKFGJU3fbsOlUheoLZf058xLm9s/9t/MdPgKInoxZMshXJfFu/qFJwQPQpN9UhLXzxXKgV4DeSIVoQUBDCvUn8=@freebsd.org X-Gm-Message-State: AOJu0YzOwsogM+vjpgjDDz5WQV2gLap4ZkCd706uLHxzEOyeALz/r+11 y7nfvHA4AxLQDXj0ytTLbUJ8QqISSqxBaxtB1lThFEEIgwtLxQT1+f5m3OwG+oKs9HQLPhcD1BS h+wE7P5Jf2mztEzb+TOP0WqArD7tryXA= X-Google-Smtp-Source: AGHT+IGUQmznjfI0coV4Jf/jOjuytVRvn8ros9B20vEblw53CzS/q5VW746zFxVE+/M4bfY0QNgLmV4TRJY1pQp2HKA= X-Received: by 2002:a05:620a:408a:b0:7c8:c9c:2a8a with SMTP id af79cd13be357-7d429771d8emr1063581985a.49.1750946602206; Thu, 26 Jun 2025 07:03:22 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506151602.55FG2SHe047772@gitrepo.freebsd.org> In-Reply-To: From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Thu, 26 Jun 2025 16:03:10 +0200 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXxilCbSVVWAdtDbIPcm4hFdp_LdxSpZOyYCNEikRq6nCZCxfAagfUSvlDc Message-ID: Subject: Re: git: 5c1ba994a8bc - main - Add a regression test for a libtpool bug To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000003ed11f06387a0603" --0000000000003ed11f06387a0603 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 26, 2025 at 2:38=E2=80=AFPM Alan Somers w= rote: > > > Wow! That change was definitely not intended. And I"m very sorry for th= e > breakage. Could you please try this patch? > > > Patch is working great. Thanks for this quick reaction. Regards, Olivier --0000000000003ed11f06387a0603 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On = Thu, Jun 26, 2025 at 2:38=E2=80=AFPM Alan Somers <asomers@freebsd.org> wrote:


Wo= w!=C2=A0 That change was definitely not intended.=C2=A0 And I"m very s= orry for the breakage.=C2=A0 Could you please try this patch?

Patch is wor= king great.
Thanks for this quick reaction.

Regards,
Olivier

--0000000000003ed11f06387a0603-- From nobody Thu Jun 26 14:06:21 2025 X-Original-To: dev-commits-src-main@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 4bSgTT5xVpz60bqm; Thu, 26 Jun 2025 14:06: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 4bSgTT510Fz3l3L; Thu, 26 Jun 2025 14:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750946781; 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=f0BQC3T7pjB53mfb7jEso9D4pmHfKqLGxToztyxZDnI=; b=T14c5/5MPwvEv6kfFA2E/UfazxUauDb7iGuUgPELgn5M+iADCQyfN1epWPbH0an9POxGkr j6N8IfjIH3omSzruVcqF8QU0yRdpvzhwlgOLanIMhtXzpkjp8+vMpLXiILXVOyXNcKxTLF ftfS6kdD6sjVQQJ3houu/bpGY14kn3hWpj5U1wO+/G9Jk6+9uGKuIryjE8tHHiHHA5JlxV fGzUNQxJYQbw89jQAsU1rmtHACeRx6uWTwbOx5loxU5X6B/OzPv4YGob/tbRDfcJCu9GhR NjIAPIXoZyPOzyQAT2QvICxAZ0JYNiGrYaFh4UAMMYDjzu9cD2EhIzv6CgElOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750946781; 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=f0BQC3T7pjB53mfb7jEso9D4pmHfKqLGxToztyxZDnI=; b=Jb3sZ/Axb0aGbAT1zbE0Wtdkr7sU7JiKQ9uEvWJw6+YJRDUVeGyJZayaI8uaEEKBilyvjD DUdEQp1SqpadKJB663WojWRW26m7WG3zIZs/YE4Ab24e//xlVpOsWhfrCM5O8X3COtd/4a 5/+ngaUFwd9N+Rovz7PtgEnSCBbfrrv+K1unkhs1ZMFMcRXJc9iZocYnrTVaxklt/JqAHk 1x4BaZyXqJVZakGwqd/tjztN3AeIKM/8OUbi6+HYHG2v4L1sDo6DVNY9Crdyz1gYwxRDAf yH/UzHSCZx37hudIrnPTV64gP30TlO3o4rw6YE2KwmTlx7xvaHzLLX5hYPoE9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750946781; a=rsa-sha256; cv=none; b=Zmw+H4YuZUZjoeK6T4QzX4la2NA03BY/minCsxpiOb1KG0OJqs5Ih2gyKneICKdRPMxwXX /MvuvbTS6B3+iGwRrflAW4O8ncaMvJm/ax6uztZ0w9bSs0P7E19PXTbpBzLDdwAh74qhq1 JphMUqut0Wingdy6mVz5aTnkbiLO6tDgiUevLTDch71dKpMBllg+/Qz0s9CWzUIk8zkXkI lwpo11kAhF3+J+s4SU+YgbYrYnThbsWojb1vKdz3ip1hTpodXIRw9rsDi7zgb4u8UgPvBJ sjLbCG7MeB6kHTVzasIlhsqJywae+k0I5gtx5oMpkqah/jvMP1o0dhIVbDkp5A== 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 4bSgTT4Vc6z14ys; Thu, 26 Jun 2025 14:06: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 55QE6LoI023412; Thu, 26 Jun 2025 14:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QE6LA1023409; Thu, 26 Jun 2025 14:06:21 GMT (envelope-from git) Date: Thu, 26 Jun 2025 14:06:21 GMT Message-Id: <202506261406.55QE6LA1023409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 41c1db8a4daa - main - tcp: remove references to Lock(b) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41c1db8a4daae24dff545ee2d20ba6ffe8abd625 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=41c1db8a4daae24dff545ee2d20ba6ffe8abd625 commit 41c1db8a4daae24dff545ee2d20ba6ffe8abd625 Author: Peter Lei AuthorDate: 2025-06-26 14:05:05 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 14:05:05 +0000 tcp: remove references to Lock(b) Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/tcp_bbr.h | 2 -- sys/netinet/tcp_stacks/tcp_rack.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/netinet/tcp_stacks/tcp_bbr.h b/sys/netinet/tcp_stacks/tcp_bbr.h index f88efe3c9ef9..10ddd12bda75 100644 --- a/sys/netinet/tcp_stacks/tcp_bbr.h +++ b/sys/netinet/tcp_stacks/tcp_bbr.h @@ -347,8 +347,6 @@ struct bbr_log_sysctl_out { /* * Locking for the rack control block. * a) Locked by INP_WLOCK - * b) Locked by the hpts-mutex - * */ #define BBR_STATE_STARTUP 0x01 #define BBR_STATE_DRAIN 0x02 diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index 2393240489ac..144b4fabf7eb 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -327,8 +327,6 @@ extern counter_u64_t rack_opts_arry[RACK_OPTS_SIZE]; /* * Locking for the rack control block. * a) Locked by INP_WLOCK - * b) Locked by the hpts-mutex - * */ #define RACK_GP_HIST 4 /* How much goodput history do we maintain? */ #define RETRAN_CNT_SIZE 16 From nobody Thu Jun 26 14:10:02 2025 X-Original-To: dev-commits-src-main@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 4bSgYm06dWz60btK; Thu, 26 Jun 2025 14:10: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 4bSgYl454jz3nh5; Thu, 26 Jun 2025 14:10:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750947003; 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=kGEqNubw0TpbvgqaFPx3NXkUbMQnb7oMQmBHsvyMFkc=; b=o06BimdYM7RFTnRmBPo+X9Tcid649IYYi4Bf1cxMmXDQGXta++LwcnVzqnEFm8yLX5pYyh yOUr8k6oz9HGNicULJ++0a1888zJmUttmWhBmAASxiPgb7qxDyVhM8Cw8/kBduLDAKbI6X ArP3nTD3BoR2C5k/xrm9ez45yBCPT+j7lErPcLe3uJ4959iGBtsIJfd+ZRAKnrXMwCKz1x UxI9j4YOJ+lGQ//SVoxcuPYi0NLyjLN+m3QK8xSK08XPTMnwA37sniIgKGuCdnrl7HDz19 H9tbDcX9EhAK+LyapvwzmIeYRjKKaO5ouplDtj5eGl+v68j5fa5yMQE57ojcTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750947003; 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=kGEqNubw0TpbvgqaFPx3NXkUbMQnb7oMQmBHsvyMFkc=; b=WWSUmJhdbqYgEsyWbrjgyfxgZx6p32He4tkwRJjBO5u2h+Z7b9jEuoU3RL+jSIQa2f5k6X vk2Qqx28dy9b1F0MxKK9OUszCeh24xXDQT2rT8QqEQOOKR9lQMWF3qHsXZi9r+0rZU26WT zILSRbKbw4KAaMiHSdeEHbn7p477U7hN3Zzsb0hR7GpxPk8VCYbh4iLdUHTHOp2b/P8PyP kAaLe4Vl9SRLagrDVfxjteZBXWV+bWIs6+VMqGYtfy4AaqO+f3dRINApt1ukeDoh0ThREa rydGct93VLhMdry1NxjUgroEu6XtpqrP9VRI39CQMoSUmZ7ue9e2qG8bPzU/0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750947003; a=rsa-sha256; cv=none; b=Ds+47lDTibTuP5Dz/OSfNJ/tEKF6qgHpBvEYK+DNNJT7Krmp2SeQHQyHJ8L7nA6LOxdWLN PPtrdo+HziBswH8qFoRPASowhRfOmV14z4t2SZBAkskOuKtNn246gKjZDeLUc9Xmas1XE5 gehr6bAGGWnwdXyckM6PRMOWSuBxNpENlnYCEfJQ23BKfYcgq4aop07UklR7GLABXF4HA1 nHcFJRkacRLvq66Wovp7cQ2GHpiJ/mmcg4NkowZ4OF8Z6E+wBkCJ67+kVOSGYy4azmnrej HeG+CFe+3ntAEac4tjSbSLPAsZdQdFPQAVq6xFZVYCt+RKyKpckCcg4LFuTeMw== 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 4bSgYl1cNfz15fM; Thu, 26 Jun 2025 14:10: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 55QEA30X026830; Thu, 26 Jun 2025 14:10:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QEA24r026821; Thu, 26 Jun 2025 14:10:02 GMT (envelope-from git) Date: Thu, 26 Jun 2025 14:10:02 GMT Message-Id: <202506261410.55QEA24r026821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e0c2d7377548 - main - tcp rack: simplify expression List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0c2d73775481b08c3fdc4b1bc68e22410035a39 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e0c2d73775481b08c3fdc4b1bc68e22410035a39 commit e0c2d73775481b08c3fdc4b1bc68e22410035a39 Author: Peter Lei AuthorDate: 2025-06-26 14:08:23 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 14:08:23 +0000 tcp rack: simplify expression Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/rack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index aef05f691e1d..8e05498863b9 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -3489,7 +3489,7 @@ rack_free(struct tcp_rack *rack, struct rack_sendmap *rsm) rack->r_ctl.rc_num_split_allocs--; } if (rsm == rack->r_ctl.rc_first_appl) { - rack->r_ctl.cleared_app_ack_seq = rsm->r_start + (rsm->r_end - rsm->r_start); + rack->r_ctl.cleared_app_ack_seq = rsm->r_end; rack->r_ctl.cleared_app_ack = 1; if (rack->r_ctl.rc_app_limited_cnt == 0) rack->r_ctl.rc_first_appl = NULL; From nobody Thu Jun 26 14:12:15 2025 X-Original-To: dev-commits-src-main@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 4bSgcH495Fz60bw7; Thu, 26 Jun 2025 14:12: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 4bSgcH1V0Gz3rSq; Thu, 26 Jun 2025 14:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750947135; 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=yV3P9Yv780TM0bGBtI54gT7Qqz8y/ovqIwkf4CQ1lXA=; b=W3CFkeX520Jdkaxy4M1rwFmoQe56XLcmWDMnCiCO1H2QbUB8tcMyvKp7fP7s9Yy1DXIV3G UBbk37k5Of1wnbtI9kL2ZdtqPIoHT2oAcAelQw4VhkdfViL4nGzP0py6VHGhBelL9eEmOK qi0hOoD67T2MVX4F1dtRvMqFsT3sff9PnmuQ7BTQyP68bxOsblv2xKZoA/PWyIm4NFg/6R dKHYJ+LGXxgy9fwMoZBLvyV1xDurBo/f2dcYLHR46ySnW/94dg8+LOr5kacxbapgFZ/6IZ uhbcrRN25rqVdxdL4uCKhqRJeSJj5RdReic0nkDj00zvn4MeB8ej1BZ9aD2x+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750947135; 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=yV3P9Yv780TM0bGBtI54gT7Qqz8y/ovqIwkf4CQ1lXA=; b=JQDy5G7UxJDk4IMsxyZBjf7F8fMWy9bfCIL4ow1Nr3crrFllAEzmvTNTdGBC3tW8Ltf0DB gW7KziPPBO9OM3UtoWAsoZggmbcumA+7Mm5c1Gvccww0urz4k9pj38hsNdcpUVwlI/0JwH WrCLLNZ9mloJ68Yj9FwPspkdsv9kpAFbPDwY2OZMcxcSxEesWtMAjSy4fcCckrR5hivM/c nP2D1Wdw8wOQ+JENyxcqf2RWUmzGfoFfcewcq8/JaSrOaM2wR3+9FJ8f0IK2+b6LuIrPXC Ln/a9qMWOxfUB3Yb6pg8Fm9c+6J13vf+4EtLeR4qLjm9vxXdKaJxMuMDDgPXgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750947135; a=rsa-sha256; cv=none; b=CR7W3EbsXNJRp57IJp90xLnRCi06omNPDvT9B6ETNBNujDqfYQ7jXySFXPzhBbuM+NcHUD COgvBaEmUVDv6diQFa0Q5Dt2H23J9w/zOPtU6J5kK9QUKW3ksgIwJV6p7oNruXYT2/cYsI m8N3axp8O+5gSDC2tVLve+2ySICSNo6ahLJs47ZwN9TYP8iHExdZg0Rl4o0UtUWB2XlP4p +Hr3UV+CtDGG9eRF/Y8a1zn3dh06es7ZcnXTCyygj9rbXbEpAem+iBcXCpsjLankFjSlHz kVJ/2l+yTWd3PakLSGGIz/fxf0v4s9fiVJzIBgknOB8qIFHMMnxACisoB5KwgA== 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 4bSgcH14xnz15rQ; Thu, 26 Jun 2025 14:12: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 55QECFJO040049; Thu, 26 Jun 2025 14:12:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QECFEW040046; Thu, 26 Jun 2025 14:12:15 GMT (envelope-from git) Date: Thu, 26 Jun 2025 14:12:15 GMT Message-Id: <202506261412.55QECFEW040046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: b5962a183756 - main - Fix location of libtpool.so.2 after 5c1ba994a8b List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5962a183756f2cfc93b056ce7c7c7beb5da3e7e Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b5962a183756f2cfc93b056ce7c7c7beb5da3e7e commit b5962a183756f2cfc93b056ce7c7c7beb5da3e7e Author: Alan Somers AuthorDate: 2025-06-26 14:04:50 +0000 Commit: Alan Somers CommitDate: 2025-06-26 14:12:04 +0000 Fix location of libtpool.so.2 after 5c1ba994a8b Commit 5c1ba994a8b inadvertently moved the installed location of a shared library. Move it back. Reported by: olivier Tested by: olivier Fixes: 5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9 Sponsored by: ConnectWise --- ObsoleteFiles.inc | 3 +++ cddl/lib/libtpool/Makefile | 1 + 2 files changed, 4 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1f17d54bdf08..dcda9a035b44 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250626: For 11 days 15.0-CURRENT installed libtpool to the wrong location +MOVED_LIBS+=usr/lib/libtpool.so.2 + # 20250626: replace yaml.lua with lyaml OLD_FILES+=usr/share/flua/yaml.lua diff --git a/cddl/lib/libtpool/Makefile b/cddl/lib/libtpool/Makefile index 3ab625dd306b..7acf34219a47 100644 --- a/cddl/lib/libtpool/Makefile +++ b/cddl/lib/libtpool/Makefile @@ -3,6 +3,7 @@ LIB= tpool +SHLIBDIR?= /lib LIBADD= spl PACKAGE= libzfs From nobody Thu Jun 26 14:12:36 2025 X-Original-To: dev-commits-src-main@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 4bSgd01bzLz60cDs; Thu, 26 Jun 2025 14:12:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSgcz4498z3s1Z; Thu, 26 Jun 2025 14:12:51 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-ae0de0c03e9so89017866b.2; Thu, 26 Jun 2025 07:12:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750947169; x=1751551969; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oxRwxszBtG9JHZWQZBXRIp0d3fMD5saUxlmqKM3FPb0=; b=JDmUCGJAit6LamNEHul2Wkg7BXzW97YSlDpDTaZYAnCu0dnrikGiqEW8hO+4oEFpxY btlyyahOQc/QObNt0AoDPt0U1w9xkUc3DoPjjdvYfdu2WtS2gOZWzzcFZAq8l7XPT9+u Twtt+ZcCo6cGkB+Pfyf8cD5HEniw/Cv84BD5MpvSDLFHycM+gZ6ddYqiKguluDT9n+6U WzB6uFPUWP/UWZSmjVk+DLIMa6uLZaHXQSEXrdiqTV1/FitAwzit8t4xdNKDfyWmd5aS gBakbZFKsBuKPdCikPQUoDYddaT9kBkJAJoaSmv6zAE0gLAQCVxLwqc2+d7CxdhjFBFo tNlg== X-Forwarded-Encrypted: i=1; AJvYcCUr7IzuVMokUMY20I0YIICttsMKlObG8RhfbMl0XhSp/hv5TKDY77Y86HuM8F/UVmTI2cV1FAlljfRoL0s4sYSe9x16@freebsd.org, AJvYcCWaCirxRi+q2Gg9DoNUc4PlduNkIqPbcBLdi3YdhgLvxoa2xjN8TPJfckvWZnYQVr7WeCVVWnzWH4YvjMuWOZX42sYUNJA=@freebsd.org X-Gm-Message-State: AOJu0Yz/MDhh5mYJr4/jRHT691fQntM0gUeXHOnodotaA23Nw8nJuojz QqQGXwU2+wMXxB8q+5aTEOUgzoPZfrj+zDd44dBS6QJ/oGyh9fKqcoCHTEJtK4B+9jwwWzkme2D SYJVnSE7qO1qqBbqAvQ3vdTtC5GOVAAkp7n2+ X-Gm-Gg: ASbGncvTR9lpq2FBOzPNj0gSmxReiPkOsgVoXZUPG21KbuQoBCEteogJekCd2Bz8Piz ndm2xWGeiwoA/HNi4MjKKS0zBI+YjIWJm6G9mysdhb44rUXv3+9IT9/sB5zi7OaIa/+d1qgpTPJ vH6EUtX0HnPnWnpMIyLxN0brvz5g5y9azsQb/XL3WwDK0= X-Google-Smtp-Source: AGHT+IHlN/5pLAX5VTWiAmkL1lgD/+mm7PSc+ChSd5poR6PFJtAbioxkhOXis9VP8RDwFvs6lyxISE3QcVFZG6lOqrg= X-Received: by 2002:a17:906:c102:b0:ae0:ce40:11c6 with SMTP id a640c23a62f3a-ae0ce40186cmr500863966b.21.1750947169070; Thu, 26 Jun 2025 07:12:49 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506151602.55FG2SHe047772@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Thu, 26 Jun 2025 08:12:36 -0600 X-Gm-Features: Ac12FXxOmj4xANVxma5k3WNDpm0WPtYMs_EkKiU9y4l_so-PwX3gbAn6sEIKvmc Message-ID: Subject: Re: git: 5c1ba994a8bc - main - Add a regression test for a libtpool bug To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000008740506387a2831" X-Rspamd-Queue-Id: 4bSgcz4498z3s1Z X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] --00000000000008740506387a2831 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 26, 2025 at 8:03=E2=80=AFAM Olivier Cochard-Labb=C3=A9 wrote: > > On Thu, Jun 26, 2025 at 2:38=E2=80=AFPM Alan Somers = wrote: > >> >> >> Wow! That change was definitely not intended. And I"m very sorry for >> the breakage. Could you please try this patch? >> >> >> Patch is working great. > Thanks for this quick reaction. > > Regards, > Olivier > Fixed in b5962a183756 --00000000000008740506387a2831 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jun 26, 2025 at 8:03=E2=80=AFAM Olivi= er Cochard-Labb=C3=A9 <olivier@fr= eebsd.org> wrote:

<= div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 26, 2025 at 2:38=E2=80=AFP= M Alan Somers <= asomers@freebsd.org> wrote:


Wow!=C2=A0 That cha= nge was definitely not intended.=C2=A0 And I"m very sorry for the brea= kage.=C2=A0 Could you please try this patch?


<= /div>
Patch is working great.
Th= anks for this quick reaction.

Regards,
Olivier

Fixed in=C2=A0 b5962a183756
--00000000000008740506387a2831-- From nobody Thu Jun 26 14:35:57 2025 X-Original-To: dev-commits-src-main@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 4bSh7d4kLCz60cvX; Thu, 26 Jun 2025 14:35: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 4bSh7d4DhLz44Zx; Thu, 26 Jun 2025 14:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750948557; 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=YXo0g1zQ8yGd5gn5sG+uh3tjplSYa/8S9dKoLoVY1Uk=; b=b9ffDUGbb/BNSnINzWQXrSM/c0uxPI76Gx8Jy3nId7tTyJMIy5cPRybOnXdw3jmMS2xxI/ hO2VRLRbFzafGcMFNm+vj2RdC70i8kS+FcvUwwP7arZQSaB2Ugnkbornrazaq31DyipjeN IlnV+zfxDajoRFqvCyFwJqdLCp0DKoI36cif1RbFZJrwsLINTANbCRzSgQIv/4BqBE2Ind ACWCxPoPNQF3kDpiDChh8lN8umfucCkDMJp/LNcWmdKLQeavB5RxrroYlWKhjL2JzWPSV4 ccfHAxPE15dQ04DM74wzD8WkhTzdRyUUYY2wL1pvkUv5W8E8HMcpZRNt/JEESQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750948557; 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=YXo0g1zQ8yGd5gn5sG+uh3tjplSYa/8S9dKoLoVY1Uk=; b=ojVsG/dcWqdch/0XEVZz0QkbjW29Ce2wffBvFopmB0fmAEc9OWHNwvGGu4/p/jhoV5ww0k tAeSwaBW2/8clc/PRS7UXZtqgTqnQ5afn+JEezY9tuPZOCU1eYOS1BqUHFmJx3bUEoRE1z lImNVuqeLy+EQW4oCoyHWF1czByC3KvRppsnLOUcwB6WWgP6P4CfS6YdQEkB/odd6hMirk HeON9YEpdVx2zr351z1LGrK2dZ8XQRJoHb/k4Kv7nmqGMRl3wNFYxjHrXcEbWkVm4VsooB hRr8yeenxRbeK+KCfcra/wxhSKVDGwOP1WQac9KvU1P5y1U4VJhaGwEJDZ+EOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750948557; a=rsa-sha256; cv=none; b=QuF90gtLLJ8naSIGK0vrsRtQFylqMPJtgBlwbyuoEaNalRl/LS/2bcfRrxSfEGRXDBMLgs 7492Y8PDhfPizQNQuJhM7rdT9jT2OR5BhN0h6cORkGHAXSRdbUeGIzQSW3+Z0Sz+rm8cES WwEoXHqnau9Unsp1ixQG9/B5xByJQfLxvmC1+pXopMjg/4WtgaOszU2C3S+ZqSWxSYFNgw gst85txmiiRwMakwNi6BhYT6s3TXQyxgnJ5+jDZq/7lM0kK8/LSsmiLumUC0pNWP2ehlp9 X4mr7Y40bmiiRY/fGqPosurwPqsLgf7BMFyZNWmjyK14A/uHnL4fR2ygw+0zKg== 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 4bSh7d3qJkz16PN; Thu, 26 Jun 2025 14:35: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 55QEZvnB079456; Thu, 26 Jun 2025 14:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QEZvDN079453; Thu, 26 Jun 2025 14:35:57 GMT (envelope-from git) Date: Thu, 26 Jun 2025 14:35:57 GMT Message-Id: <202506261435.55QEZvDN079453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 2b43d77af340 - main - OptionalObsoleteFiles: Keep Heimdal files when switching back List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2b43d77af340fd2675d4c9e6a2dfc3c7361d1860 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2b43d77af340fd2675d4c9e6a2dfc3c7361d1860 commit 2b43d77af340fd2675d4c9e6a2dfc3c7361d1860 Author: Cy Schubert AuthorDate: 2025-06-26 14:32:22 +0000 Commit: Cy Schubert CommitDate: 2025-06-26 14:35:40 +0000 OptionalObsoleteFiles: Keep Heimdal files when switching back When switching back to Heimdal keep Heimdal's .a files. Fixes: af2593e3212c --- tools/build/mk/OptionalObsoleteFiles.inc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 24db68e5f288..14488a63b7da 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -5775,9 +5775,7 @@ OLD_FILES+=usr/lib/krb5/plugins/preauth/pkinit.so OLD_FILES+=usr/lib/krb5/plugins/preauth/spake.so OLD_FILES+=usr/lib/krb5/plugins/preauth/test.so OLD_FILES+=usr/lib/krb5/plugins/tls/k5tls.so -OLD_FILES+=usr/lib/libcom_err.a OLD_LIBS+=usr/lib/libcom_err.so.121 -OLD_FILES+=usr/lib/libgssapi_krb5.a OLD_LIBS+=usr/lib/libgssapi_krb5.so.121 OLD_FILES+=usr/lib/libgssrpc.a OLD_FILES+=usr/lib/libgssrpc.so @@ -5788,7 +5786,6 @@ OLD_LIBS+=usr/lib/libk5crypto.so.121 OLD_FILES+=usr/lib/libkadm5clnt_mit.a OLD_FILES+=usr/lib/libkadm5clnt_mit.so OLD_LIBS+=usr/lib/libkadm5clnt_mit.so.121 -OLD_FILES+=usr/lib/libkadm5srv.a OLD_FILES+=usr/lib/libkadm5srv.so OLD_FILES+=usr/lib/libkadm5srv_mit.a OLD_FILES+=usr/lib/libkadm5srv_mit.so @@ -5799,7 +5796,6 @@ OLD_LIBS+=usr/lib/libkdb5.so.121 OLD_FILES+=usr/lib/libkrad.so OLD_FILES+=usr/lib/libkrad.a OLD_LIBS+=usr/lib/libkrad.so.121 -OLD_FILES+=usr/lib/libkrb5.a OLD_LIBS+=usr/lib/libkrb5.so.121 OLD_FILES+=usr/lib/libkrb5profile.a OLD_FILES+=usr/lib/libkrb5profile.so From nobody Thu Jun 26 14:35:58 2025 X-Original-To: dev-commits-src-main@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 4bSh7g03Dfz60dD1; Thu, 26 Jun 2025 14:35:59 +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 4bSh7f4sxyz44b1; Thu, 26 Jun 2025 14:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750948558; 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=an2ZH5ub/+8goxwFKxJB9i6n3N/Zqbv683kEVYBA4Ls=; b=xVsPQsFLyUyIk3niy29A8YzZNR5ff2DsQhO34EdOVA5RPPTzFUJqocaQi2sMYiwH9V0vzI Zffr7UNyiWL+oBzDa8zi/G5K3fC8AM8Oy8jKpBwgTIciCqTf0IZMCQbyAD8ItQUlZL+FFk EojVZ9xd81CKuUZGyA7TtYeZUk6S8YuDmF0J1SbiFLCKPlsO0rZX6gai6MOoSzSh1+qRJ0 dgwtVpsyz4Zse6KZzbxDdUMTSp2jSpFmI+qeEaNdHIemsFp5YpC4Sl1FTJGAhQ4bGAUmmN exTgeCWi8tyY7HLgqH3EulJzu/hLYKNZiUi+xlBTGkMDId2z5kiYBK0J0utn1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750948558; 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=an2ZH5ub/+8goxwFKxJB9i6n3N/Zqbv683kEVYBA4Ls=; b=niF+arPsLHUfnuU7Y6Vory+T0UqttRDyXkBU4eIZrZhbVUYZe+bTc3ElCAN0JdBCjXeFfr b08jPqAtythtq0MFhskB5v3jc0+6dF7akFlPYfoyIoBptcvuDstmjxpjJYaFHS5+k5F5Q3 Xq0XSJNbWxgnZRymsjvhFumapyXe+zjqnLphPvdERT2b+0rM1nfDaiyHxM7RuT0QPEMDXj qi67JzAQ6dQunDI3sN5GzC4WjI3LJEH5BOBqpkARJ1AcatxVCYmAWL+5saOUb81lwpDpxu /OOk7R7+hQrBY+xCRTZOm/4kvg9cOpcvJ/2BIWT53pfqxEjxthFNkz6/XzeGXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750948558; a=rsa-sha256; cv=none; b=SIPkr8fINPDY/d3Gph8njCj3LMGE0Q8eu3nCUN+/g9KuxHon+4d1aKzbhqfczIFc0yslpZ WAXIi+xs8xwgFHfhY9LEeujshMrrRzA36ciA3qk0BLykIwUN6JYNaWTQGQf+WTmryHCsv4 E+agnIKEVaRY1cndla5Kn6ztgvkiB56I+zmZB38k5N+5H9ByUM6g6zGy59zk2es4ZumIJK Ao9676TvlhPSuEavCJ3LEGW/JenmufjapsslEudfcXgt53mYFJzKWvrYKnteCjuuQUdTMq +kfqT7SLlttJzZiOTxFQBmHnHFQYydgKokoyY7RGvWdEc+S4vJuDwMXcrZkh9g== 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 4bSh7f4Tm5z16Cb; Thu, 26 Jun 2025 14:35: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 55QEZwbX079490; Thu, 26 Jun 2025 14:35:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QEZwXF079487; Thu, 26 Jun 2025 14:35:58 GMT (envelope-from git) Date: Thu, 26 Jun 2025 14:35:58 GMT Message-Id: <202506261435.55QEZwXF079487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: b499fefd6d4f - main - OptionalObsoleteFiles: Remove an MIT .a file when switching back List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b499fefd6d4fb2100ebb172e51fdaeab83947a9a Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=b499fefd6d4fb2100ebb172e51fdaeab83947a9a commit b499fefd6d4fb2100ebb172e51fdaeab83947a9a Author: Cy Schubert AuthorDate: 2025-06-26 14:34:09 +0000 Commit: Cy Schubert CommitDate: 2025-06-26 14:35:40 +0000 OptionalObsoleteFiles: Remove an MIT .a file when switching back When switching back to Heimdal remove libverto.a, an MIT KRB5 library. Fixes: af2593e3212c --- tools/build/mk/OptionalObsoleteFiles.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 14488a63b7da..1edfcdb9a57c 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -5803,6 +5803,7 @@ OLD_LIBS+=usr/lib/libkrb5profile.so.121 OLD_FILES+=usr/lib/libkrb5support.a OLD_FILES+=usr/lib/libkrb5support.so OLD_LIBS+=usr/lib/libkrb5support.so.121 +OLD_FILES+=usr/lib/libverto.a OLD_FILES+=usr/lib/libverto.so OLD_LIBS+=usr/lib/libverto.so.121 OLD_FILES+=usr/libdata/pkgconfig/gssrpc.pc From nobody Thu Jun 26 14:44:15 2025 X-Original-To: dev-commits-src-main@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 4bShKC2k0Cz60dfM; Thu, 26 Jun 2025 14:44: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 4bShKC26tpz4DYC; Thu, 26 Jun 2025 14:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750949055; 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=SPauUbq14vizzEiEghv50I7Up7FOkE/uvLadM9nZC1k=; b=ODu6UzvQBnnk88OKj+Ym30T0rO9b9vrojYhA03WcWZjOPcrlkjGrOtsIhqP92Yl850DnEz 8FIOcb7Qa/R+wblJOrSfXGuOt5m8NqsguGkY+hHULVjGr7HcOaO7q67MfIyY2l89S5rWzx Lvr5+MHJQeLHeHBusxdFCE8bCmVKehNvlbN0lvW20iBFMThO95Z0QCHcCJLWr1OUQJV362 fevKxqmQQFdLAYB3zl3xWqm7OnjIHViqqXECbN4e8nW2fk/II9Jd0PCS/Ue5Ncfrjlg2m9 BxxMeyZNlIwa4qNxr62ArnSNsty6Acf8Bxt7IZ3EW2+2k0NmeMzGD9IVlhyShA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750949055; 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=SPauUbq14vizzEiEghv50I7Up7FOkE/uvLadM9nZC1k=; b=N0DodNCNqVxPa0YC8NsdJxz1b6WeawZCrRqcfD7aPMV5VBQE98buj//XGflC/XC3Z0sWJS KGy6+qDxGOPKJOmAzsLOL+NHXTERTaYYp+v24NN935ga9WCuAZJ7H5lmLbSsVMovpQR3Yk 7VvNb5WkXRT6d/UOcRgtffZxPJP6edcQ+qJHGZphAcFKIKGR8L+zBApMP6i1kG/9NJQyCc t9mxiIvETO8vo39MEAaslsdb6y/8tfwL37A72jjSFnDrJZbl7UBsWVrzOqR940O9ahSkLT 4PXKUibQ+xhJiWT1yeQo9/IcMcI3hMVWijzfbuF/N62T4w8oOdiDLTzYxnVQ1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750949055; a=rsa-sha256; cv=none; b=OOkZRt1HkcEgHsXX0DoBoRINABl5SzwZGJohHqtmp1jUv+FZB/0uFbV+XPCuC6SClpM85r gIs4CS+J4xFLIsiFYAE/XsQ4hghw9jfpb+PMCLkMcI0apeJWcWB8VKDXIz5UyYk5YgG4K6 KLPfUZx8p2syJ7yOzMYoq06hstb9VVjVE9MHdJ+yoCGiC3MK5CtAkImfTGyGkOKnuknHT0 dw62aFg5LSwHSCIyzkjlgnKsDK5/qLjj+gnvPhcwKy3FY+kIQP76vstAu9RznHWoazC3Ob j3JiINTESeyGANsZ7qLW4Yfb1J4aIi9y2e7rFsYNpWCUhegdgsIkf3JtLXlv7A== 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 4bShKC1MJmz16SH; Thu, 26 Jun 2025 14:44: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 55QEiF57097557; Thu, 26 Jun 2025 14:44:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QEiFwH097554; Thu, 26 Jun 2025 14:44:15 GMT (envelope-from git) Date: Thu, 26 Jun 2025 14:44:15 GMT Message-Id: <202506261444.55QEiFwH097554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 95ac5b0e27e9 - main - mkimg: Add a reproducible mode List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 95ac5b0e27e9070ba91c28f9a6ecbed743d148cb Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=95ac5b0e27e9070ba91c28f9a6ecbed743d148cb commit 95ac5b0e27e9070ba91c28f9a6ecbed743d148cb Author: Mark Johnston AuthorDate: 2025-06-26 14:28:14 +0000 Commit: Mark Johnston CommitDate: 2025-06-26 14:44:01 +0000 mkimg: Add a reproducible mode mkimg embeds a UUID in the GPT header and uses the current time of day to generate it, so its output is not reproducible by default. Add a -R flag to ask it to use a fixed time for UUID generation. Merge the FreeBSD-specific implementation of osdep_uuidgen() with that of Linux, as the use of uuidgen(2) is incompatible with reproducible output mode. Reviewed by: bnovkov MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D49716 --- usr.bin/mkimg/mkimg.1 | 8 +++++++- usr.bin/mkimg/mkimg.c | 10 +++++++++- usr.bin/mkimg/mkimg.h | 3 +++ usr.bin/mkimg/uuid.c | 19 +++++-------------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1 index 82bbee53a267..f6b151d2d5c7 100644 --- a/usr.bin/mkimg/mkimg.1 +++ b/usr.bin/mkimg/mkimg.1 @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 12, 2024 +.Dd June 25, 2025 .Dt MKIMG 1 .Os .Sh NAME @@ -41,6 +41,7 @@ .Op Fl f Ar format .Op Fl o Ar outfile .Op Fl a Ar active +.Op Fl R .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -138,6 +139,11 @@ option is a shorthand to specify the minimum and maximum capacity at the same time. .Pp The +.Fl R +option enables reproducible mode: any timestamps or random identifiers will +be fixed so as to ensure consistent output. +.Pp +The .Fl v option increases the level of output that the .Nm diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index 3cd9b03c06e9..c8872ebb1bc6 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -61,6 +61,8 @@ static struct option longopts[] = { static uint64_t min_capacity = 0; static uint64_t max_capacity = 0; +bool reproducible = false; + struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -561,7 +563,7 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:S:T:", + while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:RS:T:", longopts, NULL)) != -1) { switch (c) { case 'a': /* ACTIVE PARTITION, if supported */ @@ -606,6 +608,9 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "partition"); break; + case 'R': + reproducible = true; + break; case 's': /* SCHEME */ if (scheme_selected() != NULL) usage("multiple schemes given"); @@ -675,6 +680,9 @@ main(int argc, char *argv[]) if (max_capacity != 0 && min_capacity > max_capacity) usage("minimum capacity cannot be larger than the maximum one"); + if (reproducible) + srandom(42); + if (secsz > blksz) { if (blksz != 0) errx(EX_DATAERR, "the physical block size cannot " diff --git a/usr.bin/mkimg/mkimg.h b/usr.bin/mkimg/mkimg.h index e85f77de0ec7..608de458e83c 100644 --- a/usr.bin/mkimg/mkimg.h +++ b/usr.bin/mkimg/mkimg.h @@ -29,6 +29,9 @@ #include #include +#include + +extern bool reproducible; /* Generate reproducible output. */ struct part { TAILQ_ENTRY(part) link; diff --git a/usr.bin/mkimg/uuid.c b/usr.bin/mkimg/uuid.c index 470d92c76293..f3415a8c1111 100644 --- a/usr.bin/mkimg/uuid.c +++ b/usr.bin/mkimg/uuid.c @@ -45,20 +45,9 @@ osdep_uuidgen(mkimg_uuid_t *uuid) } #endif /* __APPLE__ */ -#ifdef __FreeBSD__ -#include - -static void -osdep_uuidgen(mkimg_uuid_t *uuid) -{ - - uuidgen((void *)uuid, 1); -} -#endif /* __FreeBSD__ */ - -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) +#include #include -#include static void osdep_uuidgen(mkimg_uuid_t *uuid) @@ -68,7 +57,9 @@ osdep_uuidgen(mkimg_uuid_t *uuid) u_int i; uint16_t seq; - if (gettimeofday(&tv, NULL) == -1) + if (reproducible) + memset(&tv, 0, sizeof(tv)); + else if (gettimeofday(&tv, NULL) == -1) abort(); time += (uint64_t)tv.tv_sec * 10000000LL; From nobody Thu Jun 26 15:23:18 2025 X-Original-To: dev-commits-src-main@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 4bSjBG6cBYz60gMm; Thu, 26 Jun 2025 15:23: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 4bSjBG60xKz3GHj; Thu, 26 Jun 2025 15:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750951398; 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=90V/Hqvh7FKZE7Vn+mKVfhLSH1v3OzC1fu/X/Fq1itU=; b=fJJM1SsGh9gYtEBxnD8TBfWZW2YdQKTQr8zMGx5n+SlD3C/QBgoNAxHMNX12OXXaKdNGS3 UV7OZLVj+x+91J84TjdgPrusAFVaVJJxtBDgkT2ZAvGpa6Gm1G5E6FCAy9vWg2gyQvtTHn CcxWOnVBnJW0of1KEpPveOTgexPFLYbpLyPgT5Uwt+SQvbw62qY3pjW1SYRBPX/XNqvN4w DVek6D/ZPIEB54zvC49D6UaKM/TsbJtjpYbKTZr6YnP3BxvMDwNIgFn58b2oLj/0d4QZLu v9IOFQ3c6X1p9oEhAD/tIfWIOh8e3dWqfh61eRotOt+Tva+F1mCGaspplYvvRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750951398; 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=90V/Hqvh7FKZE7Vn+mKVfhLSH1v3OzC1fu/X/Fq1itU=; b=NZFdonqVF5tFf6Ys2ZAas+nJLfF4hljMHVRHGjuc72Pr/zXmlGCw+5q6BlNal6GDPl5XEe YrMMh/fBatKxrUJt/bSi2urOF9PvI49xqZ3lvpmVYjtB+fA3Y7qHrMjtDfw47NT0POMAmA +gczOY57dqwY8oXajrJjRJiXgumaix89AMREURWXdf+ZQaAvJy9C85fa9YYm6YETv4bTtg HN5e1IxY6DbhXdCtXheVMmubuI4firEiq9If6QH1Og4eU9Yu7cDBzz5XpbF6yq+4WGqUqD BP2nNxcO4qFH5APXIpK8TBPy+vXf5Z6eDBwe7jAJbvko52QmgYtiubhUlgmh0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750951398; a=rsa-sha256; cv=none; b=Of+3y0g+l+r5owqZQYOfFboqf82m/dXYMGJH9wTChFgJDGypvHFUwT5KTeaUUy84S2rkUe xk0Idqc+HY4b3TFOoTMV0rwIqxD+RoTNiJjJYRPzw2h6U3nNHXZpSmwAkSiD6aAVvdgaKD LYbqW/MUclS9OFdc4gaubALQ+dH60P0fUJ9Frxs//FLPGPBUqZOZVDaKfy8AjwZ0OVlYqF A1kmGmG5jZRWz41jnTIexu2zvJRz7ftPsP0pz2D6MqUTGci/8t8Z6RVT8ket9uJN7YUNuh JXrQHWmhFHxpAVjOLaDxMojOxHWe+p63LsP6SumjwLYZ1CsLjWyNyz9q1EtzGQ== 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 4bSjBG5bl9z17NB; Thu, 26 Jun 2025 15:23:18 +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 55QFNIYa073410; Thu, 26 Jun 2025 15:23:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QFNInM073406; Thu, 26 Jun 2025 15:23:18 GMT (envelope-from git) Date: Thu, 26 Jun 2025 15:23:18 GMT Message-Id: <202506261523.55QFNInM073406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 5bd818785a07 - main - OptionalObsoleteFiles: Keep Heimdal files when switching back List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5bd818785a07262050fe20be4838172ba1a0f00e Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5bd818785a07262050fe20be4838172ba1a0f00e commit 5bd818785a07262050fe20be4838172ba1a0f00e Author: Cy Schubert AuthorDate: 2025-06-26 15:22:30 +0000 Commit: Cy Schubert CommitDate: 2025-06-26 15:22:30 +0000 OptionalObsoleteFiles: Keep Heimdal files when switching back Additional files that should not be removed when switching back to Heimdal. Fixes: af2593e3212c --- tools/build/mk/OptionalObsoleteFiles.inc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 1edfcdb9a57c..8312a4975f4a 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -5713,12 +5713,10 @@ OLD_FILES+=usr/bin/sclient OLD_FILES+=usr/bin/sim_client OLD_FILES+=usr/bin/uuclient OLD_FILES+=etc/rc.d/kpropd -OLD_FILES+=usr/include/com_err.h OLD_FILES+=usr/include/common.h OLD_FILES+=usr/include/edwards25519_fiat.h OLD_FILES+=usr/include/edwards25519_tables.h OLD_FILES+=usr/include/groups.h -OLD_FILES+=usr/include/gssapi.h OLD_FILES+=usr/include/gssapi/gssapi_ext.h OLD_FILES+=usr/include/gssapi/gssapi_oid.h OLD_FILES+=usr/include/gssapi/gssapi_alloc.h @@ -5746,7 +5744,6 @@ OLD_FILES+=usr/include/gssrpc/svc_auth.h OLD_FILES+=usr/include/gssrpc/types.h OLD_FILES+=usr/include/gssrpc/xdr.h OLD_FILES+=usr/include/iana.h -OLD_FILES+=usr/include/kadm5/admin.h OLD_FILES+=usr/include/kadm5/chpass_util_strings.h OLD_FILES+=usr/include/kadm5/kadm_err.h OLD_FILES+=usr/include/kdb.h @@ -5760,7 +5757,6 @@ OLD_FILES+=usr/include/krb5/kadm5_hook_plugin.h OLD_FILES+=usr/include/krb5/kdcpolicy_plugin.h OLD_FILES+=usr/include/krb5/kdcpreauth_plugin.h OLD_FILES+=usr/include/krb5/localauth_plugin.h -OLD_FILES+=usr/include/krb5/locate_plugin.h OLD_FILES+=usr/include/krb5/plugin.h OLD_FILES+=usr/include/krb5/preauth_plugin.h OLD_FILES+=usr/include/krb5/pwqual_plugin.h @@ -5786,7 +5782,6 @@ OLD_LIBS+=usr/lib/libk5crypto.so.121 OLD_FILES+=usr/lib/libkadm5clnt_mit.a OLD_FILES+=usr/lib/libkadm5clnt_mit.so OLD_LIBS+=usr/lib/libkadm5clnt_mit.so.121 -OLD_FILES+=usr/lib/libkadm5srv.so OLD_FILES+=usr/lib/libkadm5srv_mit.a OLD_FILES+=usr/lib/libkadm5srv_mit.so OLD_LIBS+=usr/lib/libkadm5srv_mit.so.121 From nobody Thu Jun 26 16:01:04 2025 X-Original-To: dev-commits-src-main@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 4bSk1s39hhz60jGV; Thu, 26 Jun 2025 16:01: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 4bSk1s09v6z3Ynv; Thu, 26 Jun 2025 16:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750953665; 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=qSugGJb9lFl82XAMhH9ahyCXLRyprnXNpI0/NhRn/ac=; b=ic3gcFMYoGSL8qvw4N80wZVK3MM/joOWDvxmbW6gL1DcDuQStOcM8sRQFO07JMXNhdK5eY yFsamthIfXI1+ve89RJm08ET1odgLdzHOsNHfE2CTSm66nCgy9iGFGzU6pj7/sImxKMSbP JlrRHVO6P247KoQMbbCBopQ1D/HPGWVRKYKTXduKSlocd3t3EOlar4LNgot2bahY0dZPtK 0DoWk32fkxJ7fua1nC8ALDgYAvI6SAGA7MwjxVygM9Ok6kOPsjzFGyxa4NbysoIowVzCFC ULJwr+tc7N2j/1phCIZHrk+mTEleIECnRIl+RdZBd6+F1QwV9mSs/w8+38WC6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750953665; 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=qSugGJb9lFl82XAMhH9ahyCXLRyprnXNpI0/NhRn/ac=; b=Jd1m3TRleVpw0Fyj3ftIS8+qrnhBa1mHfSP7w/lrvHqYtRmh/Tbuxr4KgWujmX/Yhnr/y+ EaLa8C2oHd+0k2Zd4vXT05syqwrN2FktYGxHUdShozOBdh2c0YwlYKZfjzK5YzMuExLbLC 1jcf6MK3kHlrqmR5tXtuLuRvBFZC3FwU/e6/IKi5a2uKu3kM31eh0Qxjp+I4Svsozx4LBt cW6JCPayO+wMqfOxBcdJuJsAEsdC3p4GqU4LwYYDts16Xsm5DNN0p26GQ+rmKgV8WLMJnY c9oMRYHrbAGLsjb9m23KT661Kr6xy4aM6sdrB+ineEf6hHNbDalvtDVLwyqTLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750953665; a=rsa-sha256; cv=none; b=b6XbXD62TIsh75gE7+htbmFF3BaT2lB046ePApBSmbm9wXZO7UK6yfYRCEZZwgskOwyR/z 8XMo0IxODVpwgMzQpQvfV4zLRJP4ohAW9XfaCbVT6st+dfxM5PhhmatoPpHgiQKamQJZrU Gg8O4OKOhSaaH85wy0Uk41oCUX9iC4Y+p6AgWmkkfpuwmW+eRzZhTNK2UqKJQ70qynWf6R M3VyTF/IliMr7bsVO83uyfd0YQUwXjuAzZExmrBsmFlpPxNN+9xCbQuxfIZSEulIUVCxCl 0hhp+GY62uVAzy1qXJxBibBv0XQNC8RcNGFk4bO5P4BtB/MymxPGl8YAXVUJ0A== 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 4bSk1r6jmCz18LT; Thu, 26 Jun 2025 16:01: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 55QG141u043280; Thu, 26 Jun 2025 16:01:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QG14Ex043277; Thu, 26 Jun 2025 16:01:04 GMT (envelope-from git) Date: Thu, 26 Jun 2025 16:01:04 GMT Message-Id: <202506261601.55QG14Ex043277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 111607db6a45 - main - OptionalObsoleteFiles: Keep Heimdal man pages when switching back List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 111607db6a45f9ddf1f025106ac74cb2d540e955 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=111607db6a45f9ddf1f025106ac74cb2d540e955 commit 111607db6a45f9ddf1f025106ac74cb2d540e955 Author: Cy Schubert AuthorDate: 2025-06-26 16:00:13 +0000 Commit: Cy Schubert CommitDate: 2025-06-26 16:00:13 +0000 OptionalObsoleteFiles: Keep Heimdal man pages when switching back Additional man pages that should not be removed when switching back to Heimdal. Fixes: af2593e3212c --- tools/build/mk/OptionalObsoleteFiles.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 8312a4975f4a..eb2713bafac9 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -6861,7 +6861,6 @@ OLD_FILES+=usr/share/licenses/krb5-1.21.3_1/catalog.mk OLD_FILES+=usr/share/locale/de/LC_MESSAGES/mit-krb5.mo OLD_FILES+=usr/share/locale/en_US/LC_MESSAGES/mit-krb5.mo OLD_FILES+=usr/share/locale/ka/LC_MESSAGES/mit-krb5.mo -OLD_FILES+=usr/share/man/man1/compile_et.1.gz OLD_FILES+=usr/share/man/man1/k5srvutil.1.gz OLD_FILES+=usr/share/man/man1/kadmin.1.gz OLD_FILES+=usr/share/man/man1/ktutil.1.gz @@ -6873,7 +6872,6 @@ OLD_FILES+=usr/share/man/man5/k5identity.5.gz OLD_FILES+=usr/share/man/man5/k5login.5.gz OLD_FILES+=usr/share/man/man5/kadm5.acl.5.gz OLD_FILES+=usr/share/man/man5/kdc.conf.5.gz -OLD_FILES+=usr/share/man/man5/krb5.conf.5.gz OLD_FILES+=usr/share/man/man7/kerberos.7.gz OLD_FILES+=usr/share/man/man8/kadmin.local.8.gz OLD_FILES+=usr/share/man/man8/kdb5_ldap_util.8.gz From nobody Thu Jun 26 16:09:50 2025 X-Original-To: dev-commits-src-main@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 4bSkCz0pQtz60jrM; Thu, 26 Jun 2025 16:09: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 4bSkCy6hNsz3cg9; Thu, 26 Jun 2025 16:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750954191; 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=34DdXchw+2lpBn1Oj5N2hmPrtz+w0L7DQoh4PpApO9Q=; b=fUxl3Ahx5ucb3gOtQrM8tCgQUsjiv/u2ynNR7TCY50I/b0zNNRMPMlmm3HraQksPZkkkQG FSk7Tqx1qLMLs3BF/CEfH7LDeNYpOEJGg0sSYgQv+aBHF3V7+VbNzssWlUtKMz/L0+YArV sNwi5uyFCD0OTS1JHcyloTVjaYldP/w7S9phRack3DrVz2EJ/51+qfaENl3zzxr8F+bxNW FSIJvnOuGA26MCy1qqRlRmbaIkvClbVrRr8Lrhte0bTX4QMVehMUCGRcmHaf2sBDFnZoir 9S0FX1ZV3UpzIP/Cpiz2Il7EfZL4csFx2gdMa381pzKgXb59nzyMYqj+aCDEEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750954191; 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=34DdXchw+2lpBn1Oj5N2hmPrtz+w0L7DQoh4PpApO9Q=; b=Qq8opvdUFhcAahYPLttzRjl1jSJY4hWjFox5g2lfu0p2bLEcTBBrG4CbKZyoRtBZqylJJQ 54jlTWocm5sqFwLtYo2rxUoKz/XHbj8suPHk/1bBh0xsyJggjlOAlBjxH5QQd4BeFniFhT TT02YdukIxo8OI723azCtnhBWwk9DNLkxDx4udctnijfXXGqfvwm5OpDdXEa4LhFZWtcvR Bvz/ejo7XhCllSBf+YlBid5G7b6v6A8qKilYZe3dhMQMumpv1YqLP4n+RIZqNZl9gb/l+U lyx6aG50zVwsxvmmtJiDsfWeiZ+eWiAEpr0CMheKVMDQtR5GEowHAO9XLrxjNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750954191; a=rsa-sha256; cv=none; b=LiS+H83b0f28ZtnJQlZY3ZAFakrDnvTRCNu5ECJzVbtd19TYsWfi95E+YAxgf1NEbVvLFC YP9DxLQbXL9868WqIfv5gHDpNO532YdZQ4WNXWssA67JT0Yy0akCjlsD/dE1U9uH8IPb3O FcP0DHG1R2AI+jyADHYtbrPFzv51qssNOjZ5idl+0ML8hSvkP6dUqS7k+dPvTpIZUq1Q6Z LVDOV8KWXnOkY8hM+qbMaqbwlMMgA7mFjeLJIf7ywb1TUa/A+J01TEHkqn1au/d3u2PVK+ 29DvEQiEnfqaFzGO8hMWP4zLJzI6XGUkMDXm+tHIc+71veDn02hGqvdSIFy3Og== 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 4bSkCy62Ztz18Lq; Thu, 26 Jun 2025 16:09: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 55QG9oXV049211; Thu, 26 Jun 2025 16:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QG9odv049208; Thu, 26 Jun 2025 16:09:50 GMT (envelope-from git) Date: Thu, 26 Jun 2025 16:09:50 GMT Message-Id: <202506261609.55QG9odv049208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 89f6eb0a61cb - main - tcp: restrict the contents of tcp_timer.h to the kernel context List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89f6eb0a61cbd93f537a2059142edfccc1b198c7 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=89f6eb0a61cbd93f537a2059142edfccc1b198c7 commit 89f6eb0a61cbd93f537a2059142edfccc1b198c7 Author: Michael Tuexen AuthorDate: 2025-06-26 16:01:53 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 16:09:43 +0000 tcp: restrict the contents of tcp_timer.h to the kernel context The header file contains only stuff relevant in the kernel context. Reviewed by: glebius, rscheff, Peter Lei, imp Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50912 --- sys/netinet/tcp_timer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 875f1584988c..a145782ba82d 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -32,6 +32,8 @@ #ifndef _NETINET_TCP_TIMER_H_ #define _NETINET_TCP_TIMER_H_ +#ifdef _KERNEL + /* * The TCPT_REXMT timer is used to force retransmissions. * The TCP has the TCPT_REXMT timer set whenever segments @@ -133,8 +135,6 @@ (tv) = (tvmax); \ } while(0) -#ifdef _KERNEL - #define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) #define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : tcp_keepidle) #define TP_KEEPINTVL(tp) ((tp)->t_keepintvl ? (tp)->t_keepintvl : tcp_keepintvl) From nobody Thu Jun 26 16:38:04 2025 X-Original-To: dev-commits-src-main@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 4bSkrY1mDBz60lLf; Thu, 26 Jun 2025 16:38: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 4bSkrY0mqLz3tTw; Thu, 26 Jun 2025 16:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750955885; 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=Zdg7FqA8qs+WCx07/9RAnkcbMLNDv6h2Oaar2+kruxk=; b=TVkhfi69UtdhH2od0OAoKdmPMul8nkghcodJicvlY9OFW4vCeveg4HlknvDWFb7lCgW0GX YhUEmEdGUSxApvXrzpsfLLL77ZcYhBrxzctgGuz/90YhGwVcq1SHLaUfBmVEDRDI42BqM9 n1IEMh7toRU0QLNjpRTAhCZT6bDrP0jAs3Sq12gpuD4D4bzJL0tfSEMxvSiIdKoAk1Ag7S WR2LOnFqjJHCbWmOID3W2g1QvWS4Q5RjPrZ2ZkcijMyO6IOoMjWZngoTuBNQv41WW2+yhE QvMdsrZdfR1Dw5KkOJ4j4r0I/q1VZuG5YCgIyE5sbR4QCCV4nsyKHdH6d8uywg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750955885; 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=Zdg7FqA8qs+WCx07/9RAnkcbMLNDv6h2Oaar2+kruxk=; b=qQaVDU7xt9ObgbuyCDH7d/8nZlVpQAKr6D95bRasDqOOJ2eaMYRQu78lDNRX3LoF3RgXae ebD1SaGzfiFxoatjTm8C9tCXNmRQPjPiCuaD/9kgfx99dFOz/IB+QVjlEn2r4tw2yRkuvj 0W/vzdoKVskIJZsISNnW5qcKBsdNhAxDHDSWodvr7qyCBz2oEggJCA9RV2oG9AM3lgbJ6e frTLLtuomToaA2tbgKz/Oaihh+FSf7GDJ05DzZU8qtyUEWJBjlO7t/n/gRy+pJAC+yl6N6 nHQgFRhMkRgkjG73tEgc9DukxWrp5pQCc4AvUN1216pr49+D/8e7Se6SpF9xuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750955885; a=rsa-sha256; cv=none; b=e7szPsfUtSpXn8AYoxhRcXwUKkGWjCA10jlCSi0OlGpcd+Iif9tvbUceZujd4Jc/rwB8BK IOPNOiQyCYyNROe/H8oeNvc42WYgER6+vF8ITt75S8j08rG4WLiDRQhvAk90Gufsus8g/E aUS5CM3syast/M7HOuXvPWjbEVapl43HatNNUa11Igo87Db0Yw38mt8J/eqRCNNYRqSEyk UJXglSLPAvpRAxS/b8J43MywDskGJoVw3He515ClZ33DI5RdhWl7aKZ1G32ouWCWhDKeH0 dy6Fw3ckivgZuSn4sFuW7uPbyPy2waB2IruwaohjllNM45qsYsQru3SrmhUikA== 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 4bSkrY033Bz19N7; Thu, 26 Jun 2025 16:38:05 +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 55QGc4Ll004756; Thu, 26 Jun 2025 16:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QGc4kg004753; Thu, 26 Jun 2025 16:38:04 GMT (envelope-from git) Date: Thu, 26 Jun 2025 16:38:04 GMT Message-Id: <202506261638.55QGc4kg004753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: a19b353d354d - main - if_vlan: Fix up if_type before attaching the interface List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a19b353d354d4ef808965c53253103cb6e7e6708 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a19b353d354d4ef808965c53253103cb6e7e6708 commit a19b353d354d4ef808965c53253103cb6e7e6708 Author: Zhenlei Huang AuthorDate: 2025-06-26 16:37:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-06-26 16:37:13 +0000 if_vlan: Fix up if_type before attaching the interface ether_ifattach() does not touch if_type, so it is not mandatory to fix the if_type after ether_ifattach(). Without this change, the event listeners, e.g. netlink, will see wrong interface type IFT_ETHER rather than the correct one IFT_L2VLAN. There is also a potential race that other threads see inconsistent interface type, i.e. initially IFT_ETHER and eventually IFT_L2VLAN. As a nice effect, this change eliminates the memory allocation for if_hw_addr, as vlan(4) interfaces do not support setting or retrieving the hardware MAC address yet [1]. [1] ddae57504b79 Persistently store NIC's hardware MAC address, and add a way to retrive it MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50914 --- sys/net/if_vlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 9561ae5c316c..e9e1c82cb688 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1177,10 +1177,10 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, ifp->if_ratelimit_query = vlan_ratelimit_query; #endif ifp->if_flags = VLAN_IFFLAGS; + ifp->if_type = IFT_L2VLAN; ether_ifattach(ifp, eaddr); /* Now undo some of the damage... */ ifp->if_baudrate = 0; - ifp->if_type = IFT_L2VLAN; ifp->if_hdrlen = ETHER_VLAN_ENCAP_LEN; ifa = ifp->if_addr; sdl = (struct sockaddr_dl *)ifa->ifa_addr; From nobody Thu Jun 26 16:41:11 2025 X-Original-To: dev-commits-src-main@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 4bSkw759tlz60lG0; Thu, 26 Jun 2025 16:41:11 +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 4bSkw74Qdpz3w3y; Thu, 26 Jun 2025 16:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750956071; 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=Wp8K3DmvHRQotQ37+IideNfDdkUZZjQ/gHh2BDliOPI=; b=ZzLyHcN4oIlLShWyACOE9GbOnjkuIwPXsEVxMapFvd79UpRy2QYsJD7jvEDtnX/6PlHlBC cQpriVCQlS7bOeSpHaYhpc9bqNdXnSdt00FqqFImmZcrKnMTLGSn0wMRh2fMBtjra5Vpk5 uZT7Fmh173y3O+iuKD+mw5p70LdBnXnjyhgwoBpSjJ2z8R5Q3ajixTL9SiCUOhaGTj2sDM c6uJ+HIlZVQfHLiSy7qCZcshHOQSCQvfSI+XrP4N7gaoC0u7R+Q+GuqPqsNmf8r6enNdeT o5PAzmrN6nqJyHAH0aqpIcFsu/z1eqz9O2LxeaOqP7rAvLbuiIdIzk5OmSEGdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750956071; 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=Wp8K3DmvHRQotQ37+IideNfDdkUZZjQ/gHh2BDliOPI=; b=Of59yd9ITbG5WbuG4ksvNgw4zXdCRRD2bfKDDaTZr9fecqLXJa4DgadjMh5xFGObFLirHa 1r1E60h77SGsr3OjOu9hjY4tyj++QHSYb0mXNIdwEArJk8AmvE7J7jneYOBhnnCRZXus/M trjZDBh4CS7AEs+F0lHiJIRhYX6N68Q6zGdJcbkS+RwAu2EYwUXiMF8qGUSv9KngWsiqpq SxdNC83xg19i/jIdgs0YFv5R03aIr1kssE1RwXq3+XKDFzUh7pvNRNI/vtwepuoEOVWD2r qLLkHd3zX4gKs5BPIqd+E+grBsXocrvI0w6VDtnWg3pTnlU80Wr9C3H86JCc7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750956071; a=rsa-sha256; cv=none; b=L7q4JKM1g1jEJo9B5Pyq7ERdM6Jc8mMEZYFCJG91hu68Df4yG0PncFudVLRD8dsm0oaU+w BqtcGeOJBkkcachcYSs1JYZVJMoFFA8uuG606GcWITSX+QFHM3JwXfYJ0rue8hipef00vm ZWKrRDzp+nq9JrGVNc9cPblDeITzJ35vg8mxqlXjqwLqRtC20/xSOX49XB5F4gXSy6QbeH o793dHUJKQXqNGA+wd64LSnqB+8/M5CJdqasqhSZA4TnY8HTv8BpbNyGtsvXIeT97+d6yy WHZJzqPNbYL9vVYBVqVaHN7c8EqIrEGKI/4sHFy5RD+yXEguZGQh8euWmBaeQA== 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 4bSkw7422fz19Yh; Thu, 26 Jun 2025 16:41:11 +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 55QGfBQs017113; Thu, 26 Jun 2025 16:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QGfBhw017111; Thu, 26 Jun 2025 16:41:11 GMT (envelope-from git) Date: Thu, 26 Jun 2025 16:41:11 GMT Message-Id: <202506261641.55QGfBhw017111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: af2949cd29ef - main - mandoc: Bump version string to 1.14.6s20250613 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af2949cd29ef453a63a6345de396be866138b051 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=af2949cd29ef453a63a6345de396be866138b051 commit af2949cd29ef453a63a6345de396be866138b051 Author: Alexander Ziaee AuthorDate: 2025-06-26 12:48:25 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-26 16:41:01 +0000 mandoc: Bump version string to 1.14.6s20250613 The mandoc compiler is still at version 1.14.6, but we have imported several snapshots since the version was bumped. Append a snapshot date string to the version to reflect this. Requested by: wosch Discussed with: bapt --- contrib/mandoc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mandoc/Makefile b/contrib/mandoc/Makefile index cd3f16652069..7ec34a560504 100644 --- a/contrib/mandoc/Makefile +++ b/contrib/mandoc/Makefile @@ -15,7 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.14.6 +VERSION = 1.14.6s20250613 # === LIST OF FILES ==================================================== From nobody Thu Jun 26 16:55:32 2025 X-Original-To: dev-commits-src-main@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 4bSlDh5m0Gz60m92; Thu, 26 Jun 2025 16: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 4bSlDh4k53z44tn; Thu, 26 Jun 2025 16: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=1750956932; 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=4XROOmuInP6ZEzXDecw+ZKCB19WJZCmdl0hUYKnpQ8A=; b=sH2TwQoWp9xaVVpDtuCjajRAwfFkTQO0yjjP4UkJTB3aUaHCYqsY9M6zFV0YwI+W+KYqkP qR+h5QKHKfQ0xzxdc439idO1n5Hahnpp5YxsctDV+IZl/EqoEIivhpRvvLu6DH2n97jec3 hHgPVTCraJk4Ppdi32jCcGvj18v1mjVwGrCtnh19K3/yr4hdSu0GDvqHpJL3IYDNElb1v8 RSgkphE3+/pX6ifxyLEwHzUyCi68veLvSHeRaxPV3I3qos0qGJ22sDDUYMyAjUAH8Xl8Rk GGOjB9GY9YsBJBnFz0blyYQlD3tf/ZEsTd4oxPQ8JT6YnCfdxcuWfM50xgUg5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750956932; 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=4XROOmuInP6ZEzXDecw+ZKCB19WJZCmdl0hUYKnpQ8A=; b=xG3TwhJGftLp5GT21OIOpWU+i6CJgsW7/tgWJXm1fqEJkgSazUd+hz2x5G366md1YSs5sZ sjPrL6oYKon2vf0UJJ1ERjl4Hn5YE7hVXslGghzWB44p5L7L2SrkBNcmE2YkXVLXVMCXTu 9YU0P6zL1YEBKsArKOmFW0XhtzM5snOOay4eNaWMn3E6nyA5/WOLRiKwMxDUctlO/9xp8r MNpEcK3R7GFCzhhVyGi39z1PRlmfVzduLesGO48i0/gd8hHHR69a+pcF6INcvtBLuDwJ33 LYRC1MjEyS/GLOYehhlDIela99LWXDbSAo0p79WKVQ1iy1nV2o/vD48GojPWaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750956932; a=rsa-sha256; cv=none; b=ItZ4g06kaYzSvLrvFzc6qfe1d0x6/GDtZF4oyO58z1IuDhBp7uhWsGLyqxx+0xcq15y1b3 OXdkYF4O56kW8+IF7gxHk5icQpzuw94KYcEhY/2rq8UqywyteNmTGVajtKqAXprY84Iv7S EC5J0jyNE6S9H/bDbuDNh9kpjroqV/0738cnzm+9s2sCBLaEIlOF/oEKmNDGRQ/z24+tWB Vd2hAHE02ipuEwunl+B8OBhaas/ep2+M1QJ7BEesDD6I4XFuF17JCbjNiKddcGFClwhblu JjJDMdxMZ8ST19Dq3nuRt6LNKkYWjFcy3sZMTzkbvEJYYqPj/BdjirT3AndrMQ== 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 4bSlDh3pyhz19Lh; Thu, 26 Jun 2025 16: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 55QGtWk8040899; Thu, 26 Jun 2025 16: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 55QGtW2I040896; Thu, 26 Jun 2025 16:55:32 GMT (envelope-from git) Date: Thu, 26 Jun 2025 16:55:32 GMT Message-Id: <202506261655.55QGtW2I040896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 0b33b25b1403 - main - tcp: cleanup timer initialisations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b33b25b14033f738995c0a1fdcfd1f695afd6f2 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0b33b25b14033f738995c0a1fdcfd1f695afd6f2 commit 0b33b25b14033f738995c0a1fdcfd1f695afd6f2 Author: Michael Tuexen AuthorDate: 2025-06-26 16:52:59 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 16:55:27 +0000 tcp: cleanup timer initialisations Use MSEC_2_TICKS() to make clearer, which values are used and to ensure that the value stored is at least one tick. This also avoids the need of some protection code. Reviewed by: glebius, cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50840 --- sys/netinet/tcp_subr.c | 4 ---- sys/netinet/tcp_timer.h | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 4542c5ccb8bb..6b1907305fb9 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1474,11 +1474,7 @@ tcp_init(void *arg __unused) tcp_keepintvl = TCPTV_KEEPINTVL; tcp_maxpersistidle = TCPTV_KEEP_IDLE; tcp_rexmit_initial = TCPTV_RTOBASE; - if (tcp_rexmit_initial < 1) - tcp_rexmit_initial = 1; tcp_rexmit_min = TCPTV_MIN; - if (tcp_rexmit_min < 1) - tcp_rexmit_min = 1; tcp_rexmit_max = TCPTV_REXMTMAX; tcp_persmin = TCPTV_PERSMIN; tcp_persmax = TCPTV_PERSMAX; diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index a145782ba82d..394207bcb89b 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -73,21 +73,21 @@ /* * Time constants. */ -#define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ +#define TCPTV_MSL MSEC_2_TICKS(30000) /* max seg lifetime (hah!) */ #define TCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ -#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO if no info */ +#define TCPTV_RTOBASE MSEC_2_TICKS(1000) /* assumed RTO if no info */ -#define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ -#define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ +#define TCPTV_PERSMIN MSEC_2_TICKS(5000) /* minimum persist interval */ +#define TCPTV_PERSMAX MSEC_2_TICKS(60000) /* maximum persist interval */ -#define TCPTV_KEEP_INIT ( 75*hz) /* initial connect keepalive */ -#define TCPTV_KEEP_IDLE (120*60*hz) /* dflt time before probing */ -#define TCPTV_KEEPINTVL ( 75*hz) /* default probe interval */ +#define TCPTV_KEEP_INIT MSEC_2_TICKS(75000) /* initial connect keepalive */ +#define TCPTV_KEEP_IDLE MSEC_2_TICKS(120*60*1000) /* dflt time before probing */ +#define TCPTV_KEEPINTVL MSEC_2_TICKS(75000) /* default probe interval */ #define TCPTV_KEEPCNT 8 /* max probes before drop */ #define TCPTV_MAXUNACKTIME 0 /* max time without making progress */ -#define TCPTV_FINWAIT2_TIMEOUT (60*hz) /* FIN_WAIT_2 timeout if no receiver */ +#define TCPTV_FINWAIT2_TIMEOUT MSEC_2_TICKS(60000) /* FIN_WAIT_2 timeout if no receiver */ /* * Minimum retransmit timer is 3 ticks, for algorithmic stability. @@ -109,13 +109,13 @@ * The prior minimum of 1*hz (1 second) badly breaks throughput on any * networks faster then a modem that has minor (e.g. 1%) packet loss. */ -#define TCPTV_MIN ( hz/33 ) /* minimum allowable value */ -#define TCPTV_CPU_VAR ( hz/5 ) /* cpu variance allowed (200ms) */ -#define TCPTV_REXMTMAX ( 64*hz) /* max allowable REXMT value */ +#define TCPTV_MIN MSEC_2_TICKS(30) /* minimum allowable value */ +#define TCPTV_CPU_VAR MSEC_2_TICKS(200) /* cpu variance allowed (200ms) */ +#define TCPTV_REXMTMAX MSEC_2_TICKS(64000) /* max allowable REXMT value */ #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ -#define TCPTV_DELACK ( hz/25 ) /* 40ms timeout */ +#define TCPTV_DELACK MSEC_2_TICKS(40) /* 40ms timeout */ /* * If we exceed this number of retransmits for a single segment, we'll consider From nobody Thu Jun 26 17:03:41 2025 X-Original-To: dev-commits-src-main@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 4bSlQ63Qxcz60mYP; Thu, 26 Jun 2025 17:03: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 4bSlQ60hYqz474p; Thu, 26 Jun 2025 17:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750957422; 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=43G2oBnlJWOTNOeh30+9pOGhYDpBnv6pTyeMy8GPIFA=; b=CDVDAdgackBjsuNg7YUyxGHCR+L9C9JdEknPoq/tBrGSSRjcPulnbwbuPANdJ+Yme741cy vnylE4nyEmsJ0IWvKxFQSrObj4VTJSAzrZmPUEYDvTw1TezNfXc9vSwtZWxhz4QjQhsMuQ twgOrP4PNA/R8NoxZb1vzLcEWYi0OqqCVl2AsKtanx5SxnZjj/LqsajrsJGydFdXQ5qVfp 5f88SjWLkNhtpaBFN32/VaBH8tVOsr7F2jCKPnbZXLQnF49l5gBwdVHiTFYzickH05/fwz Sfys0MjDPrFDUQO36ys7qMKQKtbw9lGQA/p5rwLkkPpDrY6Q8qfDVyH5vwOXMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750957422; 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=43G2oBnlJWOTNOeh30+9pOGhYDpBnv6pTyeMy8GPIFA=; b=F8LBAerCvkv7mY1CyyGtLis2enWxI8a0NQBJcCaN9j/7aemWkUK/X1yZ88e4Sz+eytiDXO g/v/tzvINq2zFY0AuKYL9xKosNO8Rt3rP5nYZerF6b+fON9opCE4hWR1fZVBVCTb06uKYQ cg5Ofqut8tG7HzQskxtnUXPk/VwkXF75mvOw2+aLxmUwNMJlZTWhE4DWwADmJ/17Xij5GO Ipye3+xCN649Ge4RCcQhjQXHzeA06QjI+iQRc4HDgLUtUbuUejzNX34Mok3Hyrk3xfPl05 xVE+gIybimn8e29/EJG67n+qpOGCjAtAbTkTZjiLWAtEcvvkn1p1dtA4N7yxsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750957422; a=rsa-sha256; cv=none; b=OYROo4LmvuUjjScfDUM129u8NpdRW515qZl0RCJAP7459Bi2kH1nl8cjQuZ24hOHye0jIX vgtqs7LYtfxmFcVNl4/dMg4sq+reIQmIDmVMpbOd6crnf6qL4Yk4teLHREsdIHriH2O2Pa 3bm9ybUyBuTfwSY0vwutoOCJ/tHXdL+WFRJ0smoDjHGz4JOvaQtvFOLZD27gd1P5CxN/o1 GgbjfOJFtjo1HPMGCvwfQE4F/mKDWfS5flIMr6nfscCfSWZ4t5il8+RvLR3c0n9dk/C2// uJLl9xNUmSXZvXeKOKCRbl3ZYZnODN7rDtm/JuLLZcWvXouv/rHYvr0d/IqIJw== 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 4bSlQ607fQz1B2F; Thu, 26 Jun 2025 17:03: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 55QH3f2N060221; Thu, 26 Jun 2025 17:03:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QH3fqK060218; Thu, 26 Jun 2025 17:03:41 GMT (envelope-from git) Date: Thu, 26 Jun 2025 17:03:41 GMT Message-Id: <202506261703.55QH3fqK060218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 5fb4b091e835 - main - tcp: allow specifying a MSL for local communications List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fb4b091e8352602894fc2b7284c8e1e3d8a8729 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5fb4b091e8352602894fc2b7284c8e1e3d8a8729 commit 5fb4b091e8352602894fc2b7284c8e1e3d8a8729 Author: Michael Tuexen AuthorDate: 2025-06-26 16:59:36 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 16:59:36 +0000 tcp: allow specifying a MSL for local communications When setting the sysctl-variable net.inet.tcp.nolocaltimewait to 1, which is the default, a TCP endpoint does not enter the TIME-WAIT state, when the communication is local. This can result in sending RST-segments without any error situation. By setting the sysctl-variable net.inet.tcp.nolocaltimewait to 0, this does not occur, and the behavior is compliant with the TCP specification. But there is no reason to stay in the TIME-WAIT state for two times the value of the sysctl-variable net.inet.tcp.msl, if the communication is local. Therefore provide a separate sysctl-variable net.inet.tcp.msl_local, which controls how long an TCP end-point stays in the TIME-WAIT state, if the communication is local. The default value is 10 ms. Reviewed by: glebius, Peter Lei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50637 --- share/man/man4/tcp.4 | 7 +++++++ sys/netinet/tcp_subr.c | 1 + sys/netinet/tcp_timer.c | 6 ++++++ sys/netinet/tcp_timer.h | 3 +++ sys/netinet/tcp_timewait.c | 26 ++++++++++++++++++++++++-- 5 files changed, 41 insertions(+), 2 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 536bd904d796..f19b6cb2ae14 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -780,6 +780,13 @@ Minimum TCP Maximum Segment Size; used to prevent a denial of service attack from an unreasonably low MSS. .It Va msl The Maximum Segment Lifetime, in milliseconds, for a packet. +.It Va msl_local +The Maximum Segment Lifetime, in milliseconds, for a packet when both endpoints +are local. +.Va msl_local +is only used if +.Va nolocaltimewait +is zero. .It Va mssdflt The default value used for the TCP Maximum Segment Size .Pq Dq MSS diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 6b1907305fb9..bbcd20b715ba 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1455,6 +1455,7 @@ tcp_vnet_init(void *arg __unused) VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); V_tcp_msl = TCPTV_MSL; + V_tcp_msl_local = TCPTV_MSL_LOCAL; arc4rand(&V_ts_offset_secret, sizeof(V_ts_offset_secret), 0); } VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index a9046e5725d5..32ce3001929c 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -109,6 +109,12 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, &VNET_NAME(tcp_msl), 0, sysctl_msec_to_ticks, "I", "Maximum segment lifetime"); +VNET_DEFINE(int, tcp_msl_local); +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl_local, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(tcp_msl_local), 0, sysctl_msec_to_ticks, "I", + "Maximum segment lifetime for local communication"); + int tcp_rexmit_initial; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, CTLTYPE_INT | CTLFLAG_RW, &tcp_rexmit_initial, 0, sysctl_msec_to_ticks, "I", diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 394207bcb89b..34a0f1375463 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -74,6 +74,7 @@ * Time constants. */ #define TCPTV_MSL MSEC_2_TICKS(30000) /* max seg lifetime (hah!) */ +#define TCPTV_MSL_LOCAL MSEC_2_TICKS(10) /* max seg lifetime for local comm */ #define TCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ #define TCPTV_RTOBASE MSEC_2_TICKS(1000) /* assumed RTO if no info */ @@ -183,6 +184,8 @@ VNET_DECLARE(int, tcp_v6pmtud_blackhole_mss); #define V_tcp_v6pmtud_blackhole_mss VNET(tcp_v6pmtud_blackhole_mss) VNET_DECLARE(int, tcp_msl); #define V_tcp_msl VNET(tcp_msl) +VNET_DECLARE(int, tcp_msl_local); +#define V_tcp_msl_local VNET(tcp_msl_local) #endif /* _KERNEL */ diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 2b4ae462af89..9f2943725ef0 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -93,6 +93,28 @@ SYSCTL_BOOL(_net_inet_tcp, OID_AUTO, nolocaltimewait, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nolocaltimewait), true, "Do not create TCP TIME_WAIT state for local connections"); +static u_int +tcp_msl(struct tcpcb *tp) +{ + struct inpcb *inp = tptoinpcb(tp); +#ifdef INET6 + bool isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; +#endif + + if ( +#ifdef INET6 + isipv6 ? in6_localip(&inp->in6p_faddr) : +#endif +#ifdef INET + in_localip(inp->inp_faddr)) +#else + false) +#endif + return (V_tcp_msl_local); + else + return (V_tcp_msl); +} + /* * Move a TCP connection into TIME_WAIT state. * inp is locked, and is unlocked before returning. @@ -140,7 +162,7 @@ tcp_twstart(struct tcpcb *tp) return; } - tcp_timer_activate(tp, TT_2MSL, 2 * V_tcp_msl); + tcp_timer_activate(tp, TT_2MSL, 2 * tcp_msl(tp)); INP_WUNLOCK(inp); } @@ -283,7 +305,7 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, if (thflags & TH_FIN) { seq = th->th_seq + tlen + (thflags & TH_SYN ? 1 : 0); if (seq + 1 == tp->rcv_nxt) - tcp_timer_activate(tp, TT_2MSL, 2 * V_tcp_msl); + tcp_timer_activate(tp, TT_2MSL, 2 * tcp_msl(tp)); } /* From nobody Thu Jun 26 17:25:39 2025 X-Original-To: dev-commits-src-main@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 4bSlvS10myz5yYR0; Thu, 26 Jun 2025 17:25: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 4bSlvR64DTz3LXW; Thu, 26 Jun 2025 17:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750958739; 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=zuz3rCXF8SbhnKpPZurc+oQgE6TcdppxH/6VMaBsMdI=; b=INi5InB6zQefwwu4FfNVWcSzlbO6DTh1XLMt1Dpx3eJZ8RmrU+1DTYXs4lfS5NWx6+l71z iJgM2i8m9afLZJOCx6zr9rCPxHrrUTNQeyIuGUpuBwRNHN7Vv/Pg1Zwo53tQLH+Ma6+3ys un3Vk+NpRD1vj+avFhC4D+OpacEHZxIyhRVFH7zauHJRSgIWqVmu3PBM8Ixkxowo2kt4cJ kkCzHaeFoXkUe76tCBKlI04sdVL2JGmcFikt0LHfKNYjo6hfey+8ubY1K70Xna9n7WHbth 85sDS2RswBznWdXCNmxnBxT8j7D4WBQyotsgHu0XUla4kAVo5nkj+7TFOXY9qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750958739; 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=zuz3rCXF8SbhnKpPZurc+oQgE6TcdppxH/6VMaBsMdI=; b=Nuh7j79C71Far0AtP6X19ob4qLpfjgWP6jWPByjmUwqspYfaTn17uQtEAjrUIgJuFvA5F3 9/SJYGelWh+YIisAtA9j7pfVIFdV+IXh2U6/Z60dSm4xMxjBb0IpdhWn0JHR4UnOWPFyC1 06F6jOWDrjgyRPLeBSuN+/ZXqcTPoWI2qWaRal5yAFG37UlaIh6t0bV7VLdIVBPJ9ka4C2 O+2I7v/qg1GoNr59czmF/tvBKdBAORpKVu5d+t/4yJY5KO656+lGti0dRP8PNSIKeAqzxo X1vJ3fbpN0ODOq9vh4VC8cXuE+BvGxJxSj+mZ6Tqe9FV9vtufqxEDnWkZ8vbzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750958739; a=rsa-sha256; cv=none; b=S/s98K4WpWXyC6HULJLHu1JjARS7lxthmuuPasjH6sdUxnKFIv/jKCPzjclyLVFBBYqTJJ SkTYe11aBp2BjnjseBO5NKDrPhv8SzRTgqrvoKwbqcQ86IKq3AkHVUAMR0ZnDyLOIPHFkZ kklwNrC7EWCbXFeUWWwZaecMB37wj/rCo2LPuHkSP0xYxGKwmvjIthtXGVY4oG10KhYfQM f4qoPtguhxGk77F+H8mPeA5MKBLS77+3K0p8Xm7ECUgbgLrn9SM1Wrl4fDAzmsBeFtw4U8 CeilvNi3/OAxK7qO8bIIXAvND3OLnaF4GDsFsn00PUpV1aW9oDdePgNB97fWtg== 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 4bSlvR5KVPz1Bm6; Thu, 26 Jun 2025 17:25: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 55QHPdtM097778; Thu, 26 Jun 2025 17:25:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QHPdTM097775; Thu, 26 Jun 2025 17:25:39 GMT (envelope-from git) Date: Thu, 26 Jun 2025 17:25:39 GMT Message-Id: <202506261725.55QHPdTM097775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 36ba7339d4df - main - tcp: use 0 as the value being ignored List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36ba7339d4df0803f8e0655e2ba8d174d4ccec38 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=36ba7339d4df0803f8e0655e2ba8d174d4ccec38 commit 36ba7339d4df0803f8e0655e2ba8d174d4ccec38 Author: Michael Tuexen AuthorDate: 2025-06-26 17:23:56 +0000 Commit: Michael Tuexen CommitDate: 2025-06-26 17:23:56 +0000 tcp: use 0 as the value being ignored No functional change intended. MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_timewait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 9f2943725ef0..08673ddd1152 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -90,7 +90,7 @@ VNET_DEFINE_STATIC(bool, nolocaltimewait) = true; #define V_nolocaltimewait VNET(nolocaltimewait) SYSCTL_BOOL(_net_inet_tcp, OID_AUTO, nolocaltimewait, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nolocaltimewait), true, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nolocaltimewait), 0, "Do not create TCP TIME_WAIT state for local connections"); static u_int From nobody Thu Jun 26 19:57:13 2025 X-Original-To: dev-commits-src-main@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 4bSqGK4qFtz5yjd5; Thu, 26 Jun 2025 19:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSqGK1yXRz3v4Y; Thu, 26 Jun 2025 19:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750967833; 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=AMDWe7ps64svS1QTXNP+cKfS6kCGrgqmLaKXUELmTJY=; b=VCFtpQLFIK4hw0ELoFwN5an8FD/6aJyzXIuz6OKUNlNjcOS90lItclBLPGuW5JfF8jCPdi zWlz/cYpz+2+PGHb8+hT7mqI4sJ5nHgKeV9OnHBVk+2oo4Hkz21NpJcLrlxFhCg4dA3pue y3L0OZoJ+d81DwecnsSLd69AA3l9SIgdH55GzTkRMHHaHc6RhAzHJgQUnVGUvhxTwhePcz bXySl8pgTXsLf63JBY8HAyL6ufzo0PFjJxpIeSVBSwAZ2CnstOQhHPvb/7jZIEACJsz4OE cNCcaosfWTdMbriGCKDxl+RCw3iJ4xNJfxYcUxZdbSa1jbkc1q45AitofHVgYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750967833; 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=AMDWe7ps64svS1QTXNP+cKfS6kCGrgqmLaKXUELmTJY=; b=ZEFNCHW/CVnZpc4uOExqVxHQmptw99Q8KTZ4eL82mQdEekYtWHhWv9BlyFUv3Y6SkLUgpo d9cFY7wslRrAI9SwxKrsNbDCnpShf1hkWkzokrfeOLSMNXWU0JDU7lxHGXdA8FOH+m8E5G J0y1rTKtToeZ2NhnPbX1MIbMaw4t48vUWZ62Ffl01+eSay2hB1fH4+flEAyTeQnTgefTMr F/taK2bcRdHDfiK1V5TlKR90Zr/s8JgkPiKybGnshEQpY/aRy4O9GZcCfRpo8RjnwliGJt PI4NDzhXFOnrI7I5v2gQo0cDdXPt9nDeFJ5lZOSrAvAqXLV+nZ3T06Ud4TnzXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750967833; a=rsa-sha256; cv=none; b=XIRrmXCnB3aCkKR+lacnqQ5nboXJPlctwXtGUgjtgdh67j7PbfmLc+F5SnsZ50BdbbQFAZ ptZ0ojObAcaW54mloH+U+DvrtycryT7Q9Vnn0xUlcPj2p0Pn9/EUteJZ82/rhLNH8muEVR 7SlpuQDVcC3e1wWlA9whl12Pyn+nTF4WxWqrVI5nkE32y1vYOURm9FgQm+7b35p2j/Pqlr DqMxWirUAIh44rfgSMwjUyJzu7J8hHRL8+x4WcvQctviyuzhp2tgcIOVfdtDIW1U++fs2Y tDAzoKv5oWGe/Qy4kQ0on4TI2Lv+MNUgsVt8VmbQayH/ULrwloS+bvQD3NNe0Q== 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 4bSqGK0xrbz2WJ; Thu, 26 Jun 2025 19:57:13 +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 55QJvDdN078636; Thu, 26 Jun 2025 19:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QJvDAZ078633; Thu, 26 Jun 2025 19:57:13 GMT (envelope-from git) Date: Thu, 26 Jun 2025 19:57:13 GMT Message-Id: <202506261957.55QJvDAZ078633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Krzysztof Galazka Subject: git: b9e3e8491fe6 - main - release: Fix dvdrom building dependency List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9e3e8491fe652324824582ad1c00faa6e32bc80 Auto-Submitted: auto-generated The branch main has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=b9e3e8491fe652324824582ad1c00faa6e32bc80 commit b9e3e8491fe652324824582ad1c00faa6e32bc80 Author: Krzysztof Galazka AuthorDate: 2025-06-26 19:53:20 +0000 Commit: Krzysztof Galazka CommitDate: 2025-06-26 19:53:48 +0000 release: Fix dvdrom building dependency While building legacy dist sets incorrect target 'dvd1' was used to set dependency on packagesystem. Because of that generated archives were incomplete and MANIFEST file was missing. Signed-off-by: Krzysztof Galazka Fixes: 3f494a4e5ce0 (release: Add NODISTSETS to skip legacy dist sets) Reviewed by: emaste Approved by: kbowling (mentor), erj (mentor) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D51062 --- release/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index d7721cf4ccd8..84f29983b6c7 100644 --- a/release/Makefile +++ b/release/Makefile @@ -183,7 +183,7 @@ packagesystem: ${DISTRIBUTIONS} .if !defined(NODISTSETS) disc1: packagesystem bootonly: packagesystem -dvd1: packagesystem +dvd: packagesystem .endif .if defined(PKGBASE) From nobody Thu Jun 26 20:25:51 2025 X-Original-To: dev-commits-src-main@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 4bSqvM6fYYz5yl6V; Thu, 26 Jun 2025 20:25: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 4bSqvM2Vxxz49Vh; Thu, 26 Jun 2025 20:25:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750969551; 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=zxgSwqpZrEFHWQtiKomtGOWVlHiFlcXUwBMoND22tq4=; b=hJHQPm1vZeFYn8BQp1PD6WFRSg3tjQRAsL0ZCmtuwoEIfQlw9ogl9Ojmux5HXEpzJPuaew RBvBEO3NcJ3k2HGWsYWrlYh8UcLezFctWyIYgSvFIfl/tsYHMfjOYK/YAYa27AS5M+XzdX sgRWKjH2cphroVFfql5vVTaqvzwlB9OzDdmRWzVylp4rrFozC1k0Nbh7pj415hMtLHmksN /iI78hG/GarSB9v1OPNeM73fpUiQ/1FYQHFVcSoNT7gMuSGOESaDHH5YGMPFjcnPDAL3r1 L+6DkrpqIn9Fg16WAWPKb2h7L4GvPD6NjG0O+dLvgIW7VO486MSjNrlRZJXJ7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750969551; 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=zxgSwqpZrEFHWQtiKomtGOWVlHiFlcXUwBMoND22tq4=; b=TkLaEBU9P71Mu/YwU71x2n8mc4MkMzK192SuH5zxcbOfXASMR4m6Sr1352MAk2JR06Q6As 5XXgtPwY8lPGU2IQc8oGs8gh+g5zb+N4zSxPPkfyvo4NFNOVuyFrS9SbFv/7NY2ZAjFAWl gD0DTAunH5YfOFcaN1hyg1KAJKJfB8Eh7NF77k6mb7YyLdiXguVkkz6ic3ySXErtFxrRMd 44jSXaaqoebC19PjNUF3H58BpMfQBDcuqXcT/grxqYosskGHI73MchAI8m5Q8rB2nM8elq eZ9Z9E/P0GtF3SAPlBsDyWCTpxaBLb9hwRgBmqWM4EPlPVHUZCdDYdcAb/eLsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750969551; a=rsa-sha256; cv=none; b=QhTUKGJwGgT443DstFFxTwNBjhcYGapEPEzbECJQ8oyXWgtKPhGtEZImOo89k20SFvu+nJ ccQx09arwUKdj2mlJ4guiJSQfURU6iC/WMvlcqQYMxlqQ8VOV5m8h9aCz15g3zCPzXz1cs LE0QqwcWKbVjIMWYALx3Q0/sYe0WvFns9IA+mk69/pr1crV+1HADP5pSJ8BWZ+7D8tOmi/ YUYUXReBknpK37mvj6DH93ctTyEzoZEKZl7mnw1t2VGPSv5siOUZs6HDVyaTtC0VbDa/gS Ez9rw3lMPqmgjDPg4faegbixjnlUsdf+G+P6+CAL2G8kCMjmJZgFgjaf7fZFGA== 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 4bSqvM1JzBz3FW; Thu, 26 Jun 2025 20:25: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 55QKPpXn035557; Thu, 26 Jun 2025 20:25:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QKPpAl035554; Thu, 26 Jun 2025 20:25:51 GMT (envelope-from git) Date: Thu, 26 Jun 2025 20:25:51 GMT Message-Id: <202506262025.55QKPpAl035554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 8e2a90ac8089 - main - nfscommon: Factor out conversion of ae_perm to NFSv4 ACE flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e2a90ac8089e168f71d797f8b3b67659f72c7af Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8e2a90ac8089e168f71d797f8b3b67659f72c7af commit 8e2a90ac8089e168f71d797f8b3b67659f72c7af Author: Rick Macklem AuthorDate: 2025-06-26 20:22:53 +0000 Commit: Rick Macklem CommitDate: 2025-06-26 20:22:53 +0000 nfscommon: Factor out conversion of ae_perm to NFSv4 ACE flags This patch factors the code that converts the ae_perm bits in an NFSv4 style ACL to the NFSv4 on-the-wire format into a separate function. This function will be used by the NFSv4 server in a future commit. This patch should not change NFSv4 semantics. --- sys/fs/nfs/nfs_commonacl.c | 64 +++++++++++++++++++++++++++------------------- sys/fs/nfs/nfs_var.h | 1 + 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/sys/fs/nfs/nfs_commonacl.c b/sys/fs/nfs/nfs_commonacl.c index 55e6f89dd8ec..69afa8d41712 100644 --- a/sys/fs/nfs/nfs_commonacl.c +++ b/sys/fs/nfs/nfs_commonacl.c @@ -352,32 +352,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name, int namelen, if (ace->ae_perm & ACL_SYNCHRONIZE) acemask |= NFSV4ACE_SYNCHRONIZE; } else { - if (ace->ae_perm & ACL_READ_DATA) - acemask |= NFSV4ACE_READDATA; - if (ace->ae_perm & ACL_WRITE_DATA) - acemask |= NFSV4ACE_WRITEDATA; - if (ace->ae_perm & ACL_APPEND_DATA) - acemask |= NFSV4ACE_APPENDDATA; - if (ace->ae_perm & ACL_READ_NAMED_ATTRS) - acemask |= NFSV4ACE_READNAMEDATTR; - if (ace->ae_perm & ACL_WRITE_NAMED_ATTRS) - acemask |= NFSV4ACE_WRITENAMEDATTR; - if (ace->ae_perm & ACL_EXECUTE) - acemask |= NFSV4ACE_EXECUTE; - if (ace->ae_perm & ACL_READ_ATTRIBUTES) - acemask |= NFSV4ACE_READATTRIBUTES; - if (ace->ae_perm & ACL_WRITE_ATTRIBUTES) - acemask |= NFSV4ACE_WRITEATTRIBUTES; - if (ace->ae_perm & ACL_DELETE) - acemask |= NFSV4ACE_DELETE; - if (ace->ae_perm & ACL_READ_ACL) - acemask |= NFSV4ACE_READACL; - if (ace->ae_perm & ACL_WRITE_ACL) - acemask |= NFSV4ACE_WRITEACL; - if (ace->ae_perm & ACL_WRITE_OWNER) - acemask |= NFSV4ACE_WRITEOWNER; - if (ace->ae_perm & ACL_SYNCHRONIZE) - acemask |= NFSV4ACE_SYNCHRONIZE; + acemask = nfs_aceperm(ace->ae_perm); } *tl++ = txdr_unsigned(acemask); *tl++ = txdr_unsigned(namelen); @@ -387,6 +362,43 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name, int namelen, return (full_len + 4 * NFSX_UNSIGNED); } +/* + * Convert ae_perm to NFSv4 ACL acemask4 for regular files. + */ +uint32_t +nfs_aceperm(acl_perm_t ae_perm) +{ + uint32_t acemask = 0x0; + + if (ae_perm & ACL_READ_DATA) + acemask |= NFSV4ACE_READDATA; + if (ae_perm & ACL_WRITE_DATA) + acemask |= NFSV4ACE_WRITEDATA; + if (ae_perm & ACL_APPEND_DATA) + acemask |= NFSV4ACE_APPENDDATA; + if (ae_perm & ACL_READ_NAMED_ATTRS) + acemask |= NFSV4ACE_READNAMEDATTR; + if (ae_perm & ACL_WRITE_NAMED_ATTRS) + acemask |= NFSV4ACE_WRITENAMEDATTR; + if (ae_perm & ACL_EXECUTE) + acemask |= NFSV4ACE_EXECUTE; + if (ae_perm & ACL_READ_ATTRIBUTES) + acemask |= NFSV4ACE_READATTRIBUTES; + if (ae_perm & ACL_WRITE_ATTRIBUTES) + acemask |= NFSV4ACE_WRITEATTRIBUTES; + if (ae_perm & ACL_DELETE) + acemask |= NFSV4ACE_DELETE; + if (ae_perm & ACL_READ_ACL) + acemask |= NFSV4ACE_READACL; + if (ae_perm & ACL_WRITE_ACL) + acemask |= NFSV4ACE_WRITEACL; + if (ae_perm & ACL_WRITE_OWNER) + acemask |= NFSV4ACE_WRITEOWNER; + if (ae_perm & ACL_SYNCHRONIZE) + acemask |= NFSV4ACE_SYNCHRONIZE; + return (acemask); +} + /* * Build an NFSv4 ACL. */ diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 626946a70774..7206d12bd6fa 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -439,6 +439,7 @@ int nfs_supportsnfsv4acls(vnode_t); /* nfs_commonacl.c */ int nfsrv_dissectace(struct nfsrv_descript *, struct acl_entry *, bool, int *, int *, NFSPROC_T *); +uint32_t nfs_aceperm(acl_perm_t); int nfsrv_buildacl(struct nfsrv_descript *, NFSACL_T *, __enum_uint8(vtype), NFSPROC_T *); int nfsrv_compareacl(NFSACL_T *, NFSACL_T *); From nobody Thu Jun 26 21:27:46 2025 X-Original-To: dev-commits-src-main@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 4bSsGq4TBMz5yp71; Thu, 26 Jun 2025 21:27: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 4bSsGq0dWFz3sCV; Thu, 26 Jun 2025 21:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750973267; 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=6xVrkHpmKyZ/YeZ8GJL/dCaBvhSVMglkIXkb9wuvEDo=; b=NFGhm54/6Ekz8535auQLuIDzGmN/u2FUoEXUeMi0u9aql2k1DwUMH8sW02YDSkbu2Sl+5F H0UJx8cv9mCBfKMpn66e3ZyllobBMBAXbjThm3KS4CtRnsHCUpCNUP8jy/gTs/4tR6Ffk3 rQZAXM22WI1OwhbpQbe5dC1aBYZqfPXdwV+5MGU1v2LE99wUZ9RGlWLnXSbX1qI2d/7I9S XrOPNHTf+asAMqYh+YAlfRAuvEqnX9+4fnrAP87NvJZ1MEecvenR+UjhbBqPxXhUocyBi0 Er72LShHtp9bCC+FoSfSUxaQ+BX73affCjl3eVgberFVuZibbeLrUD+g14Uq1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750973267; 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=6xVrkHpmKyZ/YeZ8GJL/dCaBvhSVMglkIXkb9wuvEDo=; b=DwdVEdfiO4kVaYE7X6YVT7LauXFcUvyKJNGYuYAZ/6D2V7s74oUnrV7FApQ3WfORejYnBK MvLfYvjfoPqUfrt5xRYyTRV+KojOCnwZLlxI6hdHeoaxlc0qT207DjqUarjj7vJtuUz2/v /m0Ec37A43giQERYN0IFd71s2g6dGh40s452bUrxTr4SmU6zd39/Pm/YsHUBUSJPl1N5V4 oI8oci/t81cu2zpPt/d/4mjZFj/0SQE41KtYJCTEAFud9golwl+dasibxGpxyG3KGkCRox Qrt9AgUBMYVjPQziVJHkllyeVNVPRQ3n6CH1mrO00PTNEKiOt/njwXDyeTFWhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750973267; a=rsa-sha256; cv=none; b=mVLdBwwIZKLASgi49b66zocAPKqu0idSlHtI6TikhM+cgJfAWqTp/93TYKORnQWJPGhmIW PuZMdmM9/IRZe9dMzLoj8LDixmnjYmyCBOs5cVJ7O0f4Gaj10ay7ILrzJS6fzZJjn2W9AN 0PW1i6XPaJZ0A9JakzFN9IvCQMuqiBgtkJL+18vdmZPvvEMD2m2OqHU24xBc3bzjhnZ8tP 1fF8EbqFO/ZjL8QmUphIwFpSzjfvEpxcQxQrGRWgo0WneKvHEsfxxb7ws6anKzxNkRGVdd acgxGWymGTdjaYITFc3d8ParkBos0rWh3iPTwAWpFr9LDMP6Oyg3ejlxFasVvg== 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 4bSsGp6brnz4g8; Thu, 26 Jun 2025 21:27: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 55QLRkMM048936; Thu, 26 Jun 2025 21:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QLRkFO048933; Thu, 26 Jun 2025 21:27:46 GMT (envelope-from git) Date: Thu, 26 Jun 2025 21:27:46 GMT Message-Id: <202506262127.55QLRkFO048933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: b93063c84e4e - main - psm(4): Add kqueue support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b93063c84e4e792ede844d30452d82c4fe12bdd2 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b93063c84e4e792ede844d30452d82c4fe12bdd2 commit b93063c84e4e792ede844d30452d82c4fe12bdd2 Author: Vladimir Kondratyev AuthorDate: 2025-06-26 21:27:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-06-26 21:27:10 +0000 psm(4): Add kqueue support MFC after: 2 weeks --- sys/dev/atkbdc/psm.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 1a02dbcec020..4a84a0cb6bcb 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -607,6 +607,7 @@ static d_read_t psmread; static d_write_t psmwrite; static d_ioctl_t psmioctl; static d_poll_t psmpoll; +static d_kqfilter_t psmkqfilter; static int psmopen(struct psm_softc *); static int psmclose(struct psm_softc *); @@ -759,6 +760,7 @@ static struct cdevsw psm_cdevsw = { .d_write = psmwrite, .d_ioctl = psmioctl, .d_poll = psmpoll, + .d_kqfilter = psmkqfilter, .d_name = PSM_DRIVER_NAME, }; @@ -1955,6 +1957,7 @@ psmattach(device_t dev) sc->state = PSM_VALID; callout_init(&sc->callout, 0); callout_init(&sc->softcallout, 0); + knlist_init_mtx(&sc->rsel.si_note, &Giant); /* Setup our interrupt handler */ rid = KBDC_RID_AUX; @@ -2066,6 +2069,8 @@ psmdetach(device_t dev) destroy_dev(sc->cdev); destroy_dev(sc->bdev); + knlist_clear(&sc->rsel.si_note, 1); + knlist_destroy(&sc->rsel.si_note); callout_drain(&sc->callout); callout_drain(&sc->softcallout); @@ -5221,6 +5226,7 @@ next: wakeup(sc); } selwakeuppri(&sc->rsel, PZERO); + KNOTE_LOCKED(&sc->rsel.si_note, 0); if (sc->async != NULL) { pgsigio(&sc->async, SIGIO, 0); } @@ -5258,6 +5264,45 @@ psmpoll(struct cdev *dev, int events, struct thread *td) return (revents); } +static void +psmfilter_detach(struct knote *kn) +{ + struct psm_softc *sc = kn->kn_hook; + + knlist_remove(&sc->rsel.si_note, kn, 0); +} + +static int +psmfilter(struct knote *kn, long hint) +{ + struct psm_softc *sc = kn->kn_hook; + + GIANT_REQUIRED; + + return (sc->queue.count != 0 ? 1 : 0); +} + +static const struct filterops psmfiltops = { + .f_isfd = 1, + .f_detach = psmfilter_detach, + .f_event = psmfilter, +}; + +static int +psmkqfilter(struct cdev *dev, struct knote *kn) +{ + struct psm_softc *sc = dev->si_drv1; + + if (kn->kn_filter != EVFILT_READ) + return(EOPNOTSUPP); + + kn->kn_fop = &psmfiltops; + kn->kn_hook = sc; + knlist_add(&sc->rsel.si_note, kn, 1); + + return (0); +} + /* vendor/model specific routines */ static int mouse_id_proc1(KBDC kbdc, int res, int scale, int *status) From nobody Thu Jun 26 21:29:30 2025 X-Original-To: dev-commits-src-main@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 4bSsJq3vQnz5yq7n; Thu, 26 Jun 2025 21:29: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 4bSsJp5Gdjz3tR1; Thu, 26 Jun 2025 21:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750973370; 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=5Z7A44rVtN/M0ltyBuI2NMBrvapNocYZHb8E6XYFEuA=; b=j0IKnrrjbufM4ofySphMXqp0CSTn4DnHjbmAYWRUpzY7po+JQbJBPlaPOYBiRcinwepwuU uQp5yNFuEEnDx88gXDHaOC2WL1wurCsiMFf2UI5nkCh4qC+gALJBaZOXJ21UaTI3yzbl1y JGBZnxX/ro4WRuG1LMimEbAKtzHxT6L/FM++ct9+n2iUuHvuxvAhzlqrAhX0/GnbAIQDCi 2NjuZ8ReIXqzw2oXLQoZQJEfSOa6epXhbPY3egP8K+QHzUKbH4u+Fdba+TDWVeS4QtmV/j RwYb1HqJLAiGLiLf075rBy1ng+qOxEjc/xCvr0yhwPeNUy7arUhk35cttxE/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750973370; 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=5Z7A44rVtN/M0ltyBuI2NMBrvapNocYZHb8E6XYFEuA=; b=tHqlOs5rL+ddAcPzIkGfMTH5H30pl+8m7MLIYc1vysdf7e7FwoXSQ2HgqGi2yvsePJ3xLS O6wcrmihEAs1u3xpJaUywHI/B5gCDAaUSWOZ27LydLej3xdzRrGGi7ZcyBkWmRL8Dt0/OL 5zgWg+ShS/vxc2Iy4efiiBViq1BYyOQUXVJdR9Lqt+NA+nkVEsTINRmhkAAe4X7PovId5+ nHz4O2wqsa1PbCNHdJ2CLE8eIzWgSQdbsck+AaE+wP2o2Gk5r8yF/SXmrIXgY7UPuX5QVS 6di/Lphd8XAJK++x3wgkt4qfuKLsm99NqeYDGllAk77iuBIoOQuFra90q/RNCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750973370; a=rsa-sha256; cv=none; b=I2lzNHvFoeQKjE4iQV1HluyEBIGM9Qoo9vQKe6GLTSo+PMmbaTECo7mmeI8RCO9uZuiBG1 yvUQXmyEgxzjtjmJBZCa2s2lFXI/36D7vfuj39rTVMmeEjLi6AjBw5qx9gi2mhuR0bCni1 rbqL/hf8avY2mhbJMmBYUxwSpufnd1qMZ3DhH5qFFQUiVSsSZnpqso6FXLP14zyZkzdLy5 sJiNGWl19PX2Qjyz83oCyarLZXikIlmex0dN5RlO854iMbq9Sb+C5VEG20HGKU4cr3DeQw rOpBwPwce5eSYZXtv+fX9rWCZaKxbiK0fA5e3bLIt+wH3pNH9BHxIwqiWwLgWg== 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 4bSsJp4s9nz4rk; Thu, 26 Jun 2025 21:29: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 55QLTUG2049535; Thu, 26 Jun 2025 21:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QLTUgb049532; Thu, 26 Jun 2025 21:29:30 GMT (envelope-from git) Date: Thu, 26 Jun 2025 21:29:30 GMT Message-Id: <202506262129.55QLTUgb049532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6bdc9743d8f8 - main - fibs_test: Mark same_ip_multiple_ifaces_fib0 as expected to fail List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 6bdc9743d8f8c9727e5101d6cb6f2a85a13c5acb Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6bdc9743d8f8c9727e5101d6cb6f2a85a13c5acb commit 6bdc9743d8f8c9727e5101d6cb6f2a85a13c5acb Author: Mark Johnston AuthorDate: 2025-06-26 21:19:14 +0000 Commit: Mark Johnston CommitDate: 2025-06-26 21:27:57 +0000 fibs_test: Mark same_ip_multiple_ifaces_fib0 as expected to fail The test relies on being able to assign the same interface address to two different tap interfaces; it then removes one of the addresses, which at one point would trigger a kernel panic. Since 361a8395f0b0 it is not possible to assign an address multiple times this way, so the test fails. Just mark it as expected to fail for now: if the kernel's behaviour here changes again, this test might be a useful seatbelt. MFC after: 2 weeks --- tests/sys/netinet/fibs_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/sys/netinet/fibs_test.sh b/tests/sys/netinet/fibs_test.sh index 5fe8f7d87641..2d0b63f8e30a 100644 --- a/tests/sys/netinet/fibs_test.sh +++ b/tests/sys/netinet/fibs_test.sh @@ -320,6 +320,9 @@ same_ip_multiple_ifaces_fib0_body() # Setup the interfaces, then remove one alias. It should not panic. setup_tap 0 inet ${ADDR} ${MASK0} TAP0=${TAP} + # After commit 361a8395f0b0e6f254fd138798232529679d99f6 it became + # an error to assign the same interface address twice. + atf_expect_fail "The test results in an ifconfig error and thus spuriously fails" setup_tap 0 inet ${ADDR} ${MASK1} TAP1=${TAP} ifconfig ${TAP1} -alias ${ADDR} From nobody Thu Jun 26 22:54:53 2025 X-Original-To: dev-commits-src-main@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 4bSvCL0VJvz5yv9T; Thu, 26 Jun 2025 22:54: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 4bSvCL0244z3rc9; Thu, 26 Jun 2025 22:54:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750978494; 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=8g6dCCvH307UZuIUwYd/bidr6rj91AuuloJF7q3Krho=; b=xBJc1AuFJfNQAgsJhYLxjZbcsbbITYbd5GgKKn6zxVxwh0yk3Lcfg6rpp/QJoHdCJr6BdS S4sSKSDRUu2y0oAGS4I+qm+RdqSmceQBWu8XwSo15BW2/9vLKE/ctk8Lx/TccV7gf5+ZpU OqTyUrk7FYjXONEmcCxnFo/LHeC8bKpk7ZupBZvDruFQ7xSAZcHas3VkpgL2OQqIgjWNIK Ru0f0/zvIAqFJYe2I8zBrCi4ODOs1Ji53HxKzQVk3sF3gbNFlc4yagHKi/qsVmATllpGFC BvZjrfJW0kCdQ7tId/utrbSREi0xF7rDhTpte7UK7lyknFE+OdMLbIRFiNCaLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750978494; 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=8g6dCCvH307UZuIUwYd/bidr6rj91AuuloJF7q3Krho=; b=PbUHrXxyNUydMA6l2tdY0d8A7vc6cSWiWu0RcsFU+LNnjQbIH3eTyEMspxNqz9TAt+O263 ZbAkKlW9AojgLp1wDYb+RryUtLjpSV3TYOwoY3KmOelLxmsGUbviWi6FMLphsbJQtZy/QQ dS2GbEy6TV5ICH0u4k3Yf/cU7fzEH+3/HN/nvYpaTB7D4he4vZ+mzaE2A8nLpGd6L33OmD 2MgECZxHKNot0fg/1AHi9RpzD5RUtHAs907yYB5w/4xo1X6y51SvZf0Kq0RP+G5dnKg9U3 RSOJXzGA973tTNRrX7hDe6S6RZp2iBkt6EfdupnhtbnHo4g3fWmDNAqfW3amCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750978494; a=rsa-sha256; cv=none; b=OWb3MUNXl9XzjthFH8NYiSIh2npPyIifmhqDN50wHPhn1g8c6bSPDKawpOZxMbl4KCeRfs re+wfK1J3wJ5FTjtr94plu6qz6MF/tPpIrBH8Z63ONC/tcXm50AtfzegI6ir1qKpXsHI9O bdrBPEBZcXeAdLYqdFBg29xX72VV2LyrtnslujSp9zbByMC1Z651B19iZrje28EwsUSyet Akyea6ibIP4/2VXc7pZDjraFfC6FJDGGv/+BXY1P+9r7W8RTA73TtS9gy+SH/vljTmyzjh Oxixdd9Gbh4UatRS0hJT1HldZTHCmP7uP7bKWwAQwxHHQm5ztjCCoNi2mQQhTA== 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 4bSvCK5ztHz7MT; Thu, 26 Jun 2025 22:54: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 55QMsrVr015020; Thu, 26 Jun 2025 22:54:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55QMsrVm015017; Thu, 26 Jun 2025 22:54:53 GMT (envelope-from git) Date: Thu, 26 Jun 2025 22:54:53 GMT Message-Id: <202506262254.55QMsrVm015017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 725eb0f85ea9 - main - pctrie: drop freenode param to pctrie_remove List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 725eb0f85ea9fb0c5745efe789f7dcfb1e9d78b3 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=725eb0f85ea9fb0c5745efe789f7dcfb1e9d78b3 commit 725eb0f85ea9fb0c5745efe789f7dcfb1e9d78b3 Author: Doug Moore AuthorDate: 2025-06-26 22:53:43 +0000 Commit: Doug Moore CommitDate: 2025-06-26 22:53:43 +0000 pctrie: drop freenode param to pctrie_remove Drop the freenode argument to pctrie_remove, and instead return a bool to the caller so that the caller can set a freenode value to NULL or something else. Reviewed by: alc, markj, kib Differential Revision: https://reviews.freebsd.org/D51057 --- sys/kern/subr_pctrie.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index 194e96ced471..3a3548bad52b 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -872,19 +872,17 @@ pctrie_iter_jump_le(struct pctrie_iter *it, int64_t jump) * 'node'. If doing so causes 'node' to have only one child, purge it from the * pctrie and save it in *freenode for later disposal. */ -static void -pctrie_remove(struct pctrie *ptree, struct pctrie_node *node, uint64_t index, - struct pctrie_node **freenode) +static bool +pctrie_remove(struct pctrie *ptree, struct pctrie_node *node, uint64_t index) { smr_pctnode_t *parentp; struct pctrie_node *child; int slot; - *freenode = NULL; parentp = pctrie_child(ptree, node, index); if (node == NULL) { pctrie_node_store(parentp, PCTRIE_NULL, PCTRIE_LOCKED); - return; + return (false); } slot = pctrie_slot(node, index); KASSERT((node->pn_popmap & (1 << slot)) != 0, @@ -893,12 +891,11 @@ pctrie_remove(struct pctrie *ptree, struct pctrie_node *node, uint64_t index, node->pn_popmap ^= 1 << slot; if (!powerof2(node->pn_popmap)) { pctrie_node_store(parentp, PCTRIE_NULL, PCTRIE_LOCKED); - return; + return (false); } pctrie_node_store(parentp, PCTRIE_NULL, PCTRIE_UNSERIALIZED); KASSERT(node->pn_popmap != 0, ("%s: bad popmap all zeroes", __func__)); slot = ffs(node->pn_popmap) - 1; - *freenode = node; child = pctrie_node_load(&node->pn_child[slot], NULL, PCTRIE_LOCKED); KASSERT(child != PCTRIE_NULL, ("%s: bad popmap slot %d in node %p", __func__, slot, node)); @@ -907,6 +904,7 @@ pctrie_remove(struct pctrie *ptree, struct pctrie_node *node, uint64_t index, pctrie_setparent(child, node); parentp = pctrie_child(ptree, node, index); pctrie_node_store(parentp, child, PCTRIE_LOCKED); + return (true); } /* @@ -923,8 +921,8 @@ pctrie_remove_lookup(struct pctrie *ptree, uint64_t index, node = _pctrie_lookup_node(ptree, NULL, index, &parent, NULL, PCTRIE_LOCKED); m = pctrie_match_value(node, index); - if (m != NULL) - pctrie_remove(ptree, parent, index, freenode); + if (m != NULL && pctrie_remove(ptree, parent, index)) + *freenode = parent; else *freenode = NULL; return (m); @@ -941,9 +939,11 @@ pctrie_iter_remove(struct pctrie_iter *it, struct pctrie_node **freenode) it->ptree, it->node, it->index), NULL, PCTRIE_LOCKED), it->index), ("%s: removing value %jx not at iter", __func__, (uintmax_t)it->index)); - pctrie_remove(it->ptree, it->node, it->index, freenode); - if (*freenode != NULL) + if (pctrie_remove(it->ptree, it->node, it->index)) { + *freenode = it->node; it->node = pctrie_parent(it->node); + } else + *freenode = NULL; } /* From nobody Fri Jun 27 05:43:32 2025 X-Original-To: dev-commits-src-main@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 4bT4Gs0TF9z60K3Q; Fri, 27 Jun 2025 05:43: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 4bT4Gr6tm0z3CJx; Fri, 27 Jun 2025 05:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003013; 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=2e6AydZ9n2cWWAbndr+pCIIkvj3Oo5DdCMMhFhj0Bjg=; b=n+IWe02j4JG85AYaF4t+ld3IZ7tlM9M3UeeSB/5eEtN87PPIF9ctDIw8hpweOa1qOa5pCg JugJURDD7JS6LU5L/1yj1UdAx1g0kVZUwfKOvuVgUycvrcX4PS2HSnQv8bQN601L3oJsyW oiGzsj48k7jR2ujp5Q74mLyyN3eiLQUUTqI718FDdpaQ/1WI5LM5SLoLUM6+49d7E51BUp aVXlEn84XMj9XKzy+899O7qw2nY5xAChziivxciqcYEHBjmGjvl2dU9Td1rsjTrQkQrQ/K KV0PIilLcfIDWQKK7X2X9X4DjzBEPKeTdwl41ZCjgX+dxPrvIsEF7Bbgx/3YxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003013; 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=2e6AydZ9n2cWWAbndr+pCIIkvj3Oo5DdCMMhFhj0Bjg=; b=Izo93obapPVSSDb7r3jY3UFIvplYJGBsZkkXdkbsZG6k6IXMyKFR5XFMTp/kg/YZXEPr3F j8A5ccdUd73Xpgb2x0bbPyTwCDPdNtxV1bNHh+r3lXBK3McCYNZOBJV3RbOkMrQ8jGtNY3 chJPpiwVOItWffDkJDzb1+wLkSiBKIoIRGpQ1PrKFSPep6Q0UylufTryOgKmABZ+WoAMow HOuMBTYWqDM6LGi0RcxHmzBcP7mxeSL/1m3Modpjs56BG7QSZ/0yMQFfu+2D/7zlqWLEVP Xu7yVTqqB+lMjlhKue31LD7LkujkADr8YABfFbDaWJs9RBbHtPYTVhL9SUCofw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751003013; a=rsa-sha256; cv=none; b=uqMyPyu2NG8CRi1Urw1Ve5NmwkhnWYItNhMyvwSe1vV615g9XyZBP7ZoUv4X4byTWHFyfB BmO8SoVMGDDLFa5ATDVRiOXDx1vYQiOtmiKJKO/Zdvq0Wi+guISY7aJIG880Uh7DEU/Cmj IGxzPTV7KRsbckKSllLp4qLMLQXB8m33MLjC8xlg/ZRKV9WacN0Mal6lMRgS2nE9SvrqEQ WEXCrW9fQ+4hjSLXHBcufVb54pAOvKDRF/wBYyLrc/AWU2SCNrCZBSQPXU5GBklK+4M4yz vuPOrWxub37NwcZhN7FHUpTz1iSw3q2VgI1qdhuF36kI0jxe2/Awy+xGwyi4Tg== 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 4bT4Gr6HkVzc1p; Fri, 27 Jun 2025 05:43: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 55R5hWeg082849; Fri, 27 Jun 2025 05:43:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R5hWO4082846; Fri, 27 Jun 2025 05:43:32 GMT (envelope-from git) Date: Fri, 27 Jun 2025 05:43:32 GMT Message-Id: <202506270543.55R5hWO4082846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 39c0792b1550 - main - amd64 locore: fix typo in comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 39c0792b15505436235a0bfd24abee59d6d535d2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=39c0792b15505436235a0bfd24abee59d6d535d2 commit 39c0792b15505436235a0bfd24abee59d6d535d2 Author: Konstantin Belousov AuthorDate: 2025-06-25 03:25:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-27 04:22:59 +0000 amd64 locore: fix typo in comment Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51053 --- sys/amd64/amd64/locore.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index d39503adadf0..4d10879d9f30 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -112,7 +112,7 @@ ENTRY(btext) * - reset IDT back to long mode. */ ENTRY(la57_trampoline) - movq %rsp,lst(%rip) /* save registers into memeory */ + movq %rsp,lst(%rip) /* save registers into memory */ movq %rbx,lst+8(%rip) /* upper halves are not saved .. */ movq %rbp,lst+0x10(%rip) /* by 64->32->64 switch */ movq %cr4,%rax From nobody Fri Jun 27 05:43:33 2025 X-Original-To: dev-commits-src-main@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 4bT4Gt3y58z60Jth; Fri, 27 Jun 2025 05:43:34 +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 4bT4Gt14B6z3CMP; Fri, 27 Jun 2025 05:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003014; 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=CjLvYKg9hiC4bNrX4jyed0x3RckYzkCEDbx/bfYLqbE=; b=alIQDUh6Q1CczXUMu6+4psdTYgOA7kErhv2ibv6QN6s1D1dAFJb+yaQjKjdNNYGi71UhuA ZYpdyCtcoHwLuFOpIiZlpB2/Le4pzSnv2yZFxbMPdsyEGEWO9ExhbDpL9QvEUUJr7GwLH5 wcJeA5VmiLxoPOz0i/JAQOivHceeiWBt1MeNem5kNsrR7S/4YXvRF1xtIN6gVAvPQXe6LM /1Utccp5U3OBL5f66mNm/9Cy0yuXDFXEojj1eli1mv0uoUS6IFG3LKRupo0wr3V4BeS/rA cn1MRT+O/BtL4FS3I0+zihB06ROareWohukMSObsSVXGa70y6Objuj0GE6+47g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003014; 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=CjLvYKg9hiC4bNrX4jyed0x3RckYzkCEDbx/bfYLqbE=; b=PJPr/IsPewxDkuloARAM4TVfivDHqy6dy49JF0vVlOVdd5q8JD3uhlYx2UEsKuQe7NE5bK T8guGGHPG4eRrxl/EMU2hjJIiogi+aEhS1fskHIRy735TlY9HQFJT2tekNbvVRnQ5CX+JW RnpNQy19Lmd04H+E1gc6v9gvFGyYdXV3VSvQc+9h06ll0xN0vKDCjySuDIYHH1Yu9eqKlB +bO70Z94/wg/xm0W1Jnt6SU6U0mGR6U/Y5dvuLttkxrx9ZkFvqMtEt8Lb6zmF2NZ5Cok7+ 2xez1sSWjxUgVtRFAhNfRXENleQivIEVPXSWoflt1Ca9TWAK70CJvIz/uApnOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751003014; a=rsa-sha256; cv=none; b=i8vu7oZJNyWi2GPbjBIVh3eXHDluBf9Eha22JXTnbn+K8cMIfia1uPS+JvlQySc8J3QAZs DHlNcSaGzVbhZFnZ7IK8G4BiP/nGP6EEh/SDF5rKjdqwPMmW60yEamDIci9iCOm8VBqVpJ i3Ijo2Vu4BVaqFdSxvX/POCtGhK8lpEWu49UxjpTlymIMkKWWuI3SsxHvXRlaIfSUWPVYB dZdF+GTUd5ckxuPAI3pH8zeoEjJvGJBj4jc3SL22H1Mj7D/4wEXHqP/QGqDReBGN8wDFws bhiENp32l6mH+YKiA5aMjesmRIItoIIxgB7ALO52l0hDC8OyW1wKIy4Hy0ugVg== 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 4bT4Gt0P7LzcBf; Fri, 27 Jun 2025 05:43:34 +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 55R5hXS6082888; Fri, 27 Jun 2025 05:43:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R5hXYi082885; Fri, 27 Jun 2025 05:43:33 GMT (envelope-from git) Date: Fri, 27 Jun 2025 05:43:33 GMT Message-Id: <202506270543.55R5hXYi082885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2b09d177bd05 - main - amd64: express KV4ADDR() using KV5ADDR() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2b09d177bd058ae1d8e03e1d65cf82ab351ae011 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2b09d177bd058ae1d8e03e1d65cf82ab351ae011 commit 2b09d177bd058ae1d8e03e1d65cf82ab351ae011 Author: Konstantin Belousov AuthorDate: 2025-06-15 21:12:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-27 04:23:05 +0000 amd64: express KV4ADDR() using KV5ADDR() Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51053 --- sys/amd64/include/pmap.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index da32b3b087b7..7d3e91bcd9b9 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -110,12 +110,7 @@ * Pte related macros. This is complicated by having to deal with * the sign extension of the 48th bit. */ -#define KV4ADDR(l4, l3, l2, l1) ( \ - ((unsigned long)-1 << 47) | \ - ((unsigned long)(l4) << PML4SHIFT) | \ - ((unsigned long)(l3) << PDPSHIFT) | \ - ((unsigned long)(l2) << PDRSHIFT) | \ - ((unsigned long)(l1) << PAGE_SHIFT)) +#define KV4ADDR(l4, l3, l2, l1) KV5ADDR(-1, l4, l3, l2, l1) #define KV5ADDR(l5, l4, l3, l2, l1) ( \ ((unsigned long)-1 << 56) | \ ((unsigned long)(l5) << PML5SHIFT) | \ From nobody Fri Jun 27 05:43:35 2025 X-Original-To: dev-commits-src-main@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 4bT4Gv5V5nz60K8H; Fri, 27 Jun 2025 05:43:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT4Gv1p6Mz3CJy; Fri, 27 Jun 2025 05:43:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003015; 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=RkDKaM9H4lcAjncESKuZXx/7XTWF81wDO7H1Hx8rnpk=; b=rJ/fpZX4VpZHnOiEo1a1TA461VzC/LET3oep0q6OGxaTkKsCoT1DzJBatJpmxyGLtPlEuj 5AFbx+B53w4fYrVemZNPnsIzQDi+k9yXP4eno8Vcre2WGpdP7vkA4wwuLdj/v2cm3xA6Q8 QBg+6QM0fjYsLWD6CXb8Wnl2N3FHkyJgRtN/immkT/uhmJtlOvDPSlClRHVxFaZyVYFsuE 1vWSX8gxt9h1e/opNPNdMdpBUYBAuTHMO+IG/U7P+yyWPOYK8hrU5/mRkD9WgdvOukUdi8 1Vc9YZ9yHjajeVgOa3SvOOzc9NUCfDUNj+nYCxQNa5IUdouUkZp7G3hiuuhZNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003015; 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=RkDKaM9H4lcAjncESKuZXx/7XTWF81wDO7H1Hx8rnpk=; b=LDsZYYNHEdcoJ0qfnaB2oHQdH4PWMH3JDF4JM5Ja3Kp6Kt89xLDM2u+rHW5uCHYZkrYgvi fdBJWVqX4xfW6ALOKn9kNHjbsGd8Dufr1pbYmYTVXsxrytgSp7PAPY9cgu9czkCwgc9mEp qUx2OeT1jL4VQaD0bsHEprInM+UBREVO0ISg+D49Xqvd+WXdH9mwj7LXhPg0rNTyHl4mP+ IeYItDrQ4iMh5QxFmfG8AZ36pT+PmWXUcZkYAH+yHp63e/R8u/LBsXvf3oZnvAm0h9fPa8 wA9j6cl8GooM8R8VtbL0Pbz5OEsl4OjV0as/x0gJSYDxziX0SxasKCZ4lkAq1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751003015; a=rsa-sha256; cv=none; b=ua0qszsxS+cBTV7bCWpwOfH/4jDLNvxF0sql3n0xG0IClBX+pEVm2PL9i3FvXYM7/ipkVq 10eX4dcGm0jbRMZ5uXER4C1bAowdGCNYf9YbT1aEXJyNfrTqol4EjbpRWp9W/VPt2hMxO2 rqjGXawyR5I186X1oS0fhcOtEX8mSK944jc+Oi5BHlPCJW5gF/0GB2Dpr9JbFpemNQkDF/ QtGt8FYNG2iclgx8CqJ4ghR8nf6euCUR0f0mSw8ZyReneE6LSHfOEUGLJHykh9yJv36eWF MgR3SdbzeYdZQbmIrFY8PfCWPPrAD43nZ465Zm7BN8pQpYHdlnmF+Q/g1noQMg== 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 4bT4Gv1KNKzcKT; Fri, 27 Jun 2025 05:43: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 55R5hZ7C082923; Fri, 27 Jun 2025 05:43:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R5hZw8082920; Fri, 27 Jun 2025 05:43:35 GMT (envelope-from git) Date: Fri, 27 Jun 2025 05:43:35 GMT Message-Id: <202506270543.55R5hZw8082920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 96f6283cc7af - main - amd64: remove dmapbase, dmapend symbols List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 96f6283cc7af8342fd7965f3791d22352a028022 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=96f6283cc7af8342fd7965f3791d22352a028022 commit 96f6283cc7af8342fd7965f3791d22352a028022 Author: Konstantin Belousov AuthorDate: 2025-06-19 21:03:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-27 04:23:10 +0000 amd64: remove dmapbase, dmapend symbols Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51053 --- sys/amd64/amd64/locore.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 4d10879d9f30..29fbf38cea33 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -40,11 +40,9 @@ /* * Compiled KERNBASE location */ - .globl kernbase, kernload, dmapbase, dmapend + .globl kernbase, kernload .set kernbase,KERNBASE .set kernload,KERNLOAD - .set dmapbase,DMAP_MIN_ADDRESS - .set dmapend,DMAP_MAX_ADDRESS #define BOOTSTACK_SIZE (PAGE_SIZE * KSTACK_PAGES) From nobody Fri Jun 27 05:43:36 2025 X-Original-To: dev-commits-src-main@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 4bT4Gx2VWwz60KBM; Fri, 27 Jun 2025 05:43:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT4Gw5zJZz3CHS; Fri, 27 Jun 2025 05:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003016; 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=b8SMlZ5gVJw+tG2A1CNsJNnMwO93d1zLBARdk1gnbyQ=; b=Jy+KfieS0cXGKdsFU7Rl/fXRZmPR0I5G0VyT4M9cLqTPZxa3ETewBcsPx2dl7B6vS9CpOE sr/AzL3a9gaWYb40ZMiTnGu2DV3Y6gAf2tRWdHaPNt/96jNXTmCNASj1XyoEDq0HJcgj4P VAcQ6N9t3DTTqVmye8T7eOtfFnPJRKqbH+mVeK7fMnTLkHSYL976fpArLY17eAIj2sF/UM MIbwvZIQVbNY0d4DzmRWKdmvsdgt5fajVNmPwyGerLv6WHpBkY8/KckU4bGQQ8ecLr/5Nu LCcq+fjsdolvHCwG48fwtXzUuCMpw5XHTMCuHwqWi2BPrdv7yH7f1h8yU4e+uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003016; 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=b8SMlZ5gVJw+tG2A1CNsJNnMwO93d1zLBARdk1gnbyQ=; b=OsUZBdAO5EvS+7EiW3vS32h2KnpvUHugkshRYMvr1rcvaLTp/yPlPIDa53NAJquokKVIl7 LCrU2+wfZUrRpLgKaW1n+tZnkQzjSCZgayf8UwKuLHj9acJViOfdV25lUEwtW3FLT/jTl7 R+s4nnWMWtDVHS8WlYz7+gO5bqtotIhI99jNA9ZYL0KHgxZLnQ3YujI43c61ZjM299qYSn kk4J6QhLVuVA56steRZ7DAtBfiYlMkAgAIc9cYe97tcWKobezHkvZCkDFOQ8ZSOxjRjbyE OIit2TSbLhdAMVKcHdLDCrl8zJRFBPIE6qm8lMd42F68ufgVwleX001XuZ70dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751003016; a=rsa-sha256; cv=none; b=BqHvLRChawOSlA32I7Vb8SzHpSpyNhMsIM+DlV2801i2lgvQw04RDbiQEmZ8LYLMWv361r 9IDDKxgf1elIPRl/LDynykyS19FjmQby9aM+uqj1hyR3nlDVeV/mpt13prKMAckXOCjmM5 iW2pqXtGJhySjfhdZOKQNBlY9Rh42LQF2PLlxLCvCzXB8MbRYO8j9SpDyMd6Xuy/duCdxG uoH5NISwWw3+42YzCSqoBJwjAQzRT6kKjxRfvRa2vSRDNuSsxDeRWGHET4YrCLuH5QCIXa qVofwmPrUeD9YyhtJmvum6WEuzsiz0RomGF/1Wzxxl/HGO8D7Jgd1n9DaZQIyA== 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 4bT4Gw2FL2zbxH; Fri, 27 Jun 2025 05:43: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 55R5haZE082960; Fri, 27 Jun 2025 05:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R5ha3a082957; Fri, 27 Jun 2025 05:43:36 GMT (envelope-from git) Date: Fri, 27 Jun 2025 05:43:36 GMT Message-Id: <202506270543.55R5ha3a082957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3d1b33d92339 - main - amd64: eliminate asm symbols DMAP_MIN/MAX_ADDRESS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 3d1b33d9233936efbdd819c55d75569db1dd8690 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3d1b33d9233936efbdd819c55d75569db1dd8690 commit 3d1b33d9233936efbdd819c55d75569db1dd8690 Author: Konstantin Belousov AuthorDate: 2025-06-19 21:17:38 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-27 04:23:15 +0000 amd64: eliminate asm symbols DMAP_MIN/MAX_ADDRESS Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51053 --- sys/amd64/amd64/genassym.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c index ca266d181c7a..eb1b746f5893 100644 --- a/sys/amd64/amd64/genassym.c +++ b/sys/amd64/amd64/genassym.c @@ -110,8 +110,6 @@ ASSYM(val_PML4PML4I, PML4PML4I); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(KERNBASE, KERNBASE); ASSYM(KERNLOAD, KERNLOAD); -ASSYM(DMAP_MIN_ADDRESS, DMAP_MIN_ADDRESS); -ASSYM(DMAP_MAX_ADDRESS, DMAP_MAX_ADDRESS); ASSYM(KSTACK_PAGES, KSTACK_PAGES); ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15)); From nobody Fri Jun 27 05:43:37 2025 X-Original-To: dev-commits-src-main@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 4bT4Gy6mhyz60JwT; Fri, 27 Jun 2025 05:43: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 4bT4Gx6SZYz3CVb; Fri, 27 Jun 2025 05:43:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003017; 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=/4r0i+s1ls8SB+KQBKKV1fW9c1QzVmOavSLpyztwjyw=; b=ViuXY24FnjHqPDTOgthBv30iYaEE1CwUM6m4HwY07mtWnWlSNePVyWC2ybgHah1DA9QK6B Pjwxw1WBGJUG74o34MzT9kMJhF14wSI2x5iv5sDiSiIoqNcY/YKZabvdSB7vtY/hnNsnku WFsJY0VdCVIt+fhOabUFowQgXieQhqwZwyqpdMC4j4v4+DQ1kbdQEmu4AVCRvwf/zPyv53 CF7/yQmmyc4Fy58NbMn5X0UViW+oxrAXKj+/egyTpw0IqQwNx+VwL4nZBDiWyYEqKfKQeY 1sP+2F/l9iAGEO1bUO8OSyyQ6wHUtHUPi913Z3esxB4GxBL2yP0Hkd5TpakWaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003017; 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=/4r0i+s1ls8SB+KQBKKV1fW9c1QzVmOavSLpyztwjyw=; b=w8F9XBB0eDCsiLJY6Mnuepj3lmgLgI0jKVy5TGGLrSOsDbgwEzrk9dBooA/yPbI0Tegh4H QibJiNuQjnR6ZSDPI9rlCnWBWoqRN3OlOgTiNa0S378yG7JrqQg7A4afGirWKPTtBBLiL8 qZCQlhNS0euUjrMiNKranHG6pEREoYl1IczcbgZh5F6fm7JwjFYKf+ITokYuMLfqacpbIE gs7+e/m/hxwl+Kdvv1s6k2fWpUxrdf/OTdU+2grsOHLx4caPQF++ba0jBgu+izPwX67YPJ pfFp0P5nazKMaBnuGxGB+FCS4myzuo225EPKMmVKnYLZf3xp+MtUpwORE4FCog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751003017; a=rsa-sha256; cv=none; b=OnAtlJPAjLDCiwwr0IEYFvsep6x5xyOqQY3WsDxnYRnIsCrfeyE2vI2mQATA+VGpLA7bKy yRJQLYQN2ZsnubVX05djYNY7q93YkO0+ogpNTWFKFlqA985UmuA1uh/w1hwefL81I1Chu5 FC4AyI6pl5fBcurgrLYqNYxJQbDQKdefbG2KbOLYLaxfJkNA5PquXenDb1qoTMj11FEsfR t61MawWGKg8XUVWlfprB/xpzb7/vNF6b25UAre82W8J7gHrsMjltydY2G2D7cZOC5oOMtP GDu+KJkQGRwqEN2KDZlNecEYS0Wc0XN+SMJdnkkUSBwN7s4swr8nMD3BWc2HVA== 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 4bT4Gx329TzcQG; Fri, 27 Jun 2025 05:43: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 55R5hbhg082994; Fri, 27 Jun 2025 05:43:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R5hboW082991; Fri, 27 Jun 2025 05:43:37 GMT (envelope-from git) Date: Fri, 27 Jun 2025 05:43:37 GMT Message-Id: <202506270543.55R5hboW082991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4e1d69b9fbff - main - amd64: switch to la57 mode before creating kernel page tables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 4e1d69b9fbff280962e5ae5258624b60d5ab4618 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4e1d69b9fbff280962e5ae5258624b60d5ab4618 commit 4e1d69b9fbff280962e5ae5258624b60d5ab4618 Author: Konstantin Belousov AuthorDate: 2025-06-23 23:20:56 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-27 04:23:20 +0000 amd64: switch to la57 mode before creating kernel page tables Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51053 --- sys/amd64/amd64/locore.S | 2 + sys/amd64/amd64/pmap.c | 209 ++++++++++++++++------------------------------- 2 files changed, 73 insertions(+), 138 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 29fbf38cea33..2be555b25160 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -119,6 +119,8 @@ ENTRY(la57_trampoline) leaq la57_trampoline_end(%rip),%rsp /* priv stack */ movq %cr0,%rbp + leaq la57_trampoline_gdt(%rip),%rax + movq %rax,la57_trampoline_gdt_desc+2(%rip) lgdtq la57_trampoline_gdt_desc(%rip) pushq $(2<<3) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 6d1c2d70d8c0..18bf2b4c92a1 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1684,12 +1684,44 @@ bootaddr_rwx(vm_paddr_t pa) return (pg_nx); } +extern const char la57_trampoline[]; + +static void +pmap_bootstrap_la57(vm_paddr_t *firstaddr) +{ + void (*la57_tramp)(uint64_t pml5); + pml5_entry_t *pt; + + if ((cpu_stdext_feature2 & CPUID_STDEXT2_LA57) == 0) + return; + la57 = 1; + TUNABLE_INT_FETCH("vm.pmap.la57", &la57); + if (!la57) + return; + + KPML5phys = allocpages(firstaddr, 1); + KPML4phys = rcr3() & 0xfffff000; /* pml4 from loader must be < 4G */ + + pt = (pml5_entry_t *)KPML5phys; + pt[0] = KPML4phys | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; + pt[NPML4EPG - 1] = KPML4phys | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + + la57_tramp = (void (*)(uint64_t))((uintptr_t)la57_trampoline - + KERNSTART + amd64_loadaddr()); + printf("Calling la57 trampoline at %p, KPML5phys %#lx ...", + la57_tramp, KPML5phys); + la57_tramp(KPML5phys); + printf(" alive in la57 mode\n"); +} + static void create_pagetables(vm_paddr_t *firstaddr) { pd_entry_t *pd_p; pdp_entry_t *pdp_p; pml4_entry_t *p4_p; + pml5_entry_t *p5_p; uint64_t DMPDkernphys; vm_paddr_t pax; #ifdef KASAN @@ -1917,6 +1949,27 @@ create_pagetables(vm_paddr_t *firstaddr) } kernel_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); + + if (la57) { + /* XXXKIB bootstrap KPML5phys page is lost */ + KPML5phys = allocpages(firstaddr, 1); + for (i = 0, p5_p = (pml5_entry_t *)KPML5phys; i < NPML5EPG; + i++) { + if (i == PML5PML5I) { + /* + * Recursively map PML5 to itself in + * order to get PTmap and PDmap. + */ + p5_p[i] = KPML5phys | X86_PG_RW | X86_PG_A | + X86_PG_M | X86_PG_V | pg_nx; + } else if (i == pmap_pml5e_index(UPT_MAX_ADDRESS)) { + p5_p[i] = KPML4phys | X86_PG_RW | X86_PG_A | + X86_PG_M | X86_PG_V; + } else { + p5_p[i] = 0; + } + } + } TSEXIT(); } @@ -1950,6 +2003,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* * Create an initial set of page tables to run the kernel in. */ + pmap_bootstrap_la57(firstaddr); create_pagetables(firstaddr); pcpu0_phys = allocpages(firstaddr, 1); @@ -1979,7 +2033,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) cr4 = rcr4(); cr4 |= CR4_PGE; load_cr4(cr4); - load_cr3(KPML4phys); + load_cr3(la57 ? KPML5phys : KPML4phys); if (cpu_stdext_feature & CPUID_STDEXT_SMEP) cr4 |= CR4_SMEP; if (cpu_stdext_feature & CPUID_STDEXT_SMAP) @@ -1992,8 +2046,20 @@ pmap_bootstrap(vm_paddr_t *firstaddr) * later unmapped (using pmap_remove()) and freed. */ PMAP_LOCK_INIT(kernel_pmap); - kernel_pmap->pm_pmltop = kernel_pml4; - kernel_pmap->pm_cr3 = KPML4phys; + if (la57) { + vtoptem = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; + PTmap = (vm_offset_t)P5Tmap; + vtopdem = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; + PDmap = (vm_offset_t)P5Dmap; + kernel_pmap->pm_pmltop = (void *)PHYS_TO_DMAP(KPML5phys); + kernel_pmap->pm_cr3 = KPML5phys; + pmap_pt_page_count_adj(kernel_pmap, 1); /* top-level page */ + } else { + kernel_pmap->pm_pmltop = kernel_pml4; + kernel_pmap->pm_cr3 = KPML4phys; + } kernel_pmap->pm_ucr3 = PMAP_NO_CR3; TAILQ_INIT(&kernel_pmap->pm_pvchunk); kernel_pmap->pm_stats.resident_count = res; @@ -2048,6 +2114,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* * Re-initialize PCPU area for BSP after switching. * Make hardware use gdt and common_tss from the new PCPU. + * Also clears the usage of temporary gdt during switch to + * LA57 paging. */ STAILQ_INIT(&cpuhead); wrmsr(MSR_GSBASE, (uint64_t)&__pcpu[0]); @@ -2177,141 +2245,6 @@ pmap_page_alloc_below_4g(bool zeroed) 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT)); } -extern const char la57_trampoline[], la57_trampoline_gdt_desc[], - la57_trampoline_gdt[], la57_trampoline_end[]; - -static void -pmap_bootstrap_la57(void *arg __unused) -{ - char *v_code; - pml5_entry_t *v_pml5; - pml4_entry_t *v_pml4; - pdp_entry_t *v_pdp; - pd_entry_t *v_pd; - pt_entry_t *v_pt; - vm_page_t m_code, m_pml4, m_pdp, m_pd, m_pt, m_pml5; - void (*la57_tramp)(uint64_t pml5); - struct region_descriptor r_gdt; - - if ((cpu_stdext_feature2 & CPUID_STDEXT2_LA57) == 0) - return; - la57 = 1; - TUNABLE_INT_FETCH("vm.pmap.la57", &la57); - if (!la57) - return; - - r_gdt.rd_limit = NGDT * sizeof(struct user_segment_descriptor) - 1; - r_gdt.rd_base = (long)__pcpu[0].pc_gdt; - - m_code = pmap_page_alloc_below_4g(true); - v_code = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_code)); - m_pml5 = pmap_page_alloc_below_4g(true); - KPML5phys = VM_PAGE_TO_PHYS(m_pml5); - v_pml5 = (pml5_entry_t *)PHYS_TO_DMAP(KPML5phys); - m_pml4 = pmap_page_alloc_below_4g(true); - v_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pml4)); - m_pdp = pmap_page_alloc_below_4g(true); - v_pdp = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pdp)); - m_pd = pmap_page_alloc_below_4g(true); - v_pd = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pd)); - m_pt = pmap_page_alloc_below_4g(true); - v_pt = (pt_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pt)); - - /* - * Map m_code 1:1, it appears below 4G in KVA due to physical - * address being below 4G. Since kernel KVA is in upper half, - * the pml4e should be zero and free for temporary use. - */ - kernel_pmap->pm_pmltop[pmap_pml4e_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pdp) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pdp[pmap_pdpe_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pd) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pd[pmap_pde_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pt) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pt[pmap_pte_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_code) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - - /* - * Add pml5 entry at top of KVA pointing to existing pml4 table, - * entering all existing kernel mappings into level 5 table. - */ - v_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | - X86_PG_RW | X86_PG_A | X86_PG_M; - - /* - * Add pml5 entry for 1:1 trampoline mapping after LA57 is turned on. - */ - v_pml5[pmap_pml5e_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pml4) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pml4[pmap_pml4e_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pdp) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - - /* - * Copy and call the 48->57 trampoline, hope we return there, alive. - */ - bcopy(la57_trampoline, v_code, la57_trampoline_end - la57_trampoline); - *(u_long *)(v_code + 2 + (la57_trampoline_gdt_desc - la57_trampoline)) = - la57_trampoline_gdt - la57_trampoline + VM_PAGE_TO_PHYS(m_code); - la57_tramp = (void (*)(uint64_t))VM_PAGE_TO_PHYS(m_code); - pmap_invalidate_all(kernel_pmap); - if (bootverbose) { - printf("entering LA57 trampoline at %#lx\n", - (vm_offset_t)la57_tramp); - } - la57_tramp(KPML5phys); - - /* - * gdt was necessary reset, switch back to our gdt. - */ - lgdt(&r_gdt); - wrmsr(MSR_GSBASE, (uint64_t)&__pcpu[0]); - load_ds(_udatasel); - load_es(_udatasel); - load_fs(_ufssel); - ssdtosyssd(&gdt_segs[GPROC0_SEL], - (struct system_segment_descriptor *)&__pcpu[0].pc_gdt[GPROC0_SEL]); - ltr(GSEL(GPROC0_SEL, SEL_KPL)); - lidt(&r_idt); - - if (bootverbose) - printf("LA57 trampoline returned, CR4 %#lx\n", rcr4()); - - /* - * Now unmap the trampoline, and free the pages. - * Clear pml5 entry used for 1:1 trampoline mapping. - */ - pte_clear(&v_pml5[pmap_pml5e_index(VM_PAGE_TO_PHYS(m_code))]); - invlpg((vm_offset_t)v_code); - vm_page_free(m_code); - vm_page_free(m_pdp); - vm_page_free(m_pd); - vm_page_free(m_pt); - - /* - * Recursively map PML5 to itself in order to get PTmap and - * PDmap. - */ - v_pml5[PML5PML5I] = KPML5phys | X86_PG_RW | X86_PG_V | pg_nx; - - vtoptem = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + - NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; - PTmap = (vm_offset_t)P5Tmap; - vtopdem = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + - NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; - PDmap = (vm_offset_t)P5Dmap; - - kernel_pmap->pm_cr3 = KPML5phys; - kernel_pmap->pm_pmltop = v_pml5; - pmap_pt_page_count_adj(kernel_pmap, 1); -} -SYSINIT(la57, SI_SUB_KMEM, SI_ORDER_ANY, pmap_bootstrap_la57, NULL); - /* * Initialize a vm_page's machine-dependent fields. */ From nobody Fri Jun 27 05:43:38 2025 X-Original-To: dev-commits-src-main@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 4bT4Gz6SKNz60Jp4; Fri, 27 Jun 2025 05:43: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 4bT4Gy4G3Bz3CJ0; Fri, 27 Jun 2025 05:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003018; 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=l7zNKtUSw7pD4q7UTL+FfQ7RmrNriuuBDybfxNfZwtY=; b=pf0uJixndNIKG7krIa8ZgCCRrUzN9gMznngmMWhDWLFOl7mi7+uSr2Pa4lBw06PaoSmKK4 P03ppqukOSDYUW0a/nUgoJnRsjb3eEQPBQZQBxz2UBBwm0Qoc38Rlqx902AZ2D0koU4RzX M+TuPD1jX6wxJQRZPH2cCqKiO6F1fpmaOFDpoPVsqPx0xFYAHUvSEYGfLwTlSN/hqrFjg5 ijvYIlPGvPZ01ZPzPIm4k640T8409UUDeGKJbjwHvfRl1CBd1bOeGojqWwK/dqq1H/3l32 d3ZfBWGGRcvnjszKLhjO0r5EBQav+3Z8tDXb0A3dGd9UZeJxKS+N9wTGbYgOdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751003018; 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=l7zNKtUSw7pD4q7UTL+FfQ7RmrNriuuBDybfxNfZwtY=; b=pAm6rkGoS64nAl5TwGXcBBB4VUVmJou4wsAxuWheri5AqSLyBlfV0ZBbQGExsUnU1UdIkU 5sXbXoMBq6maTXn8S/CtdNjhZw3kfpHYLsTWcpG8oK1miXZUdQEDZIXkHQR/LRzbHpqdKH itRk/X156OfH8yJpRstl9utEEg9AxDdxAvBvpogbsMR0pr1wpP25b6nB86TUQRVfMjobhL AUS2UqKb4U9JRw4FmGvDmWiagWkqGh9gMa/Qfh7SfFWAy1VMe2qOW/vGvEHQ/alwXmZUKg 9hazz3avSlhRlkdffS5EUgUC9m8pnTCm96KYLI04K+CSzT/oGAVz6eTZKnAWNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751003018; a=rsa-sha256; cv=none; b=Psm6HnbioHYs7hvKbXHvnlr9K5CfSS06T8v6JB4dz0Urgg2EXTAHVE+LK2dSF2U3m2u+wj goyPowgIEkT84SuhEbCB/bo5NLbFE/JnzBp68xSVoree3KabibgNe3Cb4qqtPTd/forXMq rnCmjJmGdwoYKStFJdRMVqdi9PzpPNHzcdOoTV9GfSgwTUgu5ylVkGTdmTF28mLlYeO7LF eB+hWxwbxZBWa7TcLePvjmKcTgh4UZg+aDMRK3bKg7el0StJdBCQNcaLeiENLcyH0LaSPG menphw6xgCZH1hGOsvUOKDUbxWn+GcnodFIcGhoQHwBd1NhuiW0QjgDDD5hEAw== 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 4bT4Gy3gszzc1q; Fri, 27 Jun 2025 05:43: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 55R5hceR083028; Fri, 27 Jun 2025 05:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R5hcbr083025; Fri, 27 Jun 2025 05:43:38 GMT (envelope-from git) Date: Fri, 27 Jun 2025 05:43:38 GMT Message-Id: <202506270543.55R5hcbr083025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 289a7a790cf7 - main - amd64 ddb 'show pte': print both pte VA in recursive map and pte content List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 289a7a790cf74c679123a543ae95ac1be7659fad Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=289a7a790cf74c679123a543ae95ac1be7659fad commit 289a7a790cf74c679123a543ae95ac1be7659fad Author: Konstantin Belousov AuthorDate: 2025-06-27 04:06:39 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-27 04:23:22 +0000 amd64 ddb 'show pte': print both pte VA in recursive map and pte content Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 18bf2b4c92a1..2ab8c3b17e22 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -12160,7 +12160,7 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) if (pmap_is_la57(pmap)) { pml5 = pmap_pml5e(pmap, va); - db_printf(" pml5e 0x%016lx", *pml5); + db_printf(" pml5e@0x%016lx 0x%016lx", (uint64_t)pml5, *pml5); if ((*pml5 & PG_V) == 0) { db_printf("\n"); return; @@ -12169,25 +12169,25 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) } else { pml4 = pmap_pml4e(pmap, va); } - db_printf(" pml4e 0x%016lx", *pml4); + db_printf(" pml4e@0x%016lx 0x%016lx", (uint64_t)pml4, *pml4); if ((*pml4 & PG_V) == 0) { db_printf("\n"); return; } pdp = pmap_pml4e_to_pdpe(pml4, va); - db_printf(" pdpe 0x%016lx", *pdp); + db_printf(" pdpe@0x%016lx 0x%016lx", (uint64_t)pdp, *pdp); if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { db_printf("\n"); return; } pde = pmap_pdpe_to_pde(pdp, va); - db_printf(" pde 0x%016lx", *pde); + db_printf(" pde@0x%016lx 0x%016lx", (uint64_t)pde, *pde); if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { db_printf("\n"); return; } pte = pmap_pde_to_pte(pde, va); - db_printf(" pte 0x%016lx\n", *pte); + db_printf(" pte@0x%016lx 0x%016lx\n", (uint64_t)pte, *pte); } DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) From nobody Fri Jun 27 07:21:45 2025 X-Original-To: dev-commits-src-main@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 4bT6S974F5z60PbG; Fri, 27 Jun 2025 07:21: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 4bT6S95qFFz3qSY; Fri, 27 Jun 2025 07:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008905; 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=v4HgFRbkyuxEu/xmvNJldhmXjsiZgekT5zCOmpIdnDM=; b=ASDlszF09SOtAAoT9gLvbkwWURQrp8fWF78w0namucjWN8qE7xwm3LmY4ECO9yQSBM5tVR OOcU4tlyCi4F5VgL5sYm+6Vy74vNkCx+Lu0bZ6zHX7RTt/mNj+IfPkPhiGq2xF5wpZd+1f 18Zrz6Hu/6cpNlBUv217GYCSlUicovfBN/VWDo6LvXVFtpngcqEshvvV6Mq2r9lGF3MEB/ JFx9fnSnQ5drEQ28d092g2zAf23WPHLBDe0QbchtJch4qxPU2IOtJuEGhNI983FRwP8VqZ pmP9tll7T9fSDmAdh7ivP+kGF66mIgxICZrsQJD3u0xf0/C0sVE0+KLLqRJE0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008905; 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=v4HgFRbkyuxEu/xmvNJldhmXjsiZgekT5zCOmpIdnDM=; b=UM2An0eNVYJFVaR/vN7XA816D1abQhZiK/DPlRg99s40wfhyVPESeQLsmuSd517qPPUrAP 8AEyXwov/bWesC4FWOtvwHzavrRM2hpXKo/gTOPMVt5dYD6XuI7B3AVnnXDM4ZfPmNHb+u hT+quHe81x1SDLRWmcvZ2TqoqIUJhmcdCuz22gllziOuq5o8A9RS1bXoasx1dxvVXzfYWc Sy3fKJvWP+EEqLFDAK/M/JIV4u4D6LCm2riqcBrRTkYP6pymTtEd9vcz627fYlVOzCndmK wMwC4MNe5RczYItM+YqEJHxVWDz+vNiu11xBtB/HtvVLQpcSQWbUETIAN7NVBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751008905; a=rsa-sha256; cv=none; b=hJYnQPPiDEOU0llXW0fOsFmf++6UGjvkTt7RwgSgC2ZnEIqxnzHFpbRz+j/12LJ78jA4Cm trw2K/1yDQZNuG1HDqRYsTrHZPB3iZUBWmeQkbfDB1hc4JZAHDHOwM0MY9jGIlPDHsymU0 P1zNJartzU04+Hso4oQZ9EU4fxWLTiwhGUds49KAu9m4kAI5Lxj19GUkmr2Mei0feE1rWG /UmfhRMNkkDm7EnVJPrL7Igq5hgPNAiziYlYK/0phcyNWh0XhNiBXosLTLCDIh7npZoZvD ifdhnh4PpM+9A1fWrCsDckfki+T9d1drox99TFvQD761O3r/i0FaguA4jTFg+w== 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 4bT6S95QTpzfr3; Fri, 27 Jun 2025 07:21: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 55R7LjcK067158; Fri, 27 Jun 2025 07:21:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7LjMX067155; Fri, 27 Jun 2025 07:21:45 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:21:45 GMT Message-Id: <202506270721.55R7LjMX067155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 99f436aec00e - main - rk3328_codec: add trivial set_sysclk method implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 99f436aec00ece1f56132a1fee972fc797bb1b42 Auto-Submitted: auto-generated The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=99f436aec00ece1f56132a1fee972fc797bb1b42 commit 99f436aec00ece1f56132a1fee972fc797bb1b42 Author: Andriy Gapon AuthorDate: 2025-06-23 21:07:48 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:12:08 +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. MFC after: 1 week --- 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 480a1087ea2d..22e3cde9093e 100644 --- a/sys/arm64/rockchip/rk3328_codec.c +++ b/sys/arm64/rockchip/rk3328_codec.c @@ -568,6 +568,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), @@ -577,6 +583,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 Fri Jun 27 07:21:46 2025 X-Original-To: dev-commits-src-main@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 4bT6SC29fvz60PLX; Fri, 27 Jun 2025 07:21: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 4bT6SB6L4Yz3qVp; Fri, 27 Jun 2025 07:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008906; 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=bKfW0WURftCAWhkbahGuD2EhFHjhNAB1KhO/zXeObw8=; b=h+15KHHmKWPIBWkCB6bNphw5DSLZsA5aXMDk3ycM2lKabAe/vQmcgX7of2kt+4JgTRMJzm //S4d67achZnoAO8jwFYMwomTZnC/7owXZKhpnqmprzXWE+WiO1tmxpMLadGrbb9jEyZSx kPe1H8EA/Lp7v3xxTm5MbHiYc/VS2owgJTniXYCndAbKTQ1WJTC8F6Y9qrP6rprVmX1r+o bw4TZycYxavvVpwywVDEVTWel/csXpcHiAKqONn1V/YwIZa/569gpSkCgVs2xJNggcCk4x Gf+2UxIBgU7cWNXBCvwhp/UgoPU/Kr2X1f16ZXafVda3UCdqIA4t0vCpOwvD6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008906; 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=bKfW0WURftCAWhkbahGuD2EhFHjhNAB1KhO/zXeObw8=; b=tWWnU5gnKKotYU7QLLw7b3gK1kQOtyQSAzIfBiW9PIpAon2YPc8bZRSsInz0911W7Ij9ts lftmWjjpIPTNdUVVjUhB7sIpKMR6mZ1HDNAsZ8ST8P68qUFW4PpKlWLe3jn+UQl4oMADsd xHRgK3eAlW6B1JMjrH1YrP/sYm10cZ+4crNKTwnkZFS7cynt0PWxxlj3Ew4Dyh56o+CE+u ROZG0HT1qnX1zk1BKCN0ZYqOcXeD1z5cICjipAteVyfD2mGh1YNz6Oe8vFhD+FfGlgfmOc u8dtrUVZ3KyXs4IC5hk9cNKM6Ps5DgvL2Tk9JDfRrAB+G+PLQL6anAp7dz1Gpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751008906; a=rsa-sha256; cv=none; b=dQDTUZwja3vZUcNKtNwpyrBQnYphu7ZSJmXyTdNRpNzsT+MzfoPIwWIJKVsadkJ4uYPNyn A9MtXrVZel+3A3qJpOKzctNHfNJpQtnosjTekD12/tgJT7mCbpEGmTMD1ozD1Th/Nos0t7 ue6RSudFhZcoU1Sl7MaKr3d7b/kv/IvP6zOtnw7FdBLty8f02Kh9hHEEoKphaIt+bupuav bQhd4q4GSiUzxVD7tjojXNWM9FQHQhKf24ca2T676qjOQZL/DNV0TpbKp1y8yhKOTz4fgs 7y+UfSdJGhfUC8RUhDVbXonInN5Qr7BRBHc1vPgfrQARcx8QG61Xi2fE/OHZ/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 4bT6SB5wDPzfr4; Fri, 27 Jun 2025 07:21: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 55R7LksT067191; Fri, 27 Jun 2025 07:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7Lkx3067188; Fri, 27 Jun 2025 07:21:46 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:21:46 GMT Message-Id: <202506270721.55R7Lkx3067188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 10db2ad8614a - main - cam_fill_mmcio: initialize cmd.error sub-field List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 10db2ad8614adc544292856c693503ca8e9c9fd9 Auto-Submitted: auto-generated The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=10db2ad8614adc544292856c693503ca8e9c9fd9 commit 10db2ad8614adc544292856c693503ca8e9c9fd9 Author: Andriy Gapon AuthorDate: 2025-06-23 21:30:23 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:12:40 +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 MFC after: 2 weeks --- 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 da98b98ba7d1..1f110686a658 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -1524,6 +1524,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 Fri Jun 27 07:21:47 2025 X-Original-To: dev-commits-src-main@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 4bT6SD3m92z60Pxm; Fri, 27 Jun 2025 07:21: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 4bT6SD0QJcz3qbN; Fri, 27 Jun 2025 07:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008908; 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=Kbatqj5B9t30RvRWHIqnvpooSWCRskK5xoUhv8Yis6E=; b=VstRjEKhZpqbuxvs26QNuZgOEHtkSDFFh9BWEFg4k19L3gm4AzPRtfgQOruoxXQOs4im9X PUF58JgZ32Khktuip0UI8CqOJ7A6/SsPift8S42gGZMSNEJwEw0EH7flEGYJDUPsPeyfv4 nZPMG0/MBCeSmQbQg4iQlyxuYUYj+dNsgOFKOIfVxIsrhEKPJtFKK9KZlETCUHH4xwl64t k5L2kweFxauZrKNyBhjbpWJhwRMPFnoMxs68OlqzX60u695Nn9ZFb+yupTi4IRDSmNgTLZ MhIuPN6VVaX2ALjvXwvHKg9H48oMky9BR4GKHB5sOqd0isr8f2ucsKXU4Y1Fqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008908; 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=Kbatqj5B9t30RvRWHIqnvpooSWCRskK5xoUhv8Yis6E=; b=F4lYyX040A0bbNuGKLpUbhRAMSAdS0ErYRF1k1NCht6mBaPW+4rZ/SNst/Ggc21zCogyFG mf0XfuawR6io9ZghJtlHu84vsOmy8B+5Rd6EPProkgQ2VPtPnhqNJ3Bx2cmTq0gdwLGtun cUruHJrXvWO/8dArwFkeWAZldDTbZqITRThq0527NNMejWwzJhro3CidsBW71XasXI4tSD Jq3GbvgBF6GrS+iIoK2DdpmqGnRGhtHc2FK3EcQOJ5ncuilTDcAhTmFHajntyGn44izbex k5RlEsMOffOSea2SsjU4y++WKlytQty6/rFcGM3hrOoeDsmjRuPv6XnaK6mVtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751008908; a=rsa-sha256; cv=none; b=bMWTwC99nagR18Pm1RzrbexvCOEtPd3C2PGdZ0knZ+xIzEEb7KgnbykmjaQr1vB9Xb0hHB lcN50cQxjRdZApm0Bg/j5zpF/9t6Vx3WGWwtM82YiMVFUYodYT8r17k7aJVPsBUAYTq4OC 7C+HhvZZZhcRRKmT77+5NW+GV8iowIT4aWUJbfcCry6NhFaNqfPSz2LSFAbqg/qTY2dOCB uhY6xyBTi2Cng7h2KditaD8gI/yBtU+C3AXSaCtBAsBUedFVuoA7sMzyKiVJERC+NYDpbh f1ZjoXE5iJU2pPb+MoAmR4uzQQ2Tv9kR2yyotGj5bj8JGzxiSd5LH+XwBfFOew== 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 4bT6SC6sTyzfsT; Fri, 27 Jun 2025 07:21: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 55R7Ll1E067224; Fri, 27 Jun 2025 07:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7LlB1067221; Fri, 27 Jun 2025 07:21:47 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:21:47 GMT Message-Id: <202506270721.55R7LlB1067221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: ad8d33679999 - main - mmc_xpt: use strlcpy instead of strncpy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ad8d33679999c0e7f6fd2b77d2e414102bd365ec Auto-Submitted: auto-generated The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ad8d33679999c0e7f6fd2b77d2e414102bd365ec commit ad8d33679999c0e7f6fd2b77d2e414102bd365ec Author: Andriy Gapon AuthorDate: 2025-06-23 21:31:04 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:13:34 +0000 mmc_xpt: use strlcpy instead of strncpy A better practice in general. MFC after: 1 week --- 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 138f96eaaa49..4fce03004994 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -1213,9 +1213,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 Fri Jun 27 07:21:48 2025 X-Original-To: dev-commits-src-main@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 4bT6SF4h4jz60PgC; Fri, 27 Jun 2025 07:21: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 4bT6SF15nNz3qSh; Fri, 27 Jun 2025 07:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008909; 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=MxMbftQkOxzXocunklIzPPz5gwekGxmq/2pfh0uOXUc=; b=JUzRYPvWHMTZ+xK2b6ZOO8cmQF7RTonh0MFWg35kL8cE+uzH/zLYPMI+jHdz8YAgN9Hv4i mCNJRs9TzSP0p7zbiqZZWT/NugJW6THqegbKIo+OWmLToM2UXQWh0+lVu2bcbv4cOG/pzN cJJHh+ej2rBxNEU5F/J/jynFqdajotauMAUSPeLSgdpZuYtRJu6Eaik289SNFX+F/5COZ6 nUlDAGiTygm518AJiXALAt5PcVgG2afKnGGBaL4MSkpo/u2apedlQ5q/IbTQrNb6LF+7Hf OdDTcDdawi+ZHjMY4F7Ht6NbxqBA30VTgAfU5ZgaWtOxrVIC31/vMkLU3QEQ1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751008909; 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=MxMbftQkOxzXocunklIzPPz5gwekGxmq/2pfh0uOXUc=; b=yHwEAJYTJAfrdQIeloe+GPn2QifAvjRGndFPhTPxvYbqukhy03X2tZMZXc5oo+Jz3vWURi +9KDOIwgSW1/nVR9O6gr9j0okgFQfIinZanAf6oTn+InPGt2WhqCtWGWgoZtbQ30OLg2+2 nFqmRp/rUn8iCb4thDMun1bWXdH0Q6TiBLOqoSHLMnqFAaGbVEpqCpd8R3a/UMPqz2Z4+4 JzHwflbdA/urtk0vKqvap5+l8r8aF2E0Q3MllNN7XGT/tqbdjmCKpDXclQ2vGV9ELgwXXb fndajnuR9Tp+ohQfvupGAYnkQVyxfwUecNfYvR1+V2KnzUg9O0FIMNsrz+3iUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751008909; a=rsa-sha256; cv=none; b=yeKWUAj9iz03aHhCY3NkU9nhLPc29U+H7zUT0JU1LZEtAQDEklUE1E8Lm99lN8jx3C7bbV nuMIipUmcUSe8s/JIFKLlRGGy+LxjrI5KDcdoGUV4W5pnQ8i1fRGllGBpryoPmwIjO/B+d Hujrpw3vXHCt0a2jgusren5lzmmp0YLKEnOEZEUUlP/e0I/r3ql7JLeb55TVbVMvm1yrx0 IFMVoz5v1raygJjoYsCBV2GkRWnskELrB+Z5aQT6A5FQcg76awafcmtO8VRrVSVIa01mjq yTlPMPglf36mHGItf3nqoHlHkJXzaXWWohNU3QHx7+tMK52BSstC/lb23YlkjQ== 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 4bT6SF0HFtzfPs; Fri, 27 Jun 2025 07:21: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 55R7LmJc067257; Fri, 27 Jun 2025 07:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7LmtP067254; Fri, 27 Jun 2025 07:21:48 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:21:48 GMT Message-Id: <202506270721.55R7LmtP067254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 5aedb8b1d4a6 - main - mmc_da: fix garbage in disk->d_attachment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5aedb8b1d4a6c099eaa0a65f8fcbdcc4aba8f75b Auto-Submitted: auto-generated The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=5aedb8b1d4a6c099eaa0a65f8fcbdcc4aba8f75b commit 5aedb8b1d4a6c099eaa0a65f8fcbdcc4aba8f75b Author: Andriy Gapon AuthorDate: 2025-06-23 21:43:35 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:19:15 +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. MFC after: 2 weeks --- 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 fc29a1925c66..1c455e1951d7 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1572,9 +1572,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 104916a41782..ab6daffb0995 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -109,7 +109,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 Fri Jun 27 11:13:11 2025 X-Original-To: dev-commits-src-main@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 4bTCbC4vB2z5yf0k; Fri, 27 Jun 2025 11:13:11 +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 4bTCbC3cTLz4LXn; Fri, 27 Jun 2025 11:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751022791; 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=J3mjlr8wNr8y3Bh70iNmRIFiu8EG+OkB6k9EMLOzBQo=; b=flwLMiLgjDSuUzeO1m7odBjTCF3kCK8dbel8NVbb912yAFY69kN/UZmXYt7cV5HE2HVHUw Cz0fbw8sMltazUBKRshfgTI0EwUAOIhnKBJZb4JCtOtjEl2QJiTg8OB9w6isedOUST9bLY 9TSOfo2tYUoZTEdU+xcKaSe6Z/kRMp3ocroet1JedXHyvneqcUexXEyiM09/hUZrVzqsIe 8ln3NwIoVTRAuqrQgMEfTiKXfge/kXGfmWDgasdqCYIrYhS7aqgHDKlfD+wyGYsPgQVtCZ rHFmfCZEkGbGcMbHaGt4HIYYIUI5ENMdX7v+9tj3aSvaTBhxqwq6/dCusoUbrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751022791; 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=J3mjlr8wNr8y3Bh70iNmRIFiu8EG+OkB6k9EMLOzBQo=; b=x2InJgTev/xf0F3ueZn/vRevUVPIjAZ6calEh95+v58b11CkDRLoZl8U7aPpaSDXbxRTgw gIvbArPavAl12HdnFXmRZvh+KAm9al0TZRcClVqd3tSe0zQocU3l+gLXwbqiuOrCEVOHO/ OOuoRW1rZefvSuVcwv/w9auhofxXOa9ykYCxgqzsN0ssnp3o/nWkeKb7snGlXZ13FFrck2 1FOv3L7Uaa1U/RVt+n2Huc358YAQZ3hN1ZLqNuL4yRgkzv/OeI+Wy/3j6Lckg/jDWZFfKY P3FqVS5rWD9OoFktNx5t9EffNtOKpwSYJ18IkvT9lBbvfO7qnI+YnU265bH5Ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751022791; a=rsa-sha256; cv=none; b=Dxn0EU71cE+gOMZfMK34ClB4GdY8z8ir6xkL7ijPF2RJADzrzSURBcYD5eyQ96aXnVUdYy OvgbBin5wzo5aGwvMzjU+8sGiQ9X0viaK6lF5BIjzWCIXWnECFTgYh3lnZiQ1RI79cLpW0 GgEKr0zLt1wXT/KrfHGRybeNpJqPasgv2ohdskb8viV/FRII/6SdwFWfGNlLVQWWcLOx8n /mJJ48ueWCxuyaaECNBxSQUsmFuRuzGzCSEacQLP7y5KU5s799BE639PFKmdaNosq1YSr0 IZxEcDHPOUOyqRR8rqKNTFyHwjw7toIQ7AVEqgvZi+DnTAEiHfla7xyHgutSeQ== 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 4bTCbC2hqMzmLX; Fri, 27 Jun 2025 11:13:11 +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 55RBDBf5098903; Fri, 27 Jun 2025 11:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RBDBoF098901; Fri, 27 Jun 2025 11:13:11 GMT (envelope-from git) Date: Fri, 27 Jun 2025 11:13:11 GMT Message-Id: <202506271113.55RBDBoF098901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 32f793e22976 - main - pf tests: test handling of ICMP echo requests with the same ID List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32f793e2297619e1cb835c0938396ab6f6d0a6b3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=32f793e2297619e1cb835c0938396ab6f6d0a6b3 commit 32f793e2297619e1cb835c0938396ab6f6d0a6b3 Author: Kristof Provost AuthorDate: 2025-06-27 08:18:18 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 11:12:50 +0000 pf tests: test handling of ICMP echo requests with the same ID We previously broke this, so add a test to prevent regressions. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/icmp.py | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/tests/sys/netpfil/pf/icmp.py b/tests/sys/netpfil/pf/icmp.py index 232c56a23dbf..83096886691e 100644 --- a/tests/sys/netpfil/pf/icmp.py +++ b/tests/sys/netpfil/pf/icmp.py @@ -175,3 +175,80 @@ class TestICMP(VnetTestTemplate): self.check_icmp_echo(sp, 128) self.check_icmp_echo(sp, 1464) self.check_icmp_echo(sp, 1468) + +class TestICMP_NAT(VnetTestTemplate): + REQUIRED_MODULES = [ "pf" ] + TOPOLOGY = { + "vnet1": {"ifaces": ["if1"]}, + "vnet2": {"ifaces": ["if1", "if2"]}, + "vnet3": {"ifaces": ["if2"]}, + "if1": {"prefixes4": [("192.0.2.2/24", "192.0.2.1/24")]}, + "if2": {"prefixes4": [("198.51.100.1/24", "198.51.100.2/24")]}, + } + + def vnet2_handler(self, vnet): + ifname = vnet.iface_alias_map["if1"].name + if2name = vnet.iface_alias_map["if2"].name + + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.pf_rules([ + "set reassemble yes", + "set state-policy if-bound", + "nat on %s inet from 192.0.2.0/24 to any -> (%s)" % (if2name, if2name), + "block", + "pass inet proto icmp icmp-type echoreq", + ]) + + ToolsHelper.print_output("/sbin/sysctl net.inet.ip.forwarding=1") + ToolsHelper.print_output("/sbin/pfctl -x loud") + + def vnet3_handler(self, vnet): + ifname = vnet.iface_alias_map["if2"].name + ToolsHelper.print_output("/sbin/ifconfig %s inet alias 198.51.100.3/24" % ifname) + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_id_conflict(self): + """ + Test ICMP echo requests with the same ID from different clients. + Windows does this, and it can confuse pf. + """ + ifname = self.vnet.iface_alias_map["if1"].name + ToolsHelper.print_output("/sbin/route add default 192.0.2.1") + ToolsHelper.print_output("/sbin/ifconfig %s inet alias 192.0.2.3/24" % ifname) + + ToolsHelper.print_output("/sbin/ping -c 1 192.0.2.1") + ToolsHelper.print_output("/sbin/ping -c 1 198.51.100.1") + ToolsHelper.print_output("/sbin/ping -c 1 198.51.100.2") + ToolsHelper.print_output("/sbin/ping -c 1 198.51.100.3") + + # Import in the correct vnet, so at to not confuse Scapy + import scapy.all as sp + + # Address one + packet = sp.IP(src="192.0.2.2", dst="198.51.100.2", flags="DF") \ + / sp.ICMP(type='echo-request', id=42) \ + / sp.raw(bytes.fromhex('f0') * 16) + + p = sp.sr1(packet, timeout=3) + p.show() + ip = p.getlayer(sp.IP) + icmp = p.getlayer(sp.ICMP) + assert ip + assert icmp + assert ip.dst == "192.0.2.2" + assert icmp.id == 42 + + # Address one + packet = sp.IP(src="192.0.2.3", dst="198.51.100.2", flags="DF") \ + / sp.ICMP(type='echo-request', id=42) \ + / sp.raw(bytes.fromhex('f0') * 16) + + p = sp.sr1(packet, timeout=3) + p.show() + ip = p.getlayer(sp.IP) + icmp = p.getlayer(sp.ICMP) + assert ip + assert icmp + assert ip.dst == "192.0.2.3" + assert icmp.id == 42 From nobody Fri Jun 27 11:13:10 2025 X-Original-To: dev-commits-src-main@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 4bTCbC0Zfnz5ydxy; Fri, 27 Jun 2025 11:13:11 +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 4bTCbB2BNDz4LVf; Fri, 27 Jun 2025 11:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751022790; 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=zmF5QJg0VKq77yEQjSS5EQQnqY5SxZIAc3ZUxLasOkI=; b=GoQ7O9GEWQX1TcGCWPDin0hcFtD3NyXWEk5++9qbXn8Kh5SrEkX+3rCbQH8+6kXd5Y5dwO bK/Q5O4Miihvc8uUzBlGF9eZG++EXoPBqGV6YFJ4lKu1rtTuH5n+JldK+zje0B8fDU/M1n wyeXi6LV/ZzIk+1x9KnQGrGwNK5Rf8EyTelloNfnPyzL6kZ6y/dbBwRT4ijjQE0PsyJhr6 kASM0JmJGmvDPWgicvTdcrlWUVaILDFWqW7S7iuiLg+LKIOi5rlH/z5sITiBe/zImn7ZIQ EPmJsIEy8d5ZWypPzdtNjSccZAVK0gtqTTznp87OMKpmwjFgZsJ0EZY9Uha2ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751022790; 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=zmF5QJg0VKq77yEQjSS5EQQnqY5SxZIAc3ZUxLasOkI=; b=CdJxWQmz6k3jwS7JMMj5ssAViuLhMjOjTX1rJLGsM68wolBY8obmQnnVJ48TrUxLHio49X H30BI8WCD9zwsGcdXOnRHvTdcoSpT0lErdLXayChOjplD2GHT0tqPZduurYIofoWw5ciHH +5s81ahwNIY+YbiL0p+QnENBDhr/61xE/vQuvrVmF9cjyWw+8JYVqT/Ql/ul0NhlhFOZ7o Sfdv7nsEnoezbX7DVL4+wXAJMjsUPtpwiPBCKkEo3eQgnLBL1VPXXceauelMKnNfOK0TIN ytVuYAxjiBuV1zKlQxSDwe0rVKnxqv7qisqjZFuGFaE5O5zEPoxSnrZdAohLaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751022790; a=rsa-sha256; cv=none; b=FJNX1bDtC5QrgauRnTAbQlnSrGi+NTBmdPmKYlWIIen4/zwDHgEP6Ucn8sK4kYP+Ei0Xjx WK1p6EdjlxC751ZTNqqur6aSwUFaJML7W+FtTn5FlDpEk2FBWVtacbuVjvYE9Mwri7RMfs 4oAEQtnTx6LOvczuB4+Qidkok1HxIkmRSNefb4OpBs2G+MhetFjBsRltqcdK2pfD7b8r+e wxrcp3XTUac423yHZSZeQBoXWXmtC7N0rz/TXuGz/BBtORGuhlosWDS3U5X4ZuqH7An35T zsI+26V4k1vQPPZZ+Kuk3CqyYC09n+OIr8r/mQZY93DOWlA4MYaqqfoezH486Q== 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 4bTCbB1nhDzmXY; Fri, 27 Jun 2025 11:13:10 +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 55RBDANt098871; Fri, 27 Jun 2025 11:13:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RBDARW098868; Fri, 27 Jun 2025 11:13:10 GMT (envelope-from git) Date: Fri, 27 Jun 2025 11:13:10 GMT Message-Id: <202506271113.55RBDARW098868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e7abf8829d8d - main - pf: fix ICMP ECHO handling of ID conflicts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7abf8829d8d496a8753946f67fb2016851b4f7c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e7abf8829d8d496a8753946f67fb2016851b4f7c commit e7abf8829d8d496a8753946f67fb2016851b4f7c Author: Damir Bikmuhametov AuthorDate: 2025-06-26 17:26:14 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 11:12:44 +0000 pf: fix ICMP ECHO handling of ID conflicts After applying FreeBSD-SA-24:05.pf, a problem with ICMP ECHO passing through PF NAT was raised: two or more Windows workstations cannot ping the same destination address at the same time. More precisely, only one workstation pings normally, while the pings of the others are rejected by the packet filter. The thing is that Windows always uses the same ICMP ID (1). Therefore, the state is created only for the workstation that started pinging earlier. In the pf_get_sport() function, we compare *nport with the ICMP_ECHO constant, while icmptype (virtual_type actually) is passed in the pd->ndport parameter. MFC after: 2 weeks Reviewed by: kp --- sys/netpfil/pf/pf_lb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 4a40ef6b845a..5e7865e4fac5 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -348,7 +348,7 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, goto failed; if (pd->proto == IPPROTO_ICMP) { - if (*nport == htons(ICMP_ECHO)) { + if (pd->ndport == htons(ICMP_ECHO)) { low = 1; high = 65535; } else @@ -356,7 +356,7 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, } #ifdef INET6 if (pd->proto == IPPROTO_ICMPV6) { - if (*nport == htons(ICMP6_ECHO_REQUEST)) { + if (pd->ndport == htons(ICMP6_ECHO_REQUEST)) { low = 1; high = 65535; } else From nobody Fri Jun 27 11:29:57 2025 X-Original-To: dev-commits-src-main@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 4bTCyZ0YCfz5yg9W; Fri, 27 Jun 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 4bTCyY6PwTz3CJX; Fri, 27 Jun 2025 11:29:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751023797; 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=73D99b4Zj4BeCa1Mmv4tU0A/5iGzaIGdkiG6ctEWr/8=; b=Sk8DCskdx7S2pmueQSeqjMM2DSzkwWAvTvrwfASGYZ4gAY9K2MRG+FLUgd1B99Q1+IZs63 zrayFkpoiR82XcrL6JDiDYeTyckBmfElNWMTYgQYXuijGVmdLzT80p6KP2IxwEpqo97RHV XvXztBs5cH2Ov1ZB7Nguesp3qWbL58F91zWbhF8u/VVmqWVlHOsQ1szOVlFxymAyG5/OmU rGtgOJijbiySkqPisjH/EF0T6CmcUDTPfJb5cfUvqup0ArMffe/yEKoHZIddpwauENluzu 0Vw9/61NxdvEVwSqfbauncnqubIiiDoavOEoPubT9nEkf4DUSstnHOy45InMYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751023797; 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=73D99b4Zj4BeCa1Mmv4tU0A/5iGzaIGdkiG6ctEWr/8=; b=eErOyiKuuwkBPyhOoEF+kbWTHkkum2BAAtC1YzZ2cnf+4iBe2LP2cYfQ0d0Q45TKLS7vlw /KSNjSmU8IFKksTNnz/eJtaALrKdN14xvV0U/zEnXMDLfmGR+HkEHw576oR06gpgTYayrY Dv3e3pBkIj4wafaDTaZpW4DSZ9+m50PJa4dMabjDzEdvod1PS1awwTsMswJ6sAmqAyQ4lX C0O4tklvrCvj90I+gKHPSdThvIzDr7O27gwkAzWsUYPfTHJK3tzqQXg+eZvbpOTad8/kZt W+g11P8U/NYPnouYfCy1zpLIf5A1b0XiN5aTKlxxVB9b4f7QNCxEx6pOpCH36w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751023797; a=rsa-sha256; cv=none; b=O7NiI1bsPjOLO4D8w6zr+7+VXtf4OPCStUCQS59rz1OMwItZCr/1HSk4DAf8lrtM/iSTrh xnuTdrflgW1NcHRN+Fuet+OfHL3LsYeuYy06NvcqlglmWwEOkl2d8hPVluTI7YrPplb10+ yKc32oTMMRMLd11m2Eb5R/OjOGkhwmvTVGNPzpjo/9r5ffARoMLx5d17NSOflAJ/hto6kO jvsY/cmyKUO+9mrvMcuSXjpTQdt8vVzs7L6fQ06kKmzwQW8tScmFLsr8/D1lQOITcIIu23 NlVv2xSN0W7F26UiPyHgVJhQVxQ08UddhmNQ7aFzoKeN+y3VCwWzsBRRKKyF/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 4bTCyY5hJvzmKM; Fri, 27 Jun 2025 11:29: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 55RBTvoO020193; Fri, 27 Jun 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 55RBTveW020190; Fri, 27 Jun 2025 11:29:57 GMT (envelope-from git) Date: Fri, 27 Jun 2025 11:29:57 GMT Message-Id: <202506271129.55RBTveW020190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d0c873399707 - main - mac_do(4): fix typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0c8733997079a54828ad2222517427d9447dbaf Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d0c8733997079a54828ad2222517427d9447dbaf commit d0c8733997079a54828ad2222517427d9447dbaf Author: Baptiste Daroussin AuthorDate: 2025-06-27 11:29:34 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-27 11:29:34 +0000 mac_do(4): fix typo Reported by: des --- share/man/man4/mac_do.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4 index fb165dfe5a1a..4dcb54c89673 100644 --- a/share/man/man4/mac_do.4 +++ b/share/man/man4/mac_do.4 @@ -44,7 +44,7 @@ It supports per-jail configuration. .Pp Currently, the .Nm -policy module only produces effects to processes spwaned from the +policy module only produces effects to processes spawned from the .Pa /usr/bin/mdo executable, please see .Xr mdo 1 From nobody Fri Jun 27 13:09:08 2025 X-Original-To: dev-commits-src-main@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 4bTG901kClz5ymB0; Fri, 27 Jun 2025 13:09: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 4bTG901F1Qz3nr8; Fri, 27 Jun 2025 13:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751029748; 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=oDL+MS1upPtxvx9Odgwku9t5I1azV1zlhQ94vKBJuCk=; b=XFudFxTsYpEPjr9SLmWczfMwq8l9IdsZL5Y7osYrEkQPeTgi91+DoP8qFtWlHsVQJfVfI1 YqCO97Fknm1vo0iHeymxKdph+T+1ue3u5BgORa0Q285GPz2OwxNTsvYcoHB4mgum5+A+N+ JmgpsE2bx4LF3ejlmza2ZCrKIx0fGMLe5YHpIXnKQ8/qY6WrXj6SWKjMgPvHN6SpixVbnc cREreWYvAKNY3J0bExwo0snmQhN9gilxresmePAfqOLZACZJjDvLAFojsF8ViDmDzxvmx6 iY2UPotrmMSLX+dNhhL5bfkL3IIXGo2iQqk6htz0V6qkqpuFa34CwU2J2EH2IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751029748; 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=oDL+MS1upPtxvx9Odgwku9t5I1azV1zlhQ94vKBJuCk=; b=emvpfnIDtQTjV6ApwsGfWLqMd7+t9yJaJxry50JTRhlJ4r+FzV1CFOCmmm9bDFYrWKCrdB Oaz5jYRUQrgP576QIhEqaL2VJ8oo6OVKs5ys9GENq+ZF9u+bCvSO9AHqeCNykiOlmY5H6c 9By4fWAtCGw7q4XWlKm+CEWwPrL8dcJGnCAQ+8jeDTuVWU8SykVDsoQxH3UKcyQSf/OPzR EoLH5BLSh9S4bimDzCKYL7/Ijnd4ozJzp9fxYsPBnC8b0kpd9zyeV2dqWE70aQejpyftxn znmIhJE3zv2DMZGMSj7Y17aTHrNBjqjcYZexU4OmYN8lnjC8oMY2CBbvmrXmSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751029748; a=rsa-sha256; cv=none; b=pyWkOu62LyrHFWsbUIrtd5sXObVbZT6lKYOzt0zV3eRCGk3ACOLqQDA65aXZvIQTbuBX5K TborSVKW/3ZG0XL1aQVkkT3VQmyVx8jN2LL40RGLrqZ9Q//4zJTzCE7CAL3/Dupt+9Db+s HiQ24bb4b2x5gtVrMHp7tWXDJ6tEGQ1XZa9P1+oIg0YMNF6BgFIuKmx1o+oaLFY/cI9sIY xxxAkSPnKsqgOzir5QzCxgL6sUGZQbY6QqnEwgLJNJjfCk9noD7+iCYal7JWqbkzxnzfBJ gAG4rl0RCBlzVfZQelp8V7ezN24zVhuQN3uhYkNCY1Xqn4zGfzVDV6+FV4LJFg== 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 4bTG900mrJzpqg; Fri, 27 Jun 2025 13:09:08 +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 55RD98Ra006580; Fri, 27 Jun 2025 13:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RD98Oq006577; Fri, 27 Jun 2025 13:09:08 GMT (envelope-from git) Date: Fri, 27 Jun 2025 13:09:08 GMT Message-Id: <202506271309.55RD98Oq006577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 78d91e21bf72 - main - Makefile.inc1: Set SOURCE_DATE_EPOCH in more pkg targets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 78d91e21bf72a1b706c4152c4f8e2fed3fcbdac3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=78d91e21bf72a1b706c4152c4f8e2fed3fcbdac3 commit 78d91e21bf72a1b706c4152c4f8e2fed3fcbdac3 Author: Mark Johnston AuthorDate: 2025-06-27 13:06:58 +0000 Commit: Mark Johnston CommitDate: 2025-06-27 13:06:58 +0000 Makefile.inc1: Set SOURCE_DATE_EPOCH in more pkg targets Otherwise timestamps in the underlying tar files are not reproducible. I believe this was a simple omission, other package targets specify the timestamp this way. Reviewed by: bapt MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51066 --- Makefile.inc1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index ea498a8afae4..e7b1a2d7acb9 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2113,7 +2113,9 @@ create-packages-source: _pkgbootstrap _repodir .PHONY ${_+_}@cd ${.CURDIR}; \ ${MAKE} -f Makefile.inc1 \ DESTDIR=${SSTAGEDIR} \ - PKG_VERSION=${PKG_VERSION} create-source-packages + PKG_VERSION=${PKG_VERSION} \ + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ + create-source-packages create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source @@ -2322,7 +2324,10 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne sign-packages: .PHONY ${_+_}@cd ${.CURDIR}; \ - ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} real-sign-packages + ${MAKE} -f Makefile.inc1 \ + PKG_VERSION=${PKG_VERSION} \ + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ + real-sign-packages real-sign-packages: _pkgbootstrap .PHONY printf "version = 2;\n" > ${WSTAGEDIR}/meta From nobody Fri Jun 27 13:15:50 2025 X-Original-To: dev-commits-src-main@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 4bTGJl34Kbz5ymC1; Fri, 27 Jun 2025 13:15: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 4bTGJl274tz3rZd; Fri, 27 Jun 2025 13:15:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751030151; 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=Gol+9nwz2nA4Rf+sgnUYRrIUa8WIHjQVORULthMk6d0=; b=hjXVcvRwta8mLMlkHDs5u/p7717B22KWX0ZQdaFxPJdFb5rqmoytd2HIYquXywNDxIXOHg SZLwM/rXwnVBRq+iUDKw+2+u5o3WQXWowFYmfCNmVPahiUbW3fB7qnaqRV8H/uVHVXPLmL ryo8JzefTuK0XuGPywIzp6Ztj/acGuWrIOb9Z7u24gO9xYsRGfIt96QTbJ26r97InWUdKh njm8v6XxB+gXPOJWwxKNflYXE8IY6O7ADvftlU2/waIES5gErzEhmkB0UGj69xJtohmx8q rJD6HtQFtvqSrpg3BGG6CLafABdmZYJps7C1gS81enRgAcLU7RHtiAGP+d3oMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751030151; 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=Gol+9nwz2nA4Rf+sgnUYRrIUa8WIHjQVORULthMk6d0=; b=XvdO3WlkABs2ZiIxDBSEzarZL6GleR7qWSTfsU11luu2gATRtWTMw4wWUXDmWB4UBnwHcO IWyz7ChvCQrV7RL6C/jpi5N9fz2ntY9CyZmginTsYJ8LK2sWXnaMZeWLpKVcT9rbABoS3L q9MLKwjwvyarv9hnDcVKdeQ3QtldN8KRKg4ZLUI1Pw4pV3tJozjXrotj3XuUvf8PZcwkUZ Cy6/OIhERVXmbqpCGTadzEl5sqIukfJA1E4I8pELZuOV1nKC9Brus7eFQlU1g2BUf9VGFj IL/5HAwEegNp9bc6M1eV2fpm7HwUrQ5pGgVjM0KZhmkZOVHNIxvfkYtIF5hN5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751030151; a=rsa-sha256; cv=none; b=XxA3MH9F+oaWv2apFw2jEdQgF00WMu40lIcJKHLcWs4Xvj26/Z3fqm5SBr4/icmbK+C7Wm FDdi0MraVvsuThIpCmhXEPSY6x5DSfkQ1QCDRoBG9LZ7gywOI50noqKC6gdVK2gUTg4vsH z9LbG0Pqj9EjtmCG0QWFBOHnWt9dnf76u2VnfXGgH+tPlpNCDJ+9q+jGC8427jZq6czzA2 3xMNImP//VvdG7gfvgbzKrbgFXaB5a8x52lszFA0ZJOuziBvRC3yLGU7IB8LJRkJk5EkYf OEb8TIH34JsI/2D+HWqL5k6MZ2HUdSIKdbBtYIRAJmKi3U3AYQmNUMR4p5oOdQ== 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 4bTGJl1FkSzqK3; Fri, 27 Jun 2025 13:15: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 55RDFour024252; Fri, 27 Jun 2025 13:15:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RDFoFl024249; Fri, 27 Jun 2025 13:15:50 GMT (envelope-from git) Date: Fri, 27 Jun 2025 13:15:50 GMT Message-Id: <202506271315.55RDFoFl024249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 78546fb0e321 - main - vm_pageout: Make the OOM killer less aggressive List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 78546fb0e3215c07f970c1bcbf15bba2f5852c76 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=78546fb0e3215c07f970c1bcbf15bba2f5852c76 commit 78546fb0e3215c07f970c1bcbf15bba2f5852c76 Author: Mark Johnston AuthorDate: 2025-06-27 13:09:39 +0000 Commit: Mark Johnston CommitDate: 2025-06-27 13:14:22 +0000 vm_pageout: Make the OOM killer less aggressive A problem can arise if we enter a shortfall of clean, inactive pages. The PID controller will attempt to overshoot the reclamation target because repeated scans of the inactive queue are just moving pages to the laundry queue, so inactive queue scans fail to address an instantaneous page shortage. The laundry thread will launder pages and move them back to the head of the inactive queue to be reclaimed, but this does not happen immediately, so the integral term of the PID controller grows and the page daemon tries to reclaim pages in excess of the setpoint. However, the laundry thread will only launder enough pages to meet the shortfall: vm_laundry_target(), which is the same as the setpoint. Oonce the shortfall is addressed by the laundry thread, no more clean pages will appear in the inactive queue, but the page daemon may keep scanning dirty pages due to this overshooting. This can result in a spurious OOM kill. Thus, reset the sequence counter if we observe that there is no instantaneous free page shortage. Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D51015 --- sys/vm/vm_pageout.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 6d3139e58c5a..b500eb8156bc 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1784,8 +1784,14 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, { int old_vote; + /* + * Do not trigger an OOM kill if the page daemon is able to make + * progress, or if there is no instantaneous shortage. The latter case + * can happen if the PID controller is still reacting to an acute + * shortage, and the inactive queue is full of dirty pages. + */ if (starting_page_shortage <= 0 || starting_page_shortage != - page_shortage) + page_shortage || !vm_paging_needed(vmd, vmd->vmd_free_count)) vmd->vmd_oom_seq = 0; else vmd->vmd_oom_seq++; From nobody Fri Jun 27 14:17:18 2025 X-Original-To: dev-commits-src-main@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 4bTHgl4v1vz5yr1b; Fri, 27 Jun 2025 14:17:23 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTHgl37sgz3D92; Fri, 27 Jun 2025 14:17:23 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751033843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=shlFAa+hvPEt+cXOONdVx4TeeOn5fDh/PAcEt0y253E=; b=fEUBE2lROx50dYm+Y9hA+prMqPRpIfe8oe9dnaUq7lr0AdYceTUQhe2oiMcPDIei3nfS45 2KzNHkezJpvqQSTvfqHZKLMEYRXTps0cMzUaWRno66v0WRPs6+mYAAXxdjsloMnfiHXhh8 BcQGj5h8plIAgnxc8WBSf+3sM/T+3/Rm2ob5/EgYAuLW9sQnkNQsBy/QjzEqF9gNxSoCqU 7nrTeLidU+KW1JOs+CkQrZoiNDXoiT2HkvCkT0vB/8U6tToThH3+fLYBPh9S+QNgGJ9Kw/ VFn4MZ9DsAhu5TcRU2Fsz2mT3KOl+w0oXqJvMpleJmSYXL+xCbrh/4KtQLwBLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751033843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=shlFAa+hvPEt+cXOONdVx4TeeOn5fDh/PAcEt0y253E=; b=o4z3zvS1KbDv19d8qiV3VmZg442gyKw501csf7xCDjBaZ4DXaHvAj3IMWcbZ9qU3a+bBLU j22MabubaWYtZBq8ox8TEwvenW6cFtMcWw2FbfTJCLUmwCI00t3Le05Pr48i7X1MM36iTJ eQsPJ1fAlkQn9XR5kAwQfQAkgKgMzt50gHS3E8oeFS4Glow6HBUsHgJwUxKvkTjVvYkZsO GV8h/RwaNFZAJMLI2VscbRJj72rXbn0xrfUMv6myHthskfdnYP2pkzNZ7p0zLmPPHT87ET 7+Zn7s+SAFfXrblrKDiRLasZ6EBgjTg88vuGaBhrpFcMuvuUgUN6JR8SjG0Xqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751033843; a=rsa-sha256; cv=none; b=Jg3/aiiBBUjJAURIq9b125jlydQmsAjhWoXo3lCSzRmbWjv55NJjc/9sQw9tPmaYcl0Qpw iJOl1f8WqT+zlOcj3/siGtX9GP7JIQTez8xkkSzapt0TonrK4PdJtwA1vWPCL6H4hqzAXT 9kZ7djNJ+H+H/3+doIJMie5Bfyowe8ypVwbGeKc8HChctpqxo+/CGTz/lCKkA01xO2BSka O0aQCP0nhOu/4cQdSwC1VbCvJW/U2p5SrA/gJyypiP6HpT6r28/G5fQxsH9MpvdvefkWsN PvjkRx8Z8KOov2YoYenQw5thDsJwOMx/Wv6wxBAsaLO30BhqDdjBODwClBuWrw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bTHgl153Gz5MM; Fri, 27 Jun 2025 14:17:23 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id ECF03798A; Fri, 27 Jun 2025 16:17:20 +0200 (CEST) From: Kristof Provost To: Michael Tuexen Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 5fb4b091e835 - main - tcp: allow specifying a MSL for local communications Date: Fri, 27 Jun 2025 16:17:18 +0200 X-Mailer: MailMate (2.0r6255) Message-ID: <8EF254D7-A8D7-4031-BAC0-FDC36DE22754@FreeBSD.org> In-Reply-To: <202506261703.55QH3fqK060218@gitrepo.freebsd.org> References: <202506261703.55QH3fqK060218@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 26 Jun 2025, at 19:03, Michael Tuexen wrote: > The branch main has been updated by tuexen: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5fb4b091e8352602894fc2b7= 284c8e1e3d8a8729 > > commit 5fb4b091e8352602894fc2b7284c8e1e3d8a8729 > Author: Michael Tuexen > AuthorDate: 2025-06-26 16:59:36 +0000 > Commit: Michael Tuexen > CommitDate: 2025-06-26 16:59:36 +0000 > > tcp: allow specifying a MSL for local communications > > When setting the sysctl-variable net.inet.tcp.nolocaltimewait to 1,= > which is the default, a TCP endpoint does not enter the TIME-WAIT s= tate, > when the communication is local. This can result in sending > RST-segments without any error situation. By setting the > sysctl-variable net.inet.tcp.nolocaltimewait to 0, this does not > occur, and the behavior is compliant with the TCP specification. > But there is no reason to stay in the TIME-WAIT state for two times= > the value of the sysctl-variable net.inet.tcp.msl, if the > communication is local. Therefore provide a separate sysctl-variabl= e > net.inet.tcp.msl_local, which controls how long an TCP end-point > stays in the TIME-WAIT state, if the communication is local. > The default value is 10 ms. > > Reviewed by: glebius, Peter Lei > Sponsored by: Netflix, Inc. > Differential Revision: https://reviews.freebsd.org/D50637 > --- > share/man/man4/tcp.4 | 7 +++++++ > sys/netinet/tcp_subr.c | 1 + > sys/netinet/tcp_timer.c | 6 ++++++ > sys/netinet/tcp_timer.h | 3 +++ > sys/netinet/tcp_timewait.c | 26 ++++++++++++++++++++++++-- > 5 files changed, 41 insertions(+), 2 deletions(-) > > diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 > index 536bd904d796..f19b6cb2ae14 100644 > --- a/share/man/man4/tcp.4 > +++ b/share/man/man4/tcp.4 > @@ -780,6 +780,13 @@ Minimum TCP Maximum Segment Size; used to prevent = a denial of service attack > from an unreasonably low MSS. > .It Va msl > The Maximum Segment Lifetime, in milliseconds, for a packet. > +.It Va msl_local > +The Maximum Segment Lifetime, in milliseconds, for a packet when both = endpoints > +are local. > +.Va msl_local > +is only used if > +.Va nolocaltimewait > +is zero. > .It Va mssdflt > The default value used for the TCP Maximum Segment Size > .Pq Dq MSS > diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c > index 6b1907305fb9..bbcd20b715ba 100644 > --- a/sys/netinet/tcp_subr.c > +++ b/sys/netinet/tcp_subr.c > @@ -1455,6 +1455,7 @@ tcp_vnet_init(void *arg __unused) > VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); > > V_tcp_msl =3D TCPTV_MSL; > + V_tcp_msl_local =3D TCPTV_MSL_LOCAL; > arc4rand(&V_ts_offset_secret, sizeof(V_ts_offset_secret), 0); > } > VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, > diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c > index a9046e5725d5..32ce3001929c 100644 > --- a/sys/netinet/tcp_timer.c > +++ b/sys/netinet/tcp_timer.c > @@ -109,6 +109,12 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, > &VNET_NAME(tcp_msl), 0, sysctl_msec_to_ticks, "I", > "Maximum segment lifetime"); > > +VNET_DEFINE(int, tcp_msl_local); > +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl_local, > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET, > + &VNET_NAME(tcp_msl_local), 0, sysctl_msec_to_ticks, "I", > + "Maximum segment lifetime for local communication"); > + > int tcp_rexmit_initial; > SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, CTLTYPE_INT | CTL= FLAG_RW, > &tcp_rexmit_initial, 0, sysctl_msec_to_ticks, "I", > diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h > index 394207bcb89b..34a0f1375463 100644 > --- a/sys/netinet/tcp_timer.h > +++ b/sys/netinet/tcp_timer.h > @@ -74,6 +74,7 @@ > * Time constants. > */ > #define TCPTV_MSL MSEC_2_TICKS(30000) /* max seg lifetime (hah!) */ > +#define TCPTV_MSL_LOCAL MSEC_2_TICKS(10) /* max seg lifetime for local= comm */ > #define TCPTV_SRTTBASE 0 /* base roundtrip time; > if 0, no idea yet */ > #define TCPTV_RTOBASE MSEC_2_TICKS(1000) /* assumed RTO if no info */ > @@ -183,6 +184,8 @@ VNET_DECLARE(int, tcp_v6pmtud_blackhole_mss); > #define V_tcp_v6pmtud_blackhole_mss VNET(tcp_v6pmtud_blackhole_mss) > VNET_DECLARE(int, tcp_msl); > #define V_tcp_msl VNET(tcp_msl) > +VNET_DECLARE(int, tcp_msl_local); > +#define V_tcp_msl_local VNET(tcp_msl_local) > > #endif /* _KERNEL */ > > diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c > index 2b4ae462af89..9f2943725ef0 100644 > --- a/sys/netinet/tcp_timewait.c > +++ b/sys/netinet/tcp_timewait.c > @@ -93,6 +93,28 @@ SYSCTL_BOOL(_net_inet_tcp, OID_AUTO, nolocaltimewait= , > CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nolocaltimewait), true, > "Do not create TCP TIME_WAIT state for local connections"); > > +static u_int > +tcp_msl(struct tcpcb *tp) > +{ > + struct inpcb *inp =3D tptoinpcb(tp); > +#ifdef INET6 > + bool isipv6 =3D inp->inp_inc.inc_flags & INC_ISIPV6; > +#endif > + > + if ( > +#ifdef INET6 > + isipv6 ? in6_localip(&inp->in6p_faddr) : > +#endif > +#ifdef INET > + in_localip(inp->inp_faddr)) > +#else > + false) > +#endif > + return (V_tcp_msl_local); > + else > + return (V_tcp_msl); > +} > + This seems to make !VIMAGE builds unhappy, probably because V_tcp_msl bec= omes tcp_msl then, and a function and a variable with the same name confu= ses the poor compiler. LINT-NOVIMAGE: --- tcp_timewait.o --- /usr/src/sys/netinet/tcp_timewait.c:97:1: error: redefinition of 'tcp_ms= l' as different kind of symbol 97 | tcp_msl(struct tcpcb *tp) | ^ /usr/src/sys/netinet/tcp_timer.h:185:19: note: previous definition is he= re 185 | VNET_DECLARE(int, tcp_msl); | ^ /usr/src/sys/netinet/tcp_timewait.c:165:45: error: called object type 'i= nt' is not a function or function pointer 165 | tcp_timer_activate(tp, TT_2MSL, 2 * tcp_msl(tp)); | ~~~~~~~^ /usr/src/sys/netinet/tcp_timewait.c:308:47: error: called object type 'i= nt' is not a function or function pointer 308 | tcp_timer_activate(tp, TT_2MSL, 2 * tcp_= msl(tp)); | ~~~~= ~~~^ 3 errors generated. =E2=80=94 Kristof From nobody Fri Jun 27 14:36:31 2025 X-Original-To: dev-commits-src-main@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 4bTJ5q4Tbjz5ysHh; Fri, 27 Jun 2025 14:36: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 4bTJ5q2VmJz3L1g; Fri, 27 Jun 2025 14:36:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751034991; 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=G0tHVMuYGLdkzELiesTjpI43NF3+Rhh+hIcFIqltqa0=; b=N2nseaXQQngzvq3bRNLhMk4089d79ssk5vGhLUbQkOjC5ohBz1NR/rsHX0YWv3TJgdCn0C QvGejiBAQ6aK7GWlLraBNjqkYfkq4b20P+YsuEs0eI0FXaJkypzR7NrpJgznQxtzysvWim 3vGJUeFQkDzVjO817qsqP/XEDgL26eBbJHcEApBwggkLQ7CRwEy1h2RLHsBjOj/1omZY4e ttb3E2YgjPUob2IQlQZqCjmq6X59OltJmYNENA7YWLZkWYJutvzM36evkYUhCOEsVgpkP9 ecCPA7wbNb+V28M7UYRNdQk1DmafoaOidsqKuN7IgZSRtdajwxJNjNd+KvXZEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751034991; 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=G0tHVMuYGLdkzELiesTjpI43NF3+Rhh+hIcFIqltqa0=; b=bVEiO8oSIMJGXGMXFe61jyvT227oShmdA1vHe5UAnb3aE8LsPKZhtIidoCoxsWKlsPE7od IMBHBorYN8cJapqIrT6Mj76k8aC7s/ZHKyEXcZQx6frkaoUeZJbcWo3mYPOPG61szb5iG0 DCI+vtKFSOoLDfjVvhcd9SDboZWd+Mj7gRvdSV8XQBobjdyNdQoII76uoXFSGQN5OYGH3x iHIe0O+cXG65NFUzFM8H9BW3lCcGj3rksjSJsrQQ6aybRaYzBuJSflfc2w6rY3hX8Q8j7H +5na9Vu0ruSi6flt3+XFdeuk5Hd3TzX2ZNfJFi9DlXMFXyWwPqTSDsRDXv7kkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751034991; a=rsa-sha256; cv=none; b=pKj/V20yYDyl/Q7AY65EXtYpWvcGLnef0ym2XUH3jS6ijTj1Fdhg+TWvcI8h82F42B7HmQ iKyaw/abRzxqcDZAwQFGbTIOTFCKlXe466IZ7kQP/cZz6pgMf+xI/kvWYBlf/iAg+bLYUn ht9/mltqwCK0D4am7U2PGnXGJ41KpC6ABxXPAzBDxcGYiyFtEVLcjLw8Fi/jd06tUKOq2s jW3B+GxvM5rYKyFjlzOZ0hOJkL1WJKlO+UH4JAF5PGKHIyTz1UKRCWDWdCx/PUdBRTc9l0 NWVLv0/NixtMIA2E9r48AHmzzQqUjq+++6DkOtSTzFIDYAJWiaGvFdL41S8Mdg== 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 4bTJ5q23JXzrj5; Fri, 27 Jun 2025 14:36: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 55REaVjb073854; Fri, 27 Jun 2025 14:36:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55REaVww073851; Fri, 27 Jun 2025 14:36:31 GMT (envelope-from git) Date: Fri, 27 Jun 2025 14:36:31 GMT Message-Id: <202506271436.55REaVww073851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 7ad574b3e3a9 - main - nuageinit: fix log name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ad574b3e3a948113c3c16cbe90e27888dc7a423 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7ad574b3e3a948113c3c16cbe90e27888dc7a423 commit 7ad574b3e3a948113c3c16cbe90e27888dc7a423 Author: Sebastien Baylocq AuthorDate: 2025-06-27 14:27:49 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-27 14:35:55 +0000 nuageinit: fix log name --- libexec/rc/rc.d/nuageinit_user_data_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/nuageinit_user_data_script b/libexec/rc/rc.d/nuageinit_user_data_script index cea7fb5c6aa0..decb6bf1483e 100755 --- a/libexec/rc/rc.d/nuageinit_user_data_script +++ b/libexec/rc/rc.d/nuageinit_user_data_script @@ -20,7 +20,7 @@ execute_user_data_script() /var/cache/nuageinit/runcmds 2>&1 | tee -a /var/log/nuageinit.log fi test -x /var/cache/nuageinit/user_data || return - echo "Executing user_data script" | tee -a /var/log/nuageinnit.log + echo "Executing user_data script" | tee -a /var/log/nuageinit.log /var/cache/nuageinit/user_data 2>&1 | tee -a /var/log/nuageinit.log } From nobody Fri Jun 27 15:16:08 2025 X-Original-To: dev-commits-src-main@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 4bTJzX6Gfsz5yvJX; Fri, 27 Jun 2025 15:16: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 4bTJzX5hfNz3YSw; Fri, 27 Jun 2025 15:16:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037368; 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=TxAYQ3S3KbpRquzX05gGZArwNs2V4SVY5pz7M9Wq5IE=; b=hNJdGPbd9/r7N3d1RTigDgWeCyixMrjzr+DXg8SFi7k6MoSmQCz+nqj4MrOpOH2Wp+ezDJ 1RH3iflejcZIzyRlYtboBCJ3EoHrcPe0gCbKv37kamzxzDzmXSQlaKHByvd+p+IDMvf9gV R+E781O6EkZhDfdl331TgbnRB+eqlmvMs8o0K8Tovz4bQHtutH6Xe+Sem5JV9P48Y5pKHr ATOuF1+S+rQRMzX17zCyDHLp41nGUGLXWOrZCvRKe+4YJTZjwYLG+IfsTzBeW3mSdTWSOj 88zmfQ1E7Bt0/Vxn+RLo0uJxWhG2pX5INzixQhxC3Fs+/K6fYD8TH34JfR5ToQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037368; 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=TxAYQ3S3KbpRquzX05gGZArwNs2V4SVY5pz7M9Wq5IE=; b=fbCb91nChnB7XNu87OFWZW3VNkB8kmKOxXEVE7VySYQxWkkNXoll+yW1MAmgQGbTPCg0ZU 42Lh9O4llPMxAOFnu6aqzg6s/zOsXTkx8oyjXPEr/Ur7UbqA37/XtklBLGfiqPUnJwyNId ClJBDyniciQL3q8p2/ryYiU7JKkFniQA5Z68LjA+8OOm2LO4r8upRfjQqOoBujKb2H3huS bqhL33BRIbzDx37nrzBUBn9Tmi4fI05xo9T7IXwfs/sw/gmXue/9azQRI3ybNT8Cv9B1je TCm1bLVoOfPWYdNOlpeoBlipnFqeDNc6AqJlj3r5nDsSnx/1++Y8MeCTHSz4Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037368; a=rsa-sha256; cv=none; b=rtGJacRLQ2zI+70eho6vmmbdrd2ltp7AgwaZRS1321ASC1h3hplebuwXfl3vKTmlDPcYd/ vkIyTi+/GLoPMKrptp6GnMPCeHRMLi94X6lDDa3nCzNkeEr/HG7pm9jpdBIRA7dh3ujiB2 xxnLyGpghAU1JS7/ZCOZOFcCMyk8H/l6N7bMAi9r3qUialt+9spM5nzggmgXRFxTP5pXW9 wZQsgS/Jibrs2wGeIhyun0RAAnR8uj1UN5K4K0qIseYIdv32mlO60RFQ/0vhA3MYjC7jfY gOI/wwb7V/AjEYgjgYOv3B74GxKVKDNa5vdGARx9eR3icEdo2RsukY4L9Wrypw== 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 4bTJzX5HbXztKj; Fri, 27 Jun 2025 15:16:08 +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 55RFG8en048985; Fri, 27 Jun 2025 15:16:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFG8Ia048982; Fri, 27 Jun 2025 15:16:08 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:08 GMT Message-Id: <202506271516.55RFG8Ia048982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 41fd03c08f67 - main - pf: add 'max-pkt-size' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41fd03c08f67fc9c891f4fb0ebf912658f30f212 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=41fd03c08f67fc9c891f4fb0ebf912658f30f212 commit 41fd03c08f67fc9c891f4fb0ebf912658f30f212 Author: Kristof Provost AuthorDate: 2025-06-06 14:45:43 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:15 +0000 pf: add 'max-pkt-size' Allow pf to limit packets to a specified maximum size. This applies to all packets, and if reassembly is enabled, looks at the reassembled size, not the size of individual fragments. Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 2 + lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/parse.y | 13 +++++- sbin/pfctl/pfctl_parser.c | 2 + sbin/pfctl/tests/files/pf1069.in | 1 + sbin/pfctl/tests/files/pf1069.ok | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + share/man/man5/pf.conf.5 | 4 ++ sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 8 ++++ sys/netpfil/pf/pf_nl.c | 2 + sys/netpfil/pf/pf_nl.h | 1 + tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/max_pkt_size.sh | 85 ++++++++++++++++++++++++++++++++++++ 14 files changed, 122 insertions(+), 1 deletion(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 4789448d2a37..e4123fe02211 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1251,6 +1251,7 @@ snl_add_msg_attr_pf_rule(struct snl_writer *nw, uint32_t type, const struct pfct snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_CONN, r->max_src_conn); snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_CONN_RATE_LIMIT, r->max_src_conn_rate.limit); snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_CONN_RATE_SECS, r->max_src_conn_rate.seconds); + snl_add_msg_attr_u16(nw, PF_RT_MAX_PKT_SIZE, r->max_pkt_size); snl_add_msg_attr_u16(nw, PF_RT_DNPIPE, r->dnpipe); snl_add_msg_attr_u16(nw, PF_RT_DNRPIPE, r->dnrpipe); @@ -1692,6 +1693,7 @@ static struct snl_attr_parser ap_getrule[] = { { .type = PF_RT_SRC_NODES_NAT, .off = _OUT(r.src_nodes_type[PF_SN_NAT]), .cb = snl_attr_get_uint64 }, { .type = PF_RT_SRC_NODES_ROUTE, .off = _OUT(r.src_nodes_type[PF_SN_ROUTE]), .cb = snl_attr_get_uint64 }, { .type = PF_RT_PKTRATE, .off = _OUT(r.pktrate), .arg = &pfctl_threshold_parser, .cb = snl_attr_get_nested }, + { .type = PF_RT_MAX_PKT_SIZE, .off =_OUT(r.max_pkt_size), .cb = snl_attr_get_uint16 }, }; #undef _OUT SNL_DECLARE_PARSER(getrule_parser, struct genlmsghdr, snl_f_p_empty, ap_getrule); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 7de7a08e90bf..98a80758ca74 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -211,6 +211,7 @@ struct pfctl_rule { uint32_t limit; uint32_t seconds; } max_src_conn_rate; + uint16_t max_pkt_size; uint32_t qid; uint32_t pqid; uint16_t dnpipe; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index e0bd5ce4aee0..257a62df76f4 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -312,6 +312,7 @@ static struct filter_opts { uint32_t limit; uint32_t seconds; } pktrate; + int max_pkt_size; } filter_opts; static struct antispoof_opts { @@ -535,7 +536,7 @@ int parseport(char *, struct range *r, int); %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW ALLOW_RELATED %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS %token DIVERTTO DIVERTREPLY BRIDGE_TO RECEIVEDON NE LE GE AFTO NATTO RDRTO -%token BINATTO MAXPKTRATE +%token BINATTO MAXPKTRATE MAXPKTSIZE %token STRING %token NUMBER %token PORTBINARY @@ -1020,6 +1021,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto r.ridentifier = $9.ridentifier; r.pktrate.limit = $9.pktrate.limit; r.pktrate.seconds = $9.pktrate.seconds; + r.max_pkt_size = $9.max_pkt_size; if ($9.tag) if (strlcpy(r.tagname, $9.tag, @@ -2499,6 +2501,7 @@ pfrule : action dir logquick interface route af proto fromto r.keep_state = $9.keep.action; r.pktrate.limit = $9.pktrate.limit; r.pktrate.seconds = $9.pktrate.seconds; + r.max_pkt_size = $9.max_pkt_size; o = $9.keep.options; /* 'keep state' by default on pass rules. */ @@ -3135,6 +3138,13 @@ filter_opt : USER uids { filter_opts.pktrate.limit = $2; filter_opts.pktrate.seconds = $4; } + | MAXPKTSIZE NUMBER { + if ($2 < 0 || $2 > UINT16_MAX) { + yyerror("only positive values permitted"); + YYERROR; + } + filter_opts.max_pkt_size = $2; + } | filter_sets ; @@ -6721,6 +6731,7 @@ lookup(char *s) { "max", MAXIMUM}, { "max-mss", MAXMSS}, { "max-pkt-rate", MAXPKTRATE}, + { "max-pkt-size", MAXPKTSIZE}, { "max-src-conn", MAXSRCCONN}, { "max-src-conn-rate", MAXSRCCONNRATE}, { "max-src-nodes", MAXSRCNODES}, diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 32e98eb20b7c..dbc7ff00782f 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1010,6 +1010,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer if (r->pktrate.limit) printf(" max-pkt-rate %u/%u", r->pktrate.limit, r->pktrate.seconds); + if (r->max_pkt_size) + printf( " max-pkt-size %u", r->max_pkt_size); if (r->scrub_flags & PFSTATE_SETMASK) { char *comma = ""; printf(" set ("); diff --git a/sbin/pfctl/tests/files/pf1069.in b/sbin/pfctl/tests/files/pf1069.in new file mode 100644 index 000000000000..3a69158fff7e --- /dev/null +++ b/sbin/pfctl/tests/files/pf1069.in @@ -0,0 +1 @@ +pass in proto icmp max-pkt-size 128 diff --git a/sbin/pfctl/tests/files/pf1069.ok b/sbin/pfctl/tests/files/pf1069.ok new file mode 100644 index 000000000000..b79228266156 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1069.ok @@ -0,0 +1 @@ +pass in proto icmp all max-pkt-size 128 keep state diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 2b237ed0922e..f798fedb70a8 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -177,3 +177,4 @@ PFCTL_TEST(1065, "no nat") PFCTL_TEST(1066, "no rdr") PFCTL_TEST_FAIL(1067, "route-to can't be used on block rules") PFCTL_TEST(1068, "max-pkt-rate") +PFCTL_TEST(1069, "max-pkt-size") diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 49c81f51294c..5d802f81984f 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -2227,6 +2227,9 @@ pass in proto icmp max-pkt-rate 100/10 When the rate is exceeded, all ICMP is blocked until the rate falls below 100 per 10 seconds again. .Pp +.It Ar max-pkt-size Aq Ar number +Limit each packet to be no more than the specified number of bytes. +This includes the IP header, but not any layer 2 header. .It Xo Ar queue Aq Ar queue .No \*(Ba ( Aq Ar queue , .Aq Ar queue ) @@ -3401,6 +3404,7 @@ filteropt = user | group | flags | icmp-type | icmp6-type | "tos" tos | "label" string | "tag" string | [ "!" ] "tagged" string | "max-pkt-rate" number "/" seconds | "set prio" ( number | "(" number [ [ "," ] number ] ")" ) | + "max-pkt-size" number | "queue" ( string | "(" string [ [ "," ] string ] ")" ) | "rtable" number | "probability" number"%" | "prio" number | "dnpipe" ( number | "(" number "," number ")" ) | diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 33574dbd5c2a..5c798216f9f5 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -845,6 +845,7 @@ struct pf_krule { u_int32_t limit; u_int32_t seconds; } max_src_conn_rate; + uint16_t max_pkt_size; u_int16_t qid; u_int16_t pqid; u_int16_t dnpipe; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 6533b06c5d9d..6da537aaa2cd 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -10677,6 +10677,14 @@ done: ("pf: dropping packet with dangerous headers\n")); } + if (r && r->max_pkt_size && pd.tot_len > r->max_pkt_size) { + action = PF_DROP; + REASON_SET(&reason, PFRES_NORM); + pd.act.log = PF_LOG_FORCE; + DPFPRINTF(PF_DEBUG_MISC, + ("pf: dropping overly long packet\n")); + } + if (s) { uint8_t log = pd.act.log; memcpy(&pd.act, &s->act, sizeof(struct pf_rule_actions)); diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 48cba96b04b0..381e966eacf1 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -761,6 +761,7 @@ static const struct nlattr_parser nla_p_rule[] = { { .type = PF_RT_RPOOL_RT, .off = _OUT(route), .arg = &pool_parser, .cb = nlattr_get_nested }, { .type = PF_RT_RCV_IFNOT, .off = _OUT(rcvifnot), .cb = nlattr_get_bool }, { .type = PF_RT_PKTRATE, .off = _OUT(pktrate), .arg = &threshold_parser, .cb = nlattr_get_nested }, + { .type = PF_RT_MAX_PKT_SIZE, .off = _OUT(max_pkt_size), .cb = nlattr_get_uint16 }, }; NL_DECLARE_ATTR_PARSER(rule_parser, nla_p_rule); #undef _OUT @@ -945,6 +946,7 @@ pf_handle_getrule(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_u32(nw, PF_RT_MAX_SRC_CONN, rule->max_src_conn); nlattr_add_u32(nw, PF_RT_MAX_SRC_CONN_RATE_LIMIT, rule->max_src_conn_rate.limit); nlattr_add_u32(nw, PF_RT_MAX_SRC_CONN_RATE_SECS, rule->max_src_conn_rate.seconds); + nlattr_add_u16(nw, PF_RT_MAX_PKT_SIZE, rule->max_pkt_size); nlattr_add_u16(nw, PF_RT_DNPIPE, rule->dnpipe); nlattr_add_u16(nw, PF_RT_DNRPIPE, rule->dnrpipe); diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 97ef574995f5..929c20e4c582 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -279,6 +279,7 @@ enum pf_rule_type_t { PF_RT_SRC_NODES_NAT = 80, /* u64 */ PF_RT_SRC_NODES_ROUTE = 81, /* u64 */ PF_RT_PKTRATE = 82, /* nested, pf_threshold_type_t */ + PF_RT_MAX_PKT_SIZE = 83, /* u16 */ }; enum pf_addrule_type_t { diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index fe2740ed0e7f..3adaef09ddbd 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -23,6 +23,7 @@ ATF_TESTS_SH+= altq \ macro \ match \ max_pkt_rate \ + max_pkt_size \ max_states \ mbuf \ modulate \ diff --git a/tests/sys/netpfil/pf/max_pkt_size.sh b/tests/sys/netpfil/pf/max_pkt_size.sh new file mode 100644 index 000000000000..05aab0b7990a --- /dev/null +++ b/tests/sys/netpfil/pf/max_pkt_size.sh @@ -0,0 +1,85 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2025 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic max-pkt-size test' + atf_set require.user root +} + +basic_body() +{ + pft_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}b 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}a + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass max-pkt-size 128" + + # Small packets pass + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 -s 100 192.0.2.1 + + # Larger packets do not + atf_check -s exit:2 -o ignore \ + ping -c 3 -s 101 192.0.2.1 + atf_check -s exit:2 -o ignore \ + ping -c 3 -s 128 192.0.2.1 + + # We can enforce this on fragmented packets too + pft_set_rules alcatraz \ + "pass max-pkt-size 2000" + + atf_check -s exit:0 -o ignore \ + ping -c 1 -s 1400 192.0.2.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 -s 1972 192.0.2.1 + atf_check -s exit:2 -o ignore \ + ping -c 1 -s 1973 192.0.2.1 + atf_check -s exit:2 -o ignore \ + ping -c 3 -s 3000 192.0.2.1 +} + +basic_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} From nobody Fri Jun 27 15:16:09 2025 X-Original-To: dev-commits-src-main@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 4bTJzZ18xSz5yvDC; Fri, 27 Jun 2025 15:16:10 +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 4bTJzY6VnSz3Yfg; Fri, 27 Jun 2025 15:16:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037369; 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=E/9hukT8jA/aZ/X4Jk+K5JAf5Ppn2ELscDGFqXXxOmY=; b=BMkX7E0idWIKo5cdkfxJ8/QOt6xSn0Ey1FeoaGlD4DIKyEloXZdeekL+zsyUUVlqeTcNSZ 2iPAlUUkzQnpQK/Y50Gd5R4e0cgOlwSbMW6WOVtKXobwENkeEJxxCRNX+ibt+iEg8ciRvU kaZpJQdV0NsaPdRUziCgjYC4UptlYv8ivR0Ahrsdm/1MOR8+NfGMBDb/DD/9rCnCZRvFfk 4iBkJ5UYZs1iNIfrd6UFbMeSyWaXzZsMS7VrOVSZmm/GJ+MAHB+xU2gETCMfOtw0sgzY0l OxkJCHUD1Fj+GFUPf0dfGS524IQ/E/HwBeU28zSZPvuhqCPRw9wiMY/nedLSlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037369; 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=E/9hukT8jA/aZ/X4Jk+K5JAf5Ppn2ELscDGFqXXxOmY=; b=iXeJ4DjN7mF/PArnxSanjiRhm5c21nyJPe0Ys+UZ0GI3wF3Kbm2AVLT1cmJFoRLWb72XnU vV2STRfjU/ZBhjJ75C0yQM50S6yAzA5/mxLQVckdvuFD1rxtPvKFoW5nvYhl3VUK08a3Sr 3D9fIyAfHBajjjX5CRc4wYCBwUo82GqUylGrpWt8z1mv/zgFuH7HstVoq9d4ugGt/HTHXR GYLAUveBervT5uLe5nNX8l+6SuBIXNQzFXBFwQTpPSN3+u7nrFxMA1WnNCefg4W/DX77+L lOCVowz9V5N8BrfJieO+fcl5Pky9dFVtK7YPEA/vUWzMRjuILL5pLJYKD7Bm0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037369; a=rsa-sha256; cv=none; b=L17PmMuLLVXVDVwRswwmgTdrH9pqMOZorNqyh+rzJAfGMcS+Wwna48h03jQpt5M4RJnasn nynCS+MHLx/IA8eMi63AaatjBUDasiiOkFrG6po9hgk09M4+7ClgPcFY8ixqw9oe9/LiLb cBRTaUkD344TzbgWNpSDQrrh5pvYttf6xNFjkuqtkNZTRO+f2WPSPTMExK6AwHgWk+3aBW nRfi5CdW07J2oPbaGxasCRvDs2643CatYWj7cvOBZKNX5XaYhM5I9E39gYA+4muttWHvCO nc9kY9cvU7/7/NX9jXV21Q6228y/xIjZE9aRY1VmmW9XWCVaMXeT97dusCdCbw== 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 4bTJzY617nztHR; Fri, 27 Jun 2025 15:16:09 +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 55RFG9ct049017; Fri, 27 Jun 2025 15:16:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFG9LF049014; Fri, 27 Jun 2025 15:16:09 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:09 GMT Message-Id: <202506271516.55RFG9LF049014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0c273335b2de - main - pf: ensure max-pkt-size works on match rules List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c273335b2deac7cf7dadbcb5cd43d35127eb3f0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0c273335b2deac7cf7dadbcb5cd43d35127eb3f0 commit 0c273335b2deac7cf7dadbcb5cd43d35127eb3f0 Author: Kristof Provost AuthorDate: 2025-06-25 15:02:28 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:15 +0000 pf: ensure max-pkt-size works on match rules Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 11 +++++-- tests/sys/netpfil/pf/max_pkt_size.sh | 61 +++++++++++++++++++++++++++++------- 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 5c798216f9f5..9fc2a00dca77 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -690,6 +690,7 @@ struct pf_rule_actions { uint8_t set_prio[2]; uint8_t rt; uint8_t allow_opts; + uint16_t max_pkt_size; }; union pf_keth_rule_ptr { diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 6da537aaa2cd..4ce2df2f0e31 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4886,6 +4886,8 @@ pf_rule_to_actions(struct pf_krule *r, struct pf_rule_actions *a) } if (r->allow_opts) a->allow_opts = r->allow_opts; + if (r->max_pkt_size) + a->max_pkt_size = r->max_pkt_size; } int @@ -10668,8 +10670,10 @@ done: if (pd.m == NULL) goto eat_pkt; - if (action == PF_PASS && pd.badopts && - !((s && s->state_flags & PFSTATE_ALLOWOPTS) || pd.act.allow_opts)) { + if (s) + memcpy(&pd.act, &s->act, sizeof(s->act)); + + if (action == PF_PASS && pd.badopts && !pd.act.allow_opts) { action = PF_DROP; REASON_SET(&reason, PFRES_IPOPTIONS); pd.act.log = PF_LOG_FORCE; @@ -10677,7 +10681,8 @@ done: ("pf: dropping packet with dangerous headers\n")); } - if (r && r->max_pkt_size && pd.tot_len > r->max_pkt_size) { + if (pd.act.max_pkt_size && pd.act.max_pkt_size && + pd.tot_len > pd.act.max_pkt_size) { action = PF_DROP; REASON_SET(&reason, PFRES_NORM); pd.act.log = PF_LOG_FORCE; diff --git a/tests/sys/netpfil/pf/max_pkt_size.sh b/tests/sys/netpfil/pf/max_pkt_size.sh index 05aab0b7990a..030d642303fc 100644 --- a/tests/sys/netpfil/pf/max_pkt_size.sh +++ b/tests/sys/netpfil/pf/max_pkt_size.sh @@ -26,17 +26,8 @@ . $(atf_get_srcdir)/utils.subr -atf_test_case "basic" "cleanup" -basic_head() -{ - atf_set descr 'Basic max-pkt-size test' - atf_set require.user root -} - -basic_body() +common_setup() { - pft_init - epair=$(vnet_mkepair) ifconfig ${epair}b 192.0.2.2/24 up @@ -45,9 +36,10 @@ basic_body() jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up jexec alcatraz pfctl -e - pft_set_rules alcatraz \ - "pass max-pkt-size 128" +} +common_test() +{ # Small packets pass atf_check -s exit:0 -o ignore \ ping -c 1 192.0.2.1 @@ -59,6 +51,25 @@ basic_body() ping -c 3 -s 101 192.0.2.1 atf_check -s exit:2 -o ignore \ ping -c 3 -s 128 192.0.2.1 +} + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic max-pkt-size test' + atf_set require.user root +} + +basic_body() +{ + pft_init + + common_setup + + pft_set_rules alcatraz \ + "pass max-pkt-size 128" + + common_test # We can enforce this on fragmented packets too pft_set_rules alcatraz \ @@ -79,7 +90,33 @@ basic_cleanup() pft_cleanup } +atf_test_case "match" "cleanup" +match_head() +{ + atf_set descr 'max-pkt-size on match rules' + atf_set require.user root +} + +match_body() +{ + pft_init + + common_setup + + pft_set_rules alcatraz \ + "match in max-pkt-size 128" \ + "pass" + + common_test +} + +match_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" + atf_add_test_case "match" } From nobody Fri Jun 27 15:16:11 2025 X-Original-To: dev-commits-src-main@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 4bTJzc2ldLz5ytt5; Fri, 27 Jun 2025 15:16:12 +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 4bTJzc0pgHz3YZ7; Fri, 27 Jun 2025 15:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037372; 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=C/8Hd8W+nT7lx8BJbWPJ6g3sYG5FbR4F6t5HHVM/s0M=; b=vjYX7AU/O3ZLi6Ad6sgjYDwJNT6pUO3w45iX7yrvL9aJ5g6EzpWCDHuqX1aJCuWCopOn/a 8euFR1Yt9EeTpcz8LtQ1Cj0LLUlLQa/FDxmCKazsoSjEcFR7uq9ix6m4JieDmhp8oDQv9M M20wSnt+SlHYCSWjlH3JykLCd19kjXinUA04cKSxSO1/3uQHZ6iRb7GZtg7wVY5uX1HxTi c/HqX09TlerJlb7a0QJHsZ1aOIbmwFZHwnVcsQbUlPRQ9Hkn0JjHBCMaArIGdLGcKpYhE4 MjHzpa0ltAGLcLbp1nJmGY7anFkezARIlUv/IT2CB8WywRGdWBR/G3zFov1GPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037372; 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=C/8Hd8W+nT7lx8BJbWPJ6g3sYG5FbR4F6t5HHVM/s0M=; b=OjWrNWjLdXxGK7MaRuccXoKSdudPnsvkABg5oZzD1FVF0JPhA4VatVViEKn+2CHO32wioB yfKnqlclhMMx8Wx3ZcYM1xV62SEFR04LpnKM6q42S5PyYWvZZYbBWjA9moM85C47qTABHJ 2jHcojVVWOx/r5pWvziZJ5MgAyvGIFivI77Gg51hILmrOmNieQ1NJsF6kef+xdccZhzHwW 9ksvyGcTjxBhVaboWcdMBRXfkbYUapCGsIMFFTkDKYo7n+4Jg9zZXxc3M+HOO9wkoKXmly u26m0YYctKBJ89ZjhmU9XOXkDit0KvShFWob8WNZ01upagMt9Fi1kr7CAEX+AA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037372; a=rsa-sha256; cv=none; b=FQKLrkRWlPDA9YZNYulWemX3cWsRfvOh38zV7LkE9yVAzZxluifu8mh/I9rgdD0keL4ZoE hxTczbbAnHvsB8gLER+NGqc0KNtuEii2j6q+NUVrTBVpHC+MNCQQInuJb5vOwRM3VxOZVn pwvNwqwCR/qpNl26LvNcNsIHPhR4yWfZMaRRA/dESVtpsanztG/dNgVBa3UV/lqh09xzKv fLl49FL3lmhgU14Zm1cVSUT0fKvNj/yyCZ9X/xgCY5tGAVEloLdOq1jI4rnPQjY7S8Y+WY Vyh25JdIu+5guSS1cXXas7rTLMIvGXACIw1TLyBtYC/UGU467AiRyDtBMcNHZg== 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 4bTJzc0FwjztHS; Fri, 27 Jun 2025 15:16:12 +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 55RFGB0U049081; Fri, 27 Jun 2025 15:16:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFGB4i049078; Fri, 27 Jun 2025 15:16:11 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:11 GMT Message-Id: <202506271516.55RFGB4i049078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e2d2aadc292a - main - pfctl tests: test line number reporting in include files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2d2aadc292a62064a61e110875db224cf533dc4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e2d2aadc292a62064a61e110875db224cf533dc4 commit e2d2aadc292a62064a61e110875db224cf533dc4 Author: Kristof Provost AuthorDate: 2025-06-23 13:18:24 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:16 +0000 pfctl tests: test line number reporting in include files Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/tests/files/pf1070.fail | 1 + sbin/pfctl/tests/files/pf1070.in | 2 ++ sbin/pfctl/tests/files/pf1070.include | 2 ++ sbin/pfctl/tests/pfctl_test_list.inc | 1 + 4 files changed, 6 insertions(+) diff --git a/sbin/pfctl/tests/files/pf1070.fail b/sbin/pfctl/tests/files/pf1070.fail new file mode 100644 index 000000000000..60b56d9da2b9 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1070.fail @@ -0,0 +1 @@ +pf1070.include:2: syntax error diff --git a/sbin/pfctl/tests/files/pf1070.in b/sbin/pfctl/tests/files/pf1070.in new file mode 100644 index 000000000000..42b874d4d6f4 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1070.in @@ -0,0 +1,2 @@ +pass in +include pf1070.include diff --git a/sbin/pfctl/tests/files/pf1070.include b/sbin/pfctl/tests/files/pf1070.include new file mode 100644 index 000000000000..09c3755dbe28 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1070.include @@ -0,0 +1,2 @@ +block out +invalidline diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index f798fedb70a8..f87d8ba6bc73 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -178,3 +178,4 @@ PFCTL_TEST(1066, "no rdr") PFCTL_TEST_FAIL(1067, "route-to can't be used on block rules") PFCTL_TEST(1068, "max-pkt-rate") PFCTL_TEST(1069, "max-pkt-size") +PFCTL_TEST_FAIL(1070, "include line number") From nobody Fri Jun 27 15:16:10 2025 X-Original-To: dev-commits-src-main@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 4bTJzb55cDz5ytqY; Fri, 27 Jun 2025 15:16:11 +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 4bTJzZ6nQTz3YP2; Fri, 27 Jun 2025 15:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037371; 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=M/cKC2uPe76Pn27cecNQGOvd6aHCX45j5fO0I/lJkeE=; b=Zk4oH7vmkMe3iEJDPSyFvzjcXlAjGsJP2ObmJFPF78VS/z6Lno2K8dTAQ/oVfPZk5L9E3v iR/e8E6Xfv5IkMvxr4yqrc82fPJGI82jCADGGDX060vVpHFYsJWsP1zX8tXpwBmyjOuLs3 YovK/cJ/kW3nDj8lxSlW2mF4saJ2v/+PA5Y68oxdD66LXOqZ8Xntle/1g+EAEkzMmmlmum msvMzRi+ZWJEUDbFYqfr4X+fv3VgKjLI5enoqSZXXgCXXWjI3bV0Q1yBgB3lorU8fEXgfp 3TvI42AB1FSF2KxQjq8Q2cLT42xWKJTOwO7Jn306m7mIBiMXFTPl2rllHP4igg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037371; 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=M/cKC2uPe76Pn27cecNQGOvd6aHCX45j5fO0I/lJkeE=; b=h6/U3WADI4rcl3lasRu08j77viBIfOtj5olD/ueDkS6PVDlBCVYNXXcAzWjxC/pXtcU5Dn UwR2nbsfXcXfTvuE8N7VjglXTk1zISOmiQTOxBegc2iPW8wDnhzaPSv1JJlylPiqkp0LDR rRl7Fiia78ox5q9JwN85b/ik508ldEE3N5VEfuQmboe0gCbJx+6KghtMljXmCjyUPenu1Z Qv8lfgWBgMHRt5K2/wSARhC//YUKBJAoGtVvzHEEBQKn3Kx6TK5xPuCWK55MJeG+bGg8X4 rk+isfr6DxRBv0jHbWvZqzNaU2j4CHtM3rFiWHi/E13Cy5XzwuzIgl5c5ySoLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037371; a=rsa-sha256; cv=none; b=gIQrx0M1BAzKNZxN1A7ACwNsJ1yNOgkRzxX5IF5pgptByP3I6O8M4KADeeNctqfU79IjqA EwdUSGPox4peOo8gAb47hgEl0/juulhk5kiHEw7NnZpXFng9kzl9NKCXoe2aDqmXqQbaA4 qcFLOnnjwVbsWMHJMMwQybv2v8SreP/6aVwoJEUCHfb93Ao6Kkezsdn5qpyAdGjUEtVBLY bbWoZhlYcF/BrE/xAXSbhtnR6f6MalKXsTPXm+iLlPbKqtT8EhshjCRLXMXqGXFZJFHDqr yEGdBRwtQ9ZhkHgwkPn1osvDccUsgaReHaDF77WbtIme5s217rZMkptqttff/g== 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 4bTJzZ6P8GztWt; Fri, 27 Jun 2025 15:16:10 +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 55RFGAFD049049; Fri, 27 Jun 2025 15:16:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFGA6M049046; Fri, 27 Jun 2025 15:16:10 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:10 GMT Message-Id: <202506271516.55RFGA6M049046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d40166400955 - main - pfctl: fix reporting of line numbers for included files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d401664009554167bfc3c1cdb51aba8d1065e92c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d401664009554167bfc3c1cdb51aba8d1065e92c commit d401664009554167bfc3c1cdb51aba8d1065e92c Author: Kristof Provost AuthorDate: 2025-06-23 13:17:17 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:16 +0000 pfctl: fix reporting of line numbers for included files Fix (include file ) line number counting by keeping track of the unget buffer per file; also use that buffer to expand macros. ok sashan@ dennis@ krw@ Obtained from: OpenBSD, otto , 475a466cc5 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 122 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 75 insertions(+), 47 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 257a62df76f4..e4cd4883e2c9 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -89,6 +89,10 @@ static struct file { TAILQ_ENTRY(file) entry; FILE *stream; char *name; + size_t ungetpos; + size_t ungetsize; + u_char *ungetbuf; + int eof_reached; int lineno; int errors; } *file; @@ -100,8 +104,9 @@ int yylex(void); int yyerror(const char *, ...); int kw_cmp(const void *, const void *); int lookup(char *); +int igetc(void); int lgetc(int); -int lungetc(int); +void lungetc(int); int findeol(void); static TAILQ_HEAD(symhead, sym) symhead = TAILQ_HEAD_INITIALIZER(symhead); @@ -6825,34 +6830,37 @@ lookup(char *s) } } -#define MAXPUSHBACK 128 +#define START_EXPAND 1 +#define DONE_EXPAND 2 -static char *parsebuf; -static int parseindex; -static char pushback_buffer[MAXPUSHBACK]; -static int pushback_index = 0; +static int expanding; int -lgetc(int quotec) +igetc(void) { - int c, next; - - if (parsebuf) { - /* Read character from the parsebuffer instead of input. */ - if (parseindex >= 0) { - c = parsebuf[parseindex++]; - if (c != '\0') - return (c); - parsebuf = NULL; - } else - parseindex++; + int c; + while (1) { + if (file->ungetpos > 0) + c = file->ungetbuf[--file->ungetpos]; + else + c = getc(file->stream); + if (c == START_EXPAND) + expanding = 1; + else if (c == DONE_EXPAND) + expanding = 0; + else + break; } + return (c); +} - if (pushback_index) - return (pushback_buffer[--pushback_index]); +int +lgetc(int quotec) +{ + int c, next; if (quotec) { - if ((c = getc(file->stream)) == EOF) { + if ((c = igetc()) == EOF) { yyerror("reached end of file while parsing quoted string"); if (popfile() == EOF) return (EOF); @@ -6861,8 +6869,8 @@ lgetc(int quotec) return (c); } - while ((c = getc(file->stream)) == '\\') { - next = getc(file->stream); + while ((c = igetc()) == '\\') { + next = igetc(); if (next != '\n') { c = next; break; @@ -6871,28 +6879,38 @@ lgetc(int quotec) file->lineno++; } - while (c == EOF) { - if (popfile() == EOF) - return (EOF); - c = getc(file->stream); + if (c == EOF) { + /* + * Fake EOL when hit EOF for the first time. This gets line + * count right if last line in included file is syntactically + * invalid and has no newline. + */ + if (file->eof_reached == 0) { + file->eof_reached = 1; + return ('\n'); + } + while (c == EOF) { + if (popfile() == EOF) + return (EOF); + c = igetc(); + } } return (c); } -int +void lungetc(int c) { if (c == EOF) - return (EOF); - if (parsebuf) { - parseindex--; - if (parseindex >= 0) - return (c); + return; + if (file->ungetpos >= file->ungetsize) { + void *p = reallocarray(file->ungetbuf, file->ungetsize, 2); + if (p == NULL) + err(1, "lungetc"); + file->ungetbuf = p; + file->ungetsize *= 2; } - if (pushback_index < MAXPUSHBACK-1) - return (pushback_buffer[pushback_index++] = c); - else - return (EOF); + file->ungetbuf[file->ungetpos++] = c; } int @@ -6900,14 +6918,9 @@ findeol(void) { int c; - parsebuf = NULL; - /* skip to either EOF or the first real EOL */ while (1) { - if (pushback_index) - c = pushback_buffer[--pushback_index]; - else - c = lgetc(0); + c = lgetc(0); if (c == '\n') { file->lineno++; break; @@ -6935,7 +6948,7 @@ top: if (c == '#') while ((c = lgetc(0)) != '\n' && c != EOF) ; /* nothing */ - if (c == '$' && parsebuf == NULL) { + if (c == '$' && !expanding) { while (1) { if ((c = lgetc(0)) == EOF) return (0); @@ -6957,8 +6970,13 @@ top: yyerror("macro '%s' not defined", buf); return (findeol()); } - parsebuf = val; - parseindex = 0; + p = val + strlen(val) - 1; + lungetc(DONE_EXPAND); + while (p >= val) { + lungetc(*p); + p--; + } + lungetc(START_EXPAND); goto top; } @@ -7148,7 +7166,16 @@ pushfile(const char *name, int secret) free(nfile); return (NULL); } - nfile->lineno = 1; + nfile->lineno = TAILQ_EMPTY(&files) ? 1 : 0; + nfile->ungetsize = 16; + nfile->ungetbuf = malloc(nfile->ungetsize); + if (nfile->ungetbuf == NULL) { + warn("malloc"); + fclose(nfile->stream); + free(nfile->name); + free(nfile); + return (NULL); + } TAILQ_INSERT_TAIL(&files, nfile, entry); return (nfile); } @@ -7163,6 +7190,7 @@ popfile(void) TAILQ_REMOVE(&files, file, entry); fclose(file->stream); free(file->name); + free(file->ungetbuf); free(file); file = prev; return (0); From nobody Fri Jun 27 15:16:14 2025 X-Original-To: dev-commits-src-main@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 4bTJzf4rmxz5yvM1; Fri, 27 Jun 2025 15:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTJzf259kz3YWv; Fri, 27 Jun 2025 15:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037374; 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=kW3BCJcQghfdTkYfqOZnbjwuTDuPevlbgjgqIIhTbJ4=; b=NF1/yPSXyvJnmKPSNOqdx/JiLaPPdanW5cliDYTnziscBs57OMvTaw3RkwRp248kqebDXq QYhsotmSlOGs4iWv323OtY0XhRFgx0bbi1Lz/Ha+ULCIF5rNZWmQDvd2me8b529Sxx0xQT VzM79y+d/PaxRkfpqHMePEhbMpB1xLXAMxr50WP5CN0OgrdiPj2IriRWokWLPSzecPXeqV BzpwDv+AzSQWCHLPYNjS8/8RYplc6Welq8MJxc1Fv1qDkQ9dKbq/fFA/2yKwKP31unDfSS sKlqKqTlnqYUQVIzsArvjnkmNlg2FtGGwb7WDiqpfiXlIhTpzHal/4FZVfYF/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037374; 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=kW3BCJcQghfdTkYfqOZnbjwuTDuPevlbgjgqIIhTbJ4=; b=biNXATe6IUe6NIwSe6r0sHYswjyvYgc1tZfWrLsSnR1dNLQ6mVaX/kcvsBQZE9u4xqPbFx TKGmLypitKVrC1+c7U3sX9l+rm75OCzwWkjtRJMw2AX646Y/fuSI8SarcEuT80Bj2glMSE p34Y3JDk0F7PjpwGgGAPhkHU1DiX7/3WIniDL9FydcxQSL5HAMGryAyb0V7ByjFYVA3XeS iK4VMF78CLYa+50+qImS8P7WRfwDjehipss7y+JekyNSxeNFApKNZDEIfsjl5zBrj7Xyw/ 9l3SN6dOmElobnLmU83q5aICQp6Onxpd7M+qFitMOGbZMWqQqJNxHDeb5f/4mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037374; a=rsa-sha256; cv=none; b=TQVxlv+WrIfqxvvKis3K23j6Kb4wiKSm7ktSet+Uv9ZOUTXzyaGRZwEEEC8Nne5yyBq9Vl co49YCdtySgBnd1e/7oc+pte5U6V4rQGYJ5KQJ7isg0U7xD7+F/+slQGPYXRHYxiMTrL8j shnMhY2oP3DvplMthWuT6cQNz53Eyt4B24zeE/ysMME6HU+nAxNnj5UjUdNz+8w08LXTHQ eLheke4ExRwU7Dp8cLN96+pNtvRfX7Uf9hzUgOvVUHr1oVsk3/KJI9xoy+qorJhvNq2imY Uxs9QkBoRYbHPtWM/fUdXcsA3/81zA6Jlqap2uRKFOzZLLSFaZk8xldS5uGMXg== 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 4bTJzf1fznztM2; Fri, 27 Jun 2025 15:16:14 +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 55RFGE5h049155; Fri, 27 Jun 2025 15:16:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFGE8B049152; Fri, 27 Jun 2025 15:16:14 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:14 GMT Message-Id: <202506271516.55RFGE8B049152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 753da351598a - main - pfctl: plug some memory leaks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 753da351598a381abe639a62621f5dae28a7bfe6 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=753da351598a381abe639a62621f5dae28a7bfe6 commit 753da351598a381abe639a62621f5dae28a7bfe6 Author: Kristof Provost AuthorDate: 2025-06-24 11:39:24 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:16 +0000 pfctl: plug some memory leaks found by parfait, ok henning Obtained from: OpenBSD, deraadt , 2f2ceddc40 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 2 ++ sbin/pfctl/pfctl.c | 2 +- sbin/pfctl/pfctl_optimize.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index e4cd4883e2c9..8afef160b205 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7143,6 +7143,8 @@ pushfile(const char *name, int secret) if ((nfile = calloc(1, sizeof(struct file))) == NULL || (nfile->name = strdup(name)) == NULL) { + if (nfile) + free(nfile); warn("malloc"); return (NULL); } diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 15766eb9b704..8435f69e91e0 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2261,7 +2261,7 @@ pfctl_rules(int dev, char *filename, int opts, int optimize, struct pfctl_ruleset *rs; struct pfctl_eth_ruleset *ethrs; struct pfr_table trs; - char *path; + char *path = NULL; int osize; RB_INIT(&pf_anchors); diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index d6417e8e73a1..b4ffcbebb1bb 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -922,6 +922,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) if (pfctl_get_rule_h(pf->h, nr, rules.ticket, "", PF_PASS, &rule, anchor_call)) { warn("DIOCGETRULENV"); + free(por); return (1); } memcpy(&por->por_rule, &rule, sizeof(por->por_rule)); From nobody Fri Jun 27 15:16:13 2025 X-Original-To: dev-commits-src-main@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 4bTJzd6fNwz5yvM0; Fri, 27 Jun 2025 15:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTJzd1XBkz3YZL; Fri, 27 Jun 2025 15:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037373; 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=dJVHzovMD1+O6cmHmHqQQAzCkaQAZB1eBv5vWIQR+Kc=; b=hneiuIgF8jSIuCnmBIG1oyHdjyyvnd930qYAxCFu9zDnYMfTIGPCr1X0bg9kWWUDHSOzkG xINfeJjRd1wRThWHnjaEFURBj3BS/D/v8X84tbHAyYBgJfnbD5gmnl1JFdaA+oepCEdqND 6X4+0D+OEyIZEAdG3wRKdRUz/fT7lD/uIrOrEc24qbjtdCZFRv/n11nOg5Wx1AxEGROcxA nbVc3imcWi097gOvyKLBe0ajwAVM4Sp9Bg0WVpjesX950N1jTXqGuuqFtzXVy1Ugs9atJX 1ASHx9VDcvf0A2bPRuvDF11yBUWzxOcRdnlFLLqHkymXUGm2FAExRyA/rAL8WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037373; 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=dJVHzovMD1+O6cmHmHqQQAzCkaQAZB1eBv5vWIQR+Kc=; b=YBheB+HtszZhY7eYRMeCZb02XDyepOiRIYLi4ChPnCCMQ2NWeXWKQPUY95CKa45b210h2X iUTWmkKfzhUH6QkH0ewy58mvfiPEd9VLKSJ4Km360nLJTurniD7VB6e92fGtYlrbxeap6T RzaH4cBZOy8QG98t+qQsPKY5JQCH+wHxBVS0+xBz4VwGhRPYYXpfaETwDz7D5seAUhjMyn X6Hjj6964kp1Gd+3UxAXx4NSbHgI6jgRN+DvBJUqMx1u+DURpZbwJwffCqn7VIK6bZ5Kos lC1mI1YiqlZbXK+TROQmfTqGQTIkI5b3aG/zanqlPrgMLx/anWb2PghErMNahg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037373; a=rsa-sha256; cv=none; b=RoKrjyJiMtzVJgcT97c6vy4nT+p/9UgI+iFaJN2EN7fRhzGTX7IrFw5RekpLBlPvACkbLb SHMW30Bip1jxngbK7CinJCPTEuD27Y5SPXbLMfrq++qFxKnWjNbUeF5DpO3zLTTWg8eTzy VOtO2AUhPMHfQHb98qZm1VWWh3YiYpcd2HJ4NnlyY2fJqyN9B04iv+lXTVE3GGbAZHnRvZ Za/sNPjJ83ui0IiEjJv+wKIztVrgnp9uwAIsco0yUQDfZsPRzIt4WdlS2FvHM0dPzOOMUb E57qkNVau3uzFwdNIeTs+UNoMnSNFYQspr8nmOjpK13RGbAaDbYINNQC20Waiw== 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 4bTJzd17WGztHT; Fri, 27 Jun 2025 15:16:13 +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 55RFGDSl049123; Fri, 27 Jun 2025 15:16:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFGDHU049120; Fri, 27 Jun 2025 15:16:13 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:13 GMT Message-Id: <202506271516.55RFGDHU049120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c114db294d5d - main - pf: Refactor the six ways to find TCP options into one new function. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c114db294d5d0cf82eb010c09061330aa0fdc925 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c114db294d5d0cf82eb010c09061330aa0fdc925 commit c114db294d5d0cf82eb010c09061330aa0fdc925 Author: Kristof Provost AuthorDate: 2025-06-24 11:27:56 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:16 +0000 pf: Refactor the six ways to find TCP options into one new function. As a result: - MSS and WSCALE option candidates must now meet their min type length. - 'max-mss' is now more tolerant of malformed option lists. These changes were immaterial to the live traffic I've examined. OK sashan@ mpi@ Obtained from: OpenBSD, procter , 672fea2ccb Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 + sys/netpfil/pf/pf.c | 198 ++++++++++++++++++------------------- sys/netpfil/pf/pf_norm.c | 247 +++++++++++++++++++---------------------------- 3 files changed, 193 insertions(+), 254 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9fc2a00dca77..71cb1862aabf 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2601,6 +2601,8 @@ int pf_tag_packet(struct pf_pdesc *, int); int pf_addr_cmp(struct pf_addr *, struct pf_addr *, sa_family_t); +uint8_t* pf_find_tcpopt(u_int8_t *, u_int8_t *, size_t, + u_int8_t, u_int8_t); u_int16_t pf_get_mss(struct pf_pdesc *); u_int8_t pf_get_wscale(struct pf_pdesc *); struct mbuf *pf_build_tcp(const struct pf_krule *, sa_family_t, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4ce2df2f0e31..f4d6f3dcb869 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3933,55 +3933,42 @@ static int pf_modulate_sack(struct pf_pdesc *pd, struct tcphdr *th, struct pf_state_peer *dst) { - int hlen = (th->th_off << 2) - sizeof(*th), thoptlen = hlen; - u_int8_t opts[TCP_MAXOLEN], *opt = opts; - int copyback = 0, i, olen; - struct sackblk sack; - -#define TCPOLEN_SACKLEN (TCPOLEN_SACK + 2) - if (hlen < TCPOLEN_SACKLEN || hlen > MAX_TCPOPTLEN || - !pf_pull_hdr(pd->m, pd->off + sizeof(*th), opts, hlen, NULL, NULL, pd->af)) - return 0; - - while (hlen >= TCPOLEN_SACKLEN) { - size_t startoff = opt - opts; - olen = opt[1]; - switch (*opt) { - case TCPOPT_EOL: /* FALLTHROUGH */ - case TCPOPT_NOP: - opt++; - hlen--; - break; - case TCPOPT_SACK: - if (olen > hlen) - olen = hlen; - if (olen >= TCPOLEN_SACKLEN) { - for (i = 2; i + TCPOLEN_SACK <= olen; - i += TCPOLEN_SACK) { - memcpy(&sack, &opt[i], sizeof(sack)); - pf_patch_32(pd, - &sack.start, - htonl(ntohl(sack.start) - dst->seqdiff), - PF_ALGNMNT(startoff)); - pf_patch_32(pd, - &sack.end, - htonl(ntohl(sack.end) - dst->seqdiff), - PF_ALGNMNT(startoff)); - memcpy(&opt[i], &sack, sizeof(sack)); - copyback = 1; - } - } - /* FALLTHROUGH */ - default: - if (olen < 2) - olen = 2; - hlen -= olen; - opt += olen; + struct sackblk sack; + int copyback = 0, i; + int olen, optsoff; + uint8_t opts[MAX_TCPOPTLEN], *opt, *eoh; + + olen = (pd->hdr.tcp.th_off << 2) - sizeof(struct tcphdr); + optsoff = pd->off + sizeof(struct tcphdr); +#define TCPOLEN_MINSACK (TCPOLEN_SACK + 2) + if (olen < TCPOLEN_MINSACK || + !pf_pull_hdr(pd->m, optsoff, opts, olen, NULL, NULL, pd->af)) + return (0); + + eoh = opts + olen; + opt = opts; + while ((opt = pf_find_tcpopt(opt, opts, olen, + TCPOPT_SACK, TCPOLEN_MINSACK)) != NULL) + { + size_t safelen = MIN(opt[1], (eoh - opt)); + for (i = 2; i + TCPOLEN_SACK <= safelen; i += TCPOLEN_SACK) { + size_t startoff = (opt + i) - opts; + memcpy(&sack, &opt[i], sizeof(sack)); + pf_patch_32(pd, &sack.start, + htonl(ntohl(sack.start) - dst->seqdiff), + PF_ALGNMNT(startoff)); + pf_patch_32(pd, &sack.end, + htonl(ntohl(sack.end) - dst->seqdiff), + PF_ALGNMNT(startoff + sizeof(sack.start))); + memcpy(&opt[i], &sack, sizeof(sack)); } + copyback = 1; + opt += opt[1]; } if (copyback) - m_copyback(pd->m, pd->off + sizeof(*th), thoptlen, (caddr_t)opts); + m_copyback(pd->m, optsoff, olen, (caddr_t)opts); + return (copyback); } @@ -4965,83 +4952,86 @@ pf_socket_lookup(struct pf_pdesc *pd) return (1); } -u_int8_t -pf_get_wscale(struct pf_pdesc *pd) +/* post: r => (r[0] == type /\ r[1] >= min_typelen >= 2 "validity" + * /\ (eoh - r) >= min_typelen >= 2 "safety" ) + * + * warning: r + r[1] may exceed opts bounds for r[1] > min_typelen + */ +uint8_t* +pf_find_tcpopt(u_int8_t *opt, u_int8_t *opts, size_t hlen, u_int8_t type, + u_int8_t min_typelen) { - struct tcphdr *th = &pd->hdr.tcp; - int hlen; - u_int8_t hdr[60]; - u_int8_t *opt, optlen; - u_int8_t wscale = 0; + uint8_t *eoh = opts + hlen; - hlen = th->th_off << 2; /* hlen <= sizeof(hdr) */ - if (hlen <= sizeof(struct tcphdr)) - return (0); - if (!pf_pull_hdr(pd->m, pd->off, hdr, hlen, NULL, NULL, pd->af)) - return (0); - opt = hdr + sizeof(struct tcphdr); - hlen -= sizeof(struct tcphdr); - while (hlen >= 3) { + if (min_typelen < 2) + return (NULL); + + while ((eoh - opt) >= min_typelen) { switch (*opt) { case TCPOPT_EOL: + /* FALLTHROUGH - Workaround the failure of some + systems to NOP-pad their bzero'd option buffers, + producing spurious EOLs */ case TCPOPT_NOP: - ++opt; - --hlen; - break; - case TCPOPT_WINDOW: - wscale = opt[2]; - if (wscale > TCP_MAX_WINSHIFT) - wscale = TCP_MAX_WINSHIFT; - wscale |= PF_WSCALE_FLAG; - /* FALLTHROUGH */ + opt++; + continue; default: - optlen = opt[1]; - if (optlen < 2) - optlen = 2; - hlen -= optlen; - opt += optlen; - break; + if (opt[0] == type && + opt[1] >= min_typelen) + return (opt); } + + opt += MAX(opt[1], 2); /* evade infinite loops */ + } + + return (NULL); +} + +u_int8_t +pf_get_wscale(struct pf_pdesc *pd) +{ + int olen; + uint8_t opts[MAX_TCPOPTLEN], *opt; + uint8_t wscale = 0; + + olen = (pd->hdr.tcp.th_off << 2) - sizeof(struct tcphdr); + if (olen < TCPOLEN_WINDOW || !pf_pull_hdr(pd->m, + pd->off + sizeof(struct tcphdr), opts, olen, NULL, NULL, pd->af)) + return (0); + + opt = opts; + while ((opt = pf_find_tcpopt(opt, opts, olen, + TCPOPT_WINDOW, TCPOLEN_WINDOW)) != NULL) { + wscale = opt[2]; + wscale = MIN(wscale, TCP_MAX_WINSHIFT); + wscale |= PF_WSCALE_FLAG; + + opt += opt[1]; } + return (wscale); } u_int16_t pf_get_mss(struct pf_pdesc *pd) { - struct tcphdr *th = &pd->hdr.tcp; - int hlen; - u_int8_t hdr[60]; - u_int8_t *opt, optlen; + int olen; + uint8_t opts[MAX_TCPOPTLEN], *opt; u_int16_t mss = V_tcp_mssdflt; - hlen = th->th_off << 2; /* hlen <= sizeof(hdr) */ - if (hlen <= sizeof(struct tcphdr)) - return (0); - if (!pf_pull_hdr(pd->m, pd->off, hdr, hlen, NULL, NULL, pd->af)) + olen = (pd->hdr.tcp.th_off << 2) - sizeof(struct tcphdr); + if (olen < TCPOLEN_MAXSEG || !pf_pull_hdr(pd->m, + pd->off + sizeof(struct tcphdr), opts, olen, NULL, NULL, pd->af)) return (0); - opt = hdr + sizeof(struct tcphdr); - hlen -= sizeof(struct tcphdr); - while (hlen >= TCPOLEN_MAXSEG) { - switch (*opt) { - case TCPOPT_EOL: - case TCPOPT_NOP: - ++opt; - --hlen; - break; - case TCPOPT_MAXSEG: - memcpy(&mss, (opt + 2), 2); - mss = ntohs(mss); - /* FALLTHROUGH */ - default: - optlen = opt[1]; - if (optlen < 2) - optlen = 2; - hlen -= optlen; - opt += optlen; - break; - } + + opt = opts; + while ((opt = pf_find_tcpopt(opt, opts, olen, + TCPOPT_MAXSEG, TCPOLEN_MAXSEG)) != NULL) { + memcpy(&mss, (opt + 2), 2); + mss = ntohs(mss); + opt += opt[1]; } + return (mss); } diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 94a436cdbfd6..369292ca365e 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1499,8 +1499,8 @@ pf_normalize_tcp_init(struct pf_pdesc *pd, struct tcphdr *th, struct pf_state_peer *src) { u_int32_t tsval, tsecr; - u_int8_t hdr[60]; - u_int8_t *opt; + int olen; + uint8_t opts[MAX_TCPOPTLEN], *opt; KASSERT((src->scrub == NULL), ("pf_normalize_tcp_init: src->scrub != NULL")); @@ -1535,43 +1535,25 @@ pf_normalize_tcp_init(struct pf_pdesc *pd, struct tcphdr *th, if ((tcp_get_flags(th) & TH_SYN) == 0) return (0); - if (th->th_off > (sizeof(struct tcphdr) >> 2) && src->scrub && - pf_pull_hdr(pd->m, pd->off, hdr, th->th_off << 2, NULL, NULL, pd->af)) { - /* Diddle with TCP options */ - int hlen; - opt = hdr + sizeof(struct tcphdr); - hlen = (th->th_off << 2) - sizeof(struct tcphdr); - while (hlen >= TCPOLEN_TIMESTAMP) { - switch (*opt) { - case TCPOPT_EOL: /* FALLTHROUGH */ - case TCPOPT_NOP: - opt++; - hlen--; - break; - case TCPOPT_TIMESTAMP: - if (opt[1] >= TCPOLEN_TIMESTAMP) { - src->scrub->pfss_flags |= - PFSS_TIMESTAMP; - src->scrub->pfss_ts_mod = - arc4random(); - - /* note PFSS_PAWS not set yet */ - memcpy(&tsval, &opt[2], - sizeof(u_int32_t)); - memcpy(&tsecr, &opt[6], - sizeof(u_int32_t)); - src->scrub->pfss_tsval0 = ntohl(tsval); - src->scrub->pfss_tsval = ntohl(tsval); - src->scrub->pfss_tsecr = ntohl(tsecr); - getmicrouptime(&src->scrub->pfss_last); - } - /* FALLTHROUGH */ - default: - hlen -= MAX(opt[1], 2); - opt += MAX(opt[1], 2); - break; - } - } + olen = (th->th_off << 2) - sizeof(*th); + if (olen < TCPOLEN_TIMESTAMP || !pf_pull_hdr(pd->m, + pd->off + sizeof(*th), opts, olen, NULL, NULL, pd->af)) + return (0); + + opt = opts; + while ((opt = pf_find_tcpopt(opt, opts, olen, + TCPOPT_TIMESTAMP, TCPOLEN_TIMESTAMP)) != NULL) { + src->scrub->pfss_flags |= PFSS_TIMESTAMP; + src->scrub->pfss_ts_mod = arc4random(); + /* note PFSS_PAWS not set yet */ + memcpy(&tsval, &opt[2], sizeof(u_int32_t)); + memcpy(&tsecr, &opt[6], sizeof(u_int32_t)); + src->scrub->pfss_tsval0 = ntohl(tsval); + src->scrub->pfss_tsval = ntohl(tsval); + src->scrub->pfss_tsecr = ntohl(tsecr); + getmicrouptime(&src->scrub->pfss_last); + + opt += opt[1]; } return (0); @@ -1611,13 +1593,12 @@ pf_normalize_tcp_stateful(struct pf_pdesc *pd, struct pf_state_peer *src, struct pf_state_peer *dst, int *writeback) { struct timeval uptime; - u_int32_t tsval, tsecr; u_int tsval_from_last; - u_int8_t hdr[60]; - u_int8_t *opt; + uint32_t tsval, tsecr; int copyback = 0; int got_ts = 0; - size_t startoff; + int olen; + uint8_t opts[MAX_TCPOPTLEN], *opt; KASSERT((src->scrub || dst->scrub), ("%s: src->scrub && dst->scrub!", __func__)); @@ -1654,80 +1635,64 @@ pf_normalize_tcp_stateful(struct pf_pdesc *pd, unhandled_af(pd->af); } - if (th->th_off > (sizeof(struct tcphdr) >> 2) && + olen = (th->th_off << 2) - sizeof(*th); + + if (olen >= TCPOLEN_TIMESTAMP && ((src->scrub && (src->scrub->pfss_flags & PFSS_TIMESTAMP)) || (dst->scrub && (dst->scrub->pfss_flags & PFSS_TIMESTAMP))) && - pf_pull_hdr(pd->m, pd->off, hdr, th->th_off << 2, NULL, NULL, pd->af)) { - /* Diddle with TCP options */ - int hlen; - opt = hdr + sizeof(struct tcphdr); - hlen = (th->th_off << 2) - sizeof(struct tcphdr); - while (hlen >= TCPOLEN_TIMESTAMP) { - startoff = opt - (hdr + sizeof(struct tcphdr)); - switch (*opt) { - case TCPOPT_EOL: /* FALLTHROUGH */ - case TCPOPT_NOP: - opt++; - hlen--; - break; - case TCPOPT_TIMESTAMP: - /* Modulate the timestamps. Can be used for - * NAT detection, OS uptime determination or - * reboot detection. - */ - - if (got_ts) { - /* Huh? Multiple timestamps!? */ - if (V_pf_status.debug >= PF_DEBUG_MISC) { - DPFPRINTF(("multiple TS??\n")); - pf_print_state(state); - printf("\n"); - } - REASON_SET(reason, PFRES_TS); - return (PF_DROP); - } - if (opt[1] >= TCPOLEN_TIMESTAMP) { - memcpy(&tsval, &opt[2], - sizeof(u_int32_t)); - if (tsval && src->scrub && - (src->scrub->pfss_flags & - PFSS_TIMESTAMP)) { - tsval = ntohl(tsval); - copyback += pf_patch_32(pd, - &opt[2], - htonl(tsval + - src->scrub->pfss_ts_mod), - PF_ALGNMNT(startoff)); - } - - /* Modulate TS reply iff valid (!0) */ - memcpy(&tsecr, &opt[6], - sizeof(u_int32_t)); - if (tsecr && dst->scrub && - (dst->scrub->pfss_flags & - PFSS_TIMESTAMP)) { - tsecr = ntohl(tsecr) - - dst->scrub->pfss_ts_mod; - copyback += pf_patch_32(pd, - &opt[6], - htonl(tsecr), - PF_ALGNMNT(startoff)); - } - got_ts = 1; + pf_pull_hdr(pd->m, pd->off + sizeof(*th), opts, olen, NULL, NULL, pd->af)) { + /* Modulate the timestamps. Can be used for NAT detection, OS + * uptime determination or reboot detection. + */ + opt = opts; + while ((opt = pf_find_tcpopt(opt, opts, olen, + TCPOPT_TIMESTAMP, TCPOLEN_TIMESTAMP)) != NULL) { + uint8_t *ts = opt + 2; + uint8_t *tsr = opt + 6; + + if (got_ts) { + /* Huh? Multiple timestamps!? */ + if (V_pf_status.debug >= PF_DEBUG_MISC) { + printf("pf: %s: multiple TS??", __func__); + pf_print_state(state); + printf("\n"); } - /* FALLTHROUGH */ - default: - hlen -= MAX(opt[1], 2); - opt += MAX(opt[1], 2); - break; + REASON_SET(reason, PFRES_TS); + return (PF_DROP); } + + memcpy(&tsval, ts, sizeof(u_int32_t)); + memcpy(&tsecr, tsr, sizeof(u_int32_t)); + + /* modulate TS */ + if (tsval && src->scrub && + (src->scrub->pfss_flags & PFSS_TIMESTAMP)) { + /* tsval used further on */ + tsval = ntohl(tsval); + pf_patch_32(pd, + ts, htonl(tsval + src->scrub->pfss_ts_mod), + PF_ALGNMNT(ts - opts)); + copyback = 1; + } + + /* modulate TS reply if any (!0) */ + if (tsecr && dst->scrub && + (dst->scrub->pfss_flags & PFSS_TIMESTAMP)) { + /* tsecr used further on */ + tsecr = ntohl(tsecr) - dst->scrub->pfss_ts_mod; + pf_patch_32(pd, tsr, htonl(tsecr), + PF_ALGNMNT(tsr - opts)); + copyback = 1; + } + + got_ts = 1; + opt += opt[1]; } + if (copyback) { /* Copyback the options, caller copys back header */ *writeback = 1; - m_copyback(pd->m, pd->off + sizeof(struct tcphdr), - (th->th_off << 2) - sizeof(struct tcphdr), hdr + - sizeof(struct tcphdr)); + m_copyback(pd->m, pd->off + sizeof(*th), olen, opts); } } @@ -1999,50 +1964,32 @@ pf_normalize_tcp_stateful(struct pf_pdesc *pd, int pf_normalize_mss(struct pf_pdesc *pd) { - struct tcphdr *th = &pd->hdr.tcp; - u_int16_t *mss; - int thoff; - int opt, cnt, optlen = 0; - u_char opts[TCP_MAXOLEN]; - u_char *optp = opts; - size_t startoff; - - thoff = th->th_off << 2; - cnt = thoff - sizeof(struct tcphdr); - - if (cnt <= 0 || cnt > MAX_TCPOPTLEN || !pf_pull_hdr(pd->m, - pd->off + sizeof(*th), opts, cnt, NULL, NULL, pd->af)) + int olen, optsoff; + uint8_t opts[MAX_TCPOPTLEN], *opt; + + olen = (pd->hdr.tcp.th_off << 2) - sizeof(struct tcphdr); + optsoff = pd->off + sizeof(struct tcphdr); + if (olen < TCPOLEN_MAXSEG || + !pf_pull_hdr(pd->m, optsoff, opts, olen, NULL, NULL, pd->af)) return (0); - for (; cnt > 0; cnt -= optlen, optp += optlen) { - startoff = optp - opts; - opt = optp[0]; - if (opt == TCPOPT_EOL) - break; - if (opt == TCPOPT_NOP) - optlen = 1; - else { - if (cnt < 2) - break; - optlen = optp[1]; - if (optlen < 2 || optlen > cnt) - break; - } - switch (opt) { - case TCPOPT_MAXSEG: - mss = (u_int16_t *)(optp + 2); - if ((ntohs(*mss)) > pd->act.max_mss) { - pf_patch_16(pd, - mss, htons(pd->act.max_mss), - PF_ALGNMNT(startoff)); - m_copyback(pd->m, pd->off + sizeof(*th), - thoff - sizeof(*th), opts); - m_copyback(pd->m, pd->off, sizeof(*th), (caddr_t)th); - } - break; - default: - break; + opt = opts; + while ((opt = pf_find_tcpopt(opt, opts, olen, + TCPOPT_MAXSEG, TCPOLEN_MAXSEG)) != NULL) { + uint16_t mss; + uint8_t *mssp = opt + 2; + memcpy(&mss, mssp, sizeof(mss)); + if (ntohs(mss) > pd->act.max_mss) { + size_t mssoffopts = mssp - opts; + pf_patch_16(pd, &mss, + htons(pd->act.max_mss), PF_ALGNMNT(mssoffopts)); + m_copyback(pd->m, optsoff + mssoffopts, + sizeof(mss), (caddr_t)&mss); + m_copyback(pd->m, pd->off, + sizeof(struct tcphdr), (caddr_t)&pd->hdr.tcp); } + + opt += opt[1]; } return (0); From nobody Fri Jun 27 15:16:16 2025 X-Original-To: dev-commits-src-main@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 4bTJzh6sDTz5yvJj; Fri, 27 Jun 2025 15:16: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 4bTJzh42hbz3Ydl; Fri, 27 Jun 2025 15:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037376; 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=k5ARhKdBpgmFXcudo2YFd8tZW0drgDyqmMdLmddM/gg=; b=hL7oELqJipBC2RXJAqQo3cQhPqPkL/WzG3UNvvzbN6JEr3qMETNT3vc9z7pODMJTLw3tym yiMzxwo4yLACN55VqWmtJ/DA5M/+ShnJ24BWIpvgqGqIRjfSb4z0QlPB2fx41ErsIKnPl1 WEzsynGpNVV0bPDzlBwyMIwFLT5+YpJHZF8EyFOiftx2bCjlwSwlzmQKN92bNe71RkOGCt pmn3niBfSmYHD76FUzkxiU3Re3SIfhPTm0vmvAz4hyY6qPcVqUDj0VRchZVfqw9OTcjr5P E23InftBVuuuPBWlPDvpDNzQbOBvuZ7uCZZfB2O1+l2wEEmml6wDbx5Rg3KRPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037376; 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=k5ARhKdBpgmFXcudo2YFd8tZW0drgDyqmMdLmddM/gg=; b=bF2j8P117th6jVKUMSp1b+XG6dFV5Sf0KIedvMr9VlS/YsBdsVc9MF28mArUokq4YHB45J X4F7B8XG3p+VK0tkk2BU22QqrZRhRUCN04fpL8uRljnpXhtbC0/uT4Fd0JqVKsMThnBfjs 5KDE0Zad0fDQKWPwqtNnHXya/oBwqC/R5G3PbEFQ4j4wRxTU7e3dG/GXA1GkxNWT7YWJnB JCpVUFgIB/lWODvOhbDVDc1k4uIY/HH7XlfJnX/CKaTZkP1OR2cvW1QpZa9x30d1mXhnl+ fAoWtbtnyoPECjJS5j0umGzuBBrl4yQW+GnfRgA1QiQtDBj2Dz1k+6t++fMNSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037376; a=rsa-sha256; cv=none; b=SL7b3famMHZ9xnqBxIBTtG/c6QXgi/3WAQnGBsJOPTLdn9TFvPEBGHDYFHAsZiklr/6J2d 6vBdNMKoJi9FfJHmi/PhTzsaV2WPCtybHstqzs8yxpfeGZlhJxhtarWgEIe8rEI2u/Z195 YF1JX+QOq8PuNaW4tz5Ja41adH675+e9RNMVAh/iKX3ktyxzLC4AkRBtPUP3+gZrweaMg3 kiq9Nc9L0LTYOQ/yGSCzxyM8f9zv+JAyYtIxdDvDa8IUBnn8EanlkqlXuSGFCAfaTf1FPz YtF8lPMDi7T/H+M+bJE3dMLoUMyQ8n/zrdWVQ/+v3yj6UENwdPIltHL4yRyFtg== 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 4bTJzh3bfczsgd; Fri, 27 Jun 2025 15:16: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 55RFGGhk049219; Fri, 27 Jun 2025 15:16:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFGG7K049216; Fri, 27 Jun 2025 15:16:16 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:16 GMT Message-Id: <202506271516.55RFGG7K049216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6ccd82f8deb5 - main - pfctl: clean up allocation warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ccd82f8deb5cff3e5c2ad4df594c60470062c08 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6ccd82f8deb5cff3e5c2ad4df594c60470062c08 commit 6ccd82f8deb5cff3e5c2ad4df594c60470062c08 Author: Kristof Provost AuthorDate: 2025-06-24 11:51:35 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:17 +0000 pfctl: clean up allocation warnings No need to mention which memory allocation entry point failed (malloc, calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@ Obtained from: OpenBSD, krw , 6a3d55f939 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 41f2d8dc70e7..39d5ba317653 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7143,23 +7143,21 @@ pushfile(const char *name, int secret) if ((nfile = calloc(1, sizeof(struct file))) == NULL || (nfile->name = strdup(name)) == NULL) { - if (nfile) { - warn("strdup"); + warn("%s", __func__); + if (nfile) free(nfile); - } else - warn("calloc"); return (NULL); } if (TAILQ_FIRST(&files) == NULL && strcmp(nfile->name, "-") == 0) { nfile->stream = stdin; free(nfile->name); if ((nfile->name = strdup("stdin")) == NULL) { - warn("strdup"); + warn("%s", __func__); free(nfile); return (NULL); } } else if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { - warn("%s", nfile->name); + warn("%s: %s", __func__, nfile->name); free(nfile->name); free(nfile); return (NULL); @@ -7174,7 +7172,7 @@ pushfile(const char *name, int secret) nfile->ungetsize = 16; nfile->ungetbuf = malloc(nfile->ungetsize); if (nfile->ungetbuf == NULL) { - warn("malloc"); + warn("%s", __func__); fclose(nfile->stream); free(nfile->name); free(nfile); From nobody Fri Jun 27 15:16:15 2025 X-Original-To: dev-commits-src-main@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 4bTJzg6R2Xz5yvJf; Fri, 27 Jun 2025 15:16: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 4bTJzg3FBMz3Ydd; Fri, 27 Jun 2025 15:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037375; 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=3N/uiFKxEsEQzCtRRH9d0uAEMQpJRvyvOVOV/3++s2s=; b=eO81UfTNNbHo2f9zZsX1QAbcoq3c2UTuxjzccZJXoBEP6UK37c9KJvE/GieOgKMVp7h6jO pbH4eLsLjJl9p4v0NDk9HNijUVJTjzXcggMDnmBNVIAbBTYL96KW23ABvbZrc0Xl1Wvw+P SQ9yr/qcuQC0OhcJ5XHefF9xbS6NBm1/LJQtjQgPUKZT8W8uahTElq33Lv/JC752pwbKxk yCN7i8YEo1h3gELLSFfWLncwwYcfSiyIgV0EunOCk48/2OogkilFN3+yuaWM6tg50dHxyY NSWTREPki7Ox+lchwn9iP/Gd+YGz18/PX5Wk5ib3rkkRPtDIrUaWeJz3IVzBKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037375; 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=3N/uiFKxEsEQzCtRRH9d0uAEMQpJRvyvOVOV/3++s2s=; b=ti7p4cfrM4jf3/gCGyIBMju+PpbvBx6/OWP+peiyiHj50zVuVv1hV2xwsLaURFrBYUw3Oq R0g4qmMm4SO2dCvtphLQ9zsEqy3l4LztHczmT/HvaoHELGGR9ZGwFdcUJ6TMlBJLFYAEVv j4RuOKTwtqI95yoVUggE7MpSISPI8WaS+GU1WSo3LWP1F7sZksF3clwjN0DNKTYUh9gTtJ FBI7OGeBlS4em1iJXmWKPgelBr0Vpn8she94lo5P/lP5A40Bgg7GQ+Tt29xYue0s/V54Rt 0pIU5qmLXHReemcmn5tomXU/w+/Vn7IuLBZNRXSWP17xZ62vTUT6PUUCilbvcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037375; a=rsa-sha256; cv=none; b=E9j2b9A6IWPZZ2PQCe5ikjZ9PITh2N5WoSmhef4LNyWiDjaYSU15Uq+Jku6CYEZiBLmuoO jG9W7PpWV/DI1yNUYCNmRMsgi0LCNEhuYTJDdKLFpYnXFlftleXVgD1hfzSMwFJR+ZQLPu ReXyDp5kOXmmHynelKMFK9q0cGnJ3G/EHDT2Hjr8ij/lumyD95uSEKm6FGxz3SlahDB7Uu H5rrBteX6R+8lDEGbA73xaY5MEWyXv6yNQb6VAJMg0woRefX4pQtspSQK3gzfregYySyIq i5kH98um1+nudmNc0Q8j6C20MDlz1ub0vgFf6BZTwPJop1YF/hLTOeFNgr2J7g== 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 4bTJzg2LQPztWv; Fri, 27 Jun 2025 15:16: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 55RFGFo3049187; Fri, 27 Jun 2025 15:16:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFGFII049184; Fri, 27 Jun 2025 15:16:15 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:15 GMT Message-Id: <202506271516.55RFGFII049184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c31621c125ee - main - pfctl: fix memory leak List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c31621c125ee4fa60e320781447864ebca5b3173 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c31621c125ee4fa60e320781447864ebca5b3173 commit c31621c125ee4fa60e320781447864ebca5b3173 Author: Kristof Provost AuthorDate: 2025-06-24 11:43:26 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:17 +0000 pfctl: fix memory leak Be consistent in warn() and log_warn() usage when running out of memory. Next step, be correct *and* consistent. ok dennis@ tb@ benno@ schwarze@ Obtained from: OpenBSD, krw , 3c12ada049 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 8afef160b205..41f2d8dc70e7 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7143,9 +7143,11 @@ pushfile(const char *name, int secret) if ((nfile = calloc(1, sizeof(struct file))) == NULL || (nfile->name = strdup(name)) == NULL) { - if (nfile) + if (nfile) { + warn("strdup"); free(nfile); - warn("malloc"); + } else + warn("calloc"); return (NULL); } if (TAILQ_FIRST(&files) == NULL && strcmp(nfile->name, "-") == 0) { From nobody Fri Jun 27 15:16:17 2025 X-Original-To: dev-commits-src-main@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 4bTJzl1jcvz5yvM3; Fri, 27 Jun 2025 15:16: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 4bTJzj5XCsz3Yf5; Fri, 27 Jun 2025 15:16:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037378; 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=GYjZ2m6qMRqiB0saY5kTFVWRZg3cRaRRyZETnc5Lag0=; b=XbUS85nZnJsxZqnk0DZR7JmNIoU+1sZmZXtmVDFFwIhrjIO9yRtMpGcEcntYgqdGaVtJI+ CGCABDDddJnU8/SfOiqGmR74/j6ex/e/ulQte8SA9tbJgWFZmRUpzJYSmloxT5v12QguWc RgxZuEnkpj2/qdS/4Q14Ev+3vNXiwdHmVcjM4itjnRastq5ggwbx2vBt3NT62ZOJS3Hzf6 7LkF6BlPakSWv+ittTH/UXlLHEATXhzW9P4yAGi3Zr7PeMTwbHB45fLZivyfWsm4ExSndh zY3k7i956TNM8KiN6bMREMO+BnzK2fyzbjcOhhDS8LoUWphMYJtMIMO/rhx1Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037378; 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=GYjZ2m6qMRqiB0saY5kTFVWRZg3cRaRRyZETnc5Lag0=; b=jt2S2rFXNa9QgVx0xa2D3x9CEcea3gL/tgdmndLtOkhaUP7dGFMnkuU4dBHOX4NFnmng8A 7L8pVJHRKu3PM+wwopNcXV1dScS0WXbtbDpuAuOXucByAIGhaBv7tCKAlS/snEU5BjxQ0S orqmJZsmEI0BsCa696VxsYtGXptkBS9NNyC8pXgti9xs4x55/cryuHuZn3PDNv4Z7yIQWi O851iCfBbOw2jQz+xF7aiu23XYIdc2C2dRPlE5PtcGL48i34XzUb8Bb0hbABLIaS7ehSgs vby0kvGBOlcQRe2AW6qJeL0MQApFKJc0M78aHJi8FqI7wpjb2WvDABEO/SKbYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037378; a=rsa-sha256; cv=none; b=fgT9//Kxot2zaLxFV+6qtj++2TmDlNsPrulv09AYXPLgx5K61jp7HLqMRahq9tZJKuDace rl8uvXMwH+lmTiud35V4YkLTY5+W57IAFNakSY74dCT5FNXlKZb1OZFr44BYNWZLVm+YDs U9zV2fGe1bZ1gEglqvQf9AcPsVSGtRp9VM70Zfatv5teuj1N2/sKazogCiMTNQm+5xs67C SvGyCReDX6BKDXK18UESBUh6Gh8qCo0WNfFZHstC+TqGamsBQlPF2XQMFcy4YiUXaHqGJ0 EHU38VQWMo+AAzJFCZ8dUVzXoCPfWxnpYpr9I7Djl4PLzL2FJ31oBRLBDXxa5Q== 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 4bTJzj4Zjbzsx4; Fri, 27 Jun 2025 15:16: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 55RFGHXJ049251; Fri, 27 Jun 2025 15:16:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFGHdM049248; Fri, 27 Jun 2025 15:16:17 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:16:17 GMT Message-Id: <202506271516.55RFGHdM049248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5f739302ba0a - main - pfctl: Zap dead code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f739302ba0ab615ba640b0c65d85d67dd826cc8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5f739302ba0ab615ba640b0c65d85d67dd826cc8 commit 5f739302ba0ab615ba640b0c65d85d67dd826cc8 Author: Kristof Provost AuthorDate: 2025-06-24 11:52:53 +0000 Commit: Kristof Provost CommitDate: 2025-06-27 14:55:17 +0000 pfctl: Zap dead code Commented since r1.465 (2004). OK deraadt benno jca sashan Obtained from: OpenBSD, kn , 478eec1c5a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 39d5ba317653..9b89dc7642c5 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -2492,14 +2492,6 @@ pfrule : action dir logquick interface route af proto fromto "apply to tcp"); YYERROR; } -#if 0 - if (($9.flags.b1 & parse_flags("S")) == 0 && - $8.src_os) { - yyerror("OS fingerprinting requires " - "the SYN TCP flag (flags S/SA)"); - YYERROR; - } -#endif } r.tos = $9.tos; From nobody Fri Jun 27 15:20:39 2025 X-Original-To: dev-commits-src-main@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 4bTK4m5t5sz5yvSl; Fri, 27 Jun 2025 15:20: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 4bTK4l6ndzz3gGl; Fri, 27 Jun 2025 15:20:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037640; 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=omDG1nzWbqtQynWQ4fsnuNpTt/HNR7wU+Poo3/aKODM=; b=Dr3edkvO0YD1C+0UwoNsyr+RD2Clf+GOsHbEteA8m8PEwBaxYZdyZAgrXI79QA0EHclvnc dc9vSVuNRr34wHlPKUMfyYe5u+D5YCSO3yflwRXqaWFxdk/svULQvcJlT2BJYm5Y3Qk3/W 4MYT2kvXKDXv8LuhiSrUwzuyCIAu6Q2mwNeZ0uz699VZWBM+awWVHnES24/ZgW5lLHClNP 0YGHavDwL3vtRdmWWbGphsPBxa3WVoFx2inV2AEOb6vTi9l3GXRvgur0Ny5pxCiHuGlv+u eGmbkebbFsTpDpRX5yOgQhecFeVW3iO5O1hapIMsf9Fsdi5ktso5j0z1VNn5ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751037640; 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=omDG1nzWbqtQynWQ4fsnuNpTt/HNR7wU+Poo3/aKODM=; b=mG0VBidGbj0PxxZKa33Db6VWdxYxPXRDfFnm7bzuwb1KCI5NKaG1myhT5ItHs3vTbdqpu1 kDJXHwFALTfmF6Uq6vr+YzY+FfxW6KvZbWWKY1WSlvweNXFYjWcFX++3jp1tN8SboKHo8m X7NiPgIUFT1UUL0Vg6q2dF+MTO1gQcjWyV7b9bIs1LHE7um/KnGXhqE5NayQG9Kdhe4Vkw KL4QsTMmvqu6w/vQ5G63FSVYptTQF8S2w8d4ek8E2kagJoFmD5TkqH6daM/1AW1+iPbI7t H+DCvNDE7Uuh6X1bkvUrlVXGDlscZ3Q3IDKJNub6FGt3PsZ694BMVMsy7VYv1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751037640; a=rsa-sha256; cv=none; b=Fpf/CRgT9IdjZWAaEomKNZvKaMhKJUL1cMvQdX06V0c4t//2y8P1C+Eby5UPJ/u3IJPulO SrkhzzDkjruqFfdYkErtJP3j/BLC784aQr+do9CoMF0cn4FgWWQJ7hIhc3ZA2xVzjiqugv wY6qw71iduVNWoW+4WIw/CFKwjUyW4gt1otEcYR9pBcnWy9YvvZYngmSPxeZen2ns7wCQP Qmjo+kXjpdXI9iAyGUvnqiFGIn4yjFdogZV4sV+xBxqj6BQPPYfuTui3A4wRVeb8uSxjOO oXMk/o3cQhqzK3Nlsb7j+DAmhyLz/IC91dITpGykMX+DdtssgajNTDDLXDKnaQ== 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 4bTK4l67KXztHY; Fri, 27 Jun 2025 15:20: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 55RFKd4E061484; Fri, 27 Jun 2025 15:20:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFKd7l061481; Fri, 27 Jun 2025 15:20:39 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:20:39 GMT Message-Id: <202506271520.55RFKd7l061481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 2c6e4aed07b2 - main - Fix typos in the CI configuration List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c6e4aed07b268f9ddb33950dc117c21b021e390 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=2c6e4aed07b268f9ddb33950dc117c21b021e390 commit 2c6e4aed07b268f9ddb33950dc117c21b021e390 Author: kalinasp AuthorDate: 2025-06-24 16:14:27 +0000 Commit: Alan Somers CommitDate: 2025-06-27 15:19:57 +0000 Fix typos in the CI configuration Fixes: a5f03413aade8f69cf954162151da043d34dd1f5 Fixes: c08f5ad160bf7c844677e1960b1a882d492006f8 Reviewed by: asomers, imp, zlei Pull Request: https://github.com/freebsd/freebsd-src/pull/1736 --- tests/ci/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ci/Makefile b/tests/ci/Makefile index e6464e8392e6..b57de345f852 100644 --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -173,15 +173,15 @@ ci-buildworld: .PHONY ci-buildkernel: ci-buildworld-${TARGET_ARCH:tl} .PHONY - @echo "Building kernel for ${TARGET_ARCH"}" + @echo "Building kernel for ${TARGET_ARCH}" ${IMAKE} -j${PARALLEL_JOBS} -C ${WORLDDIR} ${METAMODE} \ - ${CROSS_TOOLCHAIN_PARAM} __MAKE_CONF=${MAKECONF} SRCCONF=${SRCCONF} + ${CROSS_TOOLCHAIN_PARAM} __MAKE_CONF=${MAKECONF} SRCCONF=${SRCCONF} \ ${EXTRA_MAKE_FLAGS} KERNCONF=${KERNCONF} \ buildkernel > ${.CURDIR}/_.${TARGET_ARCH}.${.TARGET} 2>&1 || \ (echo "${.TARGET} failed, check _.${TARGET_ARCH}.${.TARGET} for details" ; false) ci-buildimage: ${QEMUTGT} ci-buildkernel-${TARGET_ARCH:tl} .PHONY - @echo "Building ci image for ${TARGET_ARCH"}" + @echo "Building ci image for ${TARGET_ARCH}" mkdir -p ${.OBJDIR}/${.TARGET} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ QEMUSTATIC=${QEMUSTATIC} CITYPE=${CITYPE} \ From nobody Fri Jun 27 15:59:32 2025 X-Original-To: dev-commits-src-main@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 4bTKxd0DjLz5yx75; Fri, 27 Jun 2025 15:59: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 4bTKxc5tzmz41BW; Fri, 27 Jun 2025 15:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751039972; 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=wft+TCgk7bkfuZ4oWkOOQnyFosJg2mfTuVxSJkrThoY=; b=Wfkovka9aTbq2mdxfAdug4JS7lXfWDX3ftUPYcUoPJa3OP4ID7Do1CQi4Bw6g7VqsNEOSA XdajH02lktW2E0bPCjaQ1PxJiTb9J7lQflp56g84jZo9Z7eDAP3RnikFBYCzkq3m0biZyh PEIsLwhyLKLBl/mjL5uTYcuFnl7KWPMuXx87T2Wnj+iFbYG9rVKbIPrFMgPJblQhPkBeu/ 9liIpZJZWGhOJCexkiUXs0YPaUO/8cRTHLY+qDUKnvrGFzU6KPeEvL7a75PgTGh+w3d6qj rOfwXWD1NQkhSZVOvzoiVY4OO570+aPkaVPRkLELld855aVQ7P6IpgdMJtKHjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751039972; 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=wft+TCgk7bkfuZ4oWkOOQnyFosJg2mfTuVxSJkrThoY=; b=evBdfurHTy7c0onNPdynueyMz8nm4jTJfJ05H+GxrpK+W7S2BJztrJAWTxVkojLroXn2bP /ddHtNva3NNFsW3sGm/qXLFh/pRkHGC4xVK0LlQJtcNhE6r3JJDjFBJkpoWlqT+ohrP2ce 0mmkWjFUAtml92lfjPZw82Oq1m4SFJkWzwVkokOIFBXlNkcuAa0YksIoS0niC40Hpcv5te W4zPEQDfkAnS7pp9IXVrwXivzKUJ+a5zQTkDcvo9Kmkm6IjPwLIoRS/FDjp6yC1iT0z89a zTc/Pu2SM5nDnlSqyv6gR7j4l+KFuRH7D19hpG5/4pLlSi5P/Q25WslQVxOFmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751039972; a=rsa-sha256; cv=none; b=fWRZzyPhq5WhMquMqsi/Mn3sqOxj/H0A8n5FyCX3C0k+/HG8hnaD6TDA2Swiw6b7AL9p6V 1105sXHTm/R1+isQRwGU1LsGtCkYIfaRLKrBB8jTzK2uuR5uivR882LY44KvCd/6bpcyhU OYPSN30bDyap54UmXKwrNTnwhQ2qbMfU8ErjT2XnvPumCK2SrPUZK2LyX4rC5qSIgg3uxe O27CrDXb36cAY7+VGeNPPgdrzyvlc2QbGH4J0yuy/Bew2ldivufoG7cYUI9xvXBpHtjF2h mmOMlgJANm6ZwA7BFMciE5cev6XTRHk7sc+OltzMbf19a/8tHEkU1INKJ/0jJw== 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 4bTKxc56NlzvcY; Fri, 27 Jun 2025 15:59: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 55RFxW73024727; Fri, 27 Jun 2025 15:59:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RFxWdm024724; Fri, 27 Jun 2025 15:59:32 GMT (envelope-from git) Date: Fri, 27 Jun 2025 15:59:32 GMT Message-Id: <202506271559.55RFxWdm024724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 0726c6574f88 - main - sockstat: Add automatic column sizing and remove -w option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0726c6574f889507e5030173bf4c82c80911394d Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=0726c6574f889507e5030173bf4c82c80911394d commit 0726c6574f889507e5030173bf4c82c80911394d Author: Damin Rido AuthorDate: 2025-06-12 09:12:49 +0000 Commit: Alan Somers CommitDate: 2025-06-27 15:54:41 +0000 sockstat: Add automatic column sizing and remove -w option Refactor sockstat to dynamically size table columns based on content. This eliminates the need for the -w option, which is now ignored for backwards compatibility. Numeric columns are now right-aligned for improved readability; previously, they were left-aligned. Unknown fields are now consistently shown as "??" instead of a mix of "", "?", and "?" for output uniformity. Sponsored by: Google, LLC (GSoC 2025) MFC after: 2 weeks Reviewed by: asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/1720 --- usr.bin/sockstat/sockstat.1 | 6 +- usr.bin/sockstat/sockstat.c | 622 +++++++++++++++++++++++++++----------------- 2 files changed, 392 insertions(+), 236 deletions(-) diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index b13c6afdd9c0..da658e33e542 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 6, 2025 +.Dd June 27, 2025 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46ACcfIiLlnqSsUuvw +.Op Fl 46ACcfIiLlnqSsUuv .Op Fl j Ar jail .Op Fl p Ar ports .Op Fl P Ar protocols @@ -119,8 +119,6 @@ Show sockets. .It Fl v Verbose mode. -.It Fl w -Use wider field size for displaying addresses. .El .Pp If neither diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index e1a52c57b3d1..52243910a31c 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -97,7 +97,6 @@ static bool opt_s; /* Show protocol state if applicable */ static bool opt_U; /* Show remote UDP encapsulation port number */ static bool opt_u; /* Show Unix domain sockets */ static u_int opt_v; /* Verbose mode */ -static bool opt_w; /* Wide print area for addresses */ /* * Default protocols to use if no -P was defined. @@ -193,20 +192,6 @@ static cap_channel_t *capnetdb; static cap_channel_t *capsysctl; static cap_channel_t *cappwd; -static int -xprintf(const char *fmt, ...) -{ - va_list ap; - int len; - - va_start(ap, fmt); - len = vprintf(fmt, ap); - va_end(ap); - if (len < 0) - err(1, "printf()"); - return (len); -} - static bool _check_ksize(size_t received_size, size_t expected_size, const char *struct_name) { @@ -941,7 +926,7 @@ getfiles(void) } static int -printaddr(struct sockaddr_storage *ss) +formataddr(struct sockaddr_storage *ss, char *buf, size_t bufsize) { struct sockaddr_un *sun; char addrstr[NI_MAXHOST] = { '\0', '\0' }; @@ -961,18 +946,18 @@ printaddr(struct sockaddr_storage *ss) case AF_UNIX: sun = sstosun(ss); off = (int)((char *)&sun->sun_path - (char *)sun); - return (xprintf("%.*s", sun->sun_len - off, sun->sun_path)); + return snprintf(buf, bufsize, "%.*s", + sun->sun_len - off, sun->sun_path); } if (addrstr[0] == '\0') { error = cap_getnameinfo(capnet, sstosa(ss), ss->ss_len, - addrstr, sizeof(addrstr), NULL, 0, NI_NUMERICHOST); + addrstr, sizeof(addrstr), buf, bufsize, NI_NUMERICHOST); if (error) errx(1, "cap_getnameinfo()"); } if (port == 0) - return xprintf("%s:*", addrstr); - else - return xprintf("%s:%d", addrstr, port); + return snprintf(buf, bufsize, "%s:*", addrstr); + return snprintf(buf, bufsize, "%s:%d", addrstr, port); } static const char * @@ -1107,235 +1092,408 @@ sctp_path_state(int state) } } +static int +format_unix_faddr(struct addr *faddr, char *buf, size_t bufsize) { + #define SAFEBUF (buf == NULL ? NULL : buf + pos) + #define SAFESIZE (buf == NULL ? 0 : bufsize - pos) + + size_t pos = 0; + /* Remote peer we connect(2) to, if any. */ + if (faddr->conn != 0) { + struct sock *p; + pos += strlcpy(buf, "-> ", bufsize); + p = RB_FIND(pcbs_t, &pcbs, + &(struct sock){ .pcb = faddr->conn }); + if (__predict_false(p == NULL)) { + /* XXGL: can this happen at all? */ + pos += snprintf(SAFEBUF, SAFESIZE, "??"); + } else if (p->laddr->address.ss_len == 0) { + struct file *f; + f = RB_FIND(files_t, &ftree, + &(struct file){ .xf_data = + p->socket }); + if (f != NULL) { + pos += snprintf(SAFEBUF, SAFESIZE, "[%lu %d]", + (u_long)f->xf_pid, f->xf_fd); + } + } else + pos += formataddr(&p->laddr->address, + SAFEBUF, SAFESIZE); + } + /* Remote peer(s) connect(2)ed to us, if any. */ + if (faddr->firstref != 0) { + struct sock *p; + struct file *f; + kvaddr_t ref = faddr->firstref; + bool fref = true; + + pos += snprintf(SAFEBUF, SAFESIZE, " <- "); + + while ((p = RB_FIND(pcbs_t, &pcbs, + &(struct sock){ .pcb = ref })) != 0) { + f = RB_FIND(files_t, &ftree, + &(struct file){ .xf_data = + p->socket }); + if (f != NULL) { + pos += snprintf(SAFEBUF, SAFESIZE, + "%s[%lu %d]", fref ? "" : ",", + (u_long)f->xf_pid, f->xf_fd); + } + ref = p->faddr->nextref; + fref = false; + } + } + return pos; +} + +struct col_widths { + int user; + int command; + int pid; + int fd; + int proto; + int local_addr; + int foreign_addr; + int pcb_kva; + int fib; + int splice_address; + int inp_gencnt; + int encaps; + int path_state; + int conn_state; + int stack; + int cc; +}; + static void -displaysock(struct sock *s, int pos) +calculate_sock_column_widths(struct col_widths *cw, struct sock *s) { - int first, offset; struct addr *laddr, *faddr; - - while (pos < 30) - pos += xprintf(" "); - pos += xprintf("%s", s->protoname); - if (s->vflag & INP_IPV4) - pos += xprintf("4"); - if (s->vflag & INP_IPV6) - pos += xprintf("6"); - if (s->vflag & (INP_IPV4 | INP_IPV6)) - pos += xprintf(" "); + bool first = true; + int len = 0; laddr = s->laddr; faddr = s->faddr; - first = 1; + first = true; + + len = strlen(s->protoname); + if (s->vflag & (INP_IPV4 | INP_IPV6)) + len += 1; + if (laddr != NULL && faddr != NULL && s->family == AF_UNIX && + laddr->address.ss_len == 0 && faddr->conn == 0) + len += strlen(" (not connected)"); + cw->proto = MAX(cw->proto, len); + while (laddr != NULL || faddr != NULL) { - offset = 37; - while (pos < offset) - pos += xprintf(" "); - switch (s->family) { - case AF_INET: - case AF_INET6: - if (laddr != NULL) - pos += printaddr(&laddr->address); - offset += opt_w ? 46 : 22; - do - pos += xprintf(" "); - while (pos < offset); - if (faddr != NULL) - pos += printaddr(&faddr->address); - offset += opt_w ? 46 : 22; - break; - case AF_UNIX: + if (s->family == AF_UNIX) { if ((laddr == NULL) || (faddr == NULL)) errx(1, "laddr = %p or faddr = %p is NULL", - (void *)laddr, (void *)faddr); - if (laddr->address.ss_len == 0 && faddr->conn == 0) { - pos += xprintf("(not connected)"); - offset += opt_w ? 92 : 44; - break; - } - /* Local bind(2) address, if any. */ + (void *)laddr, (void *)faddr); if (laddr->address.ss_len > 0) - pos += printaddr(&laddr->address); - /* Remote peer we connect(2) to, if any. */ - if (faddr->conn != 0) { - struct sock *p; - - pos += xprintf("%s-> ", - laddr->address.ss_len > 0 ? " " : ""); - p = RB_FIND(pcbs_t, &pcbs, - &(struct sock){ .pcb = faddr->conn }); - if (__predict_false(p == NULL)) { - /* XXGL: can this happen at all? */ - pos += xprintf("??"); - } else if (p->laddr->address.ss_len == 0) { - struct file *f; - - f = RB_FIND(files_t, &ftree, - &(struct file){ .xf_data = - p->socket }); - if (f != NULL) { - pos += xprintf("[%lu %d]", - (u_long)f->xf_pid, - f->xf_fd); - } - } else - pos += printaddr(&p->laddr->address); + len = formataddr(&laddr->address, NULL, 0); + cw->local_addr = MAX(cw->local_addr, len); + len = format_unix_faddr(faddr, NULL, 0); + cw->foreign_addr = MAX(cw->foreign_addr, len); + } else { + if (laddr != NULL) { + len = formataddr(&laddr->address, NULL, 0); + cw->local_addr = MAX(cw->local_addr, len); } - /* Remote peer(s) connect(2)ed to us, if any. */ - if (faddr->firstref != 0) { - struct sock *p; - struct file *f; - kvaddr_t ref = faddr->firstref; - bool fref = true; - - pos += xprintf(" <- "); - - while ((p = RB_FIND(pcbs_t, &pcbs, - &(struct sock){ .pcb = ref })) != 0) { - f = RB_FIND(files_t, &ftree, - &(struct file){ .xf_data = - p->socket }); - if (f != NULL) { - pos += xprintf("%s[%lu %d]", - fref ? "" : ",", - (u_long)f->xf_pid, - f->xf_fd); - } - ref = p->faddr->nextref; - fref = false; - } + if (faddr != NULL) { + len = formataddr(&faddr->address, NULL, 0); + cw->foreign_addr = MAX(cw->foreign_addr, len); } - offset += opt_w ? 92 : 44; - break; - default: - abort(); - } - while (pos < offset) - pos += xprintf(" "); - if (opt_A) { - pos += xprintf("0x%16lx", s->pcb); - offset += 18; } if (opt_f) { - pos += xprintf("%d", s->fibnum); - offset += 7; + len = snprintf(NULL, 0, "%d", s->fibnum); + cw->fib = MAX(cw->fib, len); } if (opt_I) { if (s->splice_socket != 0) { struct sock *sp; sp = RB_FIND(socks_t, &socks, &(struct sock) - { .socket = s->splice_socket }); + { .socket = s->splice_socket }); if (sp != NULL) { - do - pos += xprintf(" "); - while (pos < offset); - pos += printaddr(&sp->laddr->address); - } else { - do - pos += xprintf(" "); - while (pos < offset); - pos += xprintf("??"); - offset += opt_w ? 46 : 22; + len = formataddr(&sp->laddr->address, + NULL, 0); + cw->splice_address = MAX( + cw->splice_address, len); } } - offset += opt_w ? 46 : 22; } if (opt_i) { - if (s->proto == IPPROTO_TCP || - s->proto == IPPROTO_UDP) { - do - pos += xprintf(" "); - while (pos < offset); - pos += xprintf("%" PRIu64, s->inp_gencnt); + if (s->proto == IPPROTO_TCP || s->proto == IPPROTO_UDP) + { + len = snprintf(NULL, 0, + "%" PRIu64, s->inp_gencnt); + cw->inp_gencnt = MAX(cw->inp_gencnt, len); } - offset += 9; } if (opt_U) { if (faddr != NULL && - ((s->proto == IPPROTO_SCTP && - s->state != SCTP_CLOSED && - s->state != SCTP_BOUND && - s->state != SCTP_LISTEN) || - (s->proto == IPPROTO_TCP && - s->state != TCPS_CLOSED && - s->state != TCPS_LISTEN))) { - do - pos += xprintf(" "); - while (pos < offset); - pos += xprintf("%u", - ntohs(faddr->encaps_port)); + ((s->proto == IPPROTO_SCTP && + s->state != SCTP_CLOSED && + s->state != SCTP_BOUND && + s->state != SCTP_LISTEN) || + (s->proto == IPPROTO_TCP && + s->state != TCPS_CLOSED && + s->state != TCPS_LISTEN))) { + len = snprintf(NULL, 0, "%u", + ntohs(faddr->encaps_port)); + cw->encaps = MAX(cw->encaps, len); } - offset += 7; } if (opt_s) { if (faddr != NULL && - s->proto == IPPROTO_SCTP && - s->state != SCTP_CLOSED && - s->state != SCTP_BOUND && - s->state != SCTP_LISTEN) { - do - pos += xprintf(" "); - while (pos < offset); - pos += xprintf("%s", - sctp_path_state(faddr->state)); + s->proto == IPPROTO_SCTP && + s->state != SCTP_CLOSED && + s->state != SCTP_BOUND && + s->state != SCTP_LISTEN) { + len = strlen(sctp_path_state(faddr->state)); + cw->path_state = MAX(cw->path_state, len); } - offset += 13; + } + if (first) { + if (opt_s) { + if (s->proto == IPPROTO_SCTP || + s->proto == IPPROTO_TCP) { + switch (s->proto) { + case IPPROTO_SCTP: + len = strlen( + sctp_conn_state(s->state)); + cw->conn_state = MAX( + cw->conn_state, len); + break; + case IPPROTO_TCP: + if (s->state >= 0 && + s->state < TCP_NSTATES) { + len = strlen( + tcpstates[s->state]); + cw->conn_state = MAX( + cw->conn_state, len); + } + break; + } + } + } + if (opt_S && s->proto == IPPROTO_TCP) { + len = strlen(s->stack); + cw->stack = MAX(cw->stack, len); + } + if (opt_C && s->proto == IPPROTO_TCP) { + len = strlen(s->cc); + cw->cc = MAX(cw->cc, len); + } + } + if (laddr != NULL) + laddr = laddr->next; + if (faddr != NULL) + faddr = faddr->next; + first = false; + } +} + +static void +calculate_column_widths(struct col_widths *cw) +{ + cw->user = 4; + cw->command = 10; + cw->pid = 3; + cw->fd = 2; + cw->proto = 5; + cw->local_addr = 13; + cw->foreign_addr = 15; + cw->pcb_kva = 18; + cw->fib = 3; + cw->splice_address = 14; + cw->inp_gencnt = 2; + cw->encaps = 6; + cw->path_state = 10; + cw->conn_state = 10; + cw->stack = 5; + cw->cc = 2; + + int n, len; + struct file *xf; + struct sock *s; + struct passwd *pwd; + + for (xf = files, n = 0; n < nfiles; ++n, ++xf) { + if (xf->xf_data == 0) + continue; + if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) + continue; + s = RB_FIND(socks_t, &socks, + &(struct sock){ .socket = xf->xf_data}); + if (s == NULL || (!check_ports(s))) + continue; + s->shown = 1; + if (opt_n || + (pwd = cap_getpwuid(cappwd, xf->xf_uid)) == NULL) + len = snprintf(NULL, 0, "%lu", (u_long)xf->xf_uid); + else + len = snprintf(NULL, 0, "%s", pwd->pw_name); + cw->user = MAX(cw->user, len); + len = snprintf(NULL, 0, "%lu", (u_long)xf->xf_pid); + cw->pid = MAX(cw->pid, len); + len = snprintf(NULL, 0, "%d", xf->xf_fd); + cw->fd = MAX(cw->fd, len); + + calculate_sock_column_widths(cw, s); + } + if (opt_j >= 0) + return; + SLIST_FOREACH(s, &nosocks, socket_list) { + if (!check_ports(s)) + continue; + calculate_sock_column_widths(cw, s); + } + RB_FOREACH(s, socks_t, &socks) { + if (s->shown) + continue; + if (!check_ports(s)) + continue; + calculate_sock_column_widths(cw, s); + } +} + +static void +display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) +{ + struct addr *laddr, *faddr; + bool first; + laddr = s->laddr; + faddr = s->faddr; + first = true; + + snprintf(buf, bufsize, "%s%s%s%s", + s->protoname, + s->vflag & INP_IPV4 ? "4" : "", + s->vflag & INP_IPV6 ? "6" : "", + (laddr != NULL && faddr != NULL && + s->family == AF_UNIX && laddr->address.ss_len == 0 && + faddr->conn == 0) ? " (not connected)" : ""); + printf(" %-*s", cw->proto, buf); + while (laddr != NULL || faddr != NULL) { + if (s->family == AF_UNIX) { + if ((laddr == NULL) || (faddr == NULL)) + errx(1, "laddr = %p or faddr = %p is NULL", + (void *)laddr, (void *)faddr); + if (laddr->address.ss_len > 0) + formataddr(&laddr->address, buf, bufsize); + else + strlcpy(buf, "??", bufsize); + printf(" %-*s", cw->local_addr, buf); + if (format_unix_faddr(faddr, buf, bufsize) == 0) + strlcpy(buf, "??", bufsize); + printf(" %-*s", cw->foreign_addr, buf); + } else { + if (laddr != NULL) + formataddr(&laddr->address, buf, bufsize); + else + strlcpy(buf, "??", bufsize); + printf(" %-*s", cw->local_addr, buf); + if (faddr != NULL) + formataddr(&faddr->address, buf, bufsize); + else + strlcpy(buf, "??", bufsize); + printf(" %-*s", cw->foreign_addr, buf); + } + if (opt_A) + printf(" %#*" PRIx64, cw->pcb_kva, s->pcb); + if (opt_f) + printf(" %*d", cw->fib, s->fibnum); + if (opt_I) { + if (s->splice_socket != 0) { + struct sock *sp; + sp = RB_FIND(socks_t, &socks, &(struct sock) + { .socket = s->splice_socket }); + if (sp != NULL) + formataddr(&sp->laddr->address, + buf, bufsize); + } else + strlcpy(buf, "??", bufsize); + printf(" %-*s", cw->splice_address, buf); + } + if (opt_i) { + if (s->proto == IPPROTO_TCP || s->proto == IPPROTO_UDP) + printf(" %*" PRIu64, cw->inp_gencnt, + s->inp_gencnt); + else + printf(" %*s", cw->inp_gencnt, "??"); + } + if (opt_U) { + if (faddr != NULL && + ((s->proto == IPPROTO_SCTP && + s->state != SCTP_CLOSED && + s->state != SCTP_BOUND && + s->state != SCTP_LISTEN) || + (s->proto == IPPROTO_TCP && + s->state != TCPS_CLOSED && + s->state != TCPS_LISTEN))) { + printf(" %*u", cw->encaps, + ntohs(faddr->encaps_port)); + } else + printf(" %*s", cw->encaps, "??"); + } + if (opt_s) { + if (faddr != NULL && + s->proto == IPPROTO_SCTP && + s->state != SCTP_CLOSED && + s->state != SCTP_BOUND && + s->state != SCTP_LISTEN) { + printf(" %-*s", cw->path_state, + sctp_path_state(faddr->state)); + } else + printf(" %-*s", cw->path_state, "??"); } if (first) { if (opt_s) { if (s->proto == IPPROTO_SCTP || s->proto == IPPROTO_TCP) { - do - pos += xprintf(" "); - while (pos < offset); switch (s->proto) { case IPPROTO_SCTP: - pos += xprintf("%s", + printf(" %-*s", cw->conn_state, sctp_conn_state(s->state)); break; case IPPROTO_TCP: if (s->state >= 0 && - s->state < TCP_NSTATES) - pos += xprintf("%s", - tcpstates[s->state]); + s->state < TCP_NSTATES) + printf(" %-*s", + cw->conn_state, + tcpstates[s->state]); else - pos += xprintf("?"); + printf(" %-*s", + cw->conn_state, "??"); break; } - } - offset += 13; + } else + printf(" %-*s", cw->conn_state, "??"); } if (opt_S) { - if (s->proto == IPPROTO_TCP) { - do - pos += xprintf(" "); - while (pos < offset); - pos += xprintf("%.*s", - TCP_FUNCTION_NAME_LEN_MAX, - s->stack); - } - offset += TCP_FUNCTION_NAME_LEN_MAX + 1; + if (s->proto == IPPROTO_TCP) + printf(" %-*s", cw->stack, s->stack); + else + printf(" %-*s", cw->stack, "??"); } if (opt_C) { - if (s->proto == IPPROTO_TCP) { - do - pos += xprintf(" "); - while (pos < offset); - xprintf("%.*s", TCP_CA_NAME_MAX, s->cc); - } - offset += TCP_CA_NAME_MAX + 1; + if (s->proto == IPPROTO_TCP) + printf(" %-*s", cw->cc, s->cc); + else + printf(" %-*s", cw->cc, "??"); } } if (laddr != NULL) laddr = laddr->next; if (faddr != NULL) faddr = faddr->next; - if ((laddr != NULL) || (faddr != NULL)) { - xprintf("\n"); - pos = 0; - } - first = 0; + if (laddr != NULL || faddr != NULL) + printf("%-*s %-*s %-*s %-*s %-*s", cw->user, "", + cw->command, "", cw->pid, "", cw->fd, "", + cw->proto, ""); + first = false; } - xprintf("\n"); + printf("\n"); } static void @@ -1344,33 +1502,41 @@ display(void) struct passwd *pwd; struct file *xf; struct sock *s; - int n, pos; + int n; + struct col_widths cw; + const size_t bufsize = 512; + void *buf; + if ((buf = (char *)malloc(bufsize)) == NULL) { + err(1, "malloc()"); + return; + } + calculate_column_widths(&cw); if (!opt_q) { - printf("%-8s %-10s %-5s %-3s %-6s %-*s %-*s", - "USER", "COMMAND", "PID", "FD", "PROTO", - opt_w ? 45 : 21, "LOCAL ADDRESS", - opt_w ? 45 : 21, "FOREIGN ADDRESS"); + printf("%-*s %-*s %*s %*s %-*s %-*s %-*s", + cw.user, "USER", cw.command, "COMMAND", + cw.pid, "PID", cw.fd, "FD", cw.proto, "PROTO", + cw.local_addr, "LOCAL ADDRESS", + cw.foreign_addr,"FOREIGN ADDRESS"); if (opt_A) - printf(" %-18s", "PCB KVA"); + printf(" %-*s", cw.pcb_kva, "PCB KVA"); if (opt_f) /* RT_MAXFIBS is 65535. */ - printf(" %-6s", "FIB"); + printf(" %*s", cw.fib, "FIB"); if (opt_I) - printf(" %-*s", opt_w ? 45 : 21, "SPLICE ADDRESS"); + printf(" %-*s", cw.splice_address, "SPLICE ADDRESS"); if (opt_i) - printf(" %-8s", "ID"); + printf(" %*s", cw.inp_gencnt, "ID"); if (opt_U) - printf(" %-6s", "ENCAPS"); + printf(" %*s", cw.encaps, "ENCAPS"); if (opt_s) { - printf(" %-12s", "PATH STATE"); - printf(" %-12s", "CONN STATE"); + printf(" %-*s", cw.path_state, "PATH STATE"); + printf(" %-*s", cw.conn_state, "CONN STATE"); } if (opt_S) - printf(" %-*.*s", TCP_FUNCTION_NAME_LEN_MAX, - TCP_FUNCTION_NAME_LEN_MAX, "STACK"); + printf(" %-*s", cw.stack, "STACK"); if (opt_C) - printf(" %-.*s", TCP_CA_NAME_MAX, "CC"); + printf(" %-*s", cw.cc, "CC"); printf("\n"); } cap_setpassent(cappwd, 1); @@ -1380,28 +1546,19 @@ display(void) if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) continue; s = RB_FIND(socks_t, &socks, - &(struct sock){ .socket = xf->xf_data}); + &(struct sock){ .socket = xf->xf_data}); if (s != NULL && check_ports(s)) { s->shown = 1; - pos = 0; if (opt_n || (pwd = cap_getpwuid(cappwd, xf->xf_uid)) == NULL) - pos += xprintf("%lu", (u_long)xf->xf_uid); + printf("%-*lu", cw.user, (u_long)xf->xf_uid); else - pos += xprintf("%s", pwd->pw_name); - do - pos += xprintf(" "); - while (pos < 9); - pos += xprintf("%.10s", getprocname(xf->xf_pid)); - do - pos += xprintf(" "); - while (pos < 20); - pos += xprintf("%5lu", (u_long)xf->xf_pid); - do - pos += xprintf(" "); - while (pos < 26); - pos += xprintf("%-3d", xf->xf_fd); - displaysock(s, pos); + printf("%-*s", cw.user, pwd->pw_name); + printf(" %-*.*s", cw.command, cw.command, + getprocname(xf->xf_pid)); + printf(" %*lu", cw.pid, (u_long)xf->xf_pid); + printf(" %*d", cw.fd, xf->xf_fd); + display_sock(s, &cw, buf, bufsize); } } if (opt_j >= 0) @@ -1409,19 +1566,20 @@ display(void) SLIST_FOREACH(s, &nosocks, socket_list) { if (!check_ports(s)) continue; - pos = xprintf("%-8s %-10s %-5s %-3s", - "?", "?", "?", "?"); - displaysock(s, pos); + printf("%-*s %-*s %*s %*s", cw.user, "??", cw.command, "??", + cw.pid, "??", cw.fd, "??"); + display_sock(s, &cw, buf, bufsize); } RB_FOREACH(s, socks_t, &socks) { if (s->shown) continue; if (!check_ports(s)) continue; - pos = xprintf("%-8s %-10s %-5s %-3s", - "?", "?", "?", "?"); - displaysock(s, pos); + printf("%-*s %-*s %*s %*s", cw.user, "??", cw.command, "??", + cw.pid, "??", cw.fd, "??"); + display_sock(s, &cw, buf, bufsize); } + free(buf); } static int @@ -1484,7 +1642,7 @@ static void usage(void) { errx(1, - "usage: sockstat [-46ACcfIiLlnqSsUuvw] [-j jid] [-p ports] [-P protocols]"); + "usage: sockstat [-46ACcfIiLlnqSsUuv] [-j jid] [-p ports] [-P protocols]"); } int @@ -1563,7 +1721,7 @@ main(int argc, char *argv[]) ++opt_v; break; case 'w': - opt_w = true; + /* left for backward compatibility. */ break; default: usage(); From nobody Fri Jun 27 18:56:23 2025 X-Original-To: dev-commits-src-main@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 4bTPsk083Fz607DG; Fri, 27 Jun 2025 18:56:26 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTPsj3z5Rz3J5B; Fri, 27 Jun 2025 18:56:25 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751050585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3vBNzVFZETWadBY0/NkqKppYUaHUJItBSFkjRSXb31Y=; b=mf5x/8i4Q/QV7j9iUZ89OhwhPIq5wVEG5sA6Oa5Mf56/CBB6X6jqV6MHDT2PMX/B/t44zE MTTzAplxG/YF9sIiRmF/qE9gDd9StQDqckRgkq7INSyLkbjcAbJb2DsEzLomB9dplTDxLZ /Bp0AkNJgDoYBN/T8L7tNl+F0v9EtQAshYKjDj465uwxM6wK1KGj9GZW02qWilqLbiW97B aIsEKoc01dUPnPMA3EctnkJsQIvh0VjuJ8JfNqWO+yuYb/9/juzv7HAwsDDrSxe6zcuF8g 7FED0imPdQo+qA3tD6UDp69oSPW/qyIWeuRfoTLAJSdNppvCCa7ze2uzEIhU0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751050585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3vBNzVFZETWadBY0/NkqKppYUaHUJItBSFkjRSXb31Y=; b=ZY4JYozqLbYcYbsU3V7lkQfxZg05xXvQMOM3VwbDSVTeDwYBiLkwobWlSlel1jvAjAQrvZ JptWZ8HnyFYEQ3O4WU5zIr93En13ngXgzmmdlEuwgAH3BlKmR3emlRm62IO+dHRPpy45ZT jNklvphHCc2mwiFWodYlvtbvXMeMRHNLPssSen45txqRguStCetoNycSNbAjdRC+OLMz1J gg3W2mbse8wqi/ufExoyLA63VQPc+ibs9ZSDTCda546fUxvTP8l3iEeuMsOTHON9aIXOES 4me3971r6tNo69OVg1wzPBLviaSY9dx4SrHkp9FFJrXUKBVg6ehnQytzVTcwYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751050585; a=rsa-sha256; cv=none; b=XCM2du09uXAxIUqrNEl70EaM8Zh7c5oe9eyEr3qbHy/ADD2VdrVIhCBRjLbykJZfuAOSAe rGyo/xnlRDvqqaFbVu+70YZmv9h0qyrCniautCQy8JbJOpCvjG4pm/W/Q0NN9WZxDE3Zb5 WGW3S5FDsif26MMvFbOMt+JNr3MovGkHPIbSPeGBCJxprhGh/7JZrTk08UnSf3utWyyxJq l2lKfJnTf1k+Dm+dGNwvadGOxgP0YGaxK/4qYqTibzzzNhlifXu9u88YtF3GwRb5TeiUCZ tHYGsyzJCPdMs0oQTpJEtYpdj9sQy1A84CinLmPQVxHmQAoIlfAqzvQqdJ7KDQ== Received: from b.nours.eu (b.nours.eu [54.38.177.57]) (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) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bTPsj16ylzCPs; Fri, 27 Jun 2025 18:56:25 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by b.nours.eu (Postfix, from userid 1001) id A2C1391FDD; Fri, 27 Jun 2025 20:56:23 +0200 (CEST) Date: Fri, 27 Jun 2025 20:56:23 +0200 From: Baptiste Daroussin To: Mark Johnston Cc: Hiroki Sato , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4deb9760a9d8 - main - rc: Disable pathname expansion when calling run_rc_command() Message-ID: References: <202506121820.55CIKQTQ097365@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed 18 Jun 10:13, Mark Johnston wrote: > On Thu, Jun 12, 2025 at 06:20:26PM +0000, Hiroki Sato wrote: > > The branch main has been updated by hrs: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=4deb9760a9d84d5861ee45162ffebe83f13503b8 > > > > commit 4deb9760a9d84d5861ee45162ffebe83f13503b8 > > Author: Hiroki Sato > > AuthorDate: 2025-06-12 18:19:32 +0000 > > Commit: Hiroki Sato > > CommitDate: 2025-06-12 18:19:32 +0000 > > > > rc: Disable pathname expansion when calling run_rc_command() > > > > Variables for command-line options like $foo_flags can contain characters > > that perform pathname expansions, such as '[', ']', and '*'. They were > > passed without escaping, and the matched entries in the working directory > > affected the command-line options. This change turns off the expansion > > when run_rc_command() is called. > > > > While this changes the current behavior, an invocation of a service > > program should not depend on entries in the working directory. > > This also turns off globbing for /etc/rc.local, which broke one of my > scripts. Was that intentional? If so, we should really document it in > RELNOTES at the very least. This broke nuageinit which rely on globbing to in nuageinit_start, that this change also broke. So many downstream CI are now broken, due to this change. Best regards, Bapt From nobody Fri Jun 27 19:37:52 2025 X-Original-To: dev-commits-src-main@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 4bTQnb5kThz609d3; Fri, 27 Jun 2025 19:37:55 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTQnb538zz3pBk; Fri, 27 Jun 2025 19:37:55 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751053075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N3DW/SB3YYxRFYVZGlI3XZ5ySrZNXSjPP0dpSxHtHZY=; b=BaA2eAtXErXPShqv67TgA2wDsmkiDy96DYYsgK8h/gpaBI2VfAUEqyQCBAvFjYiPtKEOjI AanZw9l97JkJwSxyyXWLPAWHEJu1y35v7grxKt7CMidH+k1fPh9OtKUsnD83GW9RtwzaSP fNDcyFRwA7OgRu4UCEwHUyZT+FmVEjkkdCA2i7gO71i3yw+TfIKifDoAMCkU8XjokRwZOz gGc1yNXOMz/VSPDSvjBLFIRth0KRqvSZqDd60jLzRFgn27FA8I00AVygB1GG1ckisYlDaf FKSf5Qg+6AqgmD+NTAqqsF0Q/fQJaHBMMd1oJf1uFnUFkXLkN1IdbJR93lRo5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751053075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N3DW/SB3YYxRFYVZGlI3XZ5ySrZNXSjPP0dpSxHtHZY=; b=sJEORknBOcm/Ehx0ZOyM6Puk/MGaPcOB35HZ6aUwl0wKDXLsIHn0otDuYEj/n6TYGMDayZ Sw64RyMm0Jt+SPAallDX7WWE3iikzVdaSJEMXGnlbu2RYzcaOrjpdv+7DssGxA5FkVRmg0 JAiwu1zyfO/eYY1Dtj42JwunJuz42Ql6XLf1NT8iJrXFQtg5WcXljDrRJuOuVmI0Yu7PdD IIHTonL45czAfV0zn8VzzmHZ++/elYODf0zeXeSdQJ9pu0+l0AAzh6867SvW20Cj4Qx0XM igeaMxiwxWtQ46eHjZWPITaPRw2xiiQ8h09Z+E4FNL4tvhlR4u3AHlNzzUE/aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751053075; a=rsa-sha256; cv=none; b=tJYEhK1zWw9MGl6WEm0qJClsRWl1y94io3J9GJ8WsIip2AHSIUfPFwpL9K5FgfG81dnEH6 GgBUGAyMThe3h0OavfmJ5iLYJwMOitWjnyel9WmXIt7GUALdFjD1SMshxXBOBqh/2UlQGC jnBp/hNw6+aV/DzCxpQoln/pIsTPwjLmFffe0RSE6HVcHuRZ4TD0QzcXGOdD31aw8Ynf01 Y57eJORjfNqnL6h29m86nd3KV/LNHZbyTFHrBneoEo9Dxg82LhlD2vwJ0gV3bH134u//ik ikwZhQdEPcMw0dG4RxEsN9aiQ0gEAPzW+mm7iYjK9qAi3slZfpWVGYpb4BG4+A== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bTQnZ5KR3zDHQ; Fri, 27 Jun 2025 19:37:54 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Fri, 27 Jun 2025 12:37:52 -0700 From: Gleb Smirnoff To: Baptiste Daroussin Cc: Mark Johnston , Hiroki Sato , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, srcmgr@freebsd.org Subject: Re: git: 4deb9760a9d8 - main - rc: Disable pathname expansion when calling run_rc_command() Message-ID: References: <202506121820.55CIKQTQ097365@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 27, 2025 at 08:56:23PM +0200, Baptiste Daroussin wrote: B> On Wed 18 Jun 10:13, Mark Johnston wrote: B> > On Thu, Jun 12, 2025 at 06:20:26PM +0000, Hiroki Sato wrote: B> > > The branch main has been updated by hrs: B> > > B> > > URL: https://cgit.FreeBSD.org/src/commit/?id=4deb9760a9d84d5861ee45162ffebe83f13503b8 B> > > B> > > commit 4deb9760a9d84d5861ee45162ffebe83f13503b8 B> > > Author: Hiroki Sato B> > > AuthorDate: 2025-06-12 18:19:32 +0000 B> > > Commit: Hiroki Sato B> > > CommitDate: 2025-06-12 18:19:32 +0000 B> > > B> > > rc: Disable pathname expansion when calling run_rc_command() B> > > B> > > Variables for command-line options like $foo_flags can contain characters B> > > that perform pathname expansions, such as '[', ']', and '*'. They were B> > > passed without escaping, and the matched entries in the working directory B> > > affected the command-line options. This change turns off the expansion B> > > when run_rc_command() is called. B> > > B> > > While this changes the current behavior, an invocation of a service B> > > program should not depend on entries in the working directory. B> > B> > This also turns off globbing for /etc/rc.local, which broke one of my B> > scripts. Was that intentional? If so, we should really document it in B> > RELNOTES at the very least. B> B> This broke nuageinit which rely on globbing to in nuageinit_start, that this B> change also broke. B> B> So many downstream CI are now broken, due to this change. Given that Hiroki is not reacting on this email thread neither in https://reviews.freebsd.org/D51043, I would like to revert this change. I'd like also remind that the problem was discovered during the stabweek testing. Although we thawed the freeze, but we are still working on a good known stable revision for June. Any objections? Adding srcmgr@ -- Gleb Smirnoff From nobody Fri Jun 27 20:18:57 2025 X-Original-To: dev-commits-src-main@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 4bTRhy5T7Qz60C97; Fri, 27 Jun 2025 20:18: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 4bTRhy3F5Gz3KK2; Fri, 27 Jun 2025 20:18:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751055538; 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=VGkBsW0qW2fdJKn6eB+G+xdaj7plHNqn4BZfLrf4vHo=; b=wYJzeyaol297OJ+FXs7DjKfkLE+WdQ517prBKBI1nmAAAwAFO18vDi5hGB7721OQsD6cDh 38G35dMmakFaoB1fUniqIhOh4zmag/Ug69Ry5jqXcfu/Q5MDkhU6ulZUr26zaXn9KwSpNH HX4e+aMSM6rkbkgjye2HIilNapiv0uJfe7y1aaQNRTWxIaD8DDpq9RjjRgcoUs2I8mYEqL OxGl3Z6dLg1P+R0iL0oBHCVj8AXjE9SVhmsCw7uGF5kWzfuwFAwsVRJAVk4XL0b0Jqs5Sv DnL66MgTpZyJXUU61AMvBPUthvj2qoy8aN08IbpJ++86pZ4yT+XD0ODMDD0A4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751055538; 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=VGkBsW0qW2fdJKn6eB+G+xdaj7plHNqn4BZfLrf4vHo=; b=KtoUjuoauAWzFrtXbkqmh0Ir9LEL/u53Wp/lNF1x6XGKaWXoDpyw1wfPFWpzViLSoeRd9K rzOOlGefwb5XL1ZcC6LNzDLLADQDB7Y1whHO1QgCoeDCJbDTKfDVLpPDY0Y26IOG83WsBY 9xRRmtwX9iGtRV+bfOaNWA8MP7nWuwTan6/mJitysPJ6KGzPfLaHD3Z1zN2RELJ2FINxUN Ac/T8TQISeYvDE4wGP1M2Al8B5+72QGbLNBIQsnWOoWzNd3gTDW5LyzLYxpKTmowdmnG60 vDcQoRIjy8txM9E95G87cPGOmiUf8Y7WERpGKeArp6n9yVjk1EfqiQxe1U8YPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751055538; a=rsa-sha256; cv=none; b=OUNrh/X5jwPEZjgd1bOx7AXEoSXZ5snDylaxE3Yvi9I9NsVhYOXwkZaFvO7Ygu2Ethr2Id 08zkY+S6ghoA5F5Cyzb4hpQ3N5bkqCa+giU1MRszmIlBNfz36sqRzliY6oIbpg3lZ2cgD9 JUGXdJN/r/7350N1MHprtRbUp1Ck7UCarhoq08xihAVFf8Q/8EQhg7ha4crBv6OcjNPI8n GyCjalub38P6X+etCi3/F7g0OPMEo+eQmLkB+s+eniad5HqqCY5JB1NwTLehPxi/VCOOfM NwHUmu64OzGWiJ2oZr+dCYnYjT7DrcZ0tw7R3puJAeHW6NqyrxW+uQEYQwXgBA== 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 4bTRhy0t0cz12S5; Fri, 27 Jun 2025 20:18: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 55RKIvvr013474; Fri, 27 Jun 2025 20:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RKIvYa013472; Fri, 27 Jun 2025 20:18:57 GMT (envelope-from git) Date: Fri, 27 Jun 2025 20:18:57 GMT Message-Id: <202506272018.55RKIvYa013472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d783591a7deb - main - Revert "rc: Fix scripts that need pathname expansion" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: d783591a7debc75045e8fbb7c57622c6fda2da01 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d783591a7debc75045e8fbb7c57622c6fda2da01 commit d783591a7debc75045e8fbb7c57622c6fda2da01 Author: Mark Johnston AuthorDate: 2025-06-27 18:59:41 +0000 Commit: Mark Johnston CommitDate: 2025-06-27 20:18:24 +0000 Revert "rc: Fix scripts that need pathname expansion" The commit which motivated this is being reverted. This reverts commit 7faddeb395b7976b44393db24f48ec47040eff07. --- libexec/rc/rc.d/moused | 2 +- libexec/rc/rc.d/syscons | 4 ++-- libexec/rc/rc.subr | 24 ++++-------------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/libexec/rc/rc.d/moused b/libexec/rc/rc.d/moused index 9bb1a5cedc31..6f1b95af0f0a 100755 --- a/libexec/rc/rc.d/moused +++ b/libexec/rc/rc.d/moused @@ -69,7 +69,7 @@ moused_start() ;; esac - for ttyv in $(expandpath "/dev/ttyv*"); do + for ttyv in /dev/ttyv* ; do vidcontrol < ${ttyv} ${mousechar_arg} -m on done } diff --git a/libexec/rc/rc.d/syscons b/libexec/rc/rc.d/syscons index 7ad9b720e454..325628a83d8c 100755 --- a/libexec/rc/rc.d/syscons +++ b/libexec/rc/rc.d/syscons @@ -237,7 +237,7 @@ syscons_configure_keyboard() if [ -n "${allscreens_kbdflags}" ]; then sc_init echo -n ' allscreens_kbd' - for ttyv in $(expandpath "/dev/ttyv*"); do + for ttyv in /dev/ttyv*; do kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1 done fi @@ -381,7 +381,7 @@ syscons_start() if [ -n "${allscreens_flags}" ]; then sc_init echo -n ' allscreens' - for ttyv in $(expandpath "/dev/ttyv*"); do + for ttyv in /dev/ttyv*; do vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1 done fi diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index d760b75a15a3..359eebd1d342 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -223,11 +223,10 @@ rc_trace() list_vars() { # Localize 'set' option below. - local - _s + local - local IFS=$'\n' line varname - # Disable path expansion temporarily in unquoted 'for' parameters below. - _s=$(set +o) + # Disable path expansion in unquoted 'for' parameters below. set -o noglob for line in $(set); do @@ -242,7 +241,6 @@ list_vars() ;; esac done - eval $_s } # set_rcvar [var] [defval] [desc] @@ -294,19 +292,6 @@ set_rcvar_obsolete() eval ${_var}_obsolete_msg=\"$*\" } -# expandpath str -# Apply pathname expansion to str. -# -expandpath() -{ - local _s - - _s=$(set +o) - set +o noglob - echo $1 - eval $_s -} - # # force_depend script [rcvar] # Force a service to start. Intended for use by services @@ -1798,19 +1783,18 @@ _run_rc_setup() _run_rc_doit() { - local _m _s + local _m debug "run_rc_command: doit: $*" _m=$(umask) ${_umask:+umask ${_umask}} # Disable pathname expansion temporarily for run_rc_command. - _s=$(set +o) set -o noglob eval "$@" + set +o noglob _return=$? umask ${_m} - eval $_s # If command failed and force isn't set, request exit. if [ $_return -ne 0 ] && [ -z "$rc_force" ]; then From nobody Fri Jun 27 20:18:58 2025 X-Original-To: dev-commits-src-main@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 4bTRhz27hMz60C99; Fri, 27 Jun 2025 20:18:59 +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 4bTRhz0qDjz3KK6; Fri, 27 Jun 2025 20:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751055539; 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=FUo1j99dVRCS2XwJFnmg+OdyDpPHgl1hiOyLAA+DosA=; b=HbkwUUxW7aSn8NA9uqKN/XOOdYWDd3KWNzc6zzm/DvBiELPI0SS3MKdMF/F20WhD6DUxWI F7cvkd91cnTS7EX8PMnbcN2/bbv/RpFUKXLU61Dqc4S07CIwsEsxSiaqAJCn3QPuKF/xQV C68S8Pgzr+HtY3s0Abyw4yi0e9yGJmoCusqxjn7k0X3JSFUw6DXqlHEcxNhu7WRNRE0FO6 Fko3c3yUiAA8sP7sYin8HN+qehIYueVPVTeyK7wq8A4MKEEjkR8Jp+Xb/7yzB3dWAS458A 25KGxOK2kpJwKgkKcmw3SEaSpKKWHnP+ATfCOPAB5540yys4AscJETu7GXd6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751055539; 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=FUo1j99dVRCS2XwJFnmg+OdyDpPHgl1hiOyLAA+DosA=; b=tn8idocumfCqNMOfXok0FF3+G0OwseO39jkKpnAAe8m4BPWS2vi1XSaNrXH3d62Lp3/9Hx IBBbUeyDD4lVFeCAIuQ3sapg/wCJt19fwxoluT7Qgf4WnXEKQC3IIfwrApVFbxRv9H37Wb Q6VXXv+Pi2CBk0Mip1e/R6AQ7WGFiyLyyWwuhQRjyy3ikKeljBLxM4sg4muu9OZAWrGhXq 04ALk9fr7TP9CtDfWUU/81oRJK0DejyThx2BxwDrOJUqCpw4eCH738KWhY2GiT3RWcNRXV zmCMsG+5qdHdIcbjCjyQQPCqyK4NoMo1odX156sykRdlbYlC0Ivz5y/P5UPE8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751055539; a=rsa-sha256; cv=none; b=WNNWBuDllmSa0GDuvEjWT5BTBHCRX1weIkydQzGndfCQwWaqC5xwlnfrmEZUO3cs9WAnEJ c6ozeB6TZTYXpAB9Ets2Oh7edWRGFZ/DmHioQaMThWa8d86b0Fh2W2oGU6zfMfXKJ4ifV9 ktsEOsQLIdq65V5SpdgDbOyHLmZFDTw/bCXuPXGDBhrsgoLMj0dLK+I138dnVrUZckgP2x +QLdcYXIbrtgxYRPYriNQzR8OnZwDMok/hkoHoqjtQmxVdLx+BPuoPrEzZ4z23DF89G3a/ xDnuIPGbuOuVTC2hUkXocVxMr68BOgfRSSpagQnBGJ9AmmzcvWx78f1zNL6Wsw== 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 4bTRhz00Tkz12DR; Fri, 27 Jun 2025 20:18:59 +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 55RKIwnD013514; Fri, 27 Jun 2025 20:18:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RKIw5D013511; Fri, 27 Jun 2025 20:18:58 GMT (envelope-from git) Date: Fri, 27 Jun 2025 20:18:58 GMT Message-Id: <202506272018.55RKIw5D013511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9c014cc25c43 - main - Revert "rc: Disable pathname expansion when calling run_rc_command()" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 9c014cc25c437d2c4e18a7554e1276e0f290a8a0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9c014cc25c437d2c4e18a7554e1276e0f290a8a0 commit 9c014cc25c437d2c4e18a7554e1276e0f290a8a0 Author: Mark Johnston AuthorDate: 2025-06-27 18:59:54 +0000 Commit: Mark Johnston CommitDate: 2025-06-27 20:18:36 +0000 Revert "rc: Disable pathname expansion when calling run_rc_command()" At least nuageinit is broken after this commit, breaking some downstream CI systems. It also disables globbing for rc.local scripts, which is likely to break users in surprising ways. This reverts commit 4deb9760a9d84d5861ee45162ffebe83f13503b8. --- libexec/rc/rc.subr | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 359eebd1d342..2eaf336b5220 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1788,11 +1788,7 @@ _run_rc_doit() debug "run_rc_command: doit: $*" _m=$(umask) ${_umask:+umask ${_umask}} - - # Disable pathname expansion temporarily for run_rc_command. - set -o noglob eval "$@" - set +o noglob _return=$? umask ${_m} From nobody Fri Jun 27 20:19:44 2025 X-Original-To: dev-commits-src-main@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 4bTRjy6GDLz60Cd9; Fri, 27 Jun 2025 20:19:50 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTRjy3ySbz3Kql; Fri, 27 Jun 2025 20:19:50 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-7d3862646eeso13169185a.2; Fri, 27 Jun 2025 13:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751055588; x=1751660388; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=pXVRSgb2FwoGmCqMjR70aPhAiVZVleWyZOrkwaO4i0k=; b=RwLwo4xbJzw/5bIjddpiirbA60bVO3IYnAxPMIjCVXNAENy1PVG8FQALVfpRdFgTRy aBVnZTdvsovWQ6laytKDk4I7VOfCVlT0cjBPEfppAcjkT2StFppX8p9To8ceS33s51o8 jKQCbVcCIyuVHlNdfO0Wt3GR+wZDa6R3vuG8QmdjHLsXM0bzCGzgeHAiXjyA+3A3eE8i Hev1btDMt68kQIGnvCp1yCRZEG98HEalGU0DLrrOz6BSrsC2yZ4dfi2LxG6jVFUTI5Md vQ+2pbQAm7ATmH/b09TvcxbJy/9iOz2QV2NEtSxx0CK/USqJrgBAyS41yANIuvhq+/14 Zh5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751055588; x=1751660388; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pXVRSgb2FwoGmCqMjR70aPhAiVZVleWyZOrkwaO4i0k=; b=NWml3JTt7t7RiJqKUfWSWCpxJOIY59ch7nEbObRAnLleN6mc0s9V6QsFuK2hVaq87G MrKsSZ89AP7zwEezobFbHokqROy2QDu9NaPNL0otJMuae26XhVo/DyswEyLgo0DEZj10 iMCmqK5KEKH0q+vEY8qqzEG9HbTf7YeU217w8v25TMk5S+cslG1bmN0RY3MSw4Zi9IX7 rz4WoOJ4Ikj6s+lM6+E+MQztV5QCLqqiwqkQVxlnDNnjgiFJ47vcKVwV2p9byLtxZOsq VbFRFZbrDqSUbRcQHvVKXElH5kGdTP9F2vynHlfZt81lmcYbHnGHGuC2Kds97hWamAHV hMHg== X-Forwarded-Encrypted: i=1; AJvYcCU5rBkAWB/w1BS1D1u6FKp09VktPC4JdnH2CX2gbTCs+0drVHvu64pNU4CsGHHxrgb2iZ52TdjEi4VcJCQ3AZGTznNr@freebsd.org, AJvYcCUKkK7DZxbj2ah6o11N6Gv+QyVdpzSm6niMXv25jyjZ3zmRLaF4miAS7YwhLIQ+FK+14WN/POe5FZD6/gnZ6xs=@freebsd.org, AJvYcCUtY/0D261e8DhouIr4fO8mzZhVjsNppOET2JBhKRk0QUnjZJ9k9Pv60BxhOHr8nzx2N23m@freebsd.org, AJvYcCXnqQeAH8yGENoE/x/Go5OLz6+/0qsvFCmjnbchYbAjEtoM65esGOFISnKNxiYkq+p9+a74daJb@freebsd.org, AJvYcCXu/Z7vhalhvmOIur6m/UtuAJvtgdY11xVBupdoQLmX2fBv7k7ut2js8S7MTCEBCzD2vyiwcjXM9O6tMaWFW6mrIaBCfJk=@freebsd.org X-Gm-Message-State: AOJu0YwPa1FSKrXRURIeO4QQOPR2Ju0/Q7jKldzKJm8m0ijcQvQNerf/ c/yr0Rrgw6se13IhyRNckae6wGuMthivHlgk3A4gvhCPotMQszNAQwk34+b79rkO X-Gm-Gg: ASbGncvTYua0lJrZLem3XnDRHxb96QEOAcbCx9Y0wDeDxdKq4p42tgGRHXeeb9w500N 2aHObN2lAHS1IY/3Eq6gFWdljJaMSBsb4zTb/UgGAoNKWY0/iWo35NijSf80P+HZ2V1WjM/FXvv 3rIOjWV6h+SmLZz3wpIxt3QkTFihVRIzz1dePEba93VvZ1lOU4tTkjwyBY3PKdLf9ybX/SoAkml Bu7G4B5zOQ6yea8hyERnrpcS/RG28bhkTMd+Q6pFfLQN4ljjCPwEooepzPzXpTeOUcpPBHiGC1D hzE7TbXBYCKr1oG9MnVW6JJdsz1BW7B364cJb98MI+rJf1EJCwFIbgBXs8YsXrjVIBI/GlypRFq g X-Google-Smtp-Source: AGHT+IEC8Ho87w74aqZDIiA+poqz4qyfqnD1eYKXZO/FTuzXcOQfImPeHX487dJ8NzC9FoxUxRttIQ== X-Received: by 2002:a05:620a:4623:b0:7d4:434e:2c17 with SMTP id af79cd13be357-7d44398e560mr668740685a.17.1751055587620; Fri, 27 Jun 2025 13:19:47 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443204beasm188868585a.65.2025.06.27.13.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jun 2025 13:19:47 -0700 (PDT) Date: Fri, 27 Jun 2025 16:19:44 -0400 From: Mark Johnston To: Gleb Smirnoff Cc: Baptiste Daroussin , Hiroki Sato , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, srcmgr@freebsd.org Subject: Re: git: 4deb9760a9d8 - main - rc: Disable pathname expansion when calling run_rc_command() Message-ID: References: <202506121820.55CIKQTQ097365@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bTRjy3ySbz3Kql X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Fri, Jun 27, 2025 at 12:37:52PM -0700, Gleb Smirnoff wrote: > On Fri, Jun 27, 2025 at 08:56:23PM +0200, Baptiste Daroussin wrote: > B> On Wed 18 Jun 10:13, Mark Johnston wrote: > B> > On Thu, Jun 12, 2025 at 06:20:26PM +0000, Hiroki Sato wrote: > B> > > The branch main has been updated by hrs: > B> > > > B> > > URL: https://cgit.FreeBSD.org/src/commit/?id=4deb9760a9d84d5861ee45162ffebe83f13503b8 > B> > > > B> > > commit 4deb9760a9d84d5861ee45162ffebe83f13503b8 > B> > > Author: Hiroki Sato > B> > > AuthorDate: 2025-06-12 18:19:32 +0000 > B> > > Commit: Hiroki Sato > B> > > CommitDate: 2025-06-12 18:19:32 +0000 > B> > > > B> > > rc: Disable pathname expansion when calling run_rc_command() > B> > > > B> > > Variables for command-line options like $foo_flags can contain characters > B> > > that perform pathname expansions, such as '[', ']', and '*'. They were > B> > > passed without escaping, and the matched entries in the working directory > B> > > affected the command-line options. This change turns off the expansion > B> > > when run_rc_command() is called. > B> > > > B> > > While this changes the current behavior, an invocation of a service > B> > > program should not depend on entries in the working directory. > B> > > B> > This also turns off globbing for /etc/rc.local, which broke one of my > B> > scripts. Was that intentional? If so, we should really document it in > B> > RELNOTES at the very least. > B> > B> This broke nuageinit which rely on globbing to in nuageinit_start, that this > B> change also broke. > B> > B> So many downstream CI are now broken, due to this change. > > Given that Hiroki is not reacting on this email thread neither in > https://reviews.freebsd.org/D51043, I would like to revert this change. I'd > like also remind that the problem was discovered during the stabweek testing. > Although we thawed the freeze, but we are still working on a good known stable > revision for June. > > Any objections? > > Adding srcmgr@ I've reverted the change (and a follow-up fix) for now. From nobody Fri Jun 27 20:52:45 2025 X-Original-To: dev-commits-src-main@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 4bTSRy1dTDz60FdZ; Fri, 27 Jun 2025 20: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 4bTSRy03tpz3sn7; Fri, 27 Jun 2025 20: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=1751057566; 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=IE0vj9dQMcP8EYbIAhZ04ZO42SfUftoWM2WxCC01hXo=; b=xf8Enfb4zHRY3TLivhpjWDNiwyflwqeq6H69MWjMqYJELOVlaEc1g6aEPUHoWBfOR5DLk7 T/3Vz9vGk58joimP+TGSrEa0kNwYd24yKmI+kf+MIVNE8i8+YFwe6D3vWcGiVQQXwaxbF0 2eN0J1WlU1wIroSiuLkKfjiS4b03ftjpsLpXwWqTGGz0tqL+KspELD5Ic/mM/fd95VMVoZ Ha9NN+dOE1Qm/VFDO0iT5S2VU/AshpK8Y4r/F/ZCljA54Bc5/3L9ypdwEJPRRn8j+tc0D1 KymGwRabpR+lcv57qdEJGB0yHT2zwNKoiqEndot7AeRKFsb/imaLV7vU8omSHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751057566; 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=IE0vj9dQMcP8EYbIAhZ04ZO42SfUftoWM2WxCC01hXo=; b=ie+I39lyBFKGwspAjydQvtnQve23d3bRH5C1Iac6jcohb3ZFjsJkScnhZ9F/3Ef8RQ0s2y BrFHhMxyopZ07XLpzrPgKDEPgDyGHobgKokUm61GjC3F99XS1rsH5s6t61yDnV5zV5kmqi oXwI+t1GuvTly53AYuoKkaFmVYGjVe3yvEtb7QjSiFwqt54ziD7GTeDA/DvG5TDRajhI2A LOLe51XnFz4QHyBYAJ3H2QZaDacc18z+YDvi/k9c0CmiIC8Vvm4oByg8Hfyf/dNG5bF4Ey vbBmA54pMm9q+WvExu3Nu+Xyaw3L/OJSw7J3fnt03VB46ly0QpLm+n9bVnDxWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751057566; a=rsa-sha256; cv=none; b=Zg6FDqaE91kCGeT+URnnRO18zkAQp8xzgNlObMut/PfQQSEKuIG1N1BmaWDF3FfzuHVhF0 pT7XLBgKqUZirn4KGdnc7CaZZIOsMVlhw4Vj44DkbC1cg5eTCWfn+EpOPKihJbgOkmQQ7d sw/y96G7JJTLNVKA52g7gpdVP6auiZfvVJnRuFCKBZGM/Hvuu/PMUnPbdbOOi07IMA7Lzd vT7ZxFsqqbK37HGYKIfDhMXvHa37c3+kwBWMwGYc/zFhXIZNpeejcFufm1tclNFUVRXX3s rL/0eQXlbXnDgivvQ5pVdTch0yztPDaS8d8ve//hd9rZjIBmPxp4r9ivOViwtQ== 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 4bTSRx6kR4z138Y; Fri, 27 Jun 2025 20:52: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 55RKqjNm085927; Fri, 27 Jun 2025 20: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 55RKqjwk085924; Fri, 27 Jun 2025 20:52:45 GMT (envelope-from git) Date: Fri, 27 Jun 2025 20:52:45 GMT Message-Id: <202506272052.55RKqjwk085924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: c3fc0db3bc50 - main - tcp: set net.inet.tcp.nolocaltimewait to 0 and deprecate it List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3fc0db3bc50df18a724e6e6b12ea4e060fd9255 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c3fc0db3bc50df18a724e6e6b12ea4e060fd9255 commit c3fc0db3bc50df18a724e6e6b12ea4e060fd9255 Author: Michael Tuexen AuthorDate: 2025-06-27 20:47:21 +0000 Commit: Michael Tuexen CommitDate: 2025-06-27 20:47:21 +0000 tcp: set net.inet.tcp.nolocaltimewait to 0 and deprecate it Set the default value of the sysctl-variable net.inet.tcp.nolocaltimewait to 0. This will make the behavior compliant with RFC 9293. Furthermore document that using the sysctl-variable is deprecated and will be removed in FreeBSD 16. Reviewed by: glebius, Peter Lei Relnotes: yes Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D5106 --- share/man/man4/tcp.4 | 14 ++++++++++---- sys/netinet/tcp_timewait.c | 24 +++++++++++++++++++++--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index f19b6cb2ae14..fcfda42908d8 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 26, 2025 +.Dd June 27, 2025 .Dt TCP 4 .Os .Sh NAME @@ -785,8 +785,8 @@ The Maximum Segment Lifetime, in milliseconds, for a packet when both endpoints are local. .Va msl_local is only used if -.Va nolocaltimewait -is zero. +.Va nolocaltimewait , +which is deprecated, is zero. .It Va mssdflt The default value used for the TCP Maximum Segment Size .Pq Dq MSS @@ -798,10 +798,16 @@ application limited and the network bandwidth is not utilized completely. That prevents self-inflicted packet losses once the application starts to transmit data at a higher speed. .It Va nolocaltimewait -Suppress creation of TCP +Suppress the creation of TCP .Dv TIME_WAIT states for connections in which both endpoints are local. +The default is 0. +.Va nolocaltimewait +is deprecated and will be removed in +.Fx 16 . +.Va msl_local +can be used instead. .It Va path_mtu_discovery Enable Path MTU Discovery. .It Va pcbcount diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 08673ddd1152..7c6c55909215 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -87,10 +87,28 @@ #include -VNET_DEFINE_STATIC(bool, nolocaltimewait) = true; +VNET_DEFINE_STATIC(bool, nolocaltimewait) = false; #define V_nolocaltimewait VNET(nolocaltimewait) -SYSCTL_BOOL(_net_inet_tcp, OID_AUTO, nolocaltimewait, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nolocaltimewait), 0, + +static int +sysctl_net_inet_tcp_nolocaltimewait(SYSCTL_HANDLER_ARGS) +{ + int error; + bool new; + + new = V_nolocaltimewait; + error = sysctl_handle_bool(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + V_nolocaltimewait = new; + gone_in(16, "net.inet.tcp.nolocaltimewait is obsolete." + " Use net.inet.tcp.local_msl instead.\n"); + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, nolocaltimewait, + CTLFLAG_VNET | CTLFLAG_RW | CTLTYPE_U8, + &VNET_NAME(nolocaltimewait), 0, sysctl_net_inet_tcp_nolocaltimewait, "CU", "Do not create TCP TIME_WAIT state for local connections"); static u_int From nobody Fri Jun 27 21:17:10 2025 X-Original-To: dev-commits-src-main@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 4bTT065c05z60H26; Fri, 27 Jun 2025 21:17:10 +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 4bTT065040z3HGP; Fri, 27 Jun 2025 21:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751059030; 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=I8dB9KZlizCq3S7IFSpcklDC8tgSGopNpNbhB+vT71U=; b=A5ZvyEjrN5QKXC1XIa0gzSdIALad2hhPXQTv0qhdV7qjEjccaKjJELTPNN5rmXHRc2hm2P cEjtzvMMP2n+awHxJ1UOXL5dHaEcOL4ymY1tte+IHUTSvzaNlZRCQIAwvF6DB+Do8tDxCE F1n9ZDV00Xvbtkjlh1gQglVxaxbZmDqSk+Sk3wvVL5wgKXWZE8OHjvq5RSN2EsgrfrFfTO QvNRo7dBlWlzHHKLuHm1djhydlkgpvTNipnY1EGRkhzjFdYcGSZRhD4Y83BotSg4uEQaMD VqpEP65NJhbQUVnbYjHfweUN7qFuFHO54EIUnKkgP7gAQkVHyvje6rBJ+Gvj6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751059030; 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=I8dB9KZlizCq3S7IFSpcklDC8tgSGopNpNbhB+vT71U=; b=ndtZnfZO0yq8J1UgY4RGwze5ukOOVq/Vi91SE8IFQLtWAtwrpenFNB/Tnpx8ght92R0V1V W/oLmZbWtck5Xc1utX6PEAbXET9OpmLUNKiMDDyW14OBffi9cboNFRoXTDUxJwOxXsrHRv 5+VgbkSFwi6SR/9G3lTsd1jButYqMNQPenGQI8xUSHyXvhj8CaPWDsx40izNbJcc3QhCdS 8MBARS2vnsVDBObCHdCmcyVTSVtLWwyXML8p/VJtdo2fFyJjLfuiJoTaOixcA2oedvR+hg EwdZKdXTCzcrLBCy/Dg38r6nyKdVQPm+T+B2lPaeFRudZqXrhfbyNXRj0uRsQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751059030; a=rsa-sha256; cv=none; b=s7dCi/C/t8C2/TwuF/cZnqqMPaxnoZh7AlTzqfIDCODCfg1+6n4oh/sEJ8zg9JVyLD2CpQ hEw/LvGTpEJI3LWjq1Ij06wsQw51LZ8+B9hG4z82pHUIWlx5Y/kXCDRy8dWv0aqeYWxAxc Au69b+dSqeyfp6hzcmZMQKQsGFWta3u/Gt06Ir2+XElFW8CSFl3zRuIwHTzYifeBvkRrnV wYDaD+QRbDjNYOGS0giaADlz/WljLTRsjJiazBAhI7/jDy0AIqZReItcmqmxuTP8k1ze/p dzVkTA8v/74UqAlpNTFsLjN+32nQCZUDuFagLwMkaqbAzotRP1igJDTiJBZJjA== 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 4bTT0647rFz14Xw; Fri, 27 Jun 2025 21:17:10 +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 55RLHANS026763; Fri, 27 Jun 2025 21:17:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RLHAFp026759; Fri, 27 Jun 2025 21:17:10 GMT (envelope-from git) Date: Fri, 27 Jun 2025 21:17:10 GMT Message-Id: <202506272117.55RLHAFp026759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: ea6376adc8b9 - main - tcp: improve name of function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea6376adc8b969936259537ed894213162b376e8 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ea6376adc8b969936259537ed894213162b376e8 commit ea6376adc8b969936259537ed894213162b376e8 Author: Michael Tuexen AuthorDate: 2025-06-27 21:04:12 +0000 Commit: Michael Tuexen CommitDate: 2025-06-27 21:04:12 +0000 tcp: improve name of function Let us call the function to compute the effetive MSL tcp_eff_msl() instead of just tcp_msl(). This avoids a conflict with !VIMAGE builds, since in that case there is a global variable with name tcp_msl. Reported by: kp Fixes: 5fb4b091e835 ("tcp: allow specifying a MSL for local communications") --- sys/netinet/tcp_timewait.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 7c6c55909215..c095fc8f7765 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -112,7 +112,7 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, nolocaltimewait, "Do not create TCP TIME_WAIT state for local connections"); static u_int -tcp_msl(struct tcpcb *tp) +tcp_eff_msl(struct tcpcb *tp) { struct inpcb *inp = tptoinpcb(tp); #ifdef INET6 @@ -180,7 +180,7 @@ tcp_twstart(struct tcpcb *tp) return; } - tcp_timer_activate(tp, TT_2MSL, 2 * tcp_msl(tp)); + tcp_timer_activate(tp, TT_2MSL, 2 * tcp_eff_msl(tp)); INP_WUNLOCK(inp); } @@ -323,7 +323,7 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, if (thflags & TH_FIN) { seq = th->th_seq + tlen + (thflags & TH_SYN ? 1 : 0); if (seq + 1 == tp->rcv_nxt) - tcp_timer_activate(tp, TT_2MSL, 2 * tcp_msl(tp)); + tcp_timer_activate(tp, TT_2MSL, 2 * tcp_eff_msl(tp)); } /* From nobody Fri Jun 27 21:19:14 2025 X-Original-To: dev-commits-src-main@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 4bTT2Z0HQLz60GmS; Fri, 27 Jun 2025 21:19:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTT2Y4Kljz3Jv2; Fri, 27 Jun 2025 21:19:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751059157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mpRvMsxE+qvVmOf1qVcYitS2oMEY1cngi8YXuUlQoS0=; b=D86JcRjPNjYkYqGosW+DwETsaMSsrlCqoipZ1FVCYyq7JBli2PJ3e0QRNksW7tx1ZdlLkp 8MfRILALKleAfjoRMGZcTdWLdgvsjy8/nyl0vAsqjispqlUeB9ELWIv4XVnWna/ik9w1Bn auOtljTdhHOk/r9aqWSlkiwQBFZ3cfFnXXzXR9Kxv+m57uY/CSXS5IqM217hUM88Y2sENB epNFZqMWHd/H7W/2IwPh/4St7+FcvRhJIo+DBScxOLq3o9L7H5l1xtzts7CRDUAByy/SQt zPhGlrnY0L81ZfVPRklBux0pkgyUnrvU4zVQnQE+By85bHQbtfOwyXDC0Dw9zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751059157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mpRvMsxE+qvVmOf1qVcYitS2oMEY1cngi8YXuUlQoS0=; b=WW4v6SiSWstK16s269tfRJV92La/a7GqiMEhEgYtGjl+NUx8GJQKgksdzukiIlQVA86EPu PUlLKvNwj+UndjoahZI0ZnMdD8dwANE5OcBIUYMqz/tN055p/9Q42XYW+UPiXKmc75IS30 5YhluHvgIwfOsv6Z9c8xNBUgi4G9pQgUYeYioBXCjprcll0DaX+xZEAhgY6pcutsIn1i1g hnmPmm5DYB0fJH9G98+0OKonNi5zDLph6Ji3j/RvqqcZFu7oeu4nY7pv7WPhSI4mfqa7jb ZdiQ1I6n5UA5YCBd7FOVAPTsDaA2KmvyRb+NolR6NtfrAOygiGJks6DUToEr2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751059157; a=rsa-sha256; cv=none; b=Kgi9wre9KKvp5j3sR/9VC80E77yR2M09HDy0tO7+7XXLA1QlhgnhTKuYi35cVMz6u4Wf9z AjUTPGAPvirGmcAhqGHMYquUoWTplJXCZjrmyKUaDY6K8Gtt6CG4fI49y7eZBH/b8ABNoX w5OZdLW9M3UfH2r0EclfxZGs5g8uqLmRsUVXuagy1JaTsi44gkmzHihkOg5TaZo8/nhq1u +I/4z9u3Fg1dVI3VISz63EgM4hni4LVP+C1ieBLjTdDTn88oeVuMTsfjH70YQ5MU7e18S7 hwzKbsH+YqmEoeJTjrCtz0QG7xqg+DcoesSdL+H725C1WBJr5ihTrU+QYd3sEQ== Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1101:be00:519:b945:b630:ea4d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: tuexen) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bTT2X4VD9zFkp; Fri, 27 Jun 2025 21:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: 5fb4b091e835 - main - tcp: allow specifying a MSL for local communications From: Michael Tuexen In-Reply-To: <8EF254D7-A8D7-4031-BAC0-FDC36DE22754@FreeBSD.org> Date: Fri, 27 Jun 2025 23:19:14 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202506261703.55QH3fqK060218@gitrepo.freebsd.org> <8EF254D7-A8D7-4031-BAC0-FDC36DE22754@FreeBSD.org> To: Kristof Provost X-Mailer: Apple Mail (2.3826.600.51.1.1) > On 27. Jun 2025, at 16:17, Kristof Provost wrote: >=20 > On 26 Jun 2025, at 19:03, Michael Tuexen wrote: >> The branch main has been updated by tuexen: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D5fb4b091e8352602894fc2b7284c8e1e= 3d8a8729 >>=20 >> commit 5fb4b091e8352602894fc2b7284c8e1e3d8a8729 >> Author: Michael Tuexen >> AuthorDate: 2025-06-26 16:59:36 +0000 >> Commit: Michael Tuexen >> CommitDate: 2025-06-26 16:59:36 +0000 >>=20 >> tcp: allow specifying a MSL for local communications >>=20 >> When setting the sysctl-variable net.inet.tcp.nolocaltimewait to = 1, >> which is the default, a TCP endpoint does not enter the TIME-WAIT = state, >> when the communication is local. This can result in sending >> RST-segments without any error situation. By setting the >> sysctl-variable net.inet.tcp.nolocaltimewait to 0, this does not >> occur, and the behavior is compliant with the TCP specification. >> But there is no reason to stay in the TIME-WAIT state for two = times >> the value of the sysctl-variable net.inet.tcp.msl, if the >> communication is local. Therefore provide a separate = sysctl-variable >> net.inet.tcp.msl_local, which controls how long an TCP end-point >> stays in the TIME-WAIT state, if the communication is local. >> The default value is 10 ms. >>=20 >> Reviewed by: glebius, Peter Lei >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D50637 >> --- >> share/man/man4/tcp.4 | 7 +++++++ >> sys/netinet/tcp_subr.c | 1 + >> sys/netinet/tcp_timer.c | 6 ++++++ >> sys/netinet/tcp_timer.h | 3 +++ >> sys/netinet/tcp_timewait.c | 26 ++++++++++++++++++++++++-- >> 5 files changed, 41 insertions(+), 2 deletions(-) >>=20 >> diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 >> index 536bd904d796..f19b6cb2ae14 100644 >> --- a/share/man/man4/tcp.4 >> +++ b/share/man/man4/tcp.4 >> @@ -780,6 +780,13 @@ Minimum TCP Maximum Segment Size; used to = prevent a denial of service attack >> from an unreasonably low MSS. >> .It Va msl >> The Maximum Segment Lifetime, in milliseconds, for a packet. >> +.It Va msl_local >> +The Maximum Segment Lifetime, in milliseconds, for a packet when = both endpoints >> +are local. >> +.Va msl_local >> +is only used if >> +.Va nolocaltimewait >> +is zero. >> .It Va mssdflt >> The default value used for the TCP Maximum Segment Size >> .Pq Dq MSS >> diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c >> index 6b1907305fb9..bbcd20b715ba 100644 >> --- a/sys/netinet/tcp_subr.c >> +++ b/sys/netinet/tcp_subr.c >> @@ -1455,6 +1455,7 @@ tcp_vnet_init(void *arg __unused) >> VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); >>=20 >> V_tcp_msl =3D TCPTV_MSL; >> + V_tcp_msl_local =3D TCPTV_MSL_LOCAL; >> arc4rand(&V_ts_offset_secret, sizeof(V_ts_offset_secret), 0); >> } >> VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, >> diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c >> index a9046e5725d5..32ce3001929c 100644 >> --- a/sys/netinet/tcp_timer.c >> +++ b/sys/netinet/tcp_timer.c >> @@ -109,6 +109,12 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, >> &VNET_NAME(tcp_msl), 0, sysctl_msec_to_ticks, "I", >> "Maximum segment lifetime"); >>=20 >> +VNET_DEFINE(int, tcp_msl_local); >> +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl_local, >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET, >> + &VNET_NAME(tcp_msl_local), 0, sysctl_msec_to_ticks, "I", >> + "Maximum segment lifetime for local communication"); >> + >> int tcp_rexmit_initial; >> SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, CTLTYPE_INT | = CTLFLAG_RW, >> &tcp_rexmit_initial, 0, sysctl_msec_to_ticks, "I", >> diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h >> index 394207bcb89b..34a0f1375463 100644 >> --- a/sys/netinet/tcp_timer.h >> +++ b/sys/netinet/tcp_timer.h >> @@ -74,6 +74,7 @@ >> * Time constants. >> */ >> #define TCPTV_MSL MSEC_2_TICKS(30000) /* max seg lifetime (hah!) */ >> +#define TCPTV_MSL_LOCAL MSEC_2_TICKS(10) /* max seg lifetime for = local comm */ >> #define TCPTV_SRTTBASE 0 /* base roundtrip time; >> if 0, no idea yet */ >> #define TCPTV_RTOBASE MSEC_2_TICKS(1000) /* assumed RTO if no info */ >> @@ -183,6 +184,8 @@ VNET_DECLARE(int, tcp_v6pmtud_blackhole_mss); >> #define V_tcp_v6pmtud_blackhole_mss VNET(tcp_v6pmtud_blackhole_mss) >> VNET_DECLARE(int, tcp_msl); >> #define V_tcp_msl VNET(tcp_msl) >> +VNET_DECLARE(int, tcp_msl_local); >> +#define V_tcp_msl_local VNET(tcp_msl_local) >>=20 >> #endif /* _KERNEL */ >>=20 >> diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c >> index 2b4ae462af89..9f2943725ef0 100644 >> --- a/sys/netinet/tcp_timewait.c >> +++ b/sys/netinet/tcp_timewait.c >> @@ -93,6 +93,28 @@ SYSCTL_BOOL(_net_inet_tcp, OID_AUTO, = nolocaltimewait, >> CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nolocaltimewait), true, >> "Do not create TCP TIME_WAIT state for local connections"); >>=20 >> +static u_int >> +tcp_msl(struct tcpcb *tp) >> +{ >> + struct inpcb *inp =3D tptoinpcb(tp); >> +#ifdef INET6 >> + bool isipv6 =3D inp->inp_inc.inc_flags & INC_ISIPV6; >> +#endif >> + >> + if ( >> +#ifdef INET6 >> + isipv6 ? in6_localip(&inp->in6p_faddr) : >> +#endif >> +#ifdef INET >> + in_localip(inp->inp_faddr)) >> +#else >> + false) >> +#endif >> + return (V_tcp_msl_local); >> + else >> + return (V_tcp_msl); >> +} >> + > This seems to make !VIMAGE builds unhappy, probably because V_tcp_msl = becomes tcp_msl then, and a function and a variable with the same name = confuses the poor compiler. >=20 > LINT-NOVIMAGE: >=20 > --- tcp_timewait.o --- > /usr/src/sys/netinet/tcp_timewait.c:97:1: error: redefinition of = 'tcp_msl' as different kind of symbol > 97 | tcp_msl(struct tcpcb *tp) > | ^ > /usr/src/sys/netinet/tcp_timer.h:185:19: note: previous definition is = here > 185 | VNET_DECLARE(int, tcp_msl); > | ^ > /usr/src/sys/netinet/tcp_timewait.c:165:45: error: called object type = 'int' is not a function or function pointer > 165 | tcp_timer_activate(tp, TT_2MSL, 2 * tcp_msl(tp)); > | ~~~~~~~^ > /usr/src/sys/netinet/tcp_timewait.c:308:47: error: called object type = 'int' is not a function or function pointer > 308 | tcp_timer_activate(tp, TT_2MSL, 2 * = tcp_msl(tp)); > | = ~~~~~~~^ > 3 errors generated. Hi Kristof, thank you very much for reporting the issue. It should be fixed by: = https://cgit.FreeBSD.org/src/commit/?id=3Dea6376adc8b969936259537ed8942131= 62b376e8 = Sorry for the breakage. Best regards Michael >=20 > =E2=80=94 > Kristof From nobody Fri Jun 27 22:34:56 2025 X-Original-To: dev-commits-src-main@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 4bTVjt1dMWz60MBd; Fri, 27 Jun 2025 22:34:58 +0000 (UTC) (envelope-from vishwin@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTVjt0BhWz430v; Fri, 27 Jun 2025 22:34:58 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751063698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=FNsNltgLLRI9tMS59PLlUaiTvpIUP1p98ICieNiBh1M=; b=Ai1kP18kROreVnlwTTKUMWc271+5rYNMHhjew0GdDV+c0Cj8hlfqzEn6D670Npj8Iu+dEo yAhuzDMpkR79H/AZI48FE5debLcuijyP/QWA9LHvcH35dzgWk8lL41tlZ9wkyfM+NGlYcK xRS5QhRWTDgFzzWMyIcTt2DSdZX2NKkaEidcqfnHBe+g08o0h/B+YZwma5kJv7h9zAmqMF 8XnNG2/rSLzxrQgPdgH+WOpQU2W4SbHk3gVwjkt8LCZJ9lpTng5TkLHQ/1enE5MHZj1Pdh b2DsirK3yS6XHEz8qSTKqnpVcPga8K472Lyjr9mCNElP6FChM24xa1jh6SmRzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751063698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=FNsNltgLLRI9tMS59PLlUaiTvpIUP1p98ICieNiBh1M=; b=xVkIbt+v5OonkT++3NkwNDneDoEWbpO2DwsZNoeVtb11AoQXuVKm96CNTjIh/hqnmXemK/ 12A3SpCLCIcO9gud+PMhVyzez1+f6Ysks3Onwto8/UOJo15myLN2l1KCfBaC3JTKJYLq8T oVoqHQwmV1Y9hAv0Z5RyZ7e7TF+gv84utR1Kn218FntLx89doaVkCrlipFQcBJcHC1GmtQ 5KbvORI4QHYQVwZ5HO9HMzlYHG1+b3KuKcDwpKNeeArr508+8QIL4F+YVfJ3r5IrScMkkQ dltbNaBeBetJ+q24CtRZpeEWjRAZ3RxMyEgxdg64k5RPgznUcprsfqPCKjG0mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751063698; a=rsa-sha256; cv=none; b=G36l4dyOe5bqBpMmVJF/ahSW00yURfLg9gbUN53GnbZyB13zw8Syd5hPPmCiozA4xA1yxv RttG0GDIivaYzvrX1fNNiaGt9/MMlem4vpNx28PQF9ooGnIyMg67HrHvjcEKYZED0ztslF qe8W1VMLmNUzx/zpoPU7a25dDpTEkeQSTQkNwsO4FPC4AImKwRK6AYkX0fcFr7uHBTAxon gVdMQLaZXjWdRlSWP22AWLBfgeBgqU/xFDeujEGlsmPw/MMPYf9jWRygxRR6jdMFRu5yXd INfrUnyNcsNXAVFGy/DgUovO84uhe3dNYXQSZHhtZZD+eE9URSilMrkfenNOvQ== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bTVjs4hk3zHC2; Fri, 27 Jun 2025 22:34:57 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: Date: Fri, 27 Jun 2025 18:34:56 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 89f6eb0a61cb - main - tcp: restrict the contents of tcp_timer.h to the kernel context To: Michael Tuexen , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506261609.55QG9odv049208@gitrepo.freebsd.org> Content-Language: en-GB From: Charlie Li Organization: FreeBSD Project Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEaEicoBYJKwYBBAHaRw8BAQdAZBuydpjFLGem4uRJPWaYMXX2e+BN1jDhbD3tcqbxhdfN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbAwUJCWYBgAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRDP+1cn7slqBM/bAP9bhA4e0LxJYFYJlftZM5WHrMSPpUe6 G2pVqmQWTQ0EZQEA0PNryfH3qRWWPSI8mFNRnG24hi5/aXFqCnHj1tcJ9Q/OOARoSJygEgor BgEEAZdVAQUBAQdAUT4TzYFmV6ueIGwjX0N+445KZV6ns1Wiw67QMsJZxHkDAQgHwn4EGBYK ACYWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbDAUJCWYBgAAKCRDP+1cn7slqBPO/ AQCPuGiyyfJClICRs/ToG0MsT8YcPdBygzuUIIeGpkjJpgEA7AoFCQ0Y28Y3hIDFn2k9PH3B nGWL3g05W0ds2qoj+gQ= In-Reply-To: <202506261609.55QG9odv049208@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------z9MnyKtRoQKYSbMF9PY0SBm4" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------z9MnyKtRoQKYSbMF9PY0SBm4 Content-Type: multipart/mixed; boundary="------------j0aCa3n1FSkqwG8aC0UuljP8"; protected-headers="v1" From: Charlie Li To: Michael Tuexen , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: Subject: Re: git: 89f6eb0a61cb - main - tcp: restrict the contents of tcp_timer.h to the kernel context References: <202506261609.55QG9odv049208@gitrepo.freebsd.org> In-Reply-To: <202506261609.55QG9odv049208@gitrepo.freebsd.org> --------------j0aCa3n1FSkqwG8aC0UuljP8 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 TWljaGFlbCBUdWV4ZW4gd3JvdGU6DQo+ICAgICAgdGNwOiByZXN0cmljdCB0aGUgY29udGVu dHMgb2YgdGNwX3RpbWVyLmggdG8gdGhlIGtlcm5lbCBjb250ZXh0DQo+ICAgICAgDQo+ICAg ICAgVGhlIGhlYWRlciBmaWxlIGNvbnRhaW5zIG9ubHkgc3R1ZmYgcmVsZXZhbnQgaW4gdGhl IGtlcm5lbCBjb250ZXh0Lg0KPiAgICAgIA0KPiAgICAgIFJldmlld2VkIGJ5OiAgICAgICAg ICAgIGdsZWJpdXMsIHJzY2hlZmYsIFBldGVyIExlaSwgaW1wDQo+ICAgICAgU3BvbnNvcmVk IGJ5OiAgICAgICAgICAgTmV0ZmxpeCwgSW5jLg0KPiAgICAgIERpZmZlcmVudGlhbCBSZXZp c2lvbjogIGh0dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9yZy9ENTA5MTINCj4gLS0tDQo+ICAg c3lzL25ldGluZXQvdGNwX3RpbWVyLmggfCA0ICsrLS0NCj4gICAxIGZpbGUgY2hhbmdlZCwg MiBpbnNlcnRpb25zKCspLCAyIGRlbGV0aW9ucygtKQ0KPiANCj4gZGlmZiAtLWdpdCBhL3N5 cy9uZXRpbmV0L3RjcF90aW1lci5oIGIvc3lzL25ldGluZXQvdGNwX3RpbWVyLmgNCj4gaW5k ZXggODc1ZjE1ODQ5ODhjLi5hMTQ1NzgyYmE4MmQgMTAwNjQ0DQo+IC0tLSBhL3N5cy9uZXRp bmV0L3RjcF90aW1lci5oDQo+ICsrKyBiL3N5cy9uZXRpbmV0L3RjcF90aW1lci5oDQo+IEBA IC0zMiw2ICszMiw4IEBADQo+ICAgI2lmbmRlZiBfTkVUSU5FVF9UQ1BfVElNRVJfSF8NCj4g ICAjZGVmaW5lIF9ORVRJTkVUX1RDUF9USU1FUl9IXw0KPiAgIA0KPiArI2lmZGVmIF9LRVJO RUwNCj4gKw0KPiAgIC8qDQo+ICAgICogVGhlIFRDUFRfUkVYTVQgdGltZXIgaXMgdXNlZCB0 byBmb3JjZSByZXRyYW5zbWlzc2lvbnMuDQo+ICAgICogVGhlIFRDUCBoYXMgdGhlIFRDUFRf UkVYTVQgdGltZXIgc2V0IHdoZW5ldmVyIHNlZ21lbnRzDQo+IEBAIC0xMzMsOCArMTM1LDYg QEANCj4gICAJCSh0dikgPSAodHZtYXgpOyBcDQo+ICAgfSB3aGlsZSgwKQ0KPiAgIA0KPiAt I2lmZGVmIF9LRVJORUwNCj4gLQ0KPiAgICNkZWZpbmUJVFBfS0VFUElOSVQodHApCSgodHAp LT50X2tlZXBpbml0ID8gKHRwKS0+dF9rZWVwaW5pdCA6IHRjcF9rZWVwaW5pdCkNCj4gICAj ZGVmaW5lCVRQX0tFRVBJRExFKHRwKQkoKHRwKS0+dF9rZWVwaWRsZSA/ICh0cCktPnRfa2Vl cGlkbGUgOiB0Y3Bfa2VlcGlkbGUpDQo+ICAgI2RlZmluZQlUUF9LRUVQSU5UVkwodHApICgo dHApLT50X2tlZXBpbnR2bCA/ICh0cCktPnRfa2VlcGludHZsIDogdGNwX2tlZXBpbnR2bCkN Cj4gDQo+IA0KVGhpcyBicm9rZSBuZXQtbWdtdC9uZXQtc25tcCwgd2hpY2ggdXNlcyBhdCBs ZWFzdCBUQ1BUVl9NSU4gYW5kIA0KVENQVFZfUkVYTVRNQVguDQoNCi0tIA0KQ2hhcmxpZSBM aQ0KLi4ubm9wZSwgc3RpbGwgZG9uJ3QgaGF2ZSBhbiBleGl0IGxpbmUuDQoNCg== --------------j0aCa3n1FSkqwG8aC0UuljP8-- --------------z9MnyKtRoQKYSbMF9PY0SBm4 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaF8ckAUDAAAAAAAKCRDP+1cn7slqBKBB AQDHmcA5JND+CcoM9WiyElVAV++79fQFpRoqPMkrULiapwEAj1X+mF+Y2sMxJH6Hn6hGprP3nd6q Z75U7CloyX6mXAw= =ROYT -----END PGP SIGNATURE----- --------------z9MnyKtRoQKYSbMF9PY0SBm4-- From nobody Fri Jun 27 22:47:12 2025 X-Original-To: dev-commits-src-main@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 4bTW003TSQz60Myn; Fri, 27 Jun 2025 22:47:12 +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 4bTW0030F1z48Rq; Fri, 27 Jun 2025 22:47:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751064432; 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=tR1D5nMX6/eoOD7xc8yfP6A62WLiIOLV10aPvXtEW/o=; b=PeUnNBdfs+r1qW1O0AvEHgeoPtR4i/nOPMFpxljoLSRKjMEKHA05PVhAqrXygU21aYxJT2 NPkaFgJ+YmivipKbFLSeuAPH02rM7UXO2sJBuyzNbUpP6AEONz3rAT5+r4vEG5vd0C57ce HyYcSgdgsqyHJ1rpa2T6ehZdPz0bWSed7y9S2SaFozLVl27Sb4FnjWG0QIpycVLtnr/63U Epq7FplCCh3DTLNgesXu4vaBmN/ZXrSalQ+Tz61SfdCzY+y/zrvVxG4X4gOHSwo32izfLQ aWp6+YRzatLKVjWVhVAD/zfDy8e3YsaGwMww5S7Vgv8uNadXBbLdBQVlHc/f0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751064432; 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=tR1D5nMX6/eoOD7xc8yfP6A62WLiIOLV10aPvXtEW/o=; b=CKnTvoJcxHTdlqzm9dPdm0uenwo7zyoe7I6e5qpYFNTiOzvEnKbakczsBSAZTE1yI0nVl1 rvijtZJpyebgUMXv2sfmtWx6UeYlagLNaHxuRH4vYeOEd7043vdxsZ1fJw7qbtUD62QPhp e2KeF7pUhKRKPLMF33GyWUtGzMpULxUDrXneErsgZR02i/rnvDVWLflfUbyKT23e+cR5L8 jaI63OugfJLO0DznDqMzvypU7E53qqVQ3aLaxEW6NpmZtFoFdEu/gC6pJ5ZQ2Fc5XQrvlv V+9Yr0A57OyJVkgeaESgmSeTmP8D/C3GmPnbxnLHn0Z54WBno/RsDrzXkKTiqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751064432; a=rsa-sha256; cv=none; b=xshWU9rYwFoFzyTJWUCzDywBzi5UZOaCfITB0hlc3/RlHYl0A13RkObv7NFLeBV4aESlrl N3KD03c1XaXw6V4wQsQSOfvQo8eeUpZOiFWSAUxLLa4v258uzYCNUOW8OZ0776MSp8IRTz YEiP7HGCFqejmdQYRlUDBjdMn2yAYYr5IYPjD1+yVai5ZUjVP1LFHVJ0dXjJOSBWsF3S3T KZ78mEwjeM3KJycV7vc9hHEASAN1cc2n7dM0BhmgzWFyIj7c+E6UsgkFp3DxcMpsTdpBSd 7vWwH3uuLqGx1Er1oPbcnQCUT45E5RoM4Gk6m2At1LdL28svLHrudm4Au9ewNQ== 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 4bTW002Bgwz16cR; Fri, 27 Jun 2025 22:47:12 +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 55RMlCeI093439; Fri, 27 Jun 2025 22:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RMlCRv093436; Fri, 27 Jun 2025 22:47:12 GMT (envelope-from git) Date: Fri, 27 Jun 2025 22:47:12 GMT Message-Id: <202506272247.55RMlCRv093436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 24ebe9fa0ec1 - main - psm: fix build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24ebe9fa0ec17fb3a99789438982c9b2ba082257 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=24ebe9fa0ec17fb3a99789438982c9b2ba082257 commit 24ebe9fa0ec17fb3a99789438982c9b2ba082257 Author: Gleb Smirnoff AuthorDate: 2025-06-27 22:46:56 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-27 22:46:56 +0000 psm: fix build Fixes: b93063c84e4e792ede844d30452d82c4fe12bdd2 --- sys/dev/atkbdc/psm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 4a84a0cb6bcb..8563b5f93aa2 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include From nobody Sat Jun 28 01:04:11 2025 X-Original-To: dev-commits-src-main@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 4bTZ2B4Qjyz60Vsb; Sat, 28 Jun 2025 01:04: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 4bTZ2B1zHrz3clM; Sat, 28 Jun 2025 01:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751072658; 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=OMTaNhhpH2mGYD72pXCkWQikoQYR0o/BhFAd8OmuoDg=; b=Zx3AWjbOPVt4AQ2wu+YbJ9+i/Yn0y9Vh9537LVM4zizmI+aZOsBtBF/bIyviudP7dvtOcA wb+2R5aV7A+KzYTRNNdlnY25OjTxMWXBnado9TFSFPIjLAnokVxOoOXNPU9MafL16NI9+4 1D6m7qNXnUh5CbXjCdsilgFyY+YYrceY2Hnq32NjJX4r1N4fwGmWY9vB179sBKBiDvq4C7 9+1/mgC0K+3JN3Q0YuLvvPMXJm1tfnyIVPZldjd3Dn93J9WsoGJI8jQAbxzjbfcH3LOwn0 TXhW5GmrVhlCERtPhUwbWl9aHeU5uDAUYaKibHgSL0PQHL9iI73jcd/nY3GMGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751072658; 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=OMTaNhhpH2mGYD72pXCkWQikoQYR0o/BhFAd8OmuoDg=; b=DtzThv2Wuohlw5PUUKfHKnzppMBMailXYGuBD6zb3S84gKnStYYp+Y7GQKQOFw2SwvmS0r kwzRwDWh5nqLDNUOvAd4Et8ZMF7gCT/s3XCKY3z4W9EaGvIRzaUoafiUb34MxvdR/P+Veq oBijvwLUH6b+7sxx7T1Li4ULh05X/jHAgEUDQbaBCEUuowE8HFNYYDbweJWMakkNTUHmq0 Re8jTdy/8LuM3HRCM+TcHV0l/391OJbt8yvA2mfeqw5W1fXW5xIfwJSDgdVoaMv1uTGQru DTTesf0aTeeI/y5cGE0O7nbXwntdY/36J9oV6SG1X8UHRVrNPLG65VP4gpFHUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751072658; a=rsa-sha256; cv=none; b=TAdq64lt6kMwTYVDKCiy/NXcMIAMd2htZHqMCdiP1+riVim8oAwKhTxdafN09p/s22gukO y5FrRJKpKiZTVtzqhDYoP9b8gSVPFS5KRVAjS79viKHFrjQLXIq8n7neGeYxvdySesdCKM a9RhqRAv7Nhi2IzzOvj0p3nEwJu9m3RJ0Q5SfyDGoWjvg4fSPXcoZehJNiaDFDwFC/V1lS VbuXxSs1Bk5onVJn3ceIvdaftins3clFAf4qMFoUrnQgwfuiT2NK+pFAXihnszG8+DFBHX CV586KjFPtskubiLqHi2XXyps/fkj/+xqTd7FuJ4wg56TdVtjHl+oopAvzcY3w== 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 4bTZ2B1T1fz1BCY; Sat, 28 Jun 2025 01:04:18 +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 55S14IOU056022; Sat, 28 Jun 2025 01:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55S14BZL056004; Sat, 28 Jun 2025 01:04:11 GMT (envelope-from git) Date: Sat, 28 Jun 2025 01:04:11 GMT Message-Id: <202506280104.55S14BZL056004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 0df1ee76950f - main - zfs: merge openzfs/zfs@69ee01aa4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0df1ee76950fc28c3c90a8aa85534fd44641c425 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=0df1ee76950fc28c3c90a8aa85534fd44641c425 commit 0df1ee76950fc28c3c90a8aa85534fd44641c425 Merge: 24ebe9fa0ec1 69ee01aa4b10 Author: Martin Matuska AuthorDate: 2025-06-28 00:24:57 +0000 Commit: Martin Matuska CommitDate: 2025-06-28 00:27:56 +0000 zfs: merge openzfs/zfs@69ee01aa4 Notable upstream pull request merges: #17463 48ce292ea Clarify and restrict dmu_tx_assign() errors #17484 d461a67d0 Ensure that gang_copies is always at least as large as copies #17486 0a2163d19 FreeBSD: Ensure that z_pflags is initialized for new znodes #17488 ea076d692 vdev_raidz_asize_to_psize: return psize, not asize #17490 69ee01aa4 Fix bug caused by rounding in vdev_raidz_asize_to_psize Obtained from: OpenZFS OpenZFS commit: 69ee01aa4b106dd57016b0d756201ecf7c211d46 sys/contrib/openzfs/cmd/ztest.c | 7 +++-- .../config/kernel-pagemap-readahead-page.m4 | 23 ++++++++++++++ ...kernel-readpages.m4 => kernel-vfs-readpages.m4} | 0 sys/contrib/openzfs/config/kernel-vfs-writepage.m4 | 24 +++++++++++++++ sys/contrib/openzfs/config/kernel.m4 | 4 +++ sys/contrib/openzfs/include/os/linux/Makefile.am | 1 + .../include/os/linux/kernel/linux/pagemap_compat.h | 36 ++++++++++++++++++++++ .../openzfs/module/os/freebsd/zfs/zfs_znode_os.c | 2 ++ sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 9 +++--- sys/contrib/openzfs/module/zfs/dmu.c | 3 +- sys/contrib/openzfs/module/zfs/dmu_tx.c | 10 ++++-- sys/contrib/openzfs/module/zfs/dsl_dir.c | 2 ++ sys/contrib/openzfs/module/zfs/vdev_raidz.c | 10 +++++- sys/contrib/openzfs/module/zfs/zio.c | 1 + sys/modules/zfs/zfs_config.h | 10 ++++-- sys/modules/zfs/zfs_gitrev.h | 2 +- 16 files changed, 129 insertions(+), 15 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-pagemap-readahead-page.m4 index 000000000000,30f3d56682fb..30f3d56682fb mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-pagemap-readahead-page.m4 +++ b/sys/contrib/openzfs/config/kernel-pagemap-readahead-page.m4 diff --cc sys/contrib/openzfs/config/kernel-vfs-writepage.m4 index 000000000000,d438e85b457c..d438e85b457c mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-vfs-writepage.m4 +++ b/sys/contrib/openzfs/config/kernel-vfs-writepage.m4 diff --cc sys/contrib/openzfs/include/os/linux/kernel/linux/pagemap_compat.h index 000000000000,a0465ede0105..a0465ede0105 mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/os/linux/kernel/linux/pagemap_compat.h +++ b/sys/contrib/openzfs/include/os/linux/kernel/linux/pagemap_compat.h diff --cc sys/modules/zfs/zfs_config.h index 0d7641da2bcc,000000000000..f59b31f2479d mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,851 -1,0 +1,857 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* __assign_str() has one arg */ +/* #undef HAVE_1ARG_ASSIGN_STR */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* backtrace() is available */ +/* #undef HAVE_BACKTRACE */ + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_file_open_by_path() exists */ +/* #undef HAVE_BDEV_FILE_OPEN_BY_PATH */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_nr_bytes() is available */ +/* #undef HAVE_BDEV_NR_BYTES */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* __blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS */ + +/* __blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS */ + +/* blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_FLAGS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() exists */ +/* #undef HAVE_BLKDEV_PUT */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* struct queue_limits has a features field */ +/* #undef HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_disk() exists and takes 2 args */ +/* #undef HAVE_BLK_ALLOC_DISK_2ARG */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue hardware context is cached in struct request */ +/* #undef HAVE_BLK_MQ_RQ_HCTX */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* backing_dev_info is available through queue gendisk */ +/* #undef HAVE_BLK_QUEUE_DISK_BDI */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* 3-arg dequeue_signal() takes a type argument */ +/* #undef HAVE_DEQUEUE_SIGNAL_3ARG_TYPE */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* dops->d_revalidate() takes 4 args */ +/* #undef HAVE_D_REVALIDATE_4ARGS */ + +/* Define to 1 if you have the 'execvpe' function. */ +#define HAVE_EXECVPE 1 + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* file->f_version exists */ +/* #undef HAVE_FILE_F_VERSION */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* GENHD_FL_EXT_DEVT flag is available */ +/* #undef HAVE_GENHD_FL_EXT_DEVT */ + +/* GENHD_FL_NO_PART flag is available */ +/* #undef HAVE_GENHD_FL_NO_PART */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the 'gettid' function. */ +/* #undef HAVE_GETTID */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() returns struct dentry* */ +/* #undef HAVE_IOPS_MKDIR_DENTRY */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_get_pages2() is available */ +/* #undef HAVE_IOV_ITER_GET_PAGES2 */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* Define to 1 if you have the 'issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* iter_is_ubuf() is available */ +/* #undef HAVE_ITER_IS_UBUF */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel defines intptr_t */ +/* #undef HAVE_KERNEL_INTPTR_T */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* kernel has kmap_local_page */ +/* #undef HAVE_KMAP_LOCAL_PAGE */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [unwind] */ +/* #undef HAVE_LIBUNWIND */ + +/* libunwind has unw_get_elf_filename */ +/* #undef HAVE_LIBUNWIND_ELF */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* building against unsupported kernel version */ +/* #undef HAVE_LINUX_EXPERIMENTAL */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Define to 1 if you have the 'mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* PG_error flag is available */ +/* #undef HAVE_MM_PAGE_FLAG_ERROR */ + +/* page_mapping() is available */ +/* #undef HAVE_MM_PAGE_MAPPING */ + +/* page_size() is available */ +/* #undef HAVE_MM_PAGE_SIZE */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + ++/* readahead_page() exists */ ++/* #undef HAVE_PAGEMAP_READAHEAD_PAGE */ ++ +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* pin_user_pages_unlocked() is available */ +/* #undef HAVE_PIN_USER_PAGES_UNLOCKED */ + +/* proc_handler ctl_table arg is const */ +/* #undef HAVE_PROC_HANDLER_CTL_TABLE_CONST */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* If available, contains the Python version number currently in use. */ +/* #undef HAVE_PYTHON */ + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* register_sysctl_sz exists */ +/* #undef HAVE_REGISTER_SYSCTL_SZ */ + +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* shrinker_register exists */ +/* #undef HAVE_SHRINKER_REGISTER */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* STACK_FRAME_NON_STANDARD asm macro is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD_ASM */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the 'strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the 'strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* have super_block s_shrink */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK */ + +/* have super_block s_shrink pointer */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK_PTR */ + +/* have super_block s_wb_err */ +/* #undef HAVE_SUPER_BLOCK_S_WB_ERR */ + +/* sync_blockdev() is declared in include/blkdev.h */ +/* #undef HAVE_SYNC_BLOCKDEV */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* timer_delete_sync is available */ +/* #undef HAVE_TIMER_DELETE_SYNC */ + +/* i_op->tmpfile() uses old dentry signature */ +/* #undef HAVE_TMPFILE_DENTRY */ + +/* i_op->tmpfile() has mnt_idmap */ +/* #undef HAVE_TMPFILE_IDMAP */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the 'udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->setattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_SETATTR */ + +/* fops->clone_file_range() is available */ +/* #undef HAVE_VFS_CLONE_FILE_RANGE */ + +/* fops->dedupe_file_range() is available */ +/* #undef HAVE_VFS_DEDUPE_FILE_RANGE */ + +/* filemap_dirty_folio exists */ +/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ + +/* generic_copy_file_range() is available */ +/* #undef HAVE_VFS_GENERIC_COPY_FILE_RANGE */ + +/* migratepage exists */ +/* #undef HAVE_VFS_MIGRATEPAGE */ + +/* migrate_folio exists */ +/* #undef HAVE_VFS_MIGRATE_FOLIO */ + +/* address_space_operations->readpages exists */ +/* #undef HAVE_VFS_READPAGES */ + +/* read_folio exists */ +/* #undef HAVE_VFS_READ_FOLIO */ + +/* fops->remap_file_range() is available */ +/* #undef HAVE_VFS_REMAP_FILE_RANGE */ + +/* __set_page_dirty_nobuffers exists */ +/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ + +/* splice_copy_file_range() is available */ +/* #undef HAVE_VFS_SPLICE_COPY_FILE_RANGE */ + ++/* address_space_operations->writepage exists */ ++/* #undef HAVE_VFS_WRITEPAGE */ ++ +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* int (*writepage_t)() takes struct folio* */ +/* #undef HAVE_WRITEPAGE_T_FOLIO */ + +/* xattr_handler->get() wants dentry and inode and flags */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE_FLAGS */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() takes mnt_idmap */ +/* #undef HAVE_XATTR_SET_IDMAP */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if host toolchain supports XSAVE */ +#define HAVE_XSAVE 1 + +/* Define if host toolchain supports XSAVEOPT */ +#define HAVE_XSAVEOPT 1 + +/* Define if host toolchain supports XSAVES */ +#define HAVE_XSAVES 1 + +/* ZERO_PAGE() is GPL-only */ +/* #undef HAVE_ZERO_PAGE_GPL_ONLY */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* libunwind is llvm libunwind */ +/* #undef IS_LIBUNWIND_LLVM */ + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* using complete_and_exit() instead */ +/* #undef SPL_KTHREAD_COMPLETE_AND_EXIT */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* pde_data() is PDE_DATA() */ +/* #undef SPL_PDE_DATA */ + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* Version number of package */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.3.99-437-FreeBSD_g8170eb6eb" ++#define ZFS_META_ALIAS "zfs-2.3.99-443-FreeBSD_g69ee01aa4" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "6.15" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "4.18" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ +/* #undef ZFS_META_LT_REVISION */ + +/* Define the project name. */ +#define ZFS_META_NAME "zfs" + +/* Define the project release. */ - #define ZFS_META_RELEASE "437-FreeBSD_g8170eb6eb" ++#define ZFS_META_RELEASE "443-FreeBSD_g69ee01aa4" + +/* Define the project version. */ +#define ZFS_META_VERSION "2.3.99" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ diff --cc sys/modules/zfs/zfs_gitrev.h index 83ad3f5f0808,000000000000..2791bc828657 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_gitrev.h +++ b/sys/modules/zfs/zfs_gitrev.h @@@ -1,1 -1,0 +1,1 @@@ - #define ZFS_META_GITREV "zfs-2.3.99-437-g8170eb6eb" ++#define ZFS_META_GITREV "zfs-2.3.99-443-g69ee01aa4" From nobody Sat Jun 28 01:23:08 2025 X-Original-To: dev-commits-src-main@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 4bTZS02bGYz60Wy1; Sat, 28 Jun 2025 01:23:12 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTZS01p9Kz3s1F; Sat, 28 Jun 2025 01:23:12 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751073792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jQKVorYAHdjDBwJY51nOe4f+8mXuSPxKFSHTCXW+qIM=; b=uplBfMATteS5KOMuLhpkqch+HREJ3IbbY1FKrLLcUKND+LMWN89xLwEBdFpRe5jiuUPQHM szlbF/ED88rEM1ZbdntyTHYw6xoWZQY12yk3icTjqTb5daVXFNrNOVgAqM3RRbFPSwQup8 YayX0WbvTiA1hSIz8G6twQthSGkHdp3M6kXgMmwVl1hGa/Ce3uzxf0R1ffU0CBK58WBz0a 2+7Fzl5OFTkiCbCZzXKgYuYuoKsIKaMZzOmab9rq4iMefIdEwwpNe1jnYfPRlc5Oe2vZjY NRhXgHO21XdIll12bbe1pYwkoQsrhG6ozo9Kohb+RTn5ybIjENaWteY3lznU4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751073792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jQKVorYAHdjDBwJY51nOe4f+8mXuSPxKFSHTCXW+qIM=; b=JMPBHKwoomBwl0K7dvDEW32kHWE2129tHO539+qsesHF6J0XoNFQoIwZ+lqFdjtEEGjp4B MoeJiMHe91Ol9S6XwfIiXOxtetvYL+ZESn24RMVC+A4Uh3SzCB/nPzUt2tbNYhC9CG2rhm FsJHxt+hPako/RZYwUfWBsNyze0kN9EaUR0xzgIOgqvBFrEbb0WVSkF3yVW/gxOy0zVOMe V+Fw/252WknprgZ1iinHvMhqVMvoiR6lK3C9l4cMvf6ivK3tesUooDcr2bP+VxiSrojDUC lU1IoJj5+bEse7+/3ytFUPcKfumysAmpOCi8VMW7l8ZtJzTUx//5V59m6O6k/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751073792; a=rsa-sha256; cv=none; b=GiV09l3Og2D56LoIDXNFH4nRHzPtTfmny0PFfKVrdfPKiHloIoSEffmZGCTnVCggdbAGmw L+oBqH6oyoNu7Nfk7jqrJ7BhjMVHqPJo8JZOOSkY6bfmZErVzOXii3T84Jw1NIXNGMggjW ErA1Xr5zE0d+Uf4iwgzbfD//gJAceskWxkyP9kwJ9KHSTGgua+tHlQiGX4WANM3o1fns1x 6cO/dl2zt3pXULygVVQGItL0HZ2jtDY1YxS555+wBnhaS4unj+YIWV5vbKk9tN0ATO4VPM EBxVjD6PLSP7pKk9V6KlG4NELwgl6VsFx1ti3tVHmKANiX8aUvGOfTmvIarYOQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bTZRz36jzzLT5; Sat, 28 Jun 2025 01:23:11 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Fri, 27 Jun 2025 18:23:08 -0700 From: Gleb Smirnoff To: Alan Somers , Damin Rido Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0726c6574f88 - main - sockstat: Add automatic column sizing and remove -w option Message-ID: References: <202506271559.55RFxWdm024724@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506271559.55RFxWdm024724@gitrepo.freebsd.org> Hi, On Fri, Jun 27, 2025 at 03:59:32PM +0000, Alan Somers wrote: A> commit 0726c6574f889507e5030173bf4c82c80911394d A> Author: Damin Rido A> AuthorDate: 2025-06-12 09:12:49 +0000 A> Commit: Alan Somers A> CommitDate: 2025-06-27 15:54:41 +0000 A> A> sockstat: Add automatic column sizing and remove -w option A> A> Refactor sockstat to dynamically size table columns based on content. A> This eliminates the need for the -w option, which is now ignored A> for backwards compatibility. A> A> Numeric columns are now right-aligned for improved readability; A> previously, they were left-aligned. A> A> Unknown fields are now consistently shown as "??" instead of a mix A> of "", "?", and "?" for output uniformity. A> A> Sponsored by: Google, LLC (GSoC 2025) A> MFC after: 2 weeks A> Reviewed by: asomers A> Pull Request: https://github.com/freebsd/freebsd-src/pull/1720 A> --- A> usr.bin/sockstat/sockstat.1 | 6 +- A> usr.bin/sockstat/sockstat.c | 622 +++++++++++++++++++++++++++----------------- A> 2 files changed, 392 insertions(+), 236 deletions(-) The commit message looks promising, but so far the output of the program that I use daily has been made much worsr :( First, there is a spurious second newline on every line. Even after the header line! How could that pass through minimal testing? Second, the default output now just inserts a huge whitespace "column" in the middle of the list, making it extermely wide. Note, that before this change the default output was fitting into 80 char terminal. Now it is not fitting and without any good reason to do so. I really would prefer this reverted and re-tested by a wider audience before pushing it back in. -- Gleb Smirnoff From nobody Sat Jun 28 02:04:33 2025 X-Original-To: dev-commits-src-main@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 4bTbMm49jDz60Ylc; Sat, 28 Jun 2025 02:04:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTbMm2zTyz3W6F; Sat, 28 Jun 2025 02:04:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751076276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0F3uC/fR4ifpEAgpUjom4ajU41EU6OGhCDMV2W/4Q5M=; b=j4JnX2gbWWd2PkCJWAHsi0iJXhlDEfsN8rOn4tdlTB7+P3WmEN3JrqhUvfjcB/fgnRyUwm rGEwRNV7BVtvcGNZYuEP6H1phOBPyotLPd4EUsZ+saUV35uZ8hunKde81ITW1bb8dgsfN9 swMvFQwFR6TXFoVKvtMDKKa1VpH03yyOFzg8jo0ffTsMvFtrEfqex3fP4AttYqORZEi9ot hvc/Oei0+W2pCkNwRgC2GYQk/AH2OocX9U4X2rdaPxRK0pG9p1ZoxnLW9HnazWUA1xMdvP /3LECflC+ipwtst3iThN1LgaUJzrVjtAfo4Mu7NDBHV68yLeUHcAA9J/T7D5aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751076276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0F3uC/fR4ifpEAgpUjom4ajU41EU6OGhCDMV2W/4Q5M=; b=Qff5Urja0WQnRcsGnPpmO7Ey/qXVYF+LtQZ8rvlhNHt+Vn36Hraax2cv4HFSqm0JerMrBm Mv4JTp//pNTL04+wYTUSYh1iSM0y0WVYZdO2EKJ3FiDKMc4dNKoioF9579GnYUrRy/QlBd dkOOSxcuUnR/T5MbRwvwOQSY/7O/4kuUxCDV2NWcr8Jii8ya4avSwf2i9kBKsA5LYBm75J Xby3Oltqd7DoBR3xpqSchaiKBuSiHMRmiNAds43LAk0pomVg5izvqgpdrMeQcMRfns8HC3 88SBth+Qq1M/CwJo39WTvvGb6UPhGSL6XifUui/MJDzH+Ql8scqu6kQxLoCEww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751076276; a=rsa-sha256; cv=none; b=WCL8ib6abuntRT61kg19urYZlqLEIy7ET+KsCzA2R1K4lESNdMB84PDcBkiIREdZvIYWdi Jts+40UDuUtLkkE18tf5PzOsGO1/w+0f+et+GcM/gC91qImZYnceWLWDfLHbXyj93t1KTI 52z1O2wRRM3VkLP4FwbDb96s3DGnW+b2+XrAA3QrKNjAAmZiT1zEpx5rL6KI/rkd3ejHGY 1MTCULTOdxtcsnGDkC0NYBVSl7B0nk3ySV4DiVRRpEmrRBgraYaTlVmdIBsx7dGm6Bze2m K6yi8dcy3dHcqll5wbRkvjzK2cTYSdspJc827Gve0gs+PWnbrlw/rhXvpXrbxw== Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1101:be00:60aa:9198:e79f:6691]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: tuexen) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bTbMl5vC2zMNk; Sat, 28 Jun 2025 02:04:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: 89f6eb0a61cb - main - tcp: restrict the contents of tcp_timer.h to the kernel context From: Michael Tuexen In-Reply-To: Date: Sat, 28 Jun 2025 04:04:33 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202506261609.55QG9odv049208@gitrepo.freebsd.org> To: Charlie Li X-Mailer: Apple Mail (2.3826.600.51.1.1) > On 28. Jun 2025, at 00:34, Charlie Li wrote: >=20 > Michael Tuexen wrote: >> tcp: restrict the contents of tcp_timer.h to the kernel context >> The header file contains only stuff relevant in the kernel = context. >> Reviewed by: glebius, rscheff, Peter Lei, imp >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D50912 >> --- >> sys/netinet/tcp_timer.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h >> index 875f1584988c..a145782ba82d 100644 >> --- a/sys/netinet/tcp_timer.h >> +++ b/sys/netinet/tcp_timer.h >> @@ -32,6 +32,8 @@ >> #ifndef _NETINET_TCP_TIMER_H_ >> #define _NETINET_TCP_TIMER_H_ >> +#ifdef _KERNEL >> + >> /* >> * The TCPT_REXMT timer is used to force retransmissions. >> * The TCP has the TCPT_REXMT timer set whenever segments >> @@ -133,8 +135,6 @@ >> (tv) =3D (tvmax); \ >> } while(0) >> -#ifdef _KERNEL >> - >> #define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : = tcp_keepinit) >> #define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : = tcp_keepidle) >> #define TP_KEEPINTVL(tp) ((tp)->t_keepintvl ? (tp)->t_keepintvl : = tcp_keepintvl) > This broke net-mgmt/net-snmp, which uses at least TCPTV_MIN and = TCPTV_REXMTMAX. Hi Charlie, why is net-mgmt/net-snmp interested in the default value of the sysctl = variables net.inet.tcp.rexmit_min and net.inet.tcp.tcp_rexmit_max and not in the = current value of these sysctl variables? This does not make sense to me... Best regards Michael >=20 > --=20 > Charlie Li > ...nope, still don't have an exit line. >=20 From nobody Sat Jun 28 02:35:18 2025 X-Original-To: dev-commits-src-main@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 4bTc3S4N9Wz60bGH; Sat, 28 Jun 2025 02:35:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTc3S27DKz3nty; Sat, 28 Jun 2025 02:35:32 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-ae36e88a5daso40822866b.1; Fri, 27 Jun 2025 19:35:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751078130; x=1751682930; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lM4O9u8vhRbp5aOoAV4+1PoEo6q97HzX2oXxgTSxT1Q=; b=DXDbLi40CWOiEUYvh0kHMgry31/5YH10KKS7gyWy43xcYYlRZfmNX9+ovq79miYz/r 4xmKw2/VxsurxqP5pHOYLHIk2R835QfPjXrk17PHXCMD5T2dTZixTUi6ErFyB1B6NU+2 lnL2T5v7nwgtAuSx8j4OSJiaqlsLOaEcUGMUQxzt3ixhDOkghGLOeOBgojY7dMm4xxqp YFUFaIGO5MA3hMu/NqxtiRfOdSRXSbpJrjSnr7ya/3kpKumF1tqUF6BDYHgIftwBYkWL //IDexBBZDYRm99aILtTFnOj/vgPzSz+UZsnq2eWClQyMEj7tkAnuKLdmoimNc8Hu16a HfKw== X-Forwarded-Encrypted: i=1; AJvYcCVktDfySmAFatHR0cxh9hSiHnqLhTb9ulYwc8xy+SqkyvdkHJ44KlyhSReoBnq/Euo3N5YFHU7c6RhsPYjHriNN+NV9QrQ=@freebsd.org, AJvYcCWcVBoHcGYWth02RzLwGh0it6oSqZIygup54qAZJ2mrT8MSOD1SfHOnhuJatwgHdOkH9sNc/lr0DVAng6j0Xcobo2XL@freebsd.org X-Gm-Message-State: AOJu0YwfJTtHeLS1jlSxvdO1AZ2SsbLQNkH8XEticqEOXHWPeYXSn228 RENvbdyyhhLHEYGUVhgONXleAas9l6B78fpbRE6ODnyQUlIS+XpnGxl+IxfFeTFhF+NRd6lFiC/ lM6g89fyV85c9xnzsk6OZIdfhRYlPXLR0vA== X-Gm-Gg: ASbGnctShHXef2yejsRUUG6riYRZwD60ni4Rdkp+H1eRAP1t3hX6yrI6g+kKFC6Wg5P OiYUICSnYGSZIBEHcDjaJ/pg1YuDVZCgWFcbAxSHEJtO71gdceW3oKUlqJyTBdI1jVfEyEUT9jS 0VOj3X2rO2vSs6VMc5f0dUFGb3w0KeykRP7A6MuD+qqyk= X-Google-Smtp-Source: AGHT+IGt+Ya+khvXfCF+a3fl66GaTV+MnpKr4Q344Ibmcpbo74p4diDzw8AEVR8LSD/LO/M8EjVShBS6xvmOEc27zCg= X-Received: by 2002:a17:907:3f86:b0:ae0:bd48:b9b9 with SMTP id a640c23a62f3a-ae34fedf159mr528888066b.23.1751078130002; Fri, 27 Jun 2025 19:35:30 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506271559.55RFxWdm024724@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Fri, 27 Jun 2025 20:35:18 -0600 X-Gm-Features: Ac12FXx1d7j9KyIT0Yqtj-4urpp2vLv2Wvbh-r0E50nyfmT4beuyb8bNjIvePfI Message-ID: Subject: Re: git: 0726c6574f88 - main - sockstat: Add automatic column sizing and remove -w option To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Damin Rido Content-Type: multipart/alternative; boundary="000000000000e9aebe063898a521" X-Rspamd-Queue-Id: 4bTc3S27DKz3nty X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] --000000000000e9aebe063898a521 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 27, 2025 at 7:23=E2=80=AFPM Gleb Smirnoff = wrote: > Hi, > > On Fri, Jun 27, 2025 at 03:59:32PM +0000, Alan Somers wrote: > A> commit 0726c6574f889507e5030173bf4c82c80911394d > A> Author: Damin Rido > A> AuthorDate: 2025-06-12 09:12:49 +0000 > A> Commit: Alan Somers > A> CommitDate: 2025-06-27 15:54:41 +0000 > A> > A> sockstat: Add automatic column sizing and remove -w option > A> > A> Refactor sockstat to dynamically size table columns based on > content. > A> This eliminates the need for the -w option, which is now ignored > A> for backwards compatibility. > A> > A> Numeric columns are now right-aligned for improved readability; > A> previously, they were left-aligned. > A> > A> Unknown fields are now consistently shown as "??" instead of a mix > A> of "", "?", and "?" for output uniformity. > A> > A> Sponsored by: Google, LLC (GSoC 2025) > A> MFC after: 2 weeks > A> Reviewed by: asomers > A> Pull Request: https://github.com/freebsd/freebsd-src/pull/1720 > A> --- > A> usr.bin/sockstat/sockstat.1 | 6 +- > A> usr.bin/sockstat/sockstat.c | 622 > +++++++++++++++++++++++++++----------------- > A> 2 files changed, 392 insertions(+), 236 deletions(-) > > The commit message looks promising, but so far the output of the program > that I > use daily has been made much worsr :( > > First, there is a spurious second newline on every line. Even after the > header > line! How could that pass through minimal testing? > A second newline? Do you mean that the output is double-spaced? Because I do not see that at all. > > Second, the default output now just inserts a huge whitespace "column" in > the > middle of the list, making it extermely wide. Note, that before this > change > the default output was fitting into 80 char terminal. Now it is not > fitting > and without any good reason to do so. > You shouldn't be seeing any column that's pure whitespace. You might be looking at the "PROTO" column, which is often wide because some sockets show "stream (not connected)". The "(not connected)" part isn't new; that's always been there. Does your "whitespace column" go away if you use "-4" or "-6"? If so, Damin do you think we could move "(not connected)" into the "LOCAL ADDRESS" column? It might fit better there. > > I really would prefer this reverted and re-tested by a wider audience > before > pushing it back in. > I'm sorry that your experience has been poor. But I disagree that a full reversion is warranted. > > -- > Gleb Smirnoff > --000000000000e9aebe063898a521 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jun 27, 2025 at 7:23=E2=80=AFPM Gleb = Smirnoff <glebius@freebsd.org= > wrote:
=C2= =A0 Hi,

On Fri, Jun 27, 2025 at 03:59:32PM +0000, Alan Somers wrote:
A> commit 0726c6574f889507e5030173bf4c82c80911394d
A> Author:=C2=A0 =C2=A0 =C2=A0Damin Rido <rido@FreeBSD.com>
A> AuthorDate: 2025-06-12 09:12:49 +0000
A> Commit:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.org> A> CommitDate: 2025-06-27 15:54:41 +0000
A>
A>=C2=A0 =C2=A0 =C2=A0sockstat: Add automatic column sizing and remove -= w option
A>=C2=A0 =C2=A0 =C2=A0
A>=C2=A0 =C2=A0 =C2=A0Refactor sockstat to dynamically size table column= s based on content.
A>=C2=A0 =C2=A0 =C2=A0This eliminates the need for the -w option, which = is now ignored
A>=C2=A0 =C2=A0 =C2=A0for backwards compatibility.
A>=C2=A0 =C2=A0 =C2=A0
A>=C2=A0 =C2=A0 =C2=A0Numeric columns are now right-aligned for improved= readability;
A>=C2=A0 =C2=A0 =C2=A0previously, they were left-aligned.
A>=C2=A0 =C2=A0 =C2=A0
A>=C2=A0 =C2=A0 =C2=A0Unknown fields are now consistently shown as "= ;??" instead of a mix
A>=C2=A0 =C2=A0 =C2=A0of "", "?", and "?" = for output uniformity.
A>=C2=A0 =C2=A0 =C2=A0
A>=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Google, LLC (GSoC 2025)<= br> A>=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks
A>=C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 asomers
A>=C2=A0 =C2=A0 =C2=A0Pull Request:=C2=A0 =C2=A0h= ttps://github.com/freebsd/freebsd-src/pull/1720
A> ---
A>=C2=A0 usr.bin/sockstat/sockstat.1 |=C2=A0 =C2=A06 +-
A>=C2=A0 usr.bin/sockstat/sockstat.c | 622 +++++++++++++++++++++++++++--= ---------------
A>=C2=A0 2 files changed, 392 insertions(+), 236 deletions(-)

The commit message looks promising, but so far the output of the program th= at I
use daily has been made much worsr :(

First, there is a spurious second newline on every line.=C2=A0 Even after t= he header
line! How could that pass through minimal testing?
A second newline?=C2=A0 Do you mean that the output is double-s= paced?=C2=A0 Because I do not see that at all.
=C2=A0

Second, the default output now just inserts a huge whitespace "column&= quot; in the
middle of the list, making it extermely wide.=C2=A0 Note, that before this = change
the default output was fitting into 80 char terminal.=C2=A0 Now it is not f= itting
and without any good reason to do so.

Y= ou shouldn't be seeing any column that's pure whitespace.=C2=A0 You= might be looking at the "PROTO" column, which is often wide beca= use some sockets show "stream (not connected)".=C2=A0 The "(= not connected)" part isn't new; that's always been there.=C2= =A0 Does your "whitespace column" go away if you use "-4&quo= t; or "-6"?=C2=A0 If so, Damin do you think we could move "(= not connected)" into the "LOCAL ADDRESS" column?=C2=A0 It mi= ght fit better there.
=C2=A0

I really would prefer this reverted and re-tested by a wider audience befor= e
pushing it back in.

I'm sorry that = your experience has been poor.=C2=A0 But I disagree that a full reversion i= s warranted.
=C2=A0

--
Gleb Smirnoff
--000000000000e9aebe063898a521-- From nobody Sat Jun 28 02:35:50 2025 X-Original-To: dev-commits-src-main@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 4bTc3p3qG9z60bGK; Sat, 28 Jun 2025 02:35: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 4bTc3p2T9qz3pPy; Sat, 28 Jun 2025 02:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751078150; 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=tKmjxZSDLy+UinigFWHLecXFi2GB2HrQG42fOH2fWxM=; b=nvOYZKVFbj6KKOnkysMw/vsKMgwqr4Je0ggoV2RGup+2hf1Y5VFmIiFNHPQbM/O+VPYK26 IR2bChi4/C9AymD/Xuso46gJwqBrVQzrWGS+JkwxOv7XIhqcGvkDDDNyz09SHarbi1GKl0 V3fNRPvW2++UhyfoUBlyfaYt13XmEjoNqp/zHXZY21NPVDY6RCUtteLW72nYcx1f06ym5x f8I4a3hT2QpkdGruzmgijwWoLzy1Lv+KWueGxebWMwqaI7+krHPtfrNFhR3IH7s3JW3BVG CMo2kKrSMbDYhPOMwjSp+fx//yXMkMUzcq+9ODB9RP9NCAE2bR5OJbiQcTDWTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751078150; 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=tKmjxZSDLy+UinigFWHLecXFi2GB2HrQG42fOH2fWxM=; b=h6Ssx2Z9m5SnIPld8FjnFGShEU1y5zNvBrZmmqXnSe7x48hAjpdFP5ZxCWhii0WJwnmFaS jYoxpYktnaVQJ5nR8bhXMo0y8A3GY1mYeZYrhjTrE7adcRXOb6T5r9s/sCQHehjFvNjBgs oFncsEpmPc64ecWtxN2pdgxoH3lb3dNQEpYmnPE6NrnL+tKRtKQrRwwO/H3RCy0sRk7YgZ BQUQVrZ86nmua5HRZxzO3/pRR//jbyz4I88/29Vg0R21SLhUsnXxpFQsSD/QDOCdWoHKo8 PDUIyRczWxe8lZWpOjO7VDiWOFOr1+XCiergSRhqDaKPd1pcJsVgfSKg6M5zDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751078150; a=rsa-sha256; cv=none; b=eJ4bAT1cGvA+BzmJ/mt74ABwDv1WwlcSiEwOYATgOZHB6BVTeyaIgOFp8iTFuIQfts0s8j 3n1MflkR2xrs+Zen1IqB4Ub107bhcWyXS5fvd0vGG26/Q1YOTYbqEVWWRtDejlgDoqMYsc hMxF8Oi3pPHVSLse32Xb3ZTXE1S+RN+AY88JnCZEXgcA48v21CCYy9FpaZgFhzm5wsPVoz 6+wEN4FA3GIxlK5Pul4A858jav+Ypx1eN2O4UiX3nXfdghhJEQtnuB3+CxmxUeKujYDrsX mU7JvnkiBbkNqgkClJY5x82m3UQpeZOTMgzw4kbGv2O4Uesvm/k+4zH9YGSh6w== 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 4bTc3p23c8zbx; Sat, 28 Jun 2025 02:35: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 55S2ZomW023274; Sat, 28 Jun 2025 02:35:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55S2ZoIX023268; Sat, 28 Jun 2025 02:35:50 GMT (envelope-from git) Date: Sat, 28 Jun 2025 02:35:50 GMT Message-Id: <202506280235.55S2ZoIX023268@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 738a9a78fc92 - main - Revert "FreeBSD: zfs_putpages: don't undirty pages until after write completes" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 738a9a78fc92e035eb168b9d0a9ada146a9e9972 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=738a9a78fc92e035eb168b9d0a9ada146a9e9972 commit 738a9a78fc92e035eb168b9d0a9ada146a9e9972 Author: Mark Johnston AuthorDate: 2025-06-28 02:32:16 +0000 Commit: Mark Johnston CommitDate: 2025-06-28 02:32:16 +0000 Revert "FreeBSD: zfs_putpages: don't undirty pages until after write completes" This causes async putpages to leave the pages sbusied for a long time, which hurts concurrency. Revert for now until we have a better approach. This reverts commit 238eab7dc16932edbe9bcc990e8e5376bfe5b2ba. Reported by: Ihor Antonov Discussed with: Rob Norris --- .../openzfs/include/os/freebsd/spl/sys/vm.h | 1 - sys/contrib/openzfs/module/os/freebsd/spl/spl_vm.c | 1 - .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 60 ++++++---------------- 3 files changed, 15 insertions(+), 47 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/vm.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/vm.h index d36bee881d0b..454078f0fe79 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/vm.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/vm.h @@ -35,7 +35,6 @@ extern const int zfs_vm_pagerret_bad; extern const int zfs_vm_pagerret_error; extern const int zfs_vm_pagerret_ok; -extern const int zfs_vm_pagerret_pend; extern const int zfs_vm_pagerput_sync; extern const int zfs_vm_pagerput_inval; diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_vm.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_vm.c index 9d5f025423a1..733c2bd07ebb 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_vm.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_vm.c @@ -43,7 +43,6 @@ const int zfs_vm_pagerret_bad = VM_PAGER_BAD; const int zfs_vm_pagerret_error = VM_PAGER_ERROR; const int zfs_vm_pagerret_ok = VM_PAGER_OK; -const int zfs_vm_pagerret_pend = VM_PAGER_PEND; const int zfs_vm_pagerput_sync = VM_PAGER_PUT_SYNC; const int zfs_vm_pagerput_inval = VM_PAGER_PUT_INVAL; diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 9ed6053da25a..8a5006c488f3 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -25,7 +25,6 @@ * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 Nexenta Systems, Inc. - * Copyright (c) 2025, Klara, Inc. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -4300,33 +4299,6 @@ zfs_freebsd_getpages(struct vop_getpages_args *ap) ap->a_rahead)); } -typedef struct { - uint_t pca_npages; - vm_page_t pca_pages[]; -} putpage_commit_arg_t; - -static void -zfs_putpage_commit_cb(void *arg) -{ - putpage_commit_arg_t *pca = arg; - vm_object_t object = pca->pca_pages[0]->object; - - zfs_vmobject_wlock(object); - - for (uint_t i = 0; i < pca->pca_npages; i++) { - vm_page_t pp = pca->pca_pages[i]; - vm_page_undirty(pp); - vm_page_sunbusy(pp); - } - - vm_object_pip_wakeupn(object, pca->pca_npages); - - zfs_vmobject_wunlock(object); - - kmem_free(pca, - offsetof(putpage_commit_arg_t, pca_pages[pca->pca_npages])); -} - static int zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t len, int flags, int *rtvals) @@ -4428,12 +4400,10 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t len, int flags, } if (zp->z_blksz < PAGE_SIZE) { - vm_ooffset_t woff = off; - size_t wlen = len; - for (i = 0; wlen > 0; woff += tocopy, wlen -= tocopy, i++) { - tocopy = MIN(PAGE_SIZE, wlen); + for (i = 0; len > 0; off += tocopy, len -= tocopy, i++) { + tocopy = len > PAGE_SIZE ? PAGE_SIZE : len; va = zfs_map_page(ma[i], &sf); - dmu_write(zfsvfs->z_os, zp->z_id, woff, tocopy, va, tx); + dmu_write(zfsvfs->z_os, zp->z_id, off, tocopy, va, tx); zfs_unmap_page(sf); } } else { @@ -4454,19 +4424,19 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t len, int flags, zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime); err = sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); ASSERT0(err); + /* + * XXX we should be passing a callback to undirty + * but that would make the locking messier + */ + zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, + len, commit, B_FALSE, NULL, NULL); - putpage_commit_arg_t *pca = kmem_alloc( - offsetof(putpage_commit_arg_t, pca_pages[ncount]), - KM_SLEEP); - pca->pca_npages = ncount; - memcpy(pca->pca_pages, ma, sizeof (vm_page_t) * ncount); - - zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, - off, len, commit, B_FALSE, zfs_putpage_commit_cb, pca); - - for (i = 0; i < ncount; i++) - rtvals[i] = zfs_vm_pagerret_pend; - + zfs_vmobject_wlock(object); + for (i = 0; i < ncount; i++) { + rtvals[i] = zfs_vm_pagerret_ok; + vm_page_undirty(ma[i]); + } + zfs_vmobject_wunlock(object); VM_CNT_INC(v_vnodeout); VM_CNT_ADD(v_vnodepgsout, ncount); } From nobody Sat Jun 28 02:52:47 2025 X-Original-To: dev-commits-src-main@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 4bTcRV1gZXz60cK1; Sat, 28 Jun 2025 02:52: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 4bTcRV1F4bz44BR; Sat, 28 Jun 2025 02:52:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751079174; 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=Zmr4HiGjt+ZQrzYH3l0itRlJKJ+OEmHli0iwsp9pjFc=; b=hvTHQ9bFZf8iAyNgpc1at1oRbNMmyeKY3s+Z0pOY/IvlSlIm14fpoxqZLPNcLbjOMit8dD 0c0sQ90uBLTMrrWdVjLDxHJRGUuNNAfa62c1p9DuU0CY+ZnwkNMdVzeLhdopok/+9Q7hMt pq5rMGzCsO/LWKaMir0lGHElwf7YUxvb6TNz/fLZ3DB44zentzmZ/CsoQQgEzap0pBVcVf KQNajbw+rdOHCVjnh+p25XgcsoWeGXyLkwKHuI4k/9ZIc1zecGJjp8pTAtxPqCiS+uFaAz gFvpspYlGdJdlcYwAf/hc5poR43BbjZ6Gst2g6TuGJYD8mW8jr9RMbCwsTkH9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751079174; 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=Zmr4HiGjt+ZQrzYH3l0itRlJKJ+OEmHli0iwsp9pjFc=; b=sbb6r1qHCSjZxqtMaLfi/cSEOKbgXaMSIPB/ORrGNQ4pMC/5Q/rFg+7KdlSLvfPfugOola ygncRF0iMXzlCPxa40/HNA8hX0rH+GcNWfuVR/k1Yjo0wPUXFhtaaYew/mCoL6d52E7Lie zOnBCUgHsVFjui3I+Z8R+fxRCN+kqgg+838jEq3NymW/ZfzUGX8IzPaov7rC/Zvh02hppV Va4YIi9r/QL6rRe/Nsq2b5v0VHS06wcJFSYOgeRKloWkxfnOZeNfFvHcTDzgVXmcndbrqv 9wnx8wzgTeGQ/idkPPQHyqQ9RZ2k/VVax4uXDmd3X02+LGyk9mNvyMQmujp0Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751079174; a=rsa-sha256; cv=none; b=TflBxHxQI7y9J8S+v1GB20GELnFVX99vGor27xYLn9hTyeo56O24ify/wqTsNvV1swzvZd XsoM0bVcI2TuH14DbAbXL0bWUiBi/3xns8a7ijHzfcK85xPliaCeTwI2apQj2aFAM5fnz1 b45DZ2zP16nZ0DMrianK53XZ2RIhhPzOU95dlHRVbXhf8Ls1s1g4AIu4oyDov+Fu9nJL5r EHp5NE/6aaNVZBC6ZaO3hXsButdWXGZ/KFgecZFS9rWD81YZnWT0l/+eJIR0dceh5ex+Ro omGfC1qLfOzUoU2xGfUvpXRxBMWr+8i5Kpf561dT90NcmK8uNWx1VYOXRJE72g== 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 4bTcRV0qpzz19Z; Sat, 28 Jun 2025 02:52: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 55S2qsFp061074; Sat, 28 Jun 2025 02:52:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55S2qlEG061037; Sat, 28 Jun 2025 02:52:47 GMT (envelope-from git) Date: Sat, 28 Jun 2025 02:52:47 GMT Message-Id: <202506280252.55S2qlEG061037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 0b46a53a2f50 - main - Merge bmake-20250618 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b46a53a2f50b5ab0f4598104119a049b9c42cc9 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0b46a53a2f50b5ab0f4598104119a049b9c42cc9 commit 0b46a53a2f50b5ab0f4598104119a049b9c42cc9 Merge: 738a9a78fc92 4f8f2bc29466 Author: Simon J. Gerraty AuthorDate: 2025-06-28 02:47:23 +0000 Commit: Simon J. Gerraty CommitDate: 2025-06-28 02:49:16 +0000 Merge bmake-20250618 contrib/bmake/ChangeLog | 85 ++ contrib/bmake/FILES | 5 + contrib/bmake/VERSION | 2 +- contrib/bmake/bmake.1 | 11 +- contrib/bmake/bmake.cat1 | 7 +- contrib/bmake/compat.c | 32 +- contrib/bmake/cond.c | 10 +- contrib/bmake/dir.c | 6 +- contrib/bmake/for.c | 28 +- contrib/bmake/hash.c | 30 +- contrib/bmake/hash.h | 16 +- contrib/bmake/job.c | 860 ++++++++++----------- contrib/bmake/job.h | 116 +-- contrib/bmake/main.c | 152 ++-- contrib/bmake/make.1 | 11 +- contrib/bmake/make.c | 173 ++--- contrib/bmake/make.h | 20 +- contrib/bmake/make_malloc.c | 6 +- contrib/bmake/meta.c | 24 +- contrib/bmake/meta.h | 4 +- contrib/bmake/mk/ChangeLog | 40 + contrib/bmake/mk/FILES | 29 +- contrib/bmake/mk/auto.obj.mk | 4 +- contrib/bmake/mk/dirdeps2dplibs.mk | 35 + contrib/bmake/mk/gendirdeps.mk | 21 +- contrib/bmake/mk/install-mk | 4 +- contrib/bmake/mk/lib.mk | 4 +- contrib/bmake/mk/libs.mk | 4 +- contrib/bmake/mk/meta.autodep.mk | 55 +- contrib/bmake/mk/meta2deps.py | 23 +- contrib/bmake/mk/meta2deps.sh | 16 +- contrib/bmake/mk/mkopt.sh | 9 +- contrib/bmake/mk/newlog.sh | 64 +- contrib/bmake/mk/progs.mk | 4 +- contrib/bmake/mk/setopts.sh | 20 +- contrib/bmake/mk/sys.mk | 3 +- contrib/bmake/parse.c | 90 ++- contrib/bmake/suff.c | 64 +- contrib/bmake/targ.c | 9 +- contrib/bmake/trace.c | 12 +- contrib/bmake/unit-tests/Makefile | 35 +- contrib/bmake/unit-tests/archive.exp | 4 +- contrib/bmake/unit-tests/check-expect.lua | 190 +++++ contrib/bmake/unit-tests/cmd-errors-jobs.exp | 6 + contrib/bmake/unit-tests/cond-func-empty.exp | 3 +- contrib/bmake/unit-tests/cond-func-empty.mk | 3 +- contrib/bmake/unit-tests/cond-late.exp | 2 +- contrib/bmake/unit-tests/dep-op-missing.exp | 2 +- contrib/bmake/unit-tests/deptgt-suffixes.exp | 1 + contrib/bmake/unit-tests/directive-for-errors.exp | 2 +- contrib/bmake/unit-tests/directive-for-errors.mk | 7 +- contrib/bmake/unit-tests/directive-for-null.exp | 2 +- contrib/bmake/unit-tests/gnode-submake.exp | 2 +- contrib/bmake/unit-tests/job-output.exp | 13 + contrib/bmake/unit-tests/job-output.mk | 41 + contrib/bmake/unit-tests/objdir-writable.exp | 2 +- contrib/bmake/unit-tests/opt-debug-graph1.exp | 3 +- contrib/bmake/unit-tests/opt-debug-graph2.exp | 3 +- contrib/bmake/unit-tests/opt-debug-graph3.exp | 3 +- contrib/bmake/unit-tests/opt-debug-jobs.exp | 20 +- contrib/bmake/unit-tests/opt-file.exp | 2 +- contrib/bmake/unit-tests/opt-jobs-internal.exp | 33 +- contrib/bmake/unit-tests/opt-jobs-internal.mk | 70 +- contrib/bmake/unit-tests/opt-jobs.mk | 2 +- contrib/bmake/unit-tests/opt-touch-jobs.mk | 4 +- contrib/bmake/unit-tests/opt-tracefile.exp | 16 +- contrib/bmake/unit-tests/opt-tracefile.mk | 5 +- contrib/bmake/unit-tests/sh-errctl.exp | 14 +- contrib/bmake/unit-tests/shell-csh.mk | 6 +- contrib/bmake/unit-tests/shell-ksh.exp | 11 +- contrib/bmake/unit-tests/shell-ksh.mk | 42 +- contrib/bmake/unit-tests/suff-main-several.exp | 3 +- contrib/bmake/unit-tests/suff-transform-debug.exp | 3 +- contrib/bmake/unit-tests/var-op-expand.exp | 14 +- contrib/bmake/unit-tests/var-op-expand.mk | 11 +- contrib/bmake/unit-tests/var-recursive.exp | 9 +- contrib/bmake/unit-tests/varmod-assign.exp | 3 + contrib/bmake/unit-tests/varmod-ifelse.exp | 9 + contrib/bmake/unit-tests/varmod-ifelse.mk | 9 +- contrib/bmake/unit-tests/varmod-mtime.exp | 4 +- contrib/bmake/unit-tests/varmod-mtime.mk | 6 +- .../bmake/unit-tests/varname-dot-make-level.exp | 1 + contrib/bmake/unit-tests/varname-dot-makeflags.mk | 2 +- contrib/bmake/unit-tests/varname-dot-newline.exp | 6 +- .../bmake/unit-tests/varname-make_stack_trace.exp | 40 + .../bmake/unit-tests/varname-make_stack_trace.mk | 37 + contrib/bmake/unit-tests/varname.exp | 17 +- contrib/bmake/unit-tests/varname.mk | 68 +- contrib/bmake/unit-tests/varparse-errors.mk | 4 +- contrib/bmake/var.c | 108 ++- usr.bin/bmake/Makefile.config | 2 +- usr.bin/bmake/unit-tests/Makefile | 35 +- 92 files changed, 1870 insertions(+), 1178 deletions(-) diff --cc contrib/bmake/job.c index 2e6f44f722f2,b0debd3c9705..582870088f2d --- a/contrib/bmake/job.c +++ b/contrib/bmake/job.c @@@ -1481,21 -1537,16 +1553,17 @@@ JobExec(Job *job, char **argv if (lseek(STDIN_FILENO, 0, SEEK_SET) == -1) execDie("lseek to 0", "stdin"); - if (job->node->type & (OP_MAKE | OP_SUBMAKE)) { + if (Always_pass_job_queue || + (job->node->type & (OP_MAKE | OP_SUBMAKE))) { /* Pass job token pipe to submakes. */ - if (fcntl(tokenWaitJob.inPipe, F_SETFD, 0) == -1) + if (fcntl(tokenPoolJob.inPipe, F_SETFD, 0) == -1) execDie("clear close-on-exec", - "tokenWaitJob.inPipe"); - if (fcntl(tokenWaitJob.outPipe, F_SETFD, 0) == -1) + "tokenPoolJob.inPipe"); + if (fcntl(tokenPoolJob.outPipe, F_SETFD, 0) == -1) execDie("clear close-on-exec", - "tokenWaitJob.outPipe"); + "tokenPoolJob.outPipe"); } - /* - * Set up the child's output to be routed through the pipe - * we've created for it. - */ if (dup2(job->outPipe, STDOUT_FILENO) == -1) execDie("dup2", "job->outPipe"); @@@ -2664,35 -2590,22 +2613,32 @@@ TokenPool_Add(void { char tok = JOB_TOKENS[aborting], tok1; ++ /* ++ * FreeBSD: do not deposit an error token ++ * unless Job_error_token is true. ++ */ + if (!Job_error_token && aborting == ABORT_ERROR) { + if (jobTokensRunning == 0) + return; - tok = '+'; /* no error token */ ++ tok = '+'; /* no error token */ + } + /* If we are depositing an error token, flush everything else. */ - while (tok != '+' && read(tokenWaitJob.inPipe, &tok1, 1) == 1) + while (tok != '+' && read(tokenPoolJob.inPipe, &tok1, 1) == 1) continue; - DEBUG3(JOB, "(%d) aborting %d, deposit token %c\n", - getpid(), aborting, tok); - while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN) - continue; + DEBUG3(JOB, "TokenPool_Add: pid %d, aborting %s, token %c\n", + getpid(), aborting_name[aborting], tok); + TokenPool_Write(tok); } - int - Job_TempFile(const char *pattern, char *tfile, size_t tfile_sz) + static void + TokenPool_InitClient(int tokenPoolReader, int tokenPoolWriter) { - int fd; - sigset_t mask; - - JobSigLock(&mask); - fd = mkTempFile(pattern, tfile, tfile_sz); - if (tfile != NULL && !DEBUG(SCRIPT)) - unlink(tfile); - JobSigUnlock(&mask); - - return fd; + tokenPoolJob.inPipe = tokenPoolReader; + tokenPoolJob.outPipe = tokenPoolWriter; + (void)fcntl(tokenPoolReader, F_SETFD, FD_CLOEXEC); + (void)fcntl(tokenPoolWriter, F_SETFD, FD_CLOEXEC); } /* Prepare the job token pipe in the root make process. */ diff --cc contrib/bmake/mk/dirdeps2dplibs.mk index 000000000000,cecf70be7477..cecf70be7477 mode 000000,100644..100644 --- a/contrib/bmake/mk/dirdeps2dplibs.mk +++ b/contrib/bmake/mk/dirdeps2dplibs.mk diff --cc contrib/bmake/mk/install-mk index de5056a37042,8d354de17cb9..8d354de17cb9 mode 100755,100644..100644 --- a/contrib/bmake/mk/install-mk +++ b/contrib/bmake/mk/install-mk diff --cc contrib/bmake/unit-tests/check-expect.lua index 000000000000,218056fbc021..218056fbc021 mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/check-expect.lua +++ b/contrib/bmake/unit-tests/check-expect.lua diff --cc contrib/bmake/unit-tests/job-output.exp index 000000000000,1891021bf3e7..1891021bf3e7 mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/job-output.exp +++ b/contrib/bmake/unit-tests/job-output.exp diff --cc contrib/bmake/unit-tests/job-output.mk index 000000000000,ae4708a5b2f8..ae4708a5b2f8 mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/job-output.mk +++ b/contrib/bmake/unit-tests/job-output.mk diff --cc contrib/bmake/unit-tests/varname-make_stack_trace.exp index 000000000000,c0f46cc5aa1e..c0f46cc5aa1e mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/varname-make_stack_trace.exp +++ b/contrib/bmake/unit-tests/varname-make_stack_trace.exp diff --cc contrib/bmake/unit-tests/varname-make_stack_trace.mk index 000000000000,cba02559bafe..cba02559bafe mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/varname-make_stack_trace.mk +++ b/contrib/bmake/unit-tests/varname-make_stack_trace.mk diff --cc usr.bin/bmake/Makefile.config index 5a71b607ca30,000000000000..78babc2f1382 mode 100644,000000..100644 --- a/usr.bin/bmake/Makefile.config +++ b/usr.bin/bmake/Makefile.config @@@ -1,28 -1,0 +1,28 @@@ +# This is a generated file, do NOT edit! +# See contrib/bmake/bsd.after-import.mk +# + +SRCTOP?= ${.CURDIR:H:H} + +# things set by configure + - _MAKE_VERSION?=20250414 ++_MAKE_VERSION?=20250618 + +prefix?= /usr +srcdir= ${SRCTOP}/contrib/bmake +CC?= cc +MAKE_OS?= +DEFAULT_SYS_PATH?= .../share/mk:/usr/share/mk + +EGREP= egrep +CPPFLAGS+= +CFLAGS+= ${CPPFLAGS} -DHAVE_CONFIG_H +LDFLAGS+= +LIBOBJS+= ${LIBOBJDIR}stresep$U.o +LDADD+= +USE_META?= yes +USE_FILEMON?= dev +FILEMON_H?= /usr/include/dev/filemon/filemon.h +BMAKE_PATH_MAX?= 1024 +# used if MAXPATHLEN not defined +CPPFLAGS+= -DBMAKE_PATH_MAX=${BMAKE_PATH_MAX} diff --cc usr.bin/bmake/unit-tests/Makefile index 95cb31d01990,000000000000..1b9a47febe11 mode 100644,000000..100644 --- a/usr.bin/bmake/unit-tests/Makefile +++ b/usr.bin/bmake/unit-tests/Makefile @@@ -1,923 -1,0 +1,920 @@@ +# This is a generated file, do NOT edit! +# See contrib/bmake/bsd.after-import.mk +# - # $Id: Makefile,v 1.233 2025/04/14 16:02:33 sjg Exp $ ++# $Id: Makefile,v 1.239 2025/06/15 21:32:16 sjg Exp $ +# - # $NetBSD: Makefile,v 1.358 2025/04/13 09:29:32 rillig Exp $ ++# $NetBSD: Makefile,v 1.367 2025/06/13 20:23:16 rillig Exp $ +# +# Unit tests for make(1) +# +# The main targets are: +# +# all: +# run all the tests +# test: +# run 'all', and compare to expected results +# accept: +# move generated output to expected results +# +# Settable variables +# +# TEST_MAKE +# The make program to be tested. +# +# +# Adding a test case +# +# Each feature should get its own set of tests in its own suitably +# named makefile (*.mk), with its own set of expected results (*.exp), +# and it should be added to the TESTS list. +# + +.MAIN: all + +# we use these below but we might be an older make +.MAKE.OS?= ${uname -s:L:sh} +.MAKE.UID?= ${id -u:L:sh} + +# for many tests we need a TMPDIR that will not collide +# with other users. +.if ${.OBJDIR} != ${.CURDIR} +# easy +TMPDIR:= ${.OBJDIR}/tmp +.elif defined(TMPDIR) +TMPDIR:= ${TMPDIR}/uid${.MAKE.UID} +.else +TMPDIR:= /tmp/uid${.MAKE.UID} +.endif +# make sure it exists +.if !exist(${TMPDIR}) +_!= mkdir -p ${TMPDIR} +.endif +# and clean it up - outside the context of +# any target that might be using it. +.END: rm-tmpdir +rm-tmpdir: .NOMETA + @rm -rf ${TMPDIR} + +# Each test is in a sub-makefile. +# Keep the list sorted. +# Any test that is commented out must be ignored in +# src/tests/usr.bin/make/t_make.sh as well. +#TESTS+= archive +#TESTS+= archive-suffix +TESTS+= cmd-errors +TESTS+= cmd-errors-jobs +TESTS+= cmd-errors-lint +TESTS+= cmd-interrupt +TESTS+= cmdline +TESTS+= cmdline-redirect-stdin +TESTS+= cmdline-undefined +TESTS+= comment +TESTS+= compat-error +TESTS+= cond-cmp-numeric +TESTS+= cond-cmp-numeric-eq +TESTS+= cond-cmp-numeric-ge +TESTS+= cond-cmp-numeric-gt +TESTS+= cond-cmp-numeric-le +TESTS+= cond-cmp-numeric-lt +TESTS+= cond-cmp-numeric-ne +TESTS+= cond-cmp-string +TESTS+= cond-cmp-unary +TESTS+= cond-eof +TESTS+= cond-func +TESTS+= cond-func-commands +TESTS+= cond-func-defined +TESTS+= cond-func-empty +TESTS+= cond-func-exists +TESTS+= cond-func-make +TESTS+= cond-func-make-main +TESTS+= cond-func-target +TESTS+= cond-late +TESTS+= cond-op +TESTS+= cond-op-and +TESTS+= cond-op-and-lint +TESTS+= cond-op-not +TESTS+= cond-op-or +TESTS+= cond-op-or-lint +TESTS+= cond-op-parentheses +TESTS+= cond-short +TESTS+= cond-token-number +TESTS+= cond-token-plain +TESTS+= cond-token-string +TESTS+= cond-token-var +TESTS+= cond-undef-lint +TESTS+= counter +TESTS+= counter-append +TESTS+= dep +TESTS+= dep-colon +TESTS+= dep-colon-bug-cross-file +TESTS+= dep-double-colon +TESTS+= dep-double-colon-indep +TESTS+= dep-duplicate +TESTS+= dep-exclam +TESTS+= dep-none +TESTS+= dep-op-missing +TESTS+= dep-percent +TESTS+= dep-var +TESTS+= dep-wildcards +TESTS+= depsrc +TESTS+= depsrc-end +TESTS+= depsrc-exec +TESTS+= depsrc-ignore +TESTS+= depsrc-made +TESTS+= depsrc-make +TESTS+= depsrc-meta +TESTS+= depsrc-nometa +TESTS+= depsrc-nometa_cmp +TESTS+= depsrc-nopath +TESTS+= depsrc-notmain +TESTS+= depsrc-optional +TESTS+= depsrc-phony +TESTS+= depsrc-precious +TESTS+= depsrc-recursive +TESTS+= depsrc-silent +TESTS+= depsrc-use +TESTS+= depsrc-usebefore +TESTS+= depsrc-usebefore-double-colon +TESTS+= depsrc-wait +TESTS+= deptgt +TESTS+= deptgt-begin +TESTS+= deptgt-begin-fail +TESTS+= deptgt-begin-fail-indirect +TESTS+= deptgt-default +TESTS+= deptgt-delete_on_error +TESTS+= deptgt-end +TESTS+= deptgt-end-fail +TESTS+= deptgt-end-fail-all +TESTS+= deptgt-end-fail-indirect +TESTS+= deptgt-end-jobs +TESTS+= deptgt-error +TESTS+= deptgt-ignore +TESTS+= deptgt-interrupt +TESTS+= deptgt-main +TESTS+= deptgt-makeflags +TESTS+= deptgt-no_parallel +TESTS+= deptgt-nopath +TESTS+= deptgt-notparallel +TESTS+= deptgt-objdir +TESTS+= deptgt-order +TESTS+= deptgt-path +TESTS+= deptgt-path-suffix +TESTS+= deptgt-phony +TESTS+= deptgt-posix +TESTS+= deptgt-precious +TESTS+= deptgt-shell +TESTS+= deptgt-silent +TESTS+= deptgt-silent-jobs +TESTS+= deptgt-stale +TESTS+= deptgt-suffixes +TESTS+= dir +TESTS+= dir-expand-path +TESTS+= directive +TESTS+= directive-dinclude +TESTS+= directive-elif +TESTS+= directive-elifdef +TESTS+= directive-elifmake +TESTS+= directive-elifndef +TESTS+= directive-elifnmake +TESTS+= directive-else +TESTS+= directive-endfor +TESTS+= directive-endif +TESTS+= directive-error +TESTS+= directive-export +TESTS+= directive-export-env +TESTS+= directive-export-impl +TESTS+= directive-export-gmake +TESTS+= directive-export-literal +TESTS+= directive-for +TESTS+= directive-for-break +TESTS+= directive-for-empty +TESTS+= directive-for-errors +TESTS+= directive-for-escape +TESTS+= directive-for-generating-endif +TESTS+= directive-for-if +TESTS+= directive-for-lines +TESTS+= directive-for-null +TESTS+= directive-hyphen-include +TESTS+= directive-if +TESTS+= directive-if-nested +TESTS+= directive-ifdef +TESTS+= directive-ifmake +TESTS+= directive-ifndef +TESTS+= directive-ifnmake +TESTS+= directive-include +TESTS+= directive-include-fatal +TESTS+= directive-include-guard +TESTS+= directive-info +TESTS+= directive-misspellings +TESTS+= directive-sinclude +TESTS+= directive-undef +TESTS+= directive-unexport +TESTS+= directive-unexport-env +TESTS+= directive-warning +TESTS+= dollar +TESTS+= doterror +TESTS+= dotwait +TESTS+= error +TESTS+= # escape # broken by reverting POSIX changes +TESTS+= export +TESTS+= export-all +TESTS+= export-env +TESTS+= export-variants +TESTS+= gnode-submake +TESTS+= hanoi-include +TESTS+= impsrc +TESTS+= include-main +TESTS+= job-flags ++TESTS+= job-output +TESTS+= job-output-long-lines +TESTS+= job-output-null +TESTS+= jobs-empty-commands +TESTS+= jobs-empty-commands-error +TESTS+= jobs-error-indirect +TESTS+= jobs-error-nested +TESTS+= jobs-error-nested-make +TESTS+= lint +TESTS+= make-exported +TESTS+= meta-cmd-cmp +TESTS+= moderrs +TESTS+= modmisc +.if ${.MAKE.UID} > 0 +TESTS+= objdir-writable +.endif +TESTS+= opt +TESTS+= opt-backwards +TESTS+= opt-chdir +TESTS+= opt-debug +TESTS+= opt-debug-all +TESTS+= opt-debug-archive +TESTS+= opt-debug-curdir +TESTS+= opt-debug-cond +TESTS+= opt-debug-dir +TESTS+= opt-debug-errors +TESTS+= opt-debug-errors-jobs +TESTS+= opt-debug-file +TESTS+= opt-debug-for +TESTS+= opt-debug-graph1 +TESTS+= opt-debug-graph2 +TESTS+= opt-debug-graph3 +TESTS+= opt-debug-hash +TESTS+= opt-debug-jobs +TESTS+= opt-debug-lint +TESTS+= opt-debug-loud +TESTS+= opt-debug-meta +TESTS+= opt-debug-making +TESTS+= opt-debug-no-rm +TESTS+= opt-debug-parse +TESTS+= opt-debug-suff +TESTS+= opt-debug-targets +TESTS+= opt-debug-varraw +TESTS+= opt-debug-var +TESTS+= opt-debug-x-trace +TESTS+= opt-define +TESTS+= opt-env +TESTS+= opt-file +TESTS+= opt-ignore +TESTS+= opt-include-dir +TESTS+= opt-jobs +TESTS+= opt-jobs-internal +TESTS+= opt-jobs-no-action +TESTS+= opt-keep-going +TESTS+= opt-keep-going-indirect +TESTS+= opt-keep-going-multiple +TESTS+= opt-m-include-dir +TESTS+= opt-no-action +TESTS+= opt-no-action-at-all +TESTS+= opt-no-action-runflags +TESTS+= opt-no-action-touch +TESTS+= opt-query +TESTS+= opt-raw +TESTS+= opt-silent +TESTS+= opt-touch +TESTS+= opt-touch-jobs +TESTS+= opt-tracefile +TESTS+= opt-var-expanded +TESTS+= opt-var-literal +TESTS+= opt-version +TESTS+= opt-warnings-as-errors +TESTS+= opt-where-am-i +TESTS+= opt-x-reduce-exported +TESTS+= order +TESTS+= parse +TESTS+= parse-var +TESTS+= phony-end +TESTS+= posix +TESTS+= posix-execution +TESTS+= posix-expansion +TESTS+= posix-varassign +TESTS+= # posix1 # broken by reverting POSIX changes +TESTS+= recursive +TESTS+= sh +TESTS+= sh-dots +TESTS+= sh-errctl +TESTS+= sh-flags +TESTS+= sh-jobs +TESTS+= sh-jobs-error +TESTS+= sh-leading-at +TESTS+= sh-leading-hyphen +TESTS+= sh-leading-plus +TESTS+= sh-meta-chars +TESTS+= sh-multi-line +TESTS+= sh-single-line +TESTS+= shell-csh +TESTS+= shell-custom +.if exists(/bin/ksh) +TESTS+= shell-ksh +.endif +TESTS+= shell-sh +TESTS+= suff +TESTS+= suff-add-later +TESTS+= suff-clear-regular +TESTS+= suff-clear-single +TESTS+= suff-incomplete +TESTS+= suff-lookup +TESTS+= suff-main +TESTS+= suff-main-several +TESTS+= suff-phony +TESTS+= suff-rebuild +TESTS+= suff-self +TESTS+= suff-transform-debug +TESTS+= suff-transform-endless +TESTS+= suff-transform-expand +TESTS+= suff-transform-select +TESTS+= suff-use +TESTS+= sunshcmd +TESTS+= ternary +TESTS+= unexport +TESTS+= unexport-env +TESTS+= use-inference +TESTS+= var-readonly +TESTS+= var-scope +TESTS+= var-scope-cmdline +TESTS+= var-scope-env +TESTS+= var-scope-global +TESTS+= var-scope-local +TESTS+= var-scope-local-legacy +TESTS+= var-eval-short +TESTS+= var-op +TESTS+= var-op-append +TESTS+= var-op-assign +TESTS+= var-op-default +TESTS+= var-op-expand +TESTS+= var-op-shell +TESTS+= var-op-sunsh +TESTS+= var-recursive +TESTS+= varcmd +TESTS+= vardebug +TESTS+= varfind +TESTS+= varmisc +TESTS+= varmod +TESTS+= varmod-assign +TESTS+= varmod-assign-shell +TESTS+= varmod-defined +TESTS+= varmod-edge +TESTS+= varmod-exclam-shell +TESTS+= varmod-extension +TESTS+= varmod-gmtime +TESTS+= varmod-hash +TESTS+= varmod-head +TESTS+= varmod-ifelse +TESTS+= varmod-indirect +TESTS+= varmod-l-name-to-value +TESTS+= varmod-localtime +TESTS+= varmod-loop +TESTS+= varmod-loop-delete +TESTS+= varmod-loop-varname +TESTS+= varmod-match +TESTS+= varmod-match-escape +TESTS+= varmod-mtime +TESTS+= varmod-no-match +TESTS+= varmod-order +TESTS+= varmod-order-numeric +TESTS+= varmod-order-reverse +TESTS+= varmod-order-shuffle +TESTS+= varmod-order-string +TESTS+= varmod-path +TESTS+= varmod-quote +TESTS+= varmod-quote-dollar +TESTS+= varmod-range +TESTS+= varmod-remember +TESTS+= varmod-root +TESTS+= varmod-select-words +TESTS+= varmod-shell +TESTS+= varmod-subst +TESTS+= varmod-subst-regex +TESTS+= varmod-sun-shell +TESTS+= varmod-sysv +TESTS+= varmod-tail +TESTS+= varmod-to-abs +TESTS+= varmod-to-lower +TESTS+= varmod-to-many-words +TESTS+= varmod-to-one-word +TESTS+= varmod-to-separator +TESTS+= varmod-to-title +TESTS+= varmod-to-upper +TESTS+= varmod-undefined +TESTS+= varmod-unique +TESTS+= varname +TESTS+= varname-dollar +TESTS+= varname-dot-alltargets +TESTS+= varname-dot-curdir +TESTS+= varname-dot-includes +TESTS+= varname-dot-includedfromdir +TESTS+= varname-dot-includedfromfile +TESTS+= varname-dot-libs +TESTS+= varname-dot-make-dependfile +TESTS+= varname-dot-make-expand_variables +TESTS+= varname-dot-make-exported +TESTS+= varname-dot-make-jobs +TESTS+= varname-dot-make-jobs-prefix +TESTS+= varname-dot-make-level +TESTS+= varname-dot-make-makefile_preference +TESTS+= varname-dot-make-makefiles +TESTS+= varname-dot-make-meta-bailiwick +TESTS+= varname-dot-make-meta-created +TESTS+= varname-dot-make-meta-files +.if ${.MAKE.PATH_FILEMON:Uno:Nktrace:N/dev*} == "" && ${TMPDIR:N/tmp*:N/var/tmp*} != "" +# these tests will not work if TMPDIR is or is a subdir of +# /tmp or /var/tmp +.if ${.MAKE.PATH_FILEMON:N/dev/*} != "" || exists(${.MAKE.PATH_FILEMON}) +TESTS+= varname-dot-make-meta-ignore_filter +TESTS+= varname-dot-make-meta-ignore_paths +TESTS+= varname-dot-make-meta-ignore_patterns +TESTS+= varname-dot-make-path_filemon +.else +.warning Skipping tests that require ${.MAKE.PATH_FILEMON} +.endif +.endif +TESTS+= varname-dot-make-meta-prefix +TESTS+= varname-dot-make-mode +TESTS+= varname-dot-make-pid +TESTS+= varname-dot-make-ppid +TESTS+= varname-dot-make-save_dollars +TESTS+= varname-dot-makeflags +TESTS+= varname-dot-makeoverrides +TESTS+= varname-dot-newline +TESTS+= varname-dot-objdir +TESTS+= varname-dot-parsedir +TESTS+= varname-dot-parsefile +TESTS+= varname-dot-path +TESTS+= varname-dot-shell +TESTS+= varname-dot-suffixes +TESTS+= varname-dot-targets +TESTS+= varname-empty +TESTS+= varname-make ++TESTS+= varname-make_stack_trace +TESTS+= varname-make_print_var_on_error +TESTS+= varname-make_print_var_on_error-jobs +TESTS+= varname-makefile +TESTS+= varname-makeflags +TESTS+= varname-pwd +TESTS+= varname-vpath +TESTS+= varparse-dynamic +TESTS+= varparse-errors +TESTS+= varparse-mod +TESTS+= varparse-undef-partial + +# some shells have quirks +_shell:= ${.SHELL:tA:T} +.if ${_shell} == "dash" +# dash fails -x output +BROKEN_TESTS+= opt-debug-x-trace +.elif ${_shell:N*ksh*} == "" +BROKEN_TESTS+= \ + deptgt-silent-jobs \ + job-flags \ + job-output-long-lines \ + opt-debug-x-trace \ + sh-flags \ + var-op-shell \ + +.if ${_shell:Nmksh} == "" +# more broken that pdksh +BROKEN_TESTS+= \ + opt-jobs-no-action \ + sh-errctl \ + sh-leading-hyphen \ + +.endif +.endif + +.if ${UTC_1:Uno} == "" +# this will not work if UTC_1 is set empty +BROKEN_TESTS+= varmod-localtime +.endif + +.if ${.MAKE.OS:NDarwin} == "" +BROKEN_TESTS+= shell-ksh +.endif + +.if ${.MAKE.OS:NIRIX*} == "" +BROKEN_TESTS+= \ + cmd-interrupt \ + deptgt-interrupt \ + job-output-null \ + opt-chdir \ + opt-debug-x-trace \ + sh-leading-hyphen \ + +.endif + +.if ${.MAKE.OS} == "SCO_SV" +BROKEN_TESTS+= \ + opt-debug-graph[23] \ + varmod-localtime \ + varmod-to-separator \ + +.if ${_shell} == "bash" +BROKEN_TESTS+= job-output-null +.else +BROKEN_TESTS+= \ + cmd-interrupt \ + job-flags \ + +.endif +.endif + +# Some tests just do not work on some platforms or environments +# so allow for some filtering. +.if !empty(BROKEN_TESTS) +.warning Skipping broken tests: ${BROKEN_TESTS:O:u} +TESTS:= ${TESTS:${BROKEN_TESTS:S,^,N,:ts:}} +.endif + +# Ideas for more tests: +# char-0020-space.mk +# char-005C-backslash.mk +# escape-cond-str.mk +# escape-cond-func-arg.mk +# escape-varmod.mk +# escape-varmod-define.mk +# escape-varmod-match.mk +# escape-varname.mk +# escape-varassign-varname.mk +# escape-varassign-varname-cmdline.mk +# escape-varassign-value.mk +# escape-varassign-value-cmdline.mk +# escape-dependency-source.mk +# escape-dependency-target.mk +# escape-for-varname.mk +# escape-for-item.mk +# posix-*.mk (see posix.mk and posix1.mk) + +# Additional environment variables for some of the tests. +# The base environment is -i PATH="$PATH". +ENV.depsrc-optional+= TZ=UTC +ENV.deptgt-phony+= MAKESYSPATH=. +ENV.directive-undef= ENV_VAR=env-value +ENV.opt-env= FROM_ENV=value-from-env +ENV.opt-m-include-dir= ${MAKEOBJDIR:DMAKEOBJDIR=${MAKEOBJDIR}} +ENV.varmisc= FROM_ENV=env +ENV.varmisc+= FROM_ENV_BEFORE=env +ENV.varmisc+= FROM_ENV_AFTER=env +ENV.varmod-localtime+= TZ=${UTC_1:UEurope/Berlin} +ENV.varname-vpath+= VPATH=varname-vpath.dir:varname-vpath.dir2 + +# Override make flags for some of the tests; default is -k. +# If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of +# settings FLAGS.test=-dv here, since that is closer to the test code. +FLAGS.cond-func-make= via-cmdline +FLAGS.doterror= # none, especially not -k +FLAGS.jobs-error-indirect= # none, especially not -k +FLAGS.jobs-error-nested= # none, especially not -k +FLAGS.jobs-error-nested-make= # none, especially not -k +FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmdline-plain' + +# Some tests need extra postprocessing. +SED_CMDS.deptgt-phony= ${STD_SED_CMDS.dd} +SED_CMDS.dir= ${STD_SED_CMDS.dd} +SED_CMDS.directive-include-guard= \ + -e '/\.MAKEFLAGS/d' \ + -e '/^Parsing .*:[1-9][0-9]*:/d' \ + -e '/^SetFilenameVars:/d' \ + -e '/^ParseDependency/d' \ + -e '/^ParseEOF:/d' +SED_CMDS.export= -e '/^[^=_A-Za-z0-9]*=/d' +.if ${.MAKE.OS:NCygwin} == "" +SED_CMDS.export+= -e '/^WINDIR=/d' -e '/^SYSTEMROOT=/d' +.endif +SED_CMDS.export-all= ${SED_CMDS.export} +SED_CMDS.export-env= ${SED_CMDS.export} +SED_CMDS.cmdline= -e 's,uid${.MAKE.UID}/,,' +SED_CMDS.job-output-long-lines= \ + ${:D Job separators on their own line are ok. } \ + -e '/^--- job-[ab] ---$$/d' \ + ${:D Plain output lines are ok as well. } \ + ${:D They may come in multiples of 1024 or as 10000. } \ + -e '/^aa*$$/d' \ + -e '/^bb*$$/d' \ + ${:D The following lines should rather not occur since the job } \ + ${:D marker should always be at the beginning of the line. } \ + -e '/^aa*--- job-b ---$$/d' \ + -e '/^bb*--- job-a ---$$/d' +SED_CMDS.opt-chdir= -e 's,\(nonexistent\).[1-9][0-9]*,\1,' \ + -e '/name/s,file,File,' \ + -e 's,no such,No such,' \ + -e 's,Filename,File name,' + +# meta line numbers can vary based on filemon implementation +SED_CMDS.meta-ignore= -e 's,\(\.meta:\)[1-9][0-9]*:,\1:,' + +SED_CMDS.opt-chdir= -e 's,\(nonexistent\).[1-9][0-9]*,\1,' +SED_CMDS.opt-debug-graph1= ${STD_SED_CMDS.dg1} +SED_CMDS.opt-debug-graph2= ${STD_SED_CMDS.dg2} +SED_CMDS.opt-debug-graph3= ${STD_SED_CMDS.dg3} +SED_CMDS.opt-debug-hash= -e 's,\(entries\)=[1-9][0-9],\1=,' - SED_CMDS.opt-debug-jobs= -e 's,([0-9][0-9]*),(),' - SED_CMDS.opt-debug-jobs+= -e 's,pid [0-9][0-9]*,pid ,' - SED_CMDS.opt-debug-jobs+= -e 's,Process [0-9][0-9]*,Process ,' - SED_CMDS.opt-debug-jobs+= -e 's,JobFinish: [0-9][0-9]*,JobFinish: ,' - SED_CMDS.opt-debug-jobs+= -e 's,Command: ${.SHELL:T},Command: ,' - # The "-q" may be there or not, see jobs.c, variable shells. - SED_CMDS.opt-debug-jobs+= -e 's,^\(.Command: \) -q,\1,' ++SED_CMDS.opt-debug-jobs= ${STD_SED_CMDS.dj} +SED_CMDS.opt-debug-lint+= ${STD_SED_CMDS.regex} +SED_CMDS.opt-jobs-no-action= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.opt-no-action-runflags= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.opt-where-am-i= -e '/usr.obj/d' +# For Compat_RunCommand, useShell == false. +SED_CMDS.sh-dots= -e 's,^.*\.\.\.:.*,,' +# For Compat_RunCommand, useShell == true. - SED_CMDS.sh-dots+= -e 's,^make: exec(\(.*\)) failed (.*)$$,,' ++SED_CMDS.sh-dots+= -e 's,^make: exec(\(.*\)): .*$$,,' +SED_CMDS.sh-dots+= -e 's,^\(\*\*\* Error code \)[1-9][0-9]*,\1,' ++# Race condition between the child's stdout and make's status. +SED_CMDS.sh-errctl= ${STD_SED_CMDS.dj} ++SED_CMDS.sh-errctl+= -e '/^Process with pid/d' ++SED_CMDS.sh-errctl+= -e '/^JobFinish:/d' +SED_CMDS.sh-flags= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.shell-csh= ${STD_SED_CMDS.white-space} +SED_CMDS.sh-leading-hyphen= ${STD_SED_CMDS.shell} +SED_CMDS.suff-main+= ${STD_SED_CMDS.dg1} +SED_CMDS.suff-main-several+= ${STD_SED_CMDS.dg1} +SED_CMDS.suff-transform-debug+= ${STD_SED_CMDS.dg1} +SED_CMDS.var-op-shell+= ${STD_SED_CMDS.shell} +SED_CMDS.var-op-shell+= -e '/command/s,No such.*,not found,' +SED_CMDS.var-op-shell+= ${STD_SED_CMDS.white-space} +SED_CMDS.vardebug+= -e 's,${.SHELL},,' - SED_CMDS.varmod-mtime+= -e "s,\(.*\)': .*,\1': ," ++SED_CMDS.varmod-mtime+= -e "s,\(mtime for .*\): .*,\1: ," +SED_CMDS.varmod-subst-regex+= ${STD_SED_CMDS.regex} +SED_CMDS.varparse-errors+= ${STD_SED_CMDS.timestamp} +SED_CMDS.varname-dot-make-meta-ignore_filter+= ${SED_CMDS.meta-ignore} +SED_CMDS.varname-dot-make-meta-ignore_paths+= ${SED_CMDS.meta-ignore} +SED_CMDS.varname-dot-make-meta-ignore_patterns+= ${SED_CMDS.meta-ignore} +SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: [^:]*:,make: :,' +SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: [^:]*:,make: :,' +SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g' +SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g' +SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g' +SED_CMDS.varname-empty= ${.OBJDIR .PARSEDIR .PATH .SHELL .SYSPATH:L:@v@-e '/\\$v/d'@} + +# Some tests need an additional round of postprocessing. +POSTPROC.depsrc-wait= sed -e '/^---/d' -e 's,^\(: Making 3[abc]\)[123]$$,\1,' +POSTPROC.deptgt-suffixes= awk '/^\#\*\*\* Suffixes/,/^never-stop/' - POSTPROC.gnode-submake= awk '/Input graph/, /^$$/' ++POSTPROC.gnode-submake= awk '/Begin input graph/, /^$$/' +POSTPROC.varname-dot-make-mode= sed 's,^\(: Making [abc]\)[123]$$,\1,' + +# Some tests reuse other tests, which makes them unnecessarily fragile. +export-all.rawout: export.mk +unexport.rawout: export.mk +unexport-env.rawout: export.mk + +# End of the configuration section. + +# Some standard sed commands, to be used in the SED_CMDS above. + +# In tests that use the debugging option -dd, ignore debugging output that is +# only logged in -DCLEANUP mode. +STD_SED_CMDS.dd= -e '/^OpenDirs_Done:/d' +STD_SED_CMDS.dd+= -e '/^CachedDir /d' +STD_SED_CMDS.dd+= -e 's, ${DEFSYSPATH:U/usr/share/mk} , ,' + +# Omit details such as process IDs from the output of the -dg1 option. +STD_SED_CMDS.dg1= -e '/\#.* \.$$/d' +STD_SED_CMDS.dg1+= -e '/\.MAKE.PATH_FILEMON/d' +STD_SED_CMDS.dg1+= -e '/^\#.*\/mk/d' +STD_SED_CMDS.dg1+= -e 's, ${DEFSYSPATH:U/usr/share/mk}$$, ,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE\.[A-Z_]* *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE\.JOBS\.C *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(MACHINE[_ARCH]* *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(MAKE *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.SHELL *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e '/\.SYSPATH/d' + +STD_SED_CMDS.dg2= ${STD_SED_CMDS.dg1} +STD_SED_CMDS.dg2+= -e 's,\(last modified\) ..:..:.. ... ..\, ....,\1 ,' +STD_SED_CMDS.dg3= ${STD_SED_CMDS.dg2} + +# Omit details such as process IDs from the output of the -dj option. - STD_SED_CMDS.dj= \ - -e '/Process/d;/JobFinish:/d' \ - -e 's,^\(Job_TokenWithdraw\)([0-9]*),\1(),' \ - -e 's,^([0-9][0-9]*) \(withdrew token\),() \1,' \ - -e 's, \(pid\) [0-9][0-9]*, \1 ,' \ - -e 's,^\( Command:\) .*,\1 ,' ++STD_SED_CMDS.dj= -e 's, pid [0-9][0-9]*, pid ,' ++STD_SED_CMDS.dj+= -e 's,^\(.Command\): ${.SHELL:T},\1: ,' *** 217 LINES SKIPPED *** From nobody Sat Jun 28 05:08:38 2025 X-Original-To: dev-commits-src-main@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 4bTgTJ3j38z60kLT; Sat, 28 Jun 2025 05:09:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (mx.allbsd.org [131.112.84.68]) (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 ECDSA (secp384r1) client-digest SHA384) (Client CN "mail.allbsd.org", Issuer "E6" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTgTH54yVz3NmJ; Sat, 28 Jun 2025 05:09:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received-SPF: pass (mail.allbsd.org: authenticated connection) receiver=mail.allbsd.org; client-ip=2400:4051:a743:3c00:58:65ff:fe00:b0b; helo=mail-d.allbsd.org; envelope-from=hrs@FreeBSD.org; x-software=spfmilter 2.001 http://www.acme.com/software/spfmilter/ with libspf2-1.2.11; ARC-Seal: i=1; a=rsa-sha256; cv=none; d=allbsd.org; s=20250201; t= 1751087367; b=Z8xuGv5Z964s6u9d5iB1aS2KMIpzDHG3DV1lTx7NdxDMgANnEq 6xhKRegMl4GyI0bTXUfTAeoi2Pn0jlWj1ubmvmP4KzIhnHAUiSOEAPmKjKtwGAV9 ZoPCacMBrTh9XJ4Eze4S5UCX8WINhqtP+C8OTm6t/aN9zepZKcT13NOooZlxFAH8 dNrtxx5vw4lSuxOJIScb7xyGq+icdmPOowDHAwtu6rhRpi+lTCl0cMaOWrI1SkZO gXUsZXlX1OAmkdZiUIMGOnAFsburY64GoMWNqyH4AC2czqb6tfqDs81AJ0d3maYE hcwn+R6Yak3WjG5CFA3ZTAXny8OjC86QDFwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= allbsd.org; h=date:message-id:to:cc:subject:from:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=20250201; t=1751087367; bh=hgFNNXHGH3JgXgblYybfTCcVbnIrGbLUyj qcCPwW9Oc=; b=OgempfIKiFLUMRhW/aai2OGxk+WxvxRjL+n33VkS+Zjy1XHhEv TYtQmNMG8q/QQXACLqk2exMcW8pN2QXixgg3kBTndNXUnKlVVpo5UF6nWvHiOnOC MxKT0d5Ty8NG3/SYIpqwnbuD9YHi5vcg37CjSRKd0g9V6mVR9A1OTBwoWjBxRwlZ 0C3E+qqGtmXonBf/du91w/yGRRiVg9VhZKlyBAnP4/EiHfi0e+5IMqMqh9D6jqnD FlZQSd1ShwK9LVM+ON4V2Ei3KN6ThDTLMk9eRJA4/NN+XqG7pEJHrbzkvPLZwrI5 5rUKailMTqBCoQH22RZuRIAa7HvnCwuxHFIw== ARC-Authentication-Results: i=1; mail.allbsd.org; arc=none (no signatures found); auth=pass; dkim=none (no signatures found); smime=none; x-return-mx=pass header.domain=freebsd.org policy.is_org=yes (MX Records found: mx66.freebsd.org,mx1.freebsd.org); x-return-mx=pass smtp.domain=freebsd.org policy.is_org=yes (MX Records found: mx66.freebsd.org,mx1.freebsd.org) Received: from mail-d.allbsd.org ([IPv6:2400:4051:a743:3c00:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.18.1/8.18.1) with ESMTPSA id 55S59PwT054302 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) (Client CN "/CN=mail-d.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=E6"); Sat, 28 Jun 2025 14:09:27 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.d.allbsd.org ([IPv6:2400:4051:a743:3c00:5a9c:fcff:fe10:ffc2]) by mail-d.allbsd.org (8.18.1/8.16.1) with ESMTPS id 55S59NIk050914 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 28 Jun 2025 14:09:23 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.18.1/8.16.1) with ESMTPA id 55S59KpI050910; Sat, 28 Jun 2025 14:09:21 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Sat, 28 Jun 2025 14:08:38 +0900 (JST) Message-Id: <20250628.140838.1632734946851803211.hrs@FreeBSD.org> To: markj@freebsd.org, glebius@freebsd.org Cc: bapt@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, srcmgr@freebsd.org Subject: Re: git: 4deb9760a9d8 - main - rc: Disable pathname expansion when calling run_rc_command() From: Hiroki Sato In-Reply-To: References: X-Old-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-PGPkey-fingerprint: 6C0D 2353 27CF 80C7 901E FDD2 DBB0 7DC6 6F1F 737F X-Mailer: Mew version 6.8 on Emacs 29.4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha512; boundary="--Security_Multipart(Sat_Jun_28_14_08_38_2025_065)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.allbsd.org [IPv6:2402:3d00:fb5d:8001:0:0:0:41]); Sat, 28 Jun 2025 14:09:27 +0900 (JST) X-Rspamd-Queue-Id: 4bTgTH54yVz3NmJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:9367, ipnet:131.112.0.0/16, country:JP] ----Security_Multipart(Sat_Jun_28_14_08_38_2025_065)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mark Johnston wrote in : ma> On Fri, Jun 27, 2025 at 12:37:52PM -0700, Gleb Smirnoff wrote: ma> > On Fri, Jun 27, 2025 at 08:56:23PM +0200, Baptiste Daroussin wrote: ma> > B> On Wed 18 Jun 10:13, Mark Johnston wrote: ma> > B> > On Thu, Jun 12, 2025 at 06:20:26PM +0000, Hiroki Sato wrote: ma> > B> > > The branch main has been updated by hrs: ma> > B> > > ma> > B> > > URL: https://cgit.FreeBSD.org/src/commit/?id=4deb9760a9d84d5861ee45162ffebe83f13503b8 ma> > B> > > ma> > B> > > commit 4deb9760a9d84d5861ee45162ffebe83f13503b8 ma> > B> > > Author: Hiroki Sato ma> > B> > > AuthorDate: 2025-06-12 18:19:32 +0000 ma> > B> > > Commit: Hiroki Sato ma> > B> > > CommitDate: 2025-06-12 18:19:32 +0000 ma> > B> > > ma> > B> > > rc: Disable pathname expansion when calling run_rc_command() ma> > B> > > ma> > B> > > Variables for command-line options like $foo_flags can contain characters ma> > B> > > that perform pathname expansions, such as '[', ']', and '*'. They were ma> > B> > > passed without escaping, and the matched entries in the working directory ma> > B> > > affected the command-line options. This change turns off the expansion ma> > B> > > when run_rc_command() is called. ma> > B> > > ma> > B> > > While this changes the current behavior, an invocation of a service ma> > B> > > program should not depend on entries in the working directory. ma> > B> > ma> > B> > This also turns off globbing for /etc/rc.local, which broke one of my ma> > B> > scripts. Was that intentional? If so, we should really document it in ma> > B> > RELNOTES at the very least. ma> > B> ma> > B> This broke nuageinit which rely on globbing to in nuageinit_start, that this ma> > B> change also broke. ma> > B> ma> > B> So many downstream CI are now broken, due to this change. ma> > ma> > Given that Hiroki is not reacting on this email thread neither in ma> > https://reviews.freebsd.org/D51043, I would like to revert this change. I'd ma> > like also remind that the problem was discovered during the stabweek testing. ma> > Although we thawed the freeze, but we are still working on a good known stable ma> > revision for June. ma> > ma> > Any objections? ma> > ma> > Adding srcmgr@ ma> ma> I've reverted the change (and a follow-up fix) for now. I am sorry for not responding in a timely manner. I overlooked the impact and needed to revert it promptly. The original problem with globbing still remains, so I will submit another patch for review shortly. -- Hiroki ----Security_Multipart(Sat_Jun_28_14_08_38_2025_065)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iMgEABMKAC4WIQRsDSNTJ8+Ax5Ae/dLbsH3Gbx9zfwUCaF941hAcaHJzQGZyZWVi c2Qub3JnAAoJENuwfcZvH3N/eHsCCIx24qwcu54+4PS4geIqRBz3/7KrQbzlN6no UZS2d5/TE5jtyCZL3b15LC2IbRe2rCrgKjFwgWoIgB+4Qzsb2wA2AgixvAvvVa+i r6yrnfq787/CCAQqElk0fRFTXSKHexo1LzR/aPjHGWFM8NxGw/S5wcOyX751GFod gBMXED06SqXaNw== =T1Bg -----END PGP SIGNATURE----- ----Security_Multipart(Sat_Jun_28_14_08_38_2025_065)---- From nobody Sat Jun 28 06:50:57 2025 X-Original-To: dev-commits-src-main@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 4bTjk95xydz5ybgw; Sat, 28 Jun 2025 06:50: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 4bTjk92PpJz46M5; Sat, 28 Jun 2025 06:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751093457; 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=6DPZ9SLdZm/JRyb6wVkGuL5yXu38b7gbzMYLZIdWHrY=; b=Gi0/u4eF5AwzL8VNbWnauvhniadXaW627BRMn2Mh3dv75dth8i4a8ADrX9/vOWuE5lPOiW Y89wDaVP4CsfGxC6AEf8U9tXrZLhdnfxoetTtEqoSsJ4DUYMTPPVlwKqcDccg6cQqtLnAL VTRosALXrr7XafOQNyr9nREU0N6WjFZGUrsM0DNgVEwD1T3uSHArO2ca8S9qAWpbazEJc2 bZSdsljUCdtoNdDaTEAXJdkxC3pNSXV7hatBSGIQK+QDfFzUpwx/GpTF+wJ6eLzSUW+Kam S27XUpf86Tq51yGPnyh1lpDLJ1RI2mf6F5aaQZfBK/VOzMF+r7BnYelTC9Hu6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751093457; 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=6DPZ9SLdZm/JRyb6wVkGuL5yXu38b7gbzMYLZIdWHrY=; b=cIqrlHkEbGtmuhU+HBaGZCY+6jOYqhDQiSFvGFI98mM/4k65kORqQ2F+kPwdwlgX97aKOZ jTyz2v/NEcfyklxH0uQEfg3iNtyXyGGtAl3eIINGgmdF/JbDfWzw1PT1CjQz8DFE2/FJwy o5NmJiYIcS6SoOWULPsdL7E6TWrrQiuJTpAa9MwjGCA6W/iPPTr0tr1fTE9V0/enKqjdCr 0Tmx9IrmaNqwizSgrLEhjpng7MkQV/Hsv80AArVTftVEy11POYsu9TTXUr1Zt5c+Srb5kY 6cqklaeGWjejWr44PREuT22vnqwRXX9xQ3cojEac70aEgfcMp30wfT/9HRXb2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751093457; a=rsa-sha256; cv=none; b=p0wDM2lgJKE3wb9vfpTFjWKUgCUXQM2mbj+SGs2PoyCSfr0kpuhokfFyZ08NZ8FxE9dsBk LpMcHLlfiVEfnFWz0lCpTmp+ya5AZ9K2S0lmvAuqqS6/fMA2UuI1oFyQwo0U21fIWQaQYv mJoz1a3BWWZHy1otA0DtMIa1+sf+p6mgIe0i+h3DxSRU20qsV86Agt2YyKWy8vJjqO5zp7 lvNmxvjCQ978FD5+UB6ZvJfZgKk7qxCrHr5X+Vc45O4OLQvWrRSkOfhYQaBlIzWd/38Ght kPK35EvGAGS7fr3B2+Vpcl+M7XE0Ewc2LgNcZ9ApkjLw1HET9t1SXqTTwLDPlQ== 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 4bTjk91sXKz7W4; Sat, 28 Jun 2025 06:50: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 55S6ovPm010046; Sat, 28 Jun 2025 06:50:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55S6ovW4010043; Sat, 28 Jun 2025 06:50:57 GMT (envelope-from git) Date: Sat, 28 Jun 2025 06:50:57 GMT Message-Id: <202506280650.55S6ovW4010043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 3a33e39edd48 - main - pctrie: correct iter node after node allocation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a33e39edd4828cb81767acfe2d41306d8bdedf2 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=3a33e39edd4828cb81767acfe2d41306d8bdedf2 commit 3a33e39edd4828cb81767acfe2d41306d8bdedf2 Author: Doug Moore AuthorDate: 2025-06-28 06:49:38 +0000 Commit: Doug Moore CommitDate: 2025-06-28 06:49:38 +0000 pctrie: correct iter node after node allocation Usually, a pctrie_iter operation leaves the iterator node pointing to the last pctrie_node on the path to the found, or inserted, or removed leaf. However, that is not the case when inserting a leaf causes the allocation of a new pctrie node. In that case, the iterator node is left pointing to the parent of the allocated node, and not to the newly allocated node itself, the parent of the just-inserted leaf. Correct this anomaly. Reviewed by: markj, kib, alc Differential Revision: https://reviews.freebsd.org/D51059 --- sys/sys/pctrie.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index 3ff11f2c79ae..6307ffb3b88c 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -130,7 +130,7 @@ name##_PCTRIE_PTR2VAL(struct type *ptr) \ \ static __inline __unused int \ name##_PCTRIE_INSERT_BASE(struct pctrie *ptree, uint64_t *val, \ - struct pctrie_node *parent, void *parentp, \ + struct pctrie_node **parent, void *parentp, \ uint64_t *found, struct type **found_out) \ { \ struct pctrie_node *child; \ @@ -146,7 +146,8 @@ name##_PCTRIE_INSERT_BASE(struct pctrie *ptree, uint64_t *val, \ *found_out = NULL; \ return (ENOMEM); \ } \ - pctrie_insert_node(val, parent, parentp, child); \ + pctrie_insert_node(val, *parent, parentp, child); \ + *parent = child; \ } \ return (0); \ } \ @@ -159,7 +160,7 @@ name##_PCTRIE_INSERT(struct pctrie *ptree, struct type *ptr) \ uint64_t *val = name##_PCTRIE_PTR2VAL(ptr); \ \ parentp = pctrie_insert_lookup_strict(ptree, val, &parent); \ - return (name##_PCTRIE_INSERT_BASE(ptree, val, parent, parentp, \ + return (name##_PCTRIE_INSERT_BASE(ptree, val, &parent, parentp, \ NULL, NULL)); \ } \ \ @@ -173,7 +174,7 @@ name##_PCTRIE_FIND_OR_INSERT(struct pctrie *ptree, struct type *ptr, \ uint64_t *found; \ \ parentp = pctrie_insert_lookup(ptree, val, &parent, &found); \ - return (name##_PCTRIE_INSERT_BASE(ptree, val, parent, parentp, \ + return (name##_PCTRIE_INSERT_BASE(ptree, val, &parent, parentp, \ found, found_out_opt)); \ } \ \ @@ -188,7 +189,7 @@ name##_PCTRIE_INSERT_LOOKUP_LE(struct pctrie *ptree, struct type *ptr, \ int retval; \ \ parentp = pctrie_insert_lookup(ptree, val, &parent, &found); \ - retval = name##_PCTRIE_INSERT_BASE(ptree, val, parent, parentp, \ + retval = name##_PCTRIE_INSERT_BASE(ptree, val, &parent, parentp, \ found, found_out); \ if (retval != 0) \ return (retval); \ @@ -204,7 +205,7 @@ name##_PCTRIE_ITER_INSERT(struct pctrie_iter *it, struct type *ptr) \ uint64_t *val = name##_PCTRIE_PTR2VAL(ptr); \ \ parentp = pctrie_iter_insert_lookup(it, val); \ - return (name##_PCTRIE_INSERT_BASE(it->ptree, val, it->node, \ + return (name##_PCTRIE_INSERT_BASE(it->ptree, val, &it->node, \ parentp, NULL, NULL)); \ } \ \ From nobody Sat Jun 28 15:48:31 2025 X-Original-To: dev-commits-src-main@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 4bTxfR4jqkz609GB; Sat, 28 Jun 2025 15:48: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 4bTxfR3yLZz3Fct; Sat, 28 Jun 2025 15:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751125711; 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=BPUEX7xpigmCGfUuqSD2jCEzR2XvgSnnNRJgA6IM+YM=; b=chjfj+WpFqWv0YH7Dl9bZN2rCNaqh1O5hWsaQ7OLdx19zX3hGFKsxabwQS+W75hdpONt/H wrGgZSsAn2ySlsq8slxpr9BQVVNFvwJbLrJCwUk9AgkXYw6XwTvMfs+6nM4RnAjK9NVBJe a+xFSin/WgG/wC54zjbQkta5h0baS19vTFS9u4e8byRi6tvcDSfn8bxU6+yW6FoK+RbWV3 +HVD7kDWxiv7By1GJXrbMpfbqkbv2TPIzkSLrg603FoXzwx49YekQ187lY/5ys0gWCMny+ Vf7KxSEvA1T1ZO/Lk963TnMRyniZf3agNQCdl+Pl57Lydfk+LuWLYnscTah6Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751125711; 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=BPUEX7xpigmCGfUuqSD2jCEzR2XvgSnnNRJgA6IM+YM=; b=SNmyISWtmecBWtRrSyRXwEBcCzHClBY5z6ZUWwRKoRQKsKNZIlUAc1w9Tp/U7vxOHVwWAz 69gXGX74ifOOag37RnhIf2FIup0hhLH7REVXDl6/IMs7CyytmZ6GMiIetRWInZ8IpYbnt+ oaSwKQxi9tytHStoFy3PiAIZjaSeBefkxwaUQIPIo4YK2YE+VodWLfSPUoMYI6lVb6je39 CCQRkpc+98Tdnxxopwc/yP2VgXLvCgRYH1YicLblpV2uBtxXNr2ttdEL/jMcmX1vOaOWCC YLjvw8p5q+RRaNPvZeCEKj/tjPTDihkSp3GfSoyRWhgcIm2lGXzROTpV6cVJow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751125711; a=rsa-sha256; cv=none; b=NS58bOwsJIAvzAYgLjGtrn93WKsTTA7QdT9C75LaxY6lvk0nUQPZwdnpeG7m/yuf8w2ErY NH+qzmmt/td4pN6kWnuAmbpz4oAGoEEPavV5ZxF3Mkg01L9bt2xqstVo6nfIGei6DX06qv L+ss0Qil6XOITk2ArmAqOWoNN1wQaVE5DmHjr2MTeNrxjnY9SYP8q5FLs2fv/z9v1aS9Y4 524bpWWCcb0p0sexY+kXnM0FbusISNkUsJyQd5YzD1C+WRcc6Rv/7xsf3vuYyndomlUvUx yG9AA40XGmlqwASjar6MOLmCJD5V1KihlBNY1QGOTi8h0pBDtIiTWnwzPXbQdg== 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 4bTxfR3Xdkzg1N; Sat, 28 Jun 2025 15:48: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 55SFmVrZ009579; Sat, 28 Jun 2025 15:48:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55SFmVIF009576; Sat, 28 Jun 2025 15:48:31 GMT (envelope-from git) Date: Sat, 28 Jun 2025 15:48:31 GMT Message-Id: <202506281548.55SFmVIF009576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 8213c07c2058 - main - pfsync: Destroy buckets mutexes on clone destroying interface List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8213c07c20586a67bc7f7152bd7ff76c02cbc007 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8213c07c20586a67bc7f7152bd7ff76c02cbc007 commit 8213c07c20586a67bc7f7152bd7ff76c02cbc007 Author: Zhenlei Huang AuthorDate: 2025-06-28 15:46:51 +0000 Commit: Zhenlei Huang CommitDate: 2025-06-28 15:46:51 +0000 pfsync: Destroy buckets mutexes on clone destroying interface So that the associated data with them will be freed. Reviewed by: kp Fixes: 4fc65bcbe3fb pfsync: Performance improvement MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51063 --- sys/netpfil/pf/if_pfsync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 31b641b43fe3..d5d77fa1ae1d 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -494,6 +494,10 @@ pfsync_clone_destroy(struct ifnet *ifp) mtx_destroy(&sc->sc_mtx); mtx_destroy(&sc->sc_bulk_mtx); + for (c = 0; c < pfsync_buckets; c++) { + b = &sc->sc_buckets[c]; + mtx_destroy(&b->b_mtx); + } free(sc->sc_buckets, M_PFSYNC); free(sc, M_PFSYNC); From nobody Sat Jun 28 20:12:54 2025 X-Original-To: dev-commits-src-main@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 4bV3WZ0dqrz60R3P; Sat, 28 Jun 2025 20:12:58 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bV3WY5yv9z40vb; Sat, 28 Jun 2025 20:12:57 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751141577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Fqsf2cvSoTsA6feDQQnU3WX/BEC1bQMx3OoK1x4giGQ=; b=HWueNlLantbDTOqYlW8DAQgSMcmUSUFjQNU9EnJFG0MH3edkev5c5NmhMQ1L2SrZSfnxRp VYUVB77blPB7K36Onulh+JizFWUiyfH3aM63hxd2vTiR22L4qs8eBvhRb4tY5wnmRfG/VW zze4WWSlhFYB5Nmh2d6BnBi31uwi7WG/dv0aZu4sxTeWmmE/y/WrHZpN/6DzDRJz65etAH 9ebD4QkaoXTdqh/hWW4riVsDYblcQqK3MxDx5oBWOfXw2CXyOZynjBfq/uNHxfTLmDvaw7 2KWom+ujrWB0ouOWbSx8ZY9nA+PSfbuopvZKRLGzDy8CTa9rU8C4MLqMrNraLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751141577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Fqsf2cvSoTsA6feDQQnU3WX/BEC1bQMx3OoK1x4giGQ=; b=pVj4GN691EplyvzmPUO1YcYAzkk0Epb3Y+K978qIl5yDCxDkINMeNS25+yIEat3Vp3nEWL /j2UWd9oGS5VYrx7v3oQO/ieWnp0puVBCz/vEKveqmGkHcIW8lK68I7PcMv6Xr/OjXVLfr f7uPTYaX2i7erBb6F4TOntJPdfHII2Zb6FxxCKbntaEr8UD92kVSxjW8yKPb0mRymHkLa9 hvCnWZG8/97ofyXmQGMqYGp97kTPWuAOuByIo7JfkFjX+ZvaNv351bJq8f1Ep2rwsliiML t/uuw30RKF6b5nZZUjqN6K2dVre6HqVwDI+3VV8B+kk930ZHnb2mzJWJiSt5tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751141577; a=rsa-sha256; cv=none; b=qdNjH/BjDJibfW51VoDQgU8B29QhdlMEBxj3gezf9VPpl66B44Rc3UpJez5CkuOhqO/QL9 PvRmz7KQL3dG9SiJWGKGDtHoSDFZx5MeH8alljZkQzzOQwgiBOFVscjCVE5svhMFZOUItc mkHh865JcmtQyOg8nDevZmIKIx7EBKz4TV5R7qVRQ/BXVLKh6UHE4bbY+n4IcBURIJfmK3 7MQ3FOlrSRm5MyBPyIjd8n7WOOTHDUENb/9JQZ0MIZG9cwo4HoIFOcJGdcuwhsO9JTd8n5 4YLnONNLQg23dPHgHyG0mWQsww81oPXdIyfBtOPTX5cQdQMjX0LOwZV3CcBWrw== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bV3WY0CL9z12HC; Sat, 28 Jun 2025 20:12:56 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Sat, 28 Jun 2025 13:12:54 -0700 From: Gleb Smirnoff To: Michael Tuexen Cc: Charlie Li , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 89f6eb0a61cb - main - tcp: restrict the contents of tcp_timer.h to the kernel context Message-ID: References: <202506261609.55QG9odv049208@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Jun 28, 2025 at 04:04:33AM +0200, Michael Tuexen wrote: M> >> + M> >> /* M> >> * The TCPT_REXMT timer is used to force retransmissions. M> >> * The TCP has the TCPT_REXMT timer set whenever segments M> >> @@ -133,8 +135,6 @@ M> >> (tv) = (tvmax); \ M> >> } while(0) M> >> -#ifdef _KERNEL M> >> - M> >> #define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) M> >> #define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : tcp_keepidle) M> >> #define TP_KEEPINTVL(tp) ((tp)->t_keepintvl ? (tp)->t_keepintvl : tcp_keepintvl) M> > This broke net-mgmt/net-snmp, which uses at least TCPTV_MIN and TCPTV_REXMTMAX. M> Hi Charlie, M> M> why is net-mgmt/net-snmp interested in the default value of the sysctl variables M> net.inet.tcp.rexmit_min and net.inet.tcp.tcp_rexmit_max and not in the current M> value of these sysctl variables? This does not make sense to me... I'll try to find some time to make a push request for them. We already accumulates some hot fixes in the port, now this adds up. -- Gleb Smirnoff From nobody Sat Jun 28 20:22:17 2025 X-Original-To: dev-commits-src-main@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 4bV3kN4sxmz60RHG; Sat, 28 Jun 2025 20:22:20 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bV3kN3Wm0z49mt; Sat, 28 Jun 2025 20:22:20 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751142140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7nTtj40wpF1y+/6g9bG9A1bhw57UE+B8wznrmdyqHvA=; b=JL2JjqLYrAkSrJYBTHvv/LUQH5VBbIUSyuVj8pcfnONAPe1Z9XryK4oZFAHDJ5YKY4m0qU CkmC0tNBsSIdW0YbqSuZJskQdX+j+aCaAHEpVteWGzQYiEJcv9iCmNTq8C+CNYNdJNjrTp X0bYY0K5F4kiYsK0cvK87g3RtjLv2ZwiDau1VQGGRVqKQQxh79iLDTMSISYKSU2+pYNN+E YCbt9+RQqNIFs+kBsG4pKQY3ITTxKRCd+tUYnLmWJpjpw83P+UAId8J6TmMQbgMxpLhAeM lrvF9NNthLB4iWnE1pYkVk00R177+rx3SCErZP9wRdA6M4LqR2TFmLykGf1hbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751142140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7nTtj40wpF1y+/6g9bG9A1bhw57UE+B8wznrmdyqHvA=; b=NXgBbe8MYcYUQ1+ga+fekim6f4EoCDbmaGg2g3rxUmFGcl3ixyeKDYrBjSedHW70Zh2vDt t+E16cxXsjZ7MBHwXGSzzYioisDHowhEO5oJpRQooLzInmGburfITY7DUPVHsOOth2AO5R pGbC4YdPQfyLwT0bS/2YYBdx64mbOUJ+dzcH2iLicpH9Ntq65kNPEX1uWCJ/f6IPpHbCTa Wa+iqlIpk+85vWZmZif1cNev5kMqVRsKMZW65zBbJKXkZO0rM4Qo9zpSkK7tkUDU2gIW/P O0K5iZHBu528Xj/i7XKTiLm4/zvPv/+o7S6RgCf0DRSyg1/KZjbjwzpmI8zoMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751142140; a=rsa-sha256; cv=none; b=V0TRHhglBY+EFm/mPrUQA/wigYmoRKSSXbrJsD4/mfQp9Wcs9TH4L8qUnw7S3iiiYHg/3d kJoL+uXgxH22UleokNdN4RdlNgrEJtwVS4jUiYWV7reFD/mLbTAG+e2ZolR1FjDg2hFS1/ 6eiLCj/gQFPWYxAaL6EFVxxviD4wzykTori+QalWpzeK3Z/mUXcpEI2G/MheQIEOpvGamc 3tW7l9z6JBGNyr1E0i10ARkxmO7eCYaXStcyuquhknaHOP0cVlXaAk1xn9ntT778LS4yMI r65HdxtJ7sLvERI6JeLk2FJtZKQQZhHvNmB3edKTq7hoSqw+ikO87Lbklfy8lQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bV3kM4l39z12RJ; Sat, 28 Jun 2025 20:22:19 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Sat, 28 Jun 2025 13:22:17 -0700 From: Gleb Smirnoff To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Damin Rido Subject: Re: git: 0726c6574f88 - main - sockstat: Add automatic column sizing and remove -w option Message-ID: References: <202506271559.55RFxWdm024724@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 27, 2025 at 08:35:18PM -0600, Alan Somers wrote: A> > First, there is a spurious second newline on every line. Even after the A> > header A> > line! How could that pass through minimal testing? A> > A> A> A second newline? Do you mean that the output is double-spaced? Because I A> do not see that at all. Figured out, this is not an extra newline, but a whitespace padding of the end of every line. So, every line has the same length as the longest one. So, my longest line is: root syslogd 2957 6 dgram /var/run/log <- [3646 7],[2737 4],[3595 3],[3557 13],[3173 3],[2547 8],[3042 3],[3003 8] Every other line is padded with whitespace to the same length. A> > Second, the default output now just inserts a huge whitespace "column" in A> > the A> > middle of the list, making it extermely wide. Note, that before this A> > change A> > the default output was fitting into 80 char terminal. Now it is not A> > fitting A> > and without any good reason to do so. A> A> You shouldn't be seeing any column that's pure whitespace. You might be A> looking at the "PROTO" column, which is often wide because some sockets A> show "stream (not connected)". The "(not connected)" part isn't new; A> that's always been there. Does your "whitespace column" go away if you use A> "-4" or "-6"? If so, Damin do you think we could move "(not connected)" A> into the "LOCAL ADDRESS" column? It might fit better there. Figured that out, too. The "whitespace column" is extended "LOCAL ADDRESS" due to one single socket: glebius telegram-d 3552 9 stream /tmp/fdadaa6adf6d2aa7396397755aab8248-TelegramDesktop ?? So in the new mode, sockstat formats all of the strings to fit the worst one, that's why its output is no so extremely wide. :( I definitely don't like it and prefer the old mode. I expect more unhappinness as more people would update their CURRENT to the new format. -- Gleb Smirnoff From nobody Sun Jun 29 00:30:36 2025 X-Original-To: dev-commits-src-main@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 4bV9Ds1pBJz60g06; Sun, 29 Jun 2025 00:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bV9Dr4w5gz3cq6; Sun, 29 Jun 2025 00:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751157036; 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=5gtEO3py/DmFkwbuYbMs2EO07y5Zgw73pudvcgoltag=; b=tbLV2y0lEiCDjz0lRxQoXI7n93c1VKqSIB9G/S+bWBuxkF+3tpTfTli2xUquz99SMp2+sY nLwEsA7L2TpUxg9ThwL9N3tOkO7rL40qcNw7igfUTHT4Oz4+U/4ztEl4O/teNmW3ypgn7j nm4Rn+18fA8MNV+lax2h61U+RTWne4/Mcfi5i/N1/0dt6paAL8v4AOWwYj+bLB17bONgHV NAkFlFCLG0W6QgAG8sFZaFEwGirB3lcDucqOW37vmVV04FbpEC2EYgI/PLfz1nQpeoMSGz hmU6pFmZqkPk8yi3+nXv8uwd/bz4O5rdtNaLUaBqbxSgrMk9aKJk9m5cNx0bwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751157036; 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=5gtEO3py/DmFkwbuYbMs2EO07y5Zgw73pudvcgoltag=; b=wtGT75zfAVnTlDqRSdkXH5p/luHEQ2bX389XdV62d04sM2Grecs115CCy3oBESvFhLkpa8 1w48PbvNMoMrw3bzJiRL3MoYyUphpCWjUBAlgt1v6K2823uHpJgl6Th+c5NP7RDipP/zOw DCXdC9Fk6LWU65Bu1/CntIhr/Ped8zkep2YSgcz4Od8pE7tNBAqy/PO0a3iCNtYn0aJBH5 kyjA3fNkOSAXeUN0y6BLl1ZGH4tAeiO5ZZ9r5piE5mMFVcOQd6FQs2zWY8JxNiD7m8ngY2 1VH1pRg4803+wUsI+AS6wmmvpC30Rxq43i1JhxLFkkM6xI8QcVOGZBBIzVUx2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751157036; a=rsa-sha256; cv=none; b=HGK4UogGHsVlLD37gMjueWYjM3fx84ZpOyAX9UpXVy4+nkYCYSCSRAfZyv28BjSsNb0wds dDV4ne5rJDPzTp6cnVQyKBcfRskRrPMTV0eWmEptOn2RHjXVWo9a2xUiaE7QlkqayVQ19X 4qOikPyqnEbIqEo8lkxI/0JvaGU33wt6mwsjuoecouXdCXfCdkop1x6OLIwTLMDzifDRoE ubUu5vJT+1+SpxspNYOa8vlsWQV9pZGhhcwd0VeyCLd9C6t4kljZ9ZVKeu1FVX564lrJ8x Bs4K++EYRaKR7iKA2sM008om2xQdKgc1hDoRALoCCKzsIK93hS2etG1R3iJdPQ== 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 4bV9Dr4VlVzwns; Sun, 29 Jun 2025 00:30: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 55T0Ua6G096134; Sun, 29 Jun 2025 00:30:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55T0UaLb096131; Sun, 29 Jun 2025 00:30:36 GMT (envelope-from git) Date: Sun, 29 Jun 2025 00:30:36 GMT Message-Id: <202506290030.55T0UaLb096131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: 582f787e2a5c - main - ctladm: skip the tests if ctladm is missing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 582f787e2a5c3114819dfaa4611cb4762716f0a1 Auto-Submitted: auto-generated The branch main has been updated by olivier: URL: https://cgit.FreeBSD.org/src/commit/?id=582f787e2a5c3114819dfaa4611cb4762716f0a1 commit 582f787e2a5c3114819dfaa4611cb4762716f0a1 Author: Olivier Cochard AuthorDate: 2025-06-29 00:26:13 +0000 Commit: Olivier Cochard CommitDate: 2025-06-29 00:26:13 +0000 ctladm: skip the tests if ctladm is missing Reviewed by: asomers Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51081 --- usr.sbin/ctladm/tests/port.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh index a9ff609d3f4c..5bc5d879c983 100644 --- a/usr.sbin/ctladm/tests/port.sh +++ b/usr.sbin/ctladm/tests/port.sh @@ -73,6 +73,7 @@ create_ioctl_head() { atf_set "descr" "ctladm can create a new ioctl port" atf_set "require.user" "root" + atf_set "require.progs" ctladm } create_ioctl_body() { @@ -96,6 +97,7 @@ remove_ioctl_without_required_args_head() { atf_set "descr" "ctladm will gracefully fail to remove an ioctl target if required arguments are missing" atf_set "require.user" "root" + atf_set "require.progs" ctladm } remove_ioctl_without_required_args_body() { @@ -115,6 +117,7 @@ create_iscsi_head() { atf_set "descr" "ctladm can create a new iscsi port" atf_set "require.user" "root" + atf_set "require.progs" ctladm } create_iscsi_body() { @@ -142,6 +145,7 @@ create_iscsi_alias_head() { atf_set "descr" "ctladm can create a new iscsi port with a target alias" atf_set "require.user" "root" + atf_set "require.progs" ctladm } create_iscsi_alias_body() { @@ -168,6 +172,7 @@ create_iscsi_without_required_args_head() { atf_set "descr" "ctladm will gracefully fail to create an iSCSI target if required arguments are missing" atf_set "require.user" "root" + atf_set "require.progs" ctladm } create_iscsi_without_required_args_body() { @@ -184,6 +189,7 @@ create_ioctl_options_head() { atf_set "descr" "ctladm can set options when creating a new ioctl port" atf_set "require.user" "root" + atf_set "require.progs" ctladm } create_ioctl_options_body() { @@ -211,6 +217,7 @@ disable_ioctl_head() { atf_set "descr" "ctladm can disable an ioctl port" atf_set "require.user" "root" + atf_set "require.progs" ctladm } disable_ioctl_body() { @@ -232,6 +239,7 @@ enable_ioctl_head() { atf_set "descr" "ctladm can enable an ioctl port" atf_set "require.user" "root" + atf_set "require.progs" ctladm } enable_ioctl_body() { @@ -254,6 +262,7 @@ remove_ioctl_head() { atf_set "descr" "ctladm can remove an ioctl port" atf_set "require.user" "root" + atf_set "require.progs" ctladm } remove_ioctl_body() { @@ -278,6 +287,7 @@ remove_iscsi_head() { atf_set "descr" "ctladm can remove an iscsi port" atf_set "require.user" "root" + atf_set "require.progs" ctladm } remove_iscsi_body() { @@ -303,6 +313,7 @@ remove_iscsi_without_required_args_head() { atf_set "descr" "ctladm will gracefully fail to remove an iSCSI target if required arguments are missing" atf_set "require.user" "root" + atf_set "require.progs" ctladm } remove_iscsi_without_required_args_body() { From nobody Sun Jun 29 10:51:36 2025 X-Original-To: dev-commits-src-main@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 4bVR1P1yv6z604jj; Sun, 29 Jun 2025 10:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVR1P0q8Fz3sdx; Sun, 29 Jun 2025 10:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751194297; 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=AvE9PNQejGf6SiTMJrrvqa/4QaRJ7MBhsDzgj9kKhOQ=; b=QvZ1zVbkrp0X5Ohdv3TDlIIoHoNy00HPVmJ1l1erZnhJRcHCt4z9BK3n2+LQ3x+p7vEn7p ekAAsLSDBnYIOjXpFuyu8aJgDMIcSxRBZhmp5acKu+Lthzl7HrPE2YdlmrSksowHdbJNaI vRhJSzi63zzJWHVfDj0qEwKtrEz+1+LmIxsZ8qb0CyL+hj5jkXCTtTx+PckRs4VtviBWNS nIhOxJcJEb34yr16lkGoODdwOniSk/Cg0fMNpQASX36TRajlUpUBRuNJ3GSXM951LPO8Mt lEM6J1Ltz0mP20TKK4879ud7OaXS+hQ9Dd0IhYuHXS8t/cK5ygnSSUgv738Q8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751194297; 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=AvE9PNQejGf6SiTMJrrvqa/4QaRJ7MBhsDzgj9kKhOQ=; b=qxclFdSDz+JCAaIYTbOgo7moDipoiKEKmv9Fb5Pct1zPzYFo8gqiXCwGDrfgHM6PoQHkPS li0YJoH+/PkE+CIDiAdrz0yjtVbEC2T2A9qNHMfQscnzRYqTcKOl8Fv4n+FzaPO8RovLf8 OViFPQdkJRyvTB0K4aEmhsg2GBdJm1rKaLDN0vwqTUNssh28Kb8VUawQL43PoOkJnExtsH mkaMt6pD7LL2KFYk3yK7W40iEwwEm0JaGB0GOnr2tN3RFg9rk/429v8uDS/vpoJTAat0IF 3oOI6ip/vlDtsEKyR6df8cTz42vO9DIyAjHYHcQzuyAod2VsxIzwYfMZ2XVQVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751194297; a=rsa-sha256; cv=none; b=mZR/Z/yZweoyUmeDuYYJoFLZlGpV1O9PCmD9DuyKTrznQTmb+PwbHXgh3nOZlC91fLr9kR n/OcfbAHgrByMKQ2oNMoRCbv8fBdBgKPNIBDETZIiP5LI4UAqwshz3jLF8j83Mqu7In3D/ 1Ak8y0U/5Npknpllc0o/hK8uji5Wi0l2vGzuYXOF5s7oYr3/GkD45npQALBUbf7GjDCav2 fc4gGalKUEhAH34i6kHgm8uRs54M9LbTZu1LbeXfGq2YvSxtNiHS0weMn1pbNbwb+jelxN cx4fVN+f1fXCuczSkYJ5YoOsoWxnZnRhvtmATLFw35EZbC9/Pk6UVd+BTYybqQ== 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 4bVR1P02lMz1LJ; Sun, 29 Jun 2025 10:51: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 55TApaNx063092; Sun, 29 Jun 2025 10:51:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TApaLq063089; Sun, 29 Jun 2025 10:51:36 GMT (envelope-from git) Date: Sun, 29 Jun 2025 10:51:36 GMT Message-Id: <202506291051.55TApaLq063089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: afa70490ee77 - main - src/Makefile: log real/user/system time for build targets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afa70490ee779646fa0e936801cb28795580bf01 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=afa70490ee779646fa0e936801cb28795580bf01 commit afa70490ee779646fa0e936801cb28795580bf01 Author: Wolfram Schneider AuthorDate: 2025-06-29 10:48:55 +0000 Commit: Wolfram Schneider CommitDate: 2025-06-29 10:48:55 +0000 src/Makefile: log real/user/system time for build targets For some of our build targets such as buildworld, buildkernel etc. we log the real time in seconds how long the build runs. Now we log the user and system time as well in milliseconds for most build targets. Example output: make buildworld [....] >>> Time spent on target buildworld: real 2286.42 user 62870.84 sys 2294.22 PR: 287274 --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4afec2a80c60..d600eb69ed4b 100644 --- a/Makefile +++ b/Makefile @@ -376,13 +376,22 @@ buildworld: upgrade_checks kernel-toolchain: upgrade_checks .endif +# we need the system time(1) command, not from the shell +time_cmd= /usr/bin/time + +# mktemp(1) is not portable +mktemp_cmd= mktemp /tmp/_time-logging-XXXXXXXXX + # # Handle the user-driven targets, using the source relative mk files. # tinderbox toolchains kernel-toolchains: .MAKE ${TGTS}: .PHONY .MAKE - ${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET} + ${_+_}@cd ${.CURDIR}; _time_tmp=$$(${mktemp_cmd}); \ + ${time_cmd} -o $${_time_tmp} -p env ${_MAKE} ${.TARGET}; \ + echo ">>> Time spent on target ${.TARGET}: $$(tr '\n' ' ' < $${_time_tmp})"; \ + rm -f $${_time_tmp} # The historic default "all" target creates files which may cause stale # or (in the cross build case) unlinkable results. Fail with an error From nobody Sun Jun 29 16:12:16 2025 X-Original-To: dev-commits-src-main@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 4bVZ7N4H7Bz60Nr7; Sun, 29 Jun 2025 16:12: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 4bVZ7N2b8jz3Gqm; Sun, 29 Jun 2025 16:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751213536; 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=peMilQqlkdtHJK0nwqmAaaoBeIw3R1OX8vd3gNiChKE=; b=x2eYwemQZH7VC9ObhSff88pErUmbE7ZlErp+MZbihcP5qkzycHggf7nA0o8nd9Io5QFlKm M6M/IaJTLUqxcq/rCNREtvNBbTXDlDZwW7HRmYyKJ2OT4hoWtdJkvpdpMYnQDCBbPxXmJm 3WKHoxAHHSGL5SJiwgcWEkDJ5XwdFPdm8rwQIAuck/Pcwmz4iEv7DHnDPLq94zm6TMpdTJ YhejU4RavjoSONuJSYCnIbhVnUpAQfr1o0TtEdtPtEO20FZXwhAP7dCKbM5GdfUc14oQjb 1x2aBmDAiS9s8CPBUlgLDZex6W5fZ61bFHxum7TvG8+uwVMctCHxtJpoUnkbxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751213536; 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=peMilQqlkdtHJK0nwqmAaaoBeIw3R1OX8vd3gNiChKE=; b=MlrxT67/QsjsRuovzgMvnV9DCoJS7C7MaWVdd5Xh2CnonWoxSFb3aA/eUyqMSYNgnqoNa8 nlGZBsDlXGW+NK9FT/F1dqgjqtdqiyhBmMZFjRKgMxjJB7ackdyIBvBKc4ALRtSdIoVGYl M2NpZaEIHUvN8f4tBpOKkjFuvTHrYBZIszCKg7o+7YGPX4dIw393GjwOnjcdsdVtwFQoHp 7aqRIzTcLwFMJLcbkeUnJCynq7qp808sUiEEeTqDOo4pTd7CzS1YQUz2Rt/voNHCEbXUou l9VDyly2/+OLDinpobyttJi7gMW1xHP4IJWB5PcPXTdK3/9vYGKF9La6FhyBLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751213536; a=rsa-sha256; cv=none; b=JZxMjtfou8L0iraLIRIQr3FLq/1IEeCenVekL7aWEGwBUun+notFZX4x9EiGvEZ0qAic7I CRRFAYW1KQBy8iL7f+2pnOMVK8Ej3bhTciu3/cAdfDqgrLdV9zBrzcAiM5zGpCHSoA9t8b 2fq5rd4W5x1NsMi38uWH/J1oedqMfDEmzA5+Igl0rlqC3bSVQELP2y4MYLy9tajLwXPyXt 25K74S6ncCRBiuupaGR1KLpPI3tPMApQ9CPMkDvp9tN18pL9FfnOTs5IVukAysYE6lTMHx o0m8/E1xkHAv2go79apFUr3tM2hM0CWxCP6sGsvaOhyczyywJ/3nUCSciJp5zg== 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 4bVZ7N1lYPz9j4; Sun, 29 Jun 2025 16:12: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 55TGCGei074506; Sun, 29 Jun 2025 16:12:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TGCGFi074503; Sun, 29 Jun 2025 16:12:16 GMT (envelope-from git) Date: Sun, 29 Jun 2025 16:12:16 GMT Message-Id: <202506291612.55TGCGFi074503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 0d51adee3072 - main - nfsd: Use an NFSv4 ACL for the delegation ACE if available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d51adee307296a8031afb75f95a013423f7c396 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0d51adee307296a8031afb75f95a013423f7c396 commit 0d51adee307296a8031afb75f95a013423f7c396 Author: Rick Macklem AuthorDate: 2025-06-29 16:09:23 +0000 Commit: Rick Macklem CommitDate: 2025-06-29 16:09:23 +0000 nfsd: Use an NFSv4 ACL for the delegation ACE if available Without this patch, the ACE in a NFSv4 delegation reply is generated from the file's user mode bits. This is correct in most situations, but not if the file has certain NFSv4 ACLs. This patch uses the @OWNER ACE in the NFSv4 ACL if it comes before any deny ACE and returns a "nil access" ACE if a deny preceeds the @OWNER. This change affects few NFSv4 clients, since most clients ignore the delegation access ACE and it only affects cases where the NFSv4 server is issuing delegations. Fixes: 8e2a90ac8089 ("nfscommon: Factor out conversion of ae_perm to NFSv4 ACE flags") --- sys/fs/nfsserver/nfs_nfsdserv.c | 85 +++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 12 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index e54cc594d611..4e15d55eb312 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -64,6 +64,7 @@ extern u_long sb_max_adj; extern int nfsrv_pnfsatime; extern int nfsrv_maxpnfsmirror; extern uint32_t nfs_srvmaxio; +extern int nfsrv_issuedelegs; static int nfs_async = 0; SYSCTL_DECL(_vfs_nfsd); @@ -2866,6 +2867,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, NFSACL_T *aclp = NULL; struct thread *p = curthread; bool done_namei; + __enum_uint8_decl(wdelegace) { USENONE, USEMODE, USENFSV4ACL } + delegace; #ifdef NFS4_ACL_EXTATTR_NAME aclp = acl_alloc(M_WAITOK); @@ -2873,6 +2876,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, #endif NFSZERO_ATTRBIT(&attrbits); done_namei = false; + delegace = USEMODE; named.ni_cnd.cn_nameiop = 0; NFSM_DISSECT(tl, u_int32_t *, 6 * NFSX_UNSIGNED); i = fxdr_unsigned(int, *(tl + 5)); @@ -3214,6 +3218,25 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd, p, 1, NULL); + + if (nd->nd_repstat == 0 && aclp != NULL && nfsrv_issuedelegs != 0 && + (dp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0) { + if (aclp->acl_cnt == 0 && create == NFSV4OPEN_NOCREATE) { + int retacl; + + /* We do not yet have an ACL, so try and get one. */ + retacl = VOP_GETACL(vp, ACL_TYPE_NFS4, aclp, + nd->nd_cred, p); + if (retacl != 0 && retacl != ENOATTR && + retacl != EOPNOTSUPP && retacl != EINVAL) + delegace = USENONE; + else if (retacl == 0 && aclp->acl_cnt > 0) + delegace = USENFSV4ACL; + } else if (aclp->acl_cnt > 0 && create == NFSV4OPEN_CREATE) { + delegace = USENFSV4ACL; + } + } + /* * Do the open locking/delegation stuff. */ @@ -3306,18 +3329,56 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, *tl++ = txdr_unsigned(NFSV4OPEN_LIMITSIZE); txdr_hyper(nva.na_size, tl); } - NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); - *tl++ = txdr_unsigned(NFSV4ACE_ALLOWEDTYPE); - *tl++ = txdr_unsigned(0x0); - acemask = NFSV4ACE_ALLFILESMASK; - if (nva.na_mode & S_IRUSR) - acemask |= NFSV4ACE_READMASK; - if (nva.na_mode & S_IWUSR) - acemask |= NFSV4ACE_WRITEMASK; - if (nva.na_mode & S_IXUSR) - acemask |= NFSV4ACE_EXECUTEMASK; - *tl = txdr_unsigned(acemask); - (void) nfsm_strtom(nd, "OWNER@", 6); + + /* Set up the write delegation ACE. */ + NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); + if (delegace == USENFSV4ACL) { + int j; + + for (j = 0; j < aclp->acl_cnt; j++) { + if (aclp->acl_entry[j].ae_tag == + ACL_USER_OBJ || + aclp->acl_entry[j].ae_entry_type != + ACL_ENTRY_TYPE_ALLOW) + break; + } + if (j < aclp->acl_cnt && + aclp->acl_entry[j].ae_tag == + ACL_USER_OBJ && + aclp->acl_entry[j].ae_entry_type == + ACL_ENTRY_TYPE_ALLOW) { + /* Use this ACE. */ + *tl++ = txdr_unsigned( + NFSV4ACE_ALLOWEDTYPE); + *tl++ = txdr_unsigned(0x0); + *tl = txdr_unsigned( + nfs_aceperm( + aclp->acl_entry[j].ae_perm)); + (void)nfsm_strtom(nd, "OWNER@", 6); + } else + delegace = USENONE; + } + if (delegace == USENONE) { + /* Don't allow anything. */ + *tl++ = 0x0; + *tl++ = 0x0; + *tl = 0x0; + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = 0; + } else if (delegace == USEMODE) { + /* Build from mode. */ + *tl++ = txdr_unsigned(NFSV4ACE_ALLOWEDTYPE); + *tl++ = txdr_unsigned(0x0); + acemask = NFSV4ACE_ALLFILESMASK; + if (nva.na_mode & S_IRUSR) + acemask |= NFSV4ACE_READMASK; + if (nva.na_mode & S_IWUSR) + acemask |= NFSV4ACE_WRITEMASK; + if (nva.na_mode & S_IXUSR) + acemask |= NFSV4ACE_EXECUTEMASK; + *tl = txdr_unsigned(acemask); + (void)nfsm_strtom(nd, "OWNER@", 6); + } } *vpp = vp; } else if (vp) { From nobody Sun Jun 29 17:12:46 2025 X-Original-To: dev-commits-src-main@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 4bVbTC1BNmz60S5Q; Sun, 29 Jun 2025 17:12: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 4bVbTC01lDz3sTQ; Sun, 29 Jun 2025 17:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751217167; 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=uObcQyqHiouiF4gmuXheU1Ax52f8y5APRGLipJ7xYuE=; b=wWaFHl5f0APEZBx+tNwXim9v5kmHT5u7U9zcA1u5UtTEc8teZt4QCAJ0p7p4B8ig8HSfKG GzZBrSGmyI3qmf+MMBdPplkSuECjawus1bbjER58d8Coi6TMZ2jcio7Ih21qGD6gwQSM21 qrHTOb8OSag71lfJhlTPg9rLsctSUUWqDdrzqu1ELTRhrzYrkJc/q/ljfpncQEBlX86jsI D/4BW+j2qXRrBQyluCfLf3EiSQnrKH5zmbj+ugqS3j9MxuQDEXEuM5wrqrCrQWT5wUH/8f d+/xtClgqlo4E1S5l83jZPfnWoJgOZTvuJ6p4qgZET/jWRn3KHYAxnWJd44yLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751217167; 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=uObcQyqHiouiF4gmuXheU1Ax52f8y5APRGLipJ7xYuE=; b=LPArqv3/r+n0GZJ9MxrEkDpEhycKZfjSyvuPR4KWcFMaTj1XzAkKljpgWZq/mgwsl4vER1 L0WopLKSocH2t9JMiHKSubvLFk6bDvit55ZZbhf6XYJfms5KZ5lvwlmL3As5RH33vhpJ52 8KR4XMqLp5sBDolbz+f5oi9YpCCbpDcwaPR3ZuKEQ5isXOCxd40TgBNmOjWP9ItDOIJJwB OQqqzZP2rSRiYNisP3rg1NzTX5nvPU0Qwa+0knuRWjAgYp9ihrBhWD8ZSlxb6AVx8fI3Of UfCRP4zOxRf2daJK1yz+Rx2TB5KfCZCPa9XDkhaWDNVpnPfEgEXRzoL4m3/IgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751217167; a=rsa-sha256; cv=none; b=Z3Z0vOlMkmq+cA8dU5fdRgAoycV6djm6vhbvw5V3D21D7u2uHtOWY3hHvm8fZF25qPfJZ7 f0g8T+jwH9AEbK/jsjhHrXY/FYP/17xuM1O2uAUErGOx3AojL8+UY39tNul2mIK91PHUrL uQrh94CfqwMccJeQJlJmXRSfUqzWg8nDb/p55pCnCw2nOzBs4bSsvfnKohXSXzwptt+GUq 7/p6agVkZx7usvKZV9nUTIuGg+QsE8r9OlJpKzCQ3id5gdAL/hkQ3DC84Bokup8/VruuZr mdmwsPscMJ6BDX9nPFhxOOZL5f6t33z+qYTOJPDJDrAzJduBaTpoB5L5cwoSvA== 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 4bVbTB6V8tzCZw; Sun, 29 Jun 2025 17:12: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 55THCkMh087066; Sun, 29 Jun 2025 17:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55THCkRa087063; Sun, 29 Jun 2025 17:12:46 GMT (envelope-from git) Date: Sun, 29 Jun 2025 17:12:46 GMT Message-Id: <202506291712.55THCkRa087063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6783dfb10637 - main - file: Fix the !CAPABILITIES build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 6783dfb10637100067520bd6d9804e154cfee7ee Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6783dfb10637100067520bd6d9804e154cfee7ee commit 6783dfb10637100067520bd6d9804e154cfee7ee Author: Mark Johnston AuthorDate: 2025-06-29 16:56:59 +0000 Commit: Mark Johnston CommitDate: 2025-06-29 17:12:35 +0000 file: Fix the !CAPABILITIES build Reported by: Ian FREISLICH Fixes: f35525ff2053 ("file: Add a fd flag with O_RESOLVE_BENEATH semantics") --- sys/kern/kern_descrip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index bbd6d530f478..ac4b6ac3f457 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2964,7 +2964,7 @@ fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp) { int error; - error = fget_unlocked(td, fd, needrightsp, flagsp, fpp); + error = fget_unlocked_flags(td, fd, needrightsp, flagsp, fpp); if (havecapsp != NULL && error == 0) filecaps_fill(havecapsp); @@ -3141,7 +3141,6 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp) flags = fp->f_flag & FSEARCH; flags |= (fde->fde_flags & UF_RESOLVE_BENEATH) != 0 ? O_RESOLVE_BENEATH : 0; - *fsearch = ((fp->f_flag & FSEARCH) != 0); vp = fp->f_vnode; if (__predict_false(vp == NULL || vp->v_type != VDIR)) { return (EAGAIN); From nobody Sun Jun 29 18:40:02 2025 X-Original-To: dev-commits-src-main@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 4bVdPy5yBWz60XHC for ; Sun, 29 Jun 2025 18:40:06 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from smtp-42aa.mail.infomaniak.ch (smtp-42aa.mail.infomaniak.ch [84.16.66.170]) (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 (2048 bits) client-digest SHA256) (Client CN "relay.mail.infomaniak.ch", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVdPy03g4z43r1 for ; Sun, 29 Jun 2025 18:40:06 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 84.16.66.170 is neither permitted nor denied by domain of dumbbell@FreeBSD.org) smtp.mailfrom=dumbbell@FreeBSD.org; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=freebsd.org (policy=none) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4bVdPw0hZBz4D1; Sun, 29 Jun 2025 20:40:04 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4bVdPv44SzzTfC; Sun, 29 Jun 2025 20:40:03 +0200 (CEST) Message-ID: Date: Sun, 29 Jun 2025 20:40:02 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 81e6c0168d46 - main - lindebugfs.c: Fix possible NULL dereference To: Mark Millard , dev-commits-src-main@freebsd.org References: <98C6A324-35AD-471D-9A95-ABD34657BD98.ref@yahoo.com> <98C6A324-35AD-471D-9A95-ABD34657BD98@yahoo.com> Content-Language: en-US, fr From: =?UTF-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Organization: The FreeBSD Project In-Reply-To: <98C6A324-35AD-471D-9A95-ABD34657BD98@yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha X-Spamd-Result: default: False [1.22 / 15.00]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; NEURAL_SPAM_LONG(1.00)[1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; R_MIXED_CHARSET(0.71)[subject]; RWL_MAILSPIKE_EXCELLENT(-0.40)[84.16.66.170:from]; RCVD_IN_DNSWL_LOW(-0.10)[84.16.66.170:from]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; FREEMAIL_TO(0.00)[yahoo.com,freebsd.org]; HAS_ORG_HEADER(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[dumbbell]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:29222, ipnet:84.16.64.0/19, country:CH] X-Rspamd-Queue-Id: 4bVdPy03g4z43r1 X-Spamd-Bar: + On 24/06/2025 04:38, Mark Millard wrote: > Jean-Sébastien Pédron wrote on >> If `debugfs_destroy()` is called early as part of error handling during >> initialzation, `pn->pn_data` is unset. > > "is unset": Is this wording intended to mean: > > A) (...) > > vs. > > B) guaranteed to have been set to either NULL > or to a valid non-NULL pointer value? Yes, it's scenario (B). pfs_create_{file,dir}() allocates the structure with `M_ZERO`, thus the field is NULL at first. debugfs_create_{file,dir}() sets `pn_data` after `pfs_create_{file,dir}() returned successfully. However, if pfs_create_{file,dir}() fails, it calls the given "destroy" callback before returning NULL. Therefore, when debugfs_destroy() was called as part of the aborted creation, it was still assuming `pn_data` was set to its own private data; this was not the case. I hope that clears the issue origin. -- Jean-Sébastien Pédron The FreeBSD Project From nobody Sun Jun 29 19:50:07 2025 X-Original-To: dev-commits-src-main@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 4bVfym0zMCz60byX; Sun, 29 Jun 2025 19:50: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 4bVfyl6pw7z3dXh; Sun, 29 Jun 2025 19:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751226608; 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=yckc7nkQU9RBfwBpl7VB5J3WstOHOoCc386OP4NlcIQ=; b=Mj+sQJq7J2lMmEu+9C31kFjo2zPE8mRE0E3e65D+o0EUVccE23DR+sxgl3m8/qGGp/Fgo7 o3rPn27enaspWdHuCszz/+4ZGDiyOwiDvnjIJs1HWzE/Eik1Lq18TxRKjfg0PLiIe7QQfW iEdY2/7lAI9tnnvMyu6grNkUMppHvgUJaMS3K/16cvDLK6Jv7uupA2YNp1Cei82MeFifyD RLhyQjaHTRIX/6+lQ4CuuVGKiwmuKi2wk3zStpEhmMixftWrk+vCeJt/S1mdIIkWJJBRdY iNQsh4OKp1DHuq8UPUAaYqM1+fjVvJSb/pDVl1BGqF4tgrWfam/dsQadYJQVaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751226608; 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=yckc7nkQU9RBfwBpl7VB5J3WstOHOoCc386OP4NlcIQ=; b=YycRAjU5R83vQ/pSXouoKmAVSkmEw25ZAIO/xE7PVrUSiiKZceqniBaSDJ4jK73BYSJYiV JijKlvLNA0SkfO1sNWae7gI+GW9daALxaqKUijitklskKzkhWIuoFts9JsdX1hVbj3d0pL ldgY6mqPST66WFX9vzSReMBTSk3HJFrP5JT+SLzf/Y9yl6LMT+LN+C0aR6rmMWTdz17Aef WKeaopEZEJZcLYlHG1pvyuJnAVoYdMGHppoGNUnsUSBgk88qhU/94arg/6wJCAQdmYTY9M sS+2scOYUTxZySRHSaHQRpqNhadX5c0S3tu+kqlGYPP2ZHss2qYVKPGCX/NyRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751226608; a=rsa-sha256; cv=none; b=pKJ+vDb6tSGqUI7WpJR9oWJsaInZqAuihvh1vYn+YQJLBGC4ZVc38pVDzJ0xMvN3Kw50cK Wsmd9Io5waZkVBZNb14Ns5tdL8nzwLkLajMleaFelvT47dW7K0kwjZvi+nrTjGuXTpWQPT jTxGw3MiIVyq1bCRTr+vh8VjntNbONKsp2hun/yGIeTHh1mbIpMxVxSfkNgnS0sn0R7fL/ OoohiGkt8eW+2sN6SWZsjpMYMjsvk9volF/FBLd8ZwxSpAUobOWCdN7Uk6nW/UBJqpHjLF /z2Bj596qGDKAO45fgUPQziwHd8tD1m79pW6b5JFH7uLWdtoRGQEQyVq3/PouQ== 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 4bVfyl5FvnzYh3; Sun, 29 Jun 2025 19:50: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 55TJo7ar071997; Sun, 29 Jun 2025 19:50:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TJo7YF071993; Sun, 29 Jun 2025 19:50:07 GMT (envelope-from git) Date: Sun, 29 Jun 2025 19:50:07 GMT Message-Id: <202506291950.55TJo7YF071993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: ce929c4769c9 - main - ddb: print FIN flag only one when printing BBLog entries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce929c4769c9fa73eff2f723dd266203b7816657 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ce929c4769c9fa73eff2f723dd266203b7816657 commit ce929c4769c9fa73eff2f723dd266203b7816657 Author: Michael Tuexen AuthorDate: 2025-06-29 19:47:42 +0000 Commit: Michael Tuexen CommitDate: 2025-06-29 19:47:42 +0000 ddb: print FIN flag only one when printing BBLog entries Fixes: a62c6b0de48a ("ddb: add optional printing of BBLog entries") MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_log_buf.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index 3c62d3b07f99..75d693bc019b 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -3027,15 +3027,9 @@ db_print_tcphdr(struct tcp_log_buffer *tlm_buf) if (flags & TH_ECE) { db_printf("E"); } - if (flags & TH_FIN) { - db_printf("F"); - } if (flags & TH_CWR) { db_printf("W"); } - if (flags & TH_FIN) { - db_printf("F"); - } if (flags & TH_AE) { db_printf("A"); } From nobody Sun Jun 29 20:53:00 2025 X-Original-To: dev-commits-src-main@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 4bVhMJ35QYz60g4Z; Sun, 29 Jun 2025 20:53:00 +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 4bVhMJ1QCwz3T39; Sun, 29 Jun 2025 20:53:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230380; 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=2htHJyvSzjCwinpZi8BlmKurdYl1sJuD8rOUDz/qXAU=; b=XGLpMfaUaGgikdQ21sQ41ITrRfm8yOtQ3PUJAb2KvApwbBlyiOgbRjkP/gcLc/ebR88S1a dtDxHHz/71n5OZS2RSTUWm9FelS7/n9Fh8sNI1Ko8GAe1AG2KoMvvF6mjzIc75lbPRoBN1 rEXtOKSCTJQPDkJRSDxotmtpESwM1fkz1knsgoss+BhOnPTpeL2ULlOy7jz8mcMo6Jtmws xDlVeDNsnmXnzAFa9gMvS61EwgXDLYL6glmTLGNKRJFFco1Q1mzikQxwVCVBXO3aE3KqUj jr4a7jYtBjogm5W0/lfCR+Yi4lKTcMiy940PjeqWgNeEp3fPCF/BXICZYBm7mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230380; 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=2htHJyvSzjCwinpZi8BlmKurdYl1sJuD8rOUDz/qXAU=; b=WvouIkRMsbEYKKR0U6vRbf30DyOlbv3DpzivqflHcdie4D60wqy15iGngIhkSgoMOuYfAV mzdrXeJjPR7YFo+yzt4Lkv1f3w3a1znz36ba0V0HH5ygfbLJxI5c9MTJifSwz9bj0ZXa0q RAVqltYSSDWgSKKp85uESowqPDDAYHI8rJ42huXL4N+ku//Ivcsk0gQU/l2+SGBmxIe8o/ N2A71YlqdudqAjjXA7dPwMDE2bTWGuSIVOjwTIbla7p9UnO3xXXregEJAm0uKJMG5rvFTu 0JQUwgVE3fQw84PZHd6Dim5aBFLtarAufs8Qbi2VFlBNqGOJhpu3fwOO+YnXUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751230380; a=rsa-sha256; cv=none; b=UQy6eRklMMrGeFp4rxxU/Vh+IXjiVtp9erp7koZGz/PEJgo5ki7gu6jQJhJA1lOQWTM/c7 blmS23Nlv7Dv6eiSK9XwF9ohfRQuA12J1/lT7XgUJs155a+hudNpghjMfWabAgGUBgM3Pd JhLOn2/MvyNwqmwwuMzRmaXQQQ5h2GNgjLJO3awlUUL0Rwnm/9P0XiQk9heSQc0IgrFgH+ ByRu3reBQYX9X69vuXEU0vO7chSa8UCUvTXuQostKxSJ9BDamxtMVLMRLPcX7h3hIgvDvH pFTPfwULhkSdhBQ8J2TCjiuN7eemUmInsh11weabPyxyeX2aSr2QFUAAokbnww== 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 4bVhMJ0zw6zbp2; Sun, 29 Jun 2025 20:53:00 +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 55TKr01p098324; Sun, 29 Jun 2025 20:53:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TKr0Ol098321; Sun, 29 Jun 2025 20:53:00 GMT (envelope-from git) Date: Sun, 29 Jun 2025 20:53:00 GMT Message-Id: <202506292053.55TKr0Ol098321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 20e15e905c58 - main - mlx5: Decrease FW init timeout from 120 seconds to 5 seconds List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20e15e905c58e9e2020b2c3e40caa2e8406e5827 Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=20e15e905c58e9e2020b2c3e40caa2e8406e5827 commit 20e15e905c58e9e2020b2c3e40caa2e8406e5827 Author: Andrew Gallatin AuthorDate: 2025-06-29 20:51:50 +0000 Commit: Andrew Gallatin CommitDate: 2025-06-29 20:51:50 +0000 mlx5: Decrease FW init timeout from 120 seconds to 5 seconds When encountering a failed NIC, the mlx5 driver will wait up to 120 secs for the firmware to respond. This timeout is absurdly huge, and leads to boot times of 40 minutes to over an hour on our servers when a NIC fails. This is because the driver will attempt to attach to the failed NIC multiple times (once for each driver loaded after mlx5), and wait 2 minutes on each attempt. This happens because the mlx5 driver is still the best match for the device. This delay then triggers watchdog timeouts in our environment, rendering servers with a failed NIC entirely unbootable without manual intervention. Note that FW_INIT_WARN_MESSAGE_INTERVAL must also be decreased, as it must be less than the init timeout. Reviewed by: kib (initial version, before reducing warn interval) Sponsored by: Netflix --- sys/dev/mlx5/device.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/device.h b/sys/dev/mlx5/device.h index e6d46507a5d2..3e2c4f15a5cc 100644 --- a/sys/dev/mlx5/device.h +++ b/sys/dev/mlx5/device.h @@ -32,8 +32,8 @@ #define FW_INIT_TIMEOUT_MILI 2000 #define FW_INIT_WAIT_MS 2 -#define FW_PRE_INIT_TIMEOUT_MILI 120000 -#define FW_INIT_WARN_MESSAGE_INTERVAL 20000 +#define FW_PRE_INIT_TIMEOUT_MILI 5000 +#define FW_INIT_WARN_MESSAGE_INTERVAL 2000 #if defined(__LITTLE_ENDIAN) #define MLX5_SET_HOST_ENDIANNESS 0 From nobody Sun Jun 29 21:18:14 2025 X-Original-To: dev-commits-src-main@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 4bVhwR2KSXz60hKw; Sun, 29 Jun 2025 21:18: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 4bVhwR1mTgz3kH7; Sun, 29 Jun 2025 21:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751231895; 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=tyDdPufmS1hMHZHUtmCDbosqAWQo1WX2LHI0/LkpjaM=; b=qHoWa2Npg+k1G69qh/hiLtCoPi91nZVbGmxFnF89cdyOmshwkQV5nSiswcdO1QIyqqt2yM ryDdq56wDx6t4cSRLOLrziPYfVnHuGQhFNgzLuOtI0muOcm/5AE11RdWhXWsySU7j9Hl3B vsEooqAhzpWzK4SPtOYfUl+DPIslP8vVejDasJho5TCe7C3U35/Dc/PqjpBtiX8FzeYze6 AvVbOjYNT1hhHovLfTwoUSkCqb9l5p8wqCxuWSwNRBKi2Io3fovp1aPECDZHFVIQjdp+SM s4GrP3Cp5I5QTPX8xJHfYg8oB16pfRhcLp9KLzW1lwHn/tsb712YL7ouUkMEog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751231895; 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=tyDdPufmS1hMHZHUtmCDbosqAWQo1WX2LHI0/LkpjaM=; b=LfEYR1z/uoGthJfRKKSy8ROBt65I2+CNPkL9kao7cUcVi3J37+R7Dhtlozb5x+7P0X2l6U N46wjQTmiZ55jmijEH9wi+WePKxpdc0aywEasTmUrvpHoclq+Xw12I5lCNckq7mXjrn3Xk tMx0z9IuYg7eRHBbeNZaFAYy0AR00rD6LNcvq+3M3rux72sWeQB6hbtGwB33QkEKpW2wqY 4jWwxmj364BljmemkG80h57pQhHlASFK7ie4IeKvDGYlqRHU+bnYHs0Lb1nfW4+vrxV0Z5 ItcteOja4v+TQCMcF9a8Shf3TAY9Q2g1qIUs3nSEffwyfxocuR74ehzEWlNlLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751231895; a=rsa-sha256; cv=none; b=WWBdsYT/MhLNITJqYejHI4E/c58HW7J/01MiEngsHu9ukbWub8KhvnKq/J+7yufE+H4ixq eFdXlbnzK237X3wJJ6Y+qVYAogg3SSovodDU6lGY2f2RBeXWAW53nM8K5PZgVpTmC/cRxN 0cFPVPbL/yqoZ1tjcc4Td3EwChen/hzFJgyAe5oNbRMm1pzksiZfxmXaV4OImn3F1Pd7gf zl/vxuQd4VRd5wexDzHNX5hdgLaP9WcFvExGccdvPtxoIsIC7wwLALrhoVlIcqghvAwl+/ ViBzA7dDhAPMV2fRC4Z2IZzBVXPTFDg0eXYE5ryb+20tckAxfdfkKJi4RtiaHA== 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 4bVhwR0ywdzcc0; Sun, 29 Jun 2025 21:18: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 55TLIE8s038971; Sun, 29 Jun 2025 21:18:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TLIE1r038968; Sun, 29 Jun 2025 21:18:14 GMT (envelope-from git) Date: Sun, 29 Jun 2025 21:18:14 GMT Message-Id: <202506292118.55TLIE1r038968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 171f66b0c2ca - main - nfscl: Optimize NFSv4 remove and rename for nocto option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 171f66b0c2cab0b75c37eb1c815273da5282ff7e Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=171f66b0c2cab0b75c37eb1c815273da5282ff7e commit 171f66b0c2cab0b75c37eb1c815273da5282ff7e Author: Rick Macklem AuthorDate: 2025-06-29 21:15:02 +0000 Commit: Rick Macklem CommitDate: 2025-06-29 21:15:02 +0000 nfscl: Optimize NFSv4 remove and rename for nocto option Without this patch a NFSv4.1/4.2 mount will return any delegations before doing a remove or rename over the file. This includes writing all dirty buffers back to the NFSv4 server before doing the remove/rename. For the common case where the file is being removed (the exception is when the file has multiple hard links), all the writing is wasted overhead. Further, if the file has multiple hard links, the delegation is still valid and does not need to be returned. For NFSv4.0, a server did not know which client was doing the remove/rename and, as such, had no choice but to recall the delegation. However, this is not the case for NFSv4.1/4.2. This patch avoids returning the delegation(s) for NFSv4.1/4.2 mounts if the "nocto" mount option is specified. Also, with this patch, the NFSv4.1/4.2 compound tests to see if the file has actually been removed and handles the delegation(s) appropriately. This new behaviour is only enabled when the "nocto" mount option is specified and will only improve performance when NFSv4.1/4.2 servers are issuing delegations and not recalling them for remove or rename being done by the same client as the one holding the delegation. --- sys/fs/nfs/nfs.h | 2 + sys/fs/nfs/nfs_commonsubs.c | 4 +- sys/fs/nfs/nfs_var.h | 15 ++-- sys/fs/nfsclient/nfs_clnode.c | 24 ++++-- sys/fs/nfsclient/nfs_clrpcops.c | 158 +++++++++++++++++++++++++++++++++------- sys/fs/nfsclient/nfs_clstate.c | 40 ++++++---- sys/fs/nfsclient/nfs_clvnops.c | 126 +++++++++++++++++++++++++------- 7 files changed, 286 insertions(+), 83 deletions(-) diff --git a/sys/fs/nfs/nfs.h b/sys/fs/nfs/nfs.h index 9b09520b3257..e6a125b388a8 100644 --- a/sys/fs/nfs/nfs.h +++ b/sys/fs/nfs/nfs.h @@ -865,6 +865,8 @@ struct nfsslot { /* Enumerated type for nfsuserd state. */ typedef enum { NOTRUNNING=0, STARTSTOP=1, RUNNING=2 } nfsuserd_state; +typedef enum { UNKNOWN=0, DELETED=1, NLINK_ZERO=2, VALID=3 } nfsremove_status; + #endif /* _KERNEL */ #endif /* _NFS_NFS_H */ diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 68d2f7d993f3..f46b0d282861 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -251,9 +251,9 @@ static struct { { NFSV4OP_CREATE, 5, "Create", 6, }, { NFSV4OP_CREATE, 1, "Create", 6, }, { NFSV4OP_CREATE, 3, "Create", 6, }, + { NFSV4OP_REMOVE, 3, "Remove", 6, }, { NFSV4OP_REMOVE, 1, "Remove", 6, }, - { NFSV4OP_REMOVE, 1, "Remove", 6, }, - { NFSV4OP_SAVEFH, 5, "Rename", 6, }, + { NFSV4OP_SAVEFH, 7, "Rename", 6, }, { NFSV4OP_SAVEFH, 6, "Link", 4, }, { NFSV4OP_READDIR, 2, "Readdir", 7, }, { NFSV4OP_READDIR, 2, "Readdir", 7, }, diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 7206d12bd6fa..f59a898369e8 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -483,11 +483,13 @@ int nfsrpc_mknod(vnode_t, char *, int, struct vattr *, u_int32_t, int nfsrpc_create(vnode_t, char *, int, struct vattr *, nfsquad_t, int, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *); -int nfsrpc_remove(vnode_t, char *, int, vnode_t, struct ucred *, NFSPROC_T *, - struct nfsvattr *, int *); -int nfsrpc_rename(vnode_t, vnode_t, char *, int, vnode_t, vnode_t, char *, int, - struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, - int *, int *); +int nfsrpc_remove(struct vnode *, char *, int, struct vnode *, + struct nfsvattr *, int *, nfsremove_status *, struct nfsvattr *, int *, + struct ucred *, NFSPROC_T *); +int nfsrpc_rename(struct vnode *, struct vnode *, char *, int, struct vnode *, + struct vnode *, char *, int, nfsremove_status *, struct nfsvattr *, + struct nfsvattr *, int *, int *, struct nfsvattr *, int *, struct ucred *, + NFSPROC_T *); int nfsrpc_link(vnode_t, vnode_t, char *, int, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, int *, int *); @@ -616,7 +618,7 @@ void nfscl_lockinit(struct nfsv4lock *); void nfscl_lockexcl(struct nfsv4lock *, void *); void nfscl_lockunlock(struct nfsv4lock *); void nfscl_lockderef(struct nfsv4lock *); -void nfscl_delegreturnvp(vnode_t, NFSPROC_T *); +void nfscl_delegreturnvp(struct vnode *, bool, NFSPROC_T *); void nfscl_docb(struct nfsrv_descript *, NFSPROC_T *); void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *, void *, int); @@ -656,6 +658,7 @@ void nfscl_freelayout(struct nfscllayout *); void nfscl_freeflayout(struct nfsclflayout *); void nfscl_freedevinfo(struct nfscldevinfo *); int nfscl_layoutcommit(vnode_t, NFSPROC_T *); +void nfscl_startdelegrecall(struct nfsclclient *, struct nfsfh *); /* nfs_clport.c */ int nfscl_nget(mount_t, vnode_t, struct nfsfh *, diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index be2024730cf0..f85f961d424e 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -205,7 +205,7 @@ nfs_freesillyrename(void *arg, __unused int pending) } static void -ncl_releasesillyrename(struct vnode *vp, struct thread *td) +ncl_releasesillyrename(struct vnode *vp, bool flushed, struct thread *td) { struct nfsnode *np; struct sillyrename *sp; @@ -220,7 +220,8 @@ ncl_releasesillyrename(struct vnode *vp, struct thread *td) sp = NULL; if (sp != NULL) { NFSUNLOCKNODE(np); - (void) ncl_vinvalbuf(vp, 0, td, 1); + if (flushed) + (void)ncl_vinvalbuf(vp, 0, td, 1); /* * Remove the silly file that was rename'd earlier */ @@ -238,9 +239,13 @@ ncl_inactive(struct vop_inactive_args *ap) struct vnode *vp = ap->a_vp; struct nfsnode *np; struct thread *td; + struct nfsmount *nmp; + bool flushed; td = curthread; np = VTONFS(vp); + nmp = VFSTONFS(vp->v_mount); + flushed = true; if (NFS_ISV4(vp) && vp->v_type == VREG) { NFSLOCKNODE(np); np->n_openstateid = NULL; @@ -251,13 +256,18 @@ ncl_inactive(struct vop_inactive_args *ap) * buffers/pages must be flushed before the close, so that the * stateid is available for the writes. */ - vnode_pager_clean_sync(vp); - (void)ncl_flush(vp, MNT_WAIT, td, 1, 0); + if ((nmp->nm_flag & NFSMNT_NOCTO) == 0 || !NFSHASNFSV4N(nmp) || + nfscl_mustflush(vp) != 0) { + vnode_pager_clean_sync(vp); + (void)ncl_flush(vp, MNT_WAIT, td, 1, 0); + } else { + flushed = false; + } (void)nfsrpc_close(vp, 1, td); } NFSLOCKNODE(np); - ncl_releasesillyrename(vp, td); + ncl_releasesillyrename(vp, flushed, td); /* * NMODIFIED means that there might be dirty/stale buffers @@ -294,7 +304,7 @@ ncl_reclaim(struct vop_reclaim_args *ap) nfs_reclaim_p(ap); NFSLOCKNODE(np); - ncl_releasesillyrename(vp, td); + ncl_releasesillyrename(vp, true, td); if (NFS_ISV4(vp) && vp->v_type == VREG) { np->n_openstateid = NULL; @@ -315,7 +325,7 @@ ncl_reclaim(struct vop_reclaim_args *ap) MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0) { MNT_IUNLOCK(mp); - nfscl_delegreturnvp(vp, td); + nfscl_delegreturnvp(vp, true, td); } else MNT_IUNLOCK(mp); } else diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 4ff56f75123c..c07da6f9275f 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2859,22 +2859,28 @@ nfsmout: * Nfs remove rpc */ int -nfsrpc_remove(vnode_t dvp, char *name, int namelen, vnode_t vp, - struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp) +nfsrpc_remove(struct vnode *dvp, char *name, int namelen, struct vnode *vp, + struct nfsvattr *nap, int *attrflagp, nfsremove_status *file_status, + struct nfsvattr *dnap, int *dattrflagp, struct ucred *cred, NFSPROC_T *p) { - u_int32_t *tl; + uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsnode *np; struct nfsmount *nmp; nfsv4stateid_t dstateid; - int error, ret = 0, i; + nfsattrbit_t attrbits; + int error, i, ret; *dattrflagp = 0; + *attrflagp = 0; + *file_status = UNKNOWN; + ret = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); nmp = VFSTONFS(dvp->v_mount); tryagain: - if (NFSHASNFSV4(nmp) && ret == 0) { + if (NFSHASNFSV4(nmp) && ((nmp->nm_flag & NFSMNT_NOCTO) == 0 || + !NFSHASNFSV4N(nmp)) && ret == 0) { ret = nfscl_removedeleg(vp, p, &dstateid); if (ret == 1) { NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp, cred); @@ -2899,9 +2905,19 @@ tryagain: } if (ret == 0) NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp, cred); - (void) nfsm_strtom(nd, name, namelen); + (void)nfsm_strtom(nd, name, namelen); + if (ret == 0 && (nd->nd_flag & ND_NFSV4) != 0) { + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_PUTFH); + np = VTONFS(vp); + (void)nfsm_fhtom(nmp, nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + NFSGETATTR_ATTRBIT(&attrbits); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + (void)nfsrv_putattrbit(nd, &attrbits); + } error = nfscl_request(nd, dvp, p, cred); - if (error) + if (error != 0) return (error); if (nd->nd_flag & (ND_NFSV3 | ND_NFSV4)) { /* For NFSv4, parse out any Delereturn replies. */ @@ -2924,7 +2940,41 @@ tryagain: } error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp, NULL, NULL); } - if (nd->nd_repstat && !error) + if (ret == 0 && (nd->nd_flag & (ND_NFSV4 | + ND_NOMOREDATA)) == ND_NFSV4) { + /* Parse out the Remove reply for NFSPROC_REMOVE. */ + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED + 2 * NFSX_HYPER); + /* No use for change info for now. */ + /* The Remove succeeded. */ + nd->nd_repstat = 0; + } + if (ret == 0 && (nd->nd_flag & (ND_NFSV4 | + ND_NOMOREDATA)) == ND_NFSV4) { + /* Parse out the PutFH, Getattr for NFSPROC_REMOVE. */ + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (*(tl + 1) != 0) { + i = fxdr_unsigned(int, *(tl + 1)); + if (i == NFSERR_STALE) + *file_status = DELETED; + } else { + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (*(tl + 1) != 0) { + i = fxdr_unsigned(int, *(tl + 1)); + if (i == NFSERR_STALE) + *file_status = DELETED; + } else { + error = nfsm_loadattr(nd, nap); + if (error == 0) { + *attrflagp = 1; + if (nap->na_nlink == 0) + *file_status = NLINK_ZERO; + else + *file_status = VALID; + } + } + } + } + if (nd->nd_repstat != 0 && error == 0) error = nd->nd_repstat; nfsmout: m_freem(nd->nd_mrep); @@ -2935,12 +2985,14 @@ nfsmout: * Do an nfs rename rpc. */ int -nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen, - vnode_t tdvp, vnode_t tvp, char *tnameptr, int tnamelen, struct ucred *cred, - NFSPROC_T *p, struct nfsvattr *fnap, struct nfsvattr *tnap, - int *fattrflagp, int *tattrflagp) +nfsrpc_rename(struct vnode *fdvp, struct vnode *fvp, char *fnameptr, + int fnamelen, struct vnode *tdvp, struct vnode *tvp, char *tnameptr, + int tnamelen, nfsremove_status *tvp_status, struct nfsvattr *fnap, + struct nfsvattr *tnap, int *fattrflagp, int *tattrflagp, + struct nfsvattr *tvpnap, int *tvpattrflagp, struct ucred *cred, + NFSPROC_T *p) { - u_int32_t *tl; + uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsmount *nmp; struct nfsnode *np; @@ -2950,11 +3002,14 @@ nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen, *fattrflagp = 0; *tattrflagp = 0; + *tvpattrflagp = 0; + *tvp_status = UNKNOWN; nmp = VFSTONFS(fdvp->v_mount); if (fnamelen > NFS_MAXNAMLEN || tnamelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); tryagain: - if (NFSHASNFSV4(nmp) && ret == 0) { + if (NFSHASNFSV4(nmp) && ((nmp->nm_flag & NFSMNT_NOCTO) == 0 || + !NFSHASNFSV4N(nmp)) && ret == 0) { ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, &tdstateid, &gottd, p); if (gotfd && gottd) { @@ -3007,29 +3062,44 @@ tryagain: } if (ret == 0) NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp, cred); - if (nd->nd_flag & ND_NFSV4) { + if ((nd->nd_flag & ND_NFSV4) != 0) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSWCCATTR_ATTRBIT(&attrbits); - (void) nfsrv_putattrbit(nd, &attrbits); + (void)nfsrv_putattrbit(nd, &attrbits); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); (void)nfsm_fhtom(nmp, nd, VTONFS(tdvp)->n_fhp->nfh_fh, VTONFS(tdvp)->n_fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); - (void) nfsrv_putattrbit(nd, &attrbits); + (void)nfsrv_putattrbit(nd, &attrbits); nd->nd_flag |= ND_V4WCCATTR; NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_RENAME); } - (void) nfsm_strtom(nd, fnameptr, fnamelen); - if (!(nd->nd_flag & ND_NFSV4)) + (void)nfsm_strtom(nd, fnameptr, fnamelen); + if ((nd->nd_flag & ND_NFSV4) == 0) (void)nfsm_fhtom(nmp, nd, VTONFS(tdvp)->n_fhp->nfh_fh, VTONFS(tdvp)->n_fhp->nfh_len, 0); - (void) nfsm_strtom(nd, tnameptr, tnamelen); + (void)nfsm_strtom(nd, tnameptr, tnamelen); + if (ret == 0 && (nd->nd_flag & ND_NFSV4) != 0) { + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + /* When tvp == NULL, it doesn't matter which dvp is used. */ + *tl = txdr_unsigned(NFSV4OP_PUTFH); + if (tvp != NULL) + (void)nfsm_fhtom(nmp, nd, VTONFS(tvp)->n_fhp->nfh_fh, + VTONFS(tvp)->n_fhp->nfh_len, 0); + else + (void)nfsm_fhtom(nmp, nd, VTONFS(tdvp)->n_fhp->nfh_fh, + VTONFS(tdvp)->n_fhp->nfh_len, 0); + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + NFSGETATTR_ATTRBIT(&attrbits); + (void)nfsrv_putattrbit(nd, &attrbits); + } error = nfscl_request(nd, fdvp, p, cred); - if (error) + if (error != 0) return (error); if (nd->nd_flag & (ND_NFSV3 | ND_NFSV4)) { /* For NFSv4, parse out any Delereturn replies. */ @@ -3045,7 +3115,7 @@ tryagain: for (i = 0; i < (ret * 2); i++) { if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4) { - NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); if (*(tl + 1)) { if (i == 1 && ret > 1) { /* @@ -3065,23 +3135,57 @@ tryagain: } /* Now, the first wcc attribute reply. */ if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4) { - NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); if (*(tl + 1)) nd->nd_flag |= ND_NOMOREDATA; } error = nfscl_wcc_data(nd, fdvp, fnap, fattrflagp, NULL, NULL); /* and the second wcc attribute reply. */ if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4 && - !error) { - NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + error == 0) { + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); if (*(tl + 1)) nd->nd_flag |= ND_NOMOREDATA; } - if (!error) + if (error == 0) error = nfscl_wcc_data(nd, tdvp, tnap, tattrflagp, NULL, NULL); } - if (nd->nd_repstat && !error) + if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4 && + ret == 0 && error == 0) { + /* Parse out the rename successful reply. */ + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED + + 4 * NFSX_HYPER); + nd->nd_repstat = 0; /* Rename succeeded. */ + /* Parse PutFH reply for tvp. */ + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (*(tl + 1) != 0) { + if (tvp != NULL) { + i = fxdr_unsigned(int, *(tl + 1)); + if (i == NFSERR_STALE) + *tvp_status = DELETED; + } + } else { + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (*(tl + 1) != 0) { + if (tvp != NULL) { + i = fxdr_unsigned(int, *(tl + 1)); + if (i == NFSERR_STALE) + *tvp_status = DELETED; + } + } else { + error = nfsm_loadattr(nd, tvpnap); + if (error == 0 && tvp != NULL) { + *tvpattrflagp = 1; + if (tvpnap->na_nlink == 0) + *tvp_status = NLINK_ZERO; + else + *tvp_status = VALID; + } + } + } + } + if (nd->nd_repstat != 0 && error == 0) error = nd->nd_repstat; nfsmout: m_freem(nd->nd_mrep); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index adfb68f5d8f5..fe3682ae437e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3508,7 +3508,7 @@ nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p, * Return any delegation for this vp. */ void -nfscl_delegreturnvp(vnode_t vp, NFSPROC_T *p) +nfscl_delegreturnvp(struct vnode *vp, bool retdeleg, NFSPROC_T *p) { struct nfsclclient *clp; struct nfscldeleg *dp; @@ -3531,12 +3531,15 @@ nfscl_delegreturnvp(vnode_t vp, NFSPROC_T *p) if (clp != NULL) dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); - if (dp != NULL) { + if (dp != NULL && + (dp->nfsdl_flags & (NFSCLDL_RECALL | NFSCLDL_DELEGRET)) == 0) { nfscl_cleandeleg(dp); nfscl_freedeleg(&clp->nfsc_deleg, dp, false); NFSUNLOCKCLSTATE(); - newnfs_copycred(&dp->nfsdl_cred, cred); - nfscl_trydelegreturn(dp, cred, clp->nfsc_nmp, p); + if (retdeleg) { + newnfs_copycred(&dp->nfsdl_cred, cred); + nfscl_trydelegreturn(dp, cred, clp->nfsc_nmp, p); + } free(dp, M_NFSCLDELEG); } else NFSUNLOCKCLSTATE(); @@ -3716,18 +3719,10 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) clp = nfscl_getclnt(cbident); else clp = nfscl_getclntsess(sessionid); - if (clp != NULL) { - dp = nfscl_finddeleg(clp, nfhp->nfh_fh, - nfhp->nfh_len); - if (dp != NULL && (dp->nfsdl_flags & - NFSCLDL_DELEGRET) == 0) { - dp->nfsdl_flags |= - NFSCLDL_RECALL; - wakeup((caddr_t)clp); - } - } else { + if (clp != NULL) + nfscl_startdelegrecall(clp, nfhp); + else error = NFSERR_SERVERFAULT; - } NFSUNLOCKCLSTATE(); } if (nfhp != NULL) @@ -5957,3 +5952,18 @@ tryagain: NFSUNLOCKCLSTATE(); return (0); } + +/* + * Start the recall of a delegation. Called for CB_RECALL and REMOVE + * when nlink == 0 after the REMOVE. + */ +void nfscl_startdelegrecall(struct nfsclclient *clp, struct nfsfh *nfhp) +{ + struct nfscldeleg *dp; + + dp = nfscl_finddeleg(clp, nfhp->nfh_fh, nfhp->nfh_len); + if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_DELEGRET) == 0) { + dp->nfsdl_flags |= NFSCLDL_RECALL; + wakeup((caddr_t)clp); + } +} diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index c2185992f994..84046cdb503e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -106,6 +106,7 @@ uint32_t nfscl_accesscache_load_done_id; extern struct nfsstatsv1 nfsstatsv1; extern int nfsrv_useacl; extern int nfscl_debuglevel; +NFSCLSTATEMUTEX; MALLOC_DECLARE(M_NEWNFSREQ); static vop_read_t nfsfifo_read; @@ -250,10 +251,13 @@ VFS_VOP_VECTOR_REGISTER(newnfs_fifoops); static int nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap); static int nfs_removerpc(struct vnode *dvp, struct vnode *vp, char *name, - int namelen, struct ucred *cred, struct thread *td); + int namelen, struct ucred *cred, struct thread *td, bool silly); +static void nfs_removestatus(struct vnode *vp, nfsremove_status file_status, + bool silly, struct thread *td); static int nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr, int fnamelen, struct vnode *tdvp, struct vnode *tvp, - char *tnameptr, int tnamelen, struct ucred *cred, struct thread *td); + char *tnameptr, int tnamelen, bool silly, struct ucred *cred, + struct thread *td); static int nfs_renameit(struct vnode *sdvp, struct vnode *svp, struct componentname *scnp, struct sillyrename *sp); @@ -829,9 +833,11 @@ nfs_close(struct vop_close_args *ap) struct ucred *cred; int error = 0, ret, localcred = 0; int fmode = ap->a_fflag; + struct nfsmount *nmp; if (NFSCL_FORCEDISM(vp->v_mount)) return (0); + nmp = VFSTONFS(vp->v_mount); /* * During shutdown, a_cred isn't valid, so just use root. */ @@ -885,7 +891,9 @@ nfs_close(struct vop_close_args *ap) error = ncl_flush(vp, MNT_WAIT, ap->a_td, cm, 0); /* np->n_flag &= ~NMODIFIED; */ } else if (NFS_ISV4(vp)) { - if (nfscl_mustflush(vp) != 0) { + if (!NFSHASNFSV4N(nmp) || + (nmp->nm_flag & NFSMNT_NOCTO) == 0 || + nfscl_mustflush(vp) != 0) { int cm = newnfs_commit_on_close ? 1 : 0; if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); @@ -927,7 +935,7 @@ nfs_close(struct vop_close_args *ap) * is the cause of some caching/coherency issue that might * crop up.) */ - if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0) { + if (nmp->nm_negnametimeo == 0) { np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); } @@ -944,7 +952,7 @@ nfs_close(struct vop_close_args *ap) */ if (error == 0 && nfscl_nodeleg(vp, 0) != 0 && vp->v_type == VREG && - (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOCTO) == 0) { + (nmp->nm_flag & NFSMNT_NOCTO) == 0) { ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva); if (!ret) { np->n_change = nfsva.na_filerev; @@ -1025,8 +1033,9 @@ nfs_getattr(struct vop_getattr_args *ap) return (0); } } + error = nfsrpc_getattr(vp, ap->a_cred, td, &nfsva); - if (!error) + if (error == 0) error = nfscl_loadattrcache(&vp, &nfsva, vap, 0, 0); if (!error) { /* @@ -1999,6 +2008,7 @@ nfs_remove(struct vop_remove_args *ap) struct nfsnode *np = VTONFS(vp); int error = 0; struct vattr vattr; + struct nfsmount *nmp; KASSERT(vrefcnt(vp) > 0, ("nfs_remove: bad v_usecount")); if (vp->v_type == VDIR) @@ -2006,6 +2016,7 @@ nfs_remove(struct vop_remove_args *ap) else if (vrefcnt(vp) == 1 || (np->n_sillyrename && VOP_GETATTR(vp, &vattr, cnp->cn_cred) == 0 && vattr.va_nlink > 1)) { + nmp = VFSTONFS(vp->v_mount); /* * Purge the name cache so that the chance of a lookup for * the name succeeding while the remove is in progress is @@ -2017,12 +2028,19 @@ nfs_remove(struct vop_remove_args *ap) /* * throw away biocache buffers, mainly to avoid * unnecessary delayed writes later. + * Flushing here would be more correct for the case + * where nfs_close() did not do a flush. However, it + * could be a large performance hit for some servers + * and only matters when the file name being removed is + * one of multiple hard links. */ - error = ncl_vinvalbuf(vp, 0, curthread, 1); + if (!NFSHASNFSV4(nmp) || !NFSHASNFSV4N(nmp) || + (nmp->nm_flag & NFSMNT_NOCTO) == 0) + error = ncl_vinvalbuf(vp, 0, curthread, 1); if (error != EINTR && error != EIO) /* Do the rpc */ error = nfs_removerpc(dvp, vp, cnp->cn_nameptr, - cnp->cn_namelen, cnp->cn_cred, curthread); + cnp->cn_namelen, cnp->cn_cred, curthread, false); /* * Kludge City: If the first reply to the remove rpc is lost.. * the reply to the retransmitted request will be ENOENT @@ -2053,7 +2071,32 @@ ncl_removeit(struct sillyrename *sp, struct vnode *vp) if (sp->s_dvp->v_type == VBAD) return (0); return (nfs_removerpc(sp->s_dvp, vp, sp->s_name, sp->s_namlen, - sp->s_cred, NULL)); + sp->s_cred, NULL, true)); +} + +/* + * Handle the nfsremove_status reply from the RPC function. + */ +static void +nfs_removestatus(struct vnode *vp, nfsremove_status file_status, + bool silly, struct thread *td) +{ + + switch (file_status) { + case NLINK_ZERO: + /* Get rid of any delegation. */ + nfscl_delegreturnvp(vp, false, td); + /* FALLTHROUGH */ + case DELETED: + /* Throw away buffer cache blocks. */ + (void)ncl_vinvalbuf(vp, 0, td, 1); + break; + case VALID: + /* Nothing to do, delegation is still ok. */ + break; + default: + break; + } } /* @@ -2061,17 +2104,20 @@ ncl_removeit(struct sillyrename *sp, struct vnode *vp) */ static int nfs_removerpc(struct vnode *dvp, struct vnode *vp, char *name, - int namelen, struct ucred *cred, struct thread *td) + int namelen, struct ucred *cred, struct thread *td, bool silly) { - struct nfsvattr dnfsva; + struct nfsvattr dnfsva, nfsva; struct nfsnode *dnp = VTONFS(dvp); - int error = 0, dattrflag; + struct nfsmount *nmp; + int attrflag, error = 0, dattrflag; + nfsremove_status file_status; + nmp = VFSTONFS(dvp->v_mount); NFSLOCKNODE(dnp); dnp->n_flag |= NREMOVEINPROG; NFSUNLOCKNODE(dnp); - error = nfsrpc_remove(dvp, name, namelen, vp, cred, td, &dnfsva, - &dattrflag); + error = nfsrpc_remove(dvp, name, namelen, vp, &nfsva, &attrflag, + &file_status, &dnfsva, &dattrflag, cred, td); NFSLOCKNODE(dnp); if ((dnp->n_flag & NREMOVEWANT)) { dnp->n_flag &= ~(NREMOVEWANT | NREMOVEINPROG); @@ -2081,11 +2127,19 @@ nfs_removerpc(struct vnode *dvp, struct vnode *vp, char *name, dnp->n_flag &= ~NREMOVEINPROG; NFSUNLOCKNODE(dnp); } - if (dattrflag) + + if (NFSHASNFSV4(nmp) && NFSHASNFSV4N(nmp)) { + if (file_status != DELETED && attrflag != 0) + (void)nfscl_loadattrcache(&vp, &nfsva, NULL, 0, 1); + if ((nmp->nm_flag & NFSMNT_NOCTO) != 0) + nfs_removestatus(vp, file_status, silly, td); + } + + if (dattrflag != 0) (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, 0, 1); NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; - if (!dattrflag) { + if (dattrflag == 0) { dnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } @@ -2110,6 +2164,7 @@ nfs_rename(struct vop_rename_args *ap) struct nfsnode *fnp = VTONFS(ap->a_fvp); struct nfsnode *tdnp = VTONFS(ap->a_tdvp); struct nfsv4node *newv4 = NULL; + struct nfsmount *nmp; int error; /* Check for cross-device rename */ @@ -2118,6 +2173,7 @@ nfs_rename(struct vop_rename_args *ap) error = EXDEV; goto out; } + nmp = VFSTONFS(fvp->v_mount); if (fvp == tvp) { printf("nfs_rename: fvp == tvp (can't happen)\n"); @@ -2140,11 +2196,15 @@ nfs_rename(struct vop_rename_args *ap) * that was written back to our cache earlier. Not checking for * this condition can result in potential (silent) data loss. */ - error = VOP_FSYNC(fvp, MNT_WAIT, curthread); + if ((nmp->nm_flag & NFSMNT_NOCTO) == 0 || !NFSHASNFSV4(nmp) || + !NFSHASNFSV4N(nmp) || nfscl_mustflush(fvp) != 0) + error = VOP_FSYNC(fvp, MNT_WAIT, curthread); NFSVOPUNLOCK(fvp); - if (!error && tvp) + if (error == 0 && tvp != NULL && ((nmp->nm_flag & NFSMNT_NOCTO) == 0 || + !NFSHASNFSV4(nmp) || !NFSHASNFSV4N(nmp) || + nfscl_mustflush(tvp) != 0)) error = VOP_FSYNC(tvp, MNT_WAIT, curthread); - if (error) + if (error != 0) goto out; /* @@ -2159,7 +2219,7 @@ nfs_rename(struct vop_rename_args *ap) } error = nfs_renamerpc(fdvp, fvp, fcnp->cn_nameptr, fcnp->cn_namelen, - tdvp, tvp, tcnp->cn_nameptr, tcnp->cn_namelen, tcnp->cn_cred, + tdvp, tvp, tcnp->cn_nameptr, tcnp->cn_namelen, false, tcnp->cn_cred, curthread); if (error == 0 && NFS_ISV4(tdvp)) { @@ -2228,7 +2288,7 @@ nfs_renameit(struct vnode *sdvp, struct vnode *svp, struct componentname *scnp, { return (nfs_renamerpc(sdvp, svp, scnp->cn_nameptr, scnp->cn_namelen, - sdvp, NULL, sp->s_name, sp->s_namlen, scnp->cn_cred, + sdvp, NULL, sp->s_name, sp->s_namlen, true, scnp->cn_cred, curthread)); } @@ -2238,16 +2298,19 @@ nfs_renameit(struct vnode *sdvp, struct vnode *svp, struct componentname *scnp, static int nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr, int fnamelen, struct vnode *tdvp, struct vnode *tvp, char *tnameptr, - int tnamelen, struct ucred *cred, struct thread *td) + int tnamelen, bool silly, struct ucred *cred, struct thread *td) { - struct nfsvattr fnfsva, tnfsva; + struct nfsvattr fnfsva, tnfsva, tvpnfsva; struct nfsnode *fdnp = VTONFS(fdvp); struct nfsnode *tdnp = VTONFS(tdvp); - int error = 0, fattrflag, tattrflag; + struct nfsmount *nmp; + int error = 0, fattrflag, tattrflag, tvpattrflag; + nfsremove_status tvp_status; + nmp = VFSTONFS(fdvp->v_mount); error = nfsrpc_rename(fdvp, fvp, fnameptr, fnamelen, tdvp, tvp, - tnameptr, tnamelen, cred, td, &fnfsva, &tnfsva, &fattrflag, - &tattrflag); + tnameptr, tnamelen, &tvp_status, &fnfsva, &tnfsva, &fattrflag, + &tattrflag, &tvpnfsva, &tvpattrflag, cred, td); NFSLOCKNODE(fdnp); fdnp->n_flag |= NMODIFIED; if (fattrflag != 0) { @@ -2268,6 +2331,15 @@ nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr, NFSUNLOCKNODE(tdnp); KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp); } + + if (tvp != NULL) { + if (NFSHASNFSV4(nmp) && NFSHASNFSV4N(nmp) && + (nmp->nm_flag & NFSMNT_NOCTO) != 0) + nfs_removestatus(tvp, tvp_status, silly, td); + if (!silly && tvpattrflag != 0) + (void)nfscl_loadattrcache(&tvp, &tvpnfsva, NULL, 0, 1); + } + if (error && NFS_ISV4(fdvp)) error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); return (error); @@ -2291,7 +2363,9 @@ nfs_link(struct vop_link_args *ap) * doesn't get "out of sync" with the server. * XXX There should be a better way! */ +#ifdef notnow VOP_FSYNC(vp, MNT_WAIT, curthread); +#endif error = nfsrpc_link(tdvp, vp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_cred, curthread, &dnfsva, &nfsva, &attrflag, &dattrflag);